sys-apps/systemd: Merge "bump required app-arch/lz4 version to 0_p131"
[gentoo.git] / dev-util / schroot / schroot-1.6.3.ebuild
1 # Copyright 1999-2013 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI="4"
6
7 inherit autotools base pam versionator
8
9 MY_P=${PN}_${PV}
10
11 DESCRIPTION="Utility to execute commands in a chroot environment"
12 HOMEPAGE="http://packages.debian.org/source/sid/schroot"
13 SRC_URI="mirror://debian/pool/main/${PN::1}/${PN}/${MY_P}.orig.tar.xz"
14
15 LICENSE="GPL-3"
16 SLOT="0"
17 KEYWORDS="amd64 x86"
18 IUSE="btrfs +dchroot debug doc lvm nls pam test"
19
20 COMMON_DEPEND="
21         >=dev-libs/boost-1.42.0
22         dev-libs/lockdev
23         >=sys-apps/util-linux-2.16
24         btrfs? ( >=sys-fs/btrfs-progs-0.19-r2 )
25         lvm? ( sys-fs/lvm2 )
26         pam? ( sys-libs/pam )
27 "
28
29 DEPEND="${COMMON_DEPEND}
30         app-arch/xz-utils
31         sys-apps/groff
32         doc? (
33                 app-doc/doxygen
34                 media-gfx/graphviz
35         )
36         nls? (
37                 >=app-text/po4a-0.40
38                 sys-devel/gettext
39         )
40         test? ( >=dev-util/cppunit-1.10.0 )
41 "
42 RDEPEND="${COMMON_DEPEND}
43         sys-apps/debianutils
44         dchroot? ( !sys-apps/dchroot )
45         nls? ( virtual/libintl )
46 "
47
48 PATCHES=(
49         "${FILESDIR}/${PN}-1.6.3-tests.patch"
50 )
51
52 src_prepare() {
53         base_src_prepare
54
55         # Don't depend on cppunit unless we are testing
56         use test || sed -i '/AM_PATH_CPPUNIT/d' configure.ac
57
58         eautoreconf
59 }
60
61 src_configure() {
62         root_tests=no
63         use test && (( EUID == 0 )) && root_tests=yes
64         use nls || export ac_cv_path_PO4A=
65         econf \
66                 $(use_enable btrfs btrfs-snapshot) \
67                 $(use_enable doc doxygen) \
68                 $(use_enable dchroot) \
69                 $(use_enable dchroot dchroot-dsa) \
70                 $(use_enable debug) \
71                 $(use_enable lvm lvm-snapshot) \
72                 $(use_enable nls) \
73                 $(use_enable pam) \
74                 --enable-block-device \
75                 --enable-loopback \
76                 --enable-uuid \
77                 --enable-root-tests=$root_tests \
78                 --enable-shared \
79                 --disable-static \
80                 --localstatedir="${EPREFIX}"/var \
81                 --with-bash-completion-dir="${EPREFIX}"/usr/share/bash-completion
82 }
83
84 src_compile() {
85         emake all $(usev doc)
86 }
87
88 src_test() {
89         if [[ $root_tests == yes && $EUID -ne 0 ]]; then
90                 ewarn "Disabling tests because you are no longer root"
91                 return 0
92         fi
93
94         # Fix a bug in the tarball -- an empty directory was omitted
95         mkdir test/run-parts.ex2
96         default
97 }
98
99 src_install() {
100         default
101
102         insinto /usr/share/doc/${PF}/contrib/setup.d
103         doins contrib/setup.d/05customdir contrib/setup.d/09fsck contrib/setup.d/10mount-ssh
104
105         newdoc debian/schroot.NEWS NEWS.debian
106
107         newinitd "${FILESDIR}"/schroot.initd schroot
108         newconfd "${FILESDIR}"/schroot.confd schroot
109
110         if use doc; then
111                 docinto html/sbuild
112                 dohtml doc/sbuild/html/*
113                 docinto html/schroot
114                 dohtml doc/schroot/html/*
115         fi
116
117         if use pam; then
118                 rm -f "${ED}"etc/pam.d/schroot
119                 pamd_mimic_system schroot auth account session
120         fi
121
122         # Remove *.la files
123         find "${D}" -name "*.la" -exec rm {} + || die "removal of *.la files failed"
124 }
125
126 pkg_postinst() {
127         if [[ ${REPLACING_VERSIONS} == 1.[24]* ]]; then
128                 elog "Please read /usr/share/doc/${PF}/NEWS.debian* for important"
129                 elog "upgrade information."
130         fi
131 }