/[gentoo-x86]/dev-util/schroot/schroot-1.4.25.ebuild
Gentoo

Contents of /dev-util/schroot/schroot-1.4.25.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Sat Mar 3 21:20:28 2012 UTC (2 years, 4 months ago) by abcd
Branch: MAIN
CVS Tags: HEAD
New upstream version. Remove old.

(Portage version: 2.2.0_alpha89/cvs/Linux x86_64)

1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/dev-util/schroot/schroot-1.4.23-r1.ebuild,v 1.1 2011/12/13 22:24:32 abcd Exp $
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.bz2"
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 sys-apps/groff
31 doc? (
32 app-doc/doxygen
33 media-gfx/graphviz
34 )
35 nls? ( sys-devel/gettext )
36 test? ( >=dev-util/cppunit-1.10.0 )
37 "
38 RDEPEND="${COMMON_DEPEND}
39 sys-apps/debianutils
40 dchroot? ( !sys-apps/dchroot )
41 nls? ( virtual/libintl )
42 "
43
44 PATCHES=(
45 "${FILESDIR}/${PN}-1.4.7-tests.patch"
46 )
47
48 src_prepare() {
49 base_src_prepare
50
51 # Don't depend on cppunit unless we are testing
52 use test || sed -i '/AM_PATH_CPPUNIT/d' configure.ac
53
54 eautoreconf
55 }
56
57 src_configure() {
58 root_tests=no
59 use test && (( EUID == 0 )) && root_tests=yes
60 econf \
61 $(use_enable btrfs btrfs-snapshot) \
62 $(use_enable doc doxygen) \
63 $(use_enable dchroot) \
64 $(use_enable dchroot dchroot-dsa) \
65 $(use_enable debug) \
66 $(use_enable lvm lvm-snapshot) \
67 $(use_enable nls) \
68 $(use_enable pam) \
69 --enable-block-device \
70 --enable-loopback \
71 --enable-uuid \
72 --enable-root-tests=$root_tests \
73 --enable-shared \
74 --disable-static \
75 --localstatedir="${EPREFIX}"/var \
76 --with-bash-completion-dir="${EPREFIX}"/usr/share/bash-completion
77 }
78
79 src_compile() {
80 emake all $(usev doc)
81 }
82
83 src_test() {
84 if [[ $root_tests == yes && $EUID -ne 0 ]]; then
85 ewarn "Disabling tests because you are no longer root"
86 return 0
87 fi
88 default
89 }
90
91 src_install() {
92 default
93
94 insinto /usr/share/doc/${PF}/contrib/setup.d
95 doins contrib/setup.d/09fsck contrib/setup.d/10mount-ssh
96
97 newinitd "${FILESDIR}"/schroot.initd schroot
98 newconfd "${FILESDIR}"/schroot.confd schroot
99
100 if use doc; then
101 docinto html/sbuild
102 dohtml doc/sbuild/html/*
103 docinto html/schroot
104 dohtml doc/schroot/html/*
105 fi
106
107 if use pam; then
108 rm -f "${ED}"etc/pam.d/schroot
109 pamd_mimic_system schroot auth account session
110 fi
111
112 # Remove *.la files
113 find "${D}" -name "*.la" -exec rm {} + || die "removal of *.la files failed"
114 }
115
116 pkg_preinst() {
117 if [[ ${REPLACING_VERSIONS} == 1.2* || ${REPLACING_VERSIONS} == 1.4.0* ]]; then
118 einfo "Moving config files to new location..."
119 mkdir "${EROOT}etc/schroot/default"
120 mv_conffile etc/schroot/script-defaults etc/schroot/default/config
121 mv_conffile etc/schroot/mount-defaults etc/schroot/default/fstab
122 mv_conffile etc/schroot/copyfiles-defaults etc/schroot/default/copyfiles
123 mv_conffile etc/schroot/nssdatabases-defaults etc/schroot/default/nssdatabases
124 fi
125 }
126
127 mv_conffile() {
128 local OLDFILE=${EROOT}$1
129 local NEWFILE=${EROOT}$2
130
131 # if the old file doesn't exist, or is a symlink, stop
132 [[ -f ${OLDFILE} ]] || return 0
133 [[ -L ${OLDFILE} ]] && return 0
134
135 # if the new file already exists, then we have a problem...
136 if [[ -e ${NEWFILE} ]]; then
137 # but if they are the same, then don't worry about it
138 if cmp -s "${OLDFILE}" "${NEWFILE}"; then
139 rm -f "${OLDFILE}"
140 else
141 ewarn "${NEWFILE} already exists, not moving ${OLDFILE}"
142 fi
143 else
144 mv "${OLDFILE}" "${NEWFILE}"
145 fi
146
147 local x y
148 # now move all the unmerged config files as well
149 for x in "${OLDFILE%/*}"/._cfg????_"${OLDFILE##*/}"; do
150 [[ -f ${x} ]] || continue
151 # /etc/schroot/._cfg0000_script-defaults -> /etc/schroot/default/._cfg0000_config
152 y=${x##*/}
153 y=${NEWFILE%*/}${y%${OLDFILE##*/}}${NEWFILE##*/}
154 mv "${x}" "${y}"
155 done
156 }
157
158 pkg_postinst() {
159 local x
160 if [[ ${REPLACING_VERSIONS} == 1.2* || ${REPLACING_VERSIONS} == 1.4.0* ]]; then
161 for x in script:config mount:fstab copyfiles nssdatabases; do
162 if [[ ! -e ${EROOT}etc/schroot/${x%:*}-defaults && -f ${EROOT}etc/schroot/default/${x#*:} ]]; then
163 einfo "Creating compatibility symlink for ${x%:*}-defaults"
164 ln -sf "default/${x#*:}" "${ROOT}etc/schroot/${x%:*}-defaults"
165 fi
166 done
167
168 ewarn "Your config files have been moved to the new location in"
169 ewarn "/etc/schroot/default. Compatibility symlinks have been installed in"
170 ewarn "/etc/schroot, and may be removed if no running chroot refers to them."
171 fi
172 }

  ViewVC Help
Powered by ViewVC 1.1.20