Merge remote-tracking branch 'github/pr/703'. Fixes bug 560362.
[gentoo.git] / sys-apps / epoch / epoch-1.2.2.ebuild
1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI="5"
6
7 inherit eutils linux-info
8
9 MY_PV="${PV/rc/RC}"
10 MY_P="${PN}-${MY_PV}"
11
12 DESCRIPTION="An init system, a /sbin/init replacement; designed for simplicity"
13 HOMEPAGE="http://universe2.us/epoch.html"
14 SRC_URI="http://universe2.us/${PN}_${PV}.tar.gz"
15
16 LICENSE="public-domain"
17 SLOT="0"
18 KEYWORDS="~amd64 ~arm ~x86"
19
20 S="${WORKDIR}/${PN}_${PV}"
21
22 pkg_pretend() {
23         local CONFIG_CHECK="~PROC_FS"
24
25         [[ ${MERGE_TYPE} != buildonly ]] && check_extra_config
26 }
27
28 src_prepare() {
29         epatch "${FILESDIR}"/${PN}-1.0-fix-CFLAGS.patch
30 }
31
32 src_compile() {
33         NEED_EMPTY_CFLAGS=1 sh ./buildepoch.sh || die "Cannot build epoch."
34 }
35
36 newepochins() {
37         local type="$1"
38
39         cd ${type} || die "Cannot change directory."
40         for file in * ; do
41                 if [[ "${file}" != "epoch" ]] ; then
42                         new${type} ${file} epoch-${file}
43                 fi
44         done
45         cd .. || die "Cannot change directory."
46 }
47
48 src_install() {
49         cd built || die "Cannot change directory."
50
51         dosbin sbin/epoch
52
53         # For now, rename to epoch-* until we can blend in with a standard approach.
54         newepochins bin
55         newepochins sbin
56
57         insinto /etc/epoch/
58         newins "${FILESDIR}"/${PN}-1.0_rc1-epoch.conf epoch.conf
59 }
60
61 pkg_postinst() {
62         elog "Make sure to provide /run and /tmp tmpfs mounts using /etc/fstab."
63         elog ""
64         elog "An example epoch configuration is provided at /etc/epoch/epoch.conf"
65         elog "which starts a minimal needed to use Gentoo."
66         elog ""
67         elog "To use epoch, add this kernel parameter: init=/usr/sbin/epoch-init"
68         elog ""
69         elog "Additional information about epoch is available at"
70         elog "${HOMEPAGE} and configuration documentation at"
71         elog "http://universe2.us/epochconfig.html which is useful reading material."
72         elog ""
73         elog "Its author Subsentient can be contacted at #epoch on irc.freenode.net."
74 }