summaryrefslogtreecommitdiff
path: root/sys-fs
diff options
context:
space:
mode:
authorSamuli Suominen <ssuominen@gentoo.org>2012-08-11 13:02:51 +0000
committerSamuli Suominen <ssuominen@gentoo.org>2012-08-11 13:02:51 +0000
commit1c52a302ea7129aa70735fc6b37d8f1d52a2dd55 (patch)
treeb28520d5730d11bbe20f85fc89cc3fdfd9b3ecb6 /sys-fs
parentx86 stable, bug #418879 (diff)
downloadgentoo-2-1c52a302ea7129aa70735fc6b37d8f1d52a2dd55.tar.gz
gentoo-2-1c52a302ea7129aa70735fc6b37d8f1d52a2dd55.tar.bz2
gentoo-2-1c52a302ea7129aa70735fc6b37d8f1d52a2dd55.zip
Call pkg-config to read the value of udevdir from udev.pc file.
(Portage version: 2.2.0_alpha120/cvs/Linux x86_64)
Diffstat (limited to 'sys-fs')
-rw-r--r--sys-fs/vhba/ChangeLog7
-rw-r--r--sys-fs/vhba/vhba-20120422-r1.ebuild87
2 files changed, 93 insertions, 1 deletions
diff --git a/sys-fs/vhba/ChangeLog b/sys-fs/vhba/ChangeLog
index 16cf95ef33bf..81e6473851da 100644
--- a/sys-fs/vhba/ChangeLog
+++ b/sys-fs/vhba/ChangeLog
@@ -1,6 +1,11 @@
# ChangeLog for sys-fs/vhba
# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-fs/vhba/ChangeLog,v 1.38 2012/08/11 07:50:49 mgorny Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-fs/vhba/ChangeLog,v 1.39 2012/08/11 13:02:51 ssuominen Exp $
+
+*vhba-20120422-r1 (11 Aug 2012)
+
+ 11 Aug 2012; Samuli Suominen <ssuominen@gentoo.org> +vhba-20120422-r1.ebuild:
+ Call pkg-config to read the value of udevdir from udev.pc file.
11 Aug 2012; Michał Górny <mgorny@gentoo.org> vhba-20120422.ebuild:
Revert the dependency change.
diff --git a/sys-fs/vhba/vhba-20120422-r1.ebuild b/sys-fs/vhba/vhba-20120422-r1.ebuild
new file mode 100644
index 000000000000..e10294386116
--- /dev/null
+++ b/sys-fs/vhba/vhba-20120422-r1.ebuild
@@ -0,0 +1,87 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-fs/vhba/vhba-20120422-r1.ebuild,v 1.1 2012/08/11 13:02:51 ssuominen Exp $
+
+EAPI="4"
+
+inherit linux-mod user
+
+MY_P=vhba-module-${PV}
+DESCRIPTION="Virtual (SCSI) Host Bus Adapter kernel module for the CDEmu suite"
+HOMEPAGE="http://cdemu.org"
+SRC_URI="mirror://sourceforge/cdemu/${MY_P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~hppa ~x86"
+IUSE=""
+
+RDEPEND=">=sys-fs/udev-125"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+S=${WORKDIR}/${MY_P}
+MODULE_NAMES="vhba(block:${S})"
+BUILD_TARGETS=all
+
+pkg_setup() {
+ CONFIG_CHECK="~BLK_DEV_SR ~CHR_DEV_SG"
+ check_extra_config
+ BUILD_PARAMS="KDIR=${KV_DIR}"
+ linux-mod_pkg_setup
+
+ enewgroup cdemu
+}
+
+src_prepare() {
+ # Avoid "make jobserver unavailable" warning and -Werror problems
+ sed -e 's:\t$(KMAKE):\t+$(KMAKE):g' \
+ -e '/EXTRA_CFLAGS/s/-Werror$/-Wall/' \
+ -i Makefile || die "sed failed"
+}
+
+src_install() {
+ dodoc AUTHORS ChangeLog README
+ linux-mod_src_install
+
+ einfo "Generating udev rules ..."
+ local udevdir="$($(tc-getPKG_CONFIG) --variable=udevdir udev)"
+ dodir "${udevdir}"/rules.d
+ cat > "${D}/${udevdir}"/rules.d/70-vhba.rules <<-EOF || die
+ # do not edit this file, it will be overwritten on update
+ #
+ KERNEL=="vhba_ctl", MODE="0660", OWNER="root", GROUP="cdemu"
+ EOF
+}
+
+pkg_postinst() {
+ elog "Don't forget to add your user to the cdemu group if you want to"
+ elog "be able to use virtual cdemu devices."
+
+ # Older versions of vhba installed their rule file in /etc/udev/rules.d,
+ # which overrides rules in /lib/udev/rules.d. We remove the old file
+ # automatically if it is identical to the default one installed by
+ # vhba-1.2.1 or 20101015-r1. Note that the comment at the top of the rules
+ # file states that it can be automatically overwritten by the system.
+ old_rules="${ROOT}etc/udev/rules.d/70-vhba.rules"
+ if [[ -f "${old_rules}" ]]; then
+ case "$(md5sum ${old_rules})" in
+ 2959b3cf61cfe6e466cc3516a7bc19de* | 1e7a7e5d6d28c811eeec98ec26ed5d28* )
+ elog
+ elog "Removing old ${old_rules} ..."
+ rm -f "${old_rules}" ||
+ eerror "Failed, please remove ${old_rules} manually."
+ ;;
+ * )
+ ewarn
+ ewarn "The ${old_rules} file from a previous"
+ ewarn "installation of ${PN} is overriding ${P}'s"
+ ewarn "udev rules. Unless you had deliberately customized it,"
+ ewarn "you should remove it."
+ ewarn
+ ;;
+ esac
+ fi
+
+ linux-mod_pkg_postinst
+}