summaryrefslogtreecommitdiff
path: root/sys-fs/vhba/vhba-20130607.ebuild
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-08-08 13:49:04 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2015-08-08 17:38:18 -0700
commit56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch)
tree3f91093cdb475e565ae857f1c5a7fd339e2d781e /sys-fs/vhba/vhba-20130607.ebuild
downloadgentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.xz
proj/gentoo: Initial commit
This commit represents a new era for Gentoo: Storing the gentoo-x86 tree in Git, as converted from CVS. This commit is the start of the NEW history. Any historical data is intended to be grafted onto this point. Creation process: 1. Take final CVS checkout snapshot 2. Remove ALL ChangeLog* files 3. Transform all Manifests to thin 4. Remove empty Manifests 5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$ 5.1. Do not touch files with -kb/-ko keyword flags. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'sys-fs/vhba/vhba-20130607.ebuild')
-rw-r--r--sys-fs/vhba/vhba-20130607.ebuild85
1 files changed, 85 insertions, 0 deletions
diff --git a/sys-fs/vhba/vhba-20130607.ebuild b/sys-fs/vhba/vhba-20130607.ebuild
new file mode 100644
index 00000000000..05791571831
--- /dev/null
+++ b/sys-fs/vhba/vhba-20130607.ebuild
@@ -0,0 +1,85 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit linux-mod user udev
+
+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="virtual/udev"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+S=${WORKDIR}/${MY_P}
+MODULE_NAMES="vhba(block:${S})"
+BUILD_TARGETS=modules
+
+pkg_setup() {
+ CONFIG_CHECK="~BLK_DEV_SR ~CHR_DEV_SG"
+ check_extra_config
+ BUILD_PARAMS="KDIR=${KV_OUT_DIR}"
+ linux-mod_pkg_setup
+
+ enewgroup cdemu
+}
+
+src_prepare() {
+ # Avoid "make jobserver unavailable" warning and -Werror problems
+ sed -e '/ccflags/s/-Werror$/-Wall/' \
+ -i Makefile || die "sed failed"
+}
+
+src_install() {
+ dodoc AUTHORS ChangeLog README
+ linux-mod_src_install
+
+ einfo "Generating udev rules ..."
+ dodir "$(get_udevdir)"/rules.d
+ cat > "${D}/$(get_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
+}