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