Use https by default
[gentoo.git] / sys-kernel / genkernel / genkernel-3.4.49.2.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="3"
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://sources.redhat.com/pub"
20 DM_HOME="http://people.redhat.com/~heinzm/sw/dmraid/src"
21 BB_HOME="http://www.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                 http://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         KEYWORDS="alpha arm hppa ia64 ppc ppc64 s390 sh sparc"
42 else
43         inherit bash-completion-r1 eutils
44         SRC_URI="mirror://gentoo/${P}.tar.bz2
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="crypt cryptsetup ibm selinux"  # Keep 'crypt' in to keep 'use crypt' below working!
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-0.2.1
63                 !<sys-apps/openrc-0.9.9"
64 # pax-utils is used for lddtree
65
66 if [[ ${PV} == 9999* ]]; then
67         DEPEND="${DEPEND} app-text/asciidoc"
68 fi
69
70 src_unpack() {
71         if [[ ${PV} == 9999* ]] ; then
72                 git-2_src_unpack
73         else
74                 unpack ${P}.tar.bz2
75         fi
76 }
77
78 src_prepare() {
79         if [[ ${PV} == 9999* ]] ; then
80                 einfo "Producing ChangeLog from Git history..."
81                 pushd "${S}/.git" >/dev/null || die
82                 git log > "${S}"/ChangeLog || die
83                 popd >/dev/null || die
84         fi
85         use selinux && sed -i 's/###//g' "${S}"/gen_compile.sh
86
87         # Update software.sh
88         sed -i \
89                 -e "s:VERSION_BUSYBOX:$VERSION_BUSYBOX:" \
90                 -e "s:VERSION_MDADM:$VERSION_MDADM:" \
91                 -e "s:VERSION_DMRAID:$VERSION_DMRAID:" \
92                 -e "s:VERSION_FUSE:$VERSION_FUSE:" \
93                 -e "s:VERSION_ISCSI:$VERSION_ISCSI:" \
94                 -e "s:VERSION_LVM:$VERSION_LVM:" \
95                 -e "s:VERSION_UNIONFS_FUSE:$VERSION_UNIONFS_FUSE:" \
96                 -e "s:VERSION_GPG:$VERSION_GPG:" \
97                 "${S}"/defaults/software.sh \
98                 || die "Could not adjust versions"
99
100         # sparc doesn't need crosscompiler anymore
101         # remove this after >3.4.51.2
102         sed -i -e "s:^DEFAULT_KERNEL_CC:#DEFAULT_KERNEL_CC:g" \
103                 "${S}"/arch/sparc64/config.sh \
104                 || die "Could not remove sparc64 crosscompiler config"
105
106         epatch_user
107 }
108
109 src_compile() {
110         if [[ ${PV} == 9999* ]]; then
111                 emake || die
112         fi
113 }
114
115 src_install() {
116         insinto /etc
117         doins "${S}"/genkernel.conf || die "doins genkernel.conf"
118
119         doman genkernel.8 || die "doman"
120         dodoc AUTHORS ChangeLog README TODO || die "dodoc"
121
122         dobin genkernel || die "dobin genkernel"
123
124         rm -f genkernel genkernel.8 AUTHORS ChangeLog README TODO genkernel.conf
125
126         insinto /usr/share/genkernel
127         doins -r "${S}"/* || die "doins"
128         use ibm && cp "${S}"/ppc64/kernel-2.6-pSeries "${S}"/ppc64/kernel-2.6 || \
129                 cp "${S}"/arch/ppc64/kernel-2.6.g5 "${S}"/arch/ppc64/kernel-2.6
130
131         # Copy files to /var/cache/genkernel/src
132         elog "Copying files to /var/cache/genkernel/src..."
133         mkdir -p "${D}"/var/cache/genkernel/src
134         cp -f \
135                 "${DISTDIR}"/mdadm-${VERSION_MDADM}.tar.bz2 \
136                 "${DISTDIR}"/dmraid-${VERSION_DMRAID}.tar.bz2 \
137                 "${DISTDIR}"/LVM2.${VERSION_LVM}.tgz \
138                 "${DISTDIR}"/busybox-${VERSION_BUSYBOX}.tar.bz2 \
139                 "${DISTDIR}"/fuse-${VERSION_FUSE}.tar.gz \
140                 "${DISTDIR}"/unionfs-fuse-${VERSION_UNIONFS_FUSE}.tar.bz2 \
141                 "${DISTDIR}"/gnupg-${VERSION_GPG}.tar.bz2 \
142                 "${DISTDIR}"/open-iscsi-${VERSION_ISCSI}.tar.gz \
143                 "${D}"/var/cache/genkernel/src || die "Copying distfiles..."
144
145         newbashcomp "${FILESDIR}"/genkernel.bash "${PN}"
146         insinto /etc
147         doins "${FILESDIR}"/initramfs.mounts
148 }
149
150 pkg_postinst() {
151         echo
152         elog 'Documentation is available in the genkernel manual page'
153         elog 'as well as the following URL:'
154         echo
155         elog 'https://www.gentoo.org/doc/en/genkernel.xml'
156         echo
157         ewarn "This package is known to not work with reiser4.  If you are running"
158         ewarn "reiser4 and have a problem, do not file a bug.  We know it does not"
159         ewarn "work and we don't plan on fixing it since reiser4 is the one that is"
160         ewarn "broken in this regard.  Try using a sane filesystem like ext3 or"
161         ewarn "even reiser3."
162         echo
163         ewarn "The LUKS support has changed from versions prior to 3.4.4.  Now,"
164         ewarn "you use crypt_root=/dev/blah instead of real_root=luks:/dev/blah."
165         echo
166         if use crypt && ! use cryptsetup ; then
167                 ewarn "Local use flag 'crypt' has been renamed to 'cryptsetup' (bug #414523)."
168                 ewarn "Please set flag 'cryptsetup' for this very package if you would like"
169                 ewarn "to have genkernel create an initramfs with LUKS support."
170                 ewarn "Sorry for the inconvenience."
171                 echo
172         fi
173 }