/[gentoo-x86]/sys-fs/vhba/vhba-20120422.ebuild
Gentoo

Contents of /sys-fs/vhba/vhba-20120422.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.5 - (show annotations) (download)
Mon Dec 3 02:18:44 2012 UTC (5 months, 2 weeks ago) by ssuominen
Branch: MAIN
CVS Tags: HEAD
Changes since 1.4: +1 -1 lines
FILE REMOVED
old

(Portage version: 2.2.0_alpha144/cvs/Linux x86_64, signed Manifest commit with key 4868F14D)

1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/sys-fs/vhba/vhba-20120422.ebuild,v 1.4 2012/08/11 07:50:49 mgorny Exp $
4
5 EAPI="4"
6
7 inherit linux-mod user
8
9 MY_P=vhba-module-${PV}
10 DESCRIPTION="Virtual (SCSI) Host Bus Adapter kernel module for the CDEmu suite"
11 HOMEPAGE="http://cdemu.org"
12 SRC_URI="mirror://sourceforge/cdemu/${MY_P}.tar.bz2"
13
14 LICENSE="GPL-2"
15 SLOT="0"
16 KEYWORDS="~amd64 ~hppa ~x86"
17 IUSE=""
18
19 RDEPEND=">=sys-fs/udev-125"
20 DEPEND=""
21
22 S=${WORKDIR}/${MY_P}
23 MODULE_NAMES="vhba(block:${S})"
24 BUILD_TARGETS=all
25
26 pkg_setup() {
27 CONFIG_CHECK="~BLK_DEV_SR ~CHR_DEV_SG"
28 check_extra_config
29 BUILD_PARAMS="KDIR=${KV_DIR}"
30 linux-mod_pkg_setup
31
32 enewgroup cdemu
33 }
34
35 src_prepare() {
36 # Avoid "make jobserver unavailable" warning and -Werror problems
37 sed -e 's:\t$(KMAKE):\t+$(KMAKE):g' \
38 -e '/EXTRA_CFLAGS/s/-Werror$/-Wall/' \
39 -i Makefile || die "sed failed"
40 }
41
42 src_install() {
43 dodoc AUTHORS ChangeLog README
44 linux-mod_src_install
45
46 einfo "Generating udev rules ..."
47 dodir /lib/udev/rules.d/
48 cat > "${D}"/lib/udev/rules.d/70-vhba.rules <<-EOF || die
49 # do not edit this file, it will be overwritten on update
50 #
51 KERNEL=="vhba_ctl", MODE="0660", OWNER="root", GROUP="cdemu"
52 EOF
53 }
54
55 pkg_postinst() {
56 elog "Don't forget to add your user to the cdemu group if you want to"
57 elog "be able to use virtual cdemu devices."
58
59 # Older versions of vhba installed their rule file in /etc/udev/rules.d,
60 # which overrides rules in /lib/udev/rules.d. We remove the old file
61 # automatically if it is identical to the default one installed by
62 # vhba-1.2.1 or 20101015-r1. Note that the comment at the top of the rules
63 # file states that it can be automatically overwritten by the system.
64 old_rules="${ROOT}etc/udev/rules.d/70-vhba.rules"
65 if [[ -f "${old_rules}" ]]; then
66 case "$(md5sum ${old_rules})" in
67 2959b3cf61cfe6e466cc3516a7bc19de* | 1e7a7e5d6d28c811eeec98ec26ed5d28* )
68 elog
69 elog "Removing old ${old_rules} ..."
70 rm -f "${old_rules}" ||
71 eerror "Failed, please remove ${old_rules} manually."
72 ;;
73 * )
74 ewarn
75 ewarn "The ${old_rules} file from a previous"
76 ewarn "installation of ${PN} is overriding ${P}'s"
77 ewarn "udev rules. Unless you had deliberately customized it,"
78 ewarn "you should remove it."
79 ewarn
80 ;;
81 esac
82 fi
83
84 linux-mod_pkg_postinst
85 }

  ViewVC Help
Powered by ViewVC 1.1.13