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