sys-kernel/genkernel: bump for bug #591770.
[gentoo.git] / sys-kernel / genkernel / genkernel-3.5.0.4.ebuild
1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 # genkernel-9999        -> latest Git branch "master"
6 # genkernel-VERSION     -> normal genkernel release
7
8 EAPI=5 # approved 2012.09.11, required by all profiles since 2014.03.12
9
10 VERSION_BUSYBOX='1.20.2'
11 VERSION_DMRAID='1.0.0.rc16-3'
12 VERSION_MDADM='3.1.5'
13 VERSION_FUSE='2.8.6'
14 VERSION_ISCSI='2.0-872'
15 VERSION_LVM='2.02.88'
16 VERSION_UNIONFS_FUSE='0.24'
17 VERSION_GPG='1.4.11'
18
19 RH_HOME="ftp://sourceware.org/pub"
20 DM_HOME="https://people.redhat.com/~heinzm/sw/dmraid/src"
21 BB_HOME="https://busybox.net/downloads"
22
23 COMMON_URI="${DM_HOME}/dmraid-${VERSION_DMRAID}.tar.bz2
24                 ${DM_HOME}/old/dmraid-${VERSION_DMRAID}.tar.bz2
25                 mirror://kernel/linux/utils/raid/mdadm/mdadm-${VERSION_MDADM}.tar.bz2
26                 ${RH_HOME}/lvm2/LVM2.${VERSION_LVM}.tgz
27                 ${RH_HOME}/lvm2/old/LVM2.${VERSION_LVM}.tgz
28                 ${BB_HOME}/busybox-${VERSION_BUSYBOX}.tar.bz2
29                 http://www.open-iscsi.org/bits/open-iscsi-${VERSION_ISCSI}.tar.gz
30                 mirror://sourceforge/fuse/fuse-${VERSION_FUSE}.tar.gz
31                 http://podgorny.cz/unionfs-fuse/releases/unionfs-fuse-${VERSION_UNIONFS_FUSE}.tar.bz2
32                 mirror://gnupg/gnupg/gnupg-${VERSION_GPG}.tar.bz2"
33
34 if [[ ${PV} == 9999* ]]
35 then
36         EGIT_REPO_URI="git://anongit.gentoo.org/proj/${PN}.git
37                 https://anongit.gentoo.org/git/proj/${PN}.git"
38         inherit git-2 bash-completion-r1 eutils
39         S="${WORKDIR}/${PN}"
40         SRC_URI="${COMMON_URI}"
41 else
42         inherit bash-completion-r1 eutils
43         SRC_URI="mirror://gentoo/${P}.tar.xz
44                 ${COMMON_URI}"
45         #KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
46 fi
47
48 DESCRIPTION="Gentoo automatic kernel building scripts"
49 HOMEPAGE="https://www.gentoo.org"
50
51 LICENSE="GPL-2"
52 SLOT="0"
53 RESTRICT=""
54 IUSE="cryptsetup ibm selinux"
55
56 DEPEND="sys-fs/e2fsprogs
57         selinux? ( sys-libs/libselinux )"
58 RDEPEND="${DEPEND}
59         cryptsetup? ( sys-fs/cryptsetup )
60         app-arch/cpio
61         >=app-misc/pax-utils-0.2.1
62         !<sys-apps/openrc-0.9.9"
63 # pax-utils is used for lddtree
64
65 if [[ ${PV} == 9999* ]]; then
66         DEPEND="${DEPEND} app-text/asciidoc"
67 fi
68
69 pkg_pretend() {
70         if ! use cryptsetup && has_version "sys-kernel/genkernel[crypt]"; then
71                 ewarn "Local use flag 'crypt' has been renamed to 'cryptsetup' (bug #414523)."
72                 ewarn "Please set flag 'cryptsetup' for this very package if you would like"
73                 ewarn "to have genkernel create an initramfs with LUKS support."
74                 ewarn "Sorry for the inconvenience."
75                 echo
76         fi
77 }
78
79 src_unpack() {
80         if [[ ${PV} == 9999* ]] ; then
81                 git-2_src_unpack
82         else
83                 unpack ${P}.tar.xz
84         fi
85 }
86
87 src_prepare() {
88         if [[ ${PV} == 9999* ]] ; then
89                 einfo "Producing ChangeLog from Git history..."
90                 pushd "${S}/.git" >/dev/null || die
91                 git log > "${S}"/ChangeLog || die
92                 popd >/dev/null || die
93         fi
94         if use selinux ; then
95                 sed -i 's/###//g' "${S}"/gen_compile.sh || die
96         fi
97
98         # Update software.sh
99         sed -i \
100                 -e "s:VERSION_BUSYBOX:$VERSION_BUSYBOX:" \
101                 -e "s:VERSION_MDADM:$VERSION_MDADM:" \
102                 -e "s:VERSION_DMRAID:$VERSION_DMRAID:" \
103                 -e "s:VERSION_FUSE:$VERSION_FUSE:" \
104                 -e "s:VERSION_ISCSI:$VERSION_ISCSI:" \
105                 -e "s:VERSION_LVM:$VERSION_LVM:" \
106                 -e "s:VERSION_UNIONFS_FUSE:$VERSION_UNIONFS_FUSE:" \
107                 -e "s:VERSION_GPG:$VERSION_GPG:" \
108                 "${S}"/defaults/software.sh \
109                 || die "Could not adjust versions"
110
111         epatch_user
112 }
113
114 src_compile() {
115         if [[ ${PV} == 9999* ]]; then
116                 emake
117         fi
118 }
119
120 src_install() {
121         insinto /etc
122         doins "${S}"/genkernel.conf
123
124         doman genkernel.8
125         dodoc AUTHORS ChangeLog README TODO
126         dobin genkernel
127         rm -f genkernel genkernel.8 AUTHORS ChangeLog README TODO genkernel.conf
128
129         if use ibm ; then
130                 cp "${S}"/arch/ppc64/kernel-2.6{-pSeries,} || die
131         else
132                 cp "${S}"/arch/ppc64/kernel-2.6{.g5,} || die
133         fi
134         insinto /usr/share/genkernel
135         doins -r "${S}"/*
136
137         newbashcomp "${FILESDIR}"/genkernel.bash "${PN}"
138         insinto /etc
139         doins "${FILESDIR}"/initramfs.mounts
140
141         cd "${DISTDIR}"
142         insinto /usr/share/genkernel/distfiles
143         doins ${A/${P}.tar.xz/}
144 }
145
146 pkg_postinst() {
147         echo
148         elog 'Documentation is available in the genkernel manual page'
149         elog 'as well as the following URL:'
150         echo
151         elog 'https://www.gentoo.org/doc/en/genkernel.xml'
152         echo
153         ewarn "This package is known to not work with reiser4.  If you are running"
154         ewarn "reiser4 and have a problem, do not file a bug.  We know it does not"
155         ewarn "work and we don't plan on fixing it since reiser4 is the one that is"
156         ewarn "broken in this regard.  Try using a sane filesystem like ext4."
157         echo
158         ewarn "The LUKS support has changed from versions prior to 3.4.4.  Now,"
159         ewarn "you use crypt_root=/dev/blah instead of real_root=luks:/dev/blah."
160         echo
161 }