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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.8 - (show annotations) (download)
Sat Mar 3 21:20:28 2012 UTC (2 years, 6 months ago) by abcd
Branch: MAIN
CVS Tags: HEAD
Changes since 1.7: +1 -1 lines
FILE REMOVED
New upstream version. Remove old.

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

1 # Copyright 1999-2011 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.14.ebuild,v 1.7 2011/12/13 22:24:32 abcd Exp $
4
5 EAPI="3"
6 WANT_AUTOMAKE="1.11"
7
8 inherit autotools base flag-o-matic pam
9
10 MY_P=${PN}_${PV}
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.gz"
15
16 LICENSE="GPL-3"
17 SLOT="0"
18 KEYWORDS="amd64 x86"
19 #IUSE="btrfs +dchroot debug doc lvm nls pam test"
20 IUSE="+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 lvm? ( sys-fs/lvm2 )
27 pam? ( sys-libs/pam )
28 "
29 # btrfs? ( >=sys-fs/btrfs-progs-0.19-r2 )
30
31 DEPEND="${COMMON_DEPEND}
32 doc? (
33 app-doc/doxygen
34 media-gfx/graphviz
35 )
36 nls? ( sys-devel/gettext )
37 test? ( >=dev-util/cppunit-1.10.0 )
38 "
39 RDEPEND="${COMMON_DEPEND}
40 sys-apps/debianutils
41 dchroot? ( !sys-apps/dchroot )
42 nls? ( virtual/libintl )
43 "
44
45 PATCHES=(
46 "${FILESDIR}/${PN}-1.4.7-tests.patch"
47 "${FILESDIR}/${P}-debug.patch"
48 )
49
50 src_prepare() {
51 base_src_prepare
52
53 append-flags -DBOOST_FILESYSTEM_VERSION=2
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 econf \
65 --disable-btrfs-snapshot \
66 $(use_enable doc doxygen) \
67 $(use_enable dchroot) \
68 $(use_enable dchroot dchroot-dsa) \
69 $(use_enable debug) \
70 $(use_enable lvm lvm-snapshot) \
71 $(use_enable nls) \
72 $(use_enable pam) \
73 --enable-block-device \
74 --enable-loopback \
75 --enable-uuid \
76 --enable-root-tests=$root_tests \
77 --enable-shared \
78 --disable-static \
79 --localstatedir="${EPREFIX}"/var \
80 --with-bash-completion-dir="${EPREFIX}"/usr/share/bash-completion
81 # $(use_enable btrfs btrfs-snapshot) \
82 }
83
84 src_compile() {
85 emake all $(usev doc) || die "emake failed"
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 default
94 }
95
96 src_install() {
97 emake DESTDIR="${D}" install || die "emake install failed"
98
99 insinto /usr/share/doc/${PF}/contrib/setup.d
100 doins contrib/setup.d/09fsck contrib/setup.d/10mount-ssh || die "installation of contrib scripts failed"
101
102 newinitd "${FILESDIR}"/schroot.initd schroot || die "installation of init.d script failed"
103 newconfd "${FILESDIR}"/schroot.confd schroot || die "installation of conf.d file failed"
104
105 dodoc AUTHORS ChangeLog NEWS README THANKS TODO || die "installation of docs failed"
106
107 if use doc; then
108 docinto html/sbuild
109 dohtml doc/sbuild/html/* || die "installation of html docs failed"
110 docinto html/schroot
111 dohtml doc/schroot/html/* || die "installation of html docs failed"
112 fi
113
114 if use pam; then
115 rm -f "${ED}"etc/pam.d/schroot
116 pamd_mimic_system schroot auth account session
117 fi
118
119 # Remove *.la files
120 find "${D}" -name "*.la" -exec rm {} + || die "removal of *.la files failed"
121 }
122
123 pkg_preinst() {
124 export had_older_1_4_1=false
125 has_version "<dev-util/schroot-1.4.1" && had_older_1_4_1=true
126 if ${had_older_1_4_1}; then
127 einfo "Moving config files to new location..."
128 mkdir "${EROOT}etc/schroot/default"
129 mv_conffile etc/schroot/script-defaults etc/schroot/default/config
130 mv_conffile etc/schroot/mount-defaults etc/schroot/default/fstab
131 mv_conffile etc/schroot/copyfiles-defaults etc/schroot/default/copyfiles
132 mv_conffile etc/schroot/nssdatabases-defaults etc/schroot/default/nssdatabases
133 fi
134 }
135
136 mv_conffile() {
137 local OLDFILE=${EROOT}$1
138 local NEWFILE=${EROOT}$2
139
140 # if the old file doesn't exist, or is a symlink, stop
141 [[ -f ${OLDFILE} ]] || return 0
142 [[ -L ${OLDFILE} ]] && return 0
143
144 # if the new file already exists, then we have a problem...
145 if [[ -e ${NEWFILE} ]]; then
146 # but if they are the same, then don't worry about it
147 if cmp -s "${OLDFILE}" "${NEWFILE}"; then
148 rm -f "${OLDFILE}"
149 else
150 ewarn "${NEWFILE} already exists, not moving ${OLDFILE}"
151 fi
152 else
153 mv "${OLDFILE}" "${NEWFILE}"
154 fi
155
156 local x y
157 # now move all the unmerged config files as well
158 for x in "${OLDFILE%/*}"/._cfg????_"${OLDFILE##*/}"; do
159 [[ -f ${x} ]] || continue
160 # /etc/schroot/._cfg0000_script-defaults -> /etc/schroot/default/._cfg0000_config
161 y=${x##*/}
162 y=${NEWFILE%*/}${y%${OLDFILE##*/}}${NEWFILE##*/}
163 mv "${x}" "${y}"
164 done
165 }
166
167 pkg_postinst() {
168 local x
169 if ${had_older_1_4_1}; then
170 for x in script:config mount:fstab copyfiles nssdatabases; do
171 if [[ ! -e ${EROOT}etc/schroot/${x%:*}-defaults && -f ${EROOT}etc/schroot/default/${x#*:} ]]; then
172 einfo "Creating compatibility symlink for ${x%:*}-defaults"
173 ln -sf "default/${x#*:}" "${ROOT}etc/schroot/${x%:*}-defaults"
174 fi
175 done
176
177 ewarn "Your config files have been moved to the new location in"
178 ewarn "/etc/schroot/default. Compatibility symlinks have been installed in"
179 ewarn "/etc/schroot, and may be removed if no running chroot refers to them."
180 fi
181 }

  ViewVC Help
Powered by ViewVC 1.1.20