Merge remote-tracking branch 'github/pr/708'.
[gentoo.git] / dev-util / catalyst / catalyst-2.0.9999.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 if [[ ${PV} == *9999* ]]; then
8         SRC_ECLASS="git-2"
9         EGIT_REPO_URI="git://anongit.gentoo.org/proj/catalyst.git"
10         EGIT_MASTER="master"
11         EGIT_BRANCH="2.X"
12         S="${WORKDIR}/${PN}"
13 else
14         SRC_URI="mirror://gentoo/${P}.tar.bz2
15                 https://dev.gentoo.org/~jmbsvicetto/distfiles/${P}.tar.bz2
16                 https://dev.gentoo.org/~zerochaos/distfiles/${P}.tar.bz2"
17         KEYWORDS="alpha amd64 arm arm64 hppa ia64 ~mips ppc ppc64 s390 sh sparc x86 ~x86-fbsd"
18 fi
19
20 PYTHON_COMPAT=( python2_7 )
21
22 inherit eutils multilib python-single-r1 ${SRC_ECLASS}
23
24 DESCRIPTION="Release metatool used for creating releases based on Gentoo Linux"
25 HOMEPAGE="https://www.gentoo.org/proj/en/releng/catalyst/"
26
27 LICENSE="GPL-2"
28 SLOT="0"
29 IUSE="ccache kernel_linux"
30
31 DEPEND="
32         app-text/asciidoc
33         ${PYTHON_DEPS}
34 "
35 RDEPEND="
36         app-arch/lbzip2
37         app-crypt/shash
38         app-arch/tar[xattr]
39         virtual/cdrtools
40         amd64? ( >=sys-boot/syslinux-3.72 )
41         ia64? ( sys-fs/dosfstools )
42         x86? ( >=sys-boot/syslinux-3.72 )
43         ccache? ( dev-util/ccache )
44         kernel_linux? ( app-misc/zisofs-tools >=sys-fs/squashfs-tools-2.1 )
45         ${PYTHON_DEPS}
46 "
47
48 REQUIRED_USE=${PYTHON_REQUIRED_USE}
49
50 pkg_setup() {
51         if use ccache ; then
52                 einfo "Enabling ccache support for catalyst."
53         else
54                 ewarn "By default, ccache support for catalyst is disabled."
55                 ewarn "If this is not what you intended,"
56                 ewarn "then you should add ccache to your USE."
57         fi
58
59         echo
60         einfo "The template spec files are now installed by default.  You can find"
61         einfo "them under /usr/share/doc/${PF}/examples"
62         einfo "and they are considered to be the authorative source of information"
63         einfo "on catalyst."
64         echo
65
66         python-single-r1_pkg_setup
67 }
68
69 src_install() {
70         insinto /usr/$(get_libdir)/${PN}
71         exeinto /usr/$(get_libdir)/${PN}
72         doexe catalyst || die "copying catalyst"
73
74         if [[ ${PV} == 3.9999* ]]; then
75                 doins -r modules files || die "copying files"
76         else
77                 doins -r arch modules livecd || die "copying files"
78         fi
79
80         for x in targets/*; do
81                 exeinto /usr/$(get_libdir)/${PN}/$x
82                 doexe $x/* || die "copying ${x}"
83         done
84
85         # Here is where we actually enable ccache
86         use ccache && \
87                 sed -i -e 's:options="autoresume kern:options="autoresume ccache kern:' \
88                         files/catalyst.conf
89
90         sed -i -e "s:/usr/lib/catalyst:/usr/$(get_libdir)/catalyst:" \
91                 files/catalyst.conf
92
93         make_wrapper catalyst /usr/$(get_libdir)/${PN}/catalyst
94         insinto /etc/catalyst
95         doins files/catalyst.conf files/catalystrc || die "copying configuration"
96         insinto /usr/share/doc/${PF}/examples
97         doins examples/* || die
98         dodoc README AUTHORS
99         doman files/catalyst.1 files/catalyst-spec.5
100
101         python_fix_shebang "${ED}usr/$(get_libdir)/catalyst/catalyst"
102         python_optimize "${ED}"
103 }
104
105 pkg_postinst() {
106         einfo "You can find more information about catalyst by checking out the"
107         einfo "catalyst project page at:"
108         einfo "https://www.gentoo.org/proj/en/releng/catalyst/index.xml"
109 }