You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
66 lines
1.3 KiB
66 lines
1.3 KiB
3 years ago
|
# Copyright 1999-2021 Gentoo Authors
|
||
5 years ago
|
# Distributed under the terms of the GNU General Public License v2
|
||
|
|
||
|
EAPI=7
|
||
|
|
||
3 years ago
|
inherit flag-o-matic toolchain-funcs
|
||
5 years ago
|
|
||
|
DESCRIPTION="Add and remove SCSI devices from your Linux system during runtime"
|
||
|
HOMEPAGE="https://llg.cubic.org/tools/"
|
||
|
SRC_URI="https://llg.cubic.org/tools/${P}.tar.gz"
|
||
|
|
||
|
LICENSE="GPL-2"
|
||
|
SLOT="0"
|
||
|
KEYWORDS="~amd64 ~x86"
|
||
|
IUSE="suid"
|
||
|
|
||
3 years ago
|
RDEPEND="suid? ( acct-group/scsi )"
|
||
|
BDEPEND="${RDEPEND}"
|
||
5 years ago
|
|
||
|
src_prepare() {
|
||
|
default
|
||
|
|
||
3 years ago
|
# Remove 'strip' command, as portage handles this
|
||
|
sed -e "s:^\(.*strip.*\):#\1:g" -i Makefile.in || die
|
||
|
|
||
|
# Convert docs to UTF-8
|
||
5 years ago
|
if [ -x "$(type -p iconv)" ]; then
|
||
|
for X in NEWS README; do
|
||
3 years ago
|
iconv -f LATIN1 -t UTF8 -o "${X}~" "${X}" \
|
||
|
&& mv -f "${X}~" "${X}" \
|
||
5 years ago
|
|| rm -f "${X}~" || die
|
||
|
done
|
||
|
fi
|
||
|
}
|
||
|
|
||
|
src_compile() {
|
||
3 years ago
|
# Extra safety for suid
|
||
5 years ago
|
append-ldflags -Wl,-z,now
|
||
|
|
||
3 years ago
|
# Use system compiler
|
||
|
tc-export CC
|
||
|
|
||
|
default
|
||
5 years ago
|
}
|
||
|
|
||
|
src_install() {
|
||
|
dosbin scsiadd
|
||
3 years ago
|
|
||
5 years ago
|
if use suid; then
|
||
|
fowners root:scsi /usr/sbin/scsiadd
|
||
3 years ago
|
fperms 4710 /usr/sbin/scsiadd
|
||
5 years ago
|
fi
|
||
3 years ago
|
|
||
5 years ago
|
doman scsiadd.8
|
||
3 years ago
|
|
||
|
einstalldocs
|
||
5 years ago
|
}
|
||
|
|
||
|
pkg_postinst() {
|
||
|
if use suid; then
|
||
|
ewarn "You have chosen to install ${PN} with the binary setuid root. This"
|
||
|
ewarn "means that if there any undetected vulnerabilities in the binary,"
|
||
|
ewarn "then local users may be able to gain root access on your machine."
|
||
|
fi
|
||
|
}
|