Gentoo Archives: gentoo-commits

From: "Patrick Lauer (patrick)" <patrick@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in app-backup/backuppc: ChangeLog backuppc-3.2.1.ebuild
Date: Mon, 29 Aug 2011 10:41:18
Message-Id: 20110829104107.EFBEF20054@flycatcher.gentoo.org
1 patrick 11/08/29 10:41:07
2
3 Modified: ChangeLog
4 Added: backuppc-3.2.1.ebuild
5 Log:
6 Bump for #287133, ebuild from the portage-backup overlay. Thanks to Lenno Nagel.
7
8 (Portage version: 2.2.0_alpha51/cvs/Linux x86_64)
9
10 Revision Changes Path
11 1.9 app-backup/backuppc/ChangeLog
12
13 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-backup/backuppc/ChangeLog?rev=1.9&view=markup
14 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-backup/backuppc/ChangeLog?rev=1.9&content-type=text/plain
15 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-backup/backuppc/ChangeLog?r1=1.8&r2=1.9
16
17 Index: ChangeLog
18 ===================================================================
19 RCS file: /var/cvsroot/gentoo-x86/app-backup/backuppc/ChangeLog,v
20 retrieving revision 1.8
21 retrieving revision 1.9
22 diff -u -r1.8 -r1.9
23 --- ChangeLog 12 Oct 2009 17:17:02 -0000 1.8
24 +++ ChangeLog 29 Aug 2011 10:41:07 -0000 1.9
25 @@ -1,6 +1,18 @@
26 # ChangeLog for app-backup/backuppc
27 -# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
28 -# $Header: /var/cvsroot/gentoo-x86/app-backup/backuppc/ChangeLog,v 1.8 2009/10/12 17:17:02 halcy0n Exp $
29 +# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
30 +# $Header: /var/cvsroot/gentoo-x86/app-backup/backuppc/ChangeLog,v 1.9 2011/08/29 10:41:07 patrick Exp $
31 +
32 +*backuppc-3.2.1 (29 Aug 2011)
33 +
34 + 29 Aug 2011; Patrick Lauer <patrick@g.o>
35 + +files/3.2.0/01-fix-configure.pl.patch,
36 + +files/3.2.0/02-fix-config.pl-formatting.patch,
37 + +files/3.2.0/03-reasonable-config.pl-defaults.patch,
38 + +files/3.2.0/04-add-docdir-marker.patch, +files/3.2.0/05-nicelevel.patch,
39 + +files/apache2-backuppc.conf, +files/apache2-backuppc.init,
40 + +backuppc-3.2.1.ebuild, +files/httpd.conf:
41 + Bump for #287133, ebuild from the portage-backup overlay. Thanks to Lenno
42 + Nagel.
43
44 12 Oct 2009; Mark Loeser <halcy0n@g.o> backuppc-2.1.2-r1.ebuild:
45 QA fixes; unquoted variables
46
47
48
49 1.1 app-backup/backuppc/backuppc-3.2.1.ebuild
50
51 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-backup/backuppc/backuppc-3.2.1.ebuild?rev=1.1&view=markup
52 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-backup/backuppc/backuppc-3.2.1.ebuild?rev=1.1&content-type=text/plain
53
54 Index: backuppc-3.2.1.ebuild
55 ===================================================================
56 # Copyright 1999-2011 Gentoo Foundation
57 # Distributed under the terms of the GNU General Public License v2
58 # $Header: /var/cvsroot/gentoo-x86/app-backup/backuppc/backuppc-3.2.1.ebuild,v 1.1 2011/08/29 10:41:07 patrick Exp $
59
60 EAPI="2"
61
62 inherit eutils webapp
63
64 MY_P="BackupPC-${PV}"
65
66 DESCRIPTION="A high-performance system for backing up computers to a server's disk."
67 HOMEPAGE="http://backuppc.sourceforge.net/"
68 SRC_URI="mirror://sourceforge/${PN}/${MY_P}.tar.gz"
69
70 LICENSE="GPL-2"
71 KEYWORDS="~amd64 ~x86"
72
73 IUSE="rss samba"
74
75 DEPEND="dev-lang/perl
76 app-admin/apache-tools
77 app-admin/makepasswd"
78 RDEPEND="${DEPEND}
79 perl-core/IO-Compress
80 dev-perl/Archive-Zip
81 dev-perl/libwww-perl
82 >=app-arch/tar-1.13.20
83 app-arch/par2cmdline
84 app-arch/gzip
85 app-arch/bzip2
86 virtual/mta
87 www-apache/mod_perl
88 www-servers/apache
89 net-misc/rsync
90 >=dev-perl/File-RsyncP-0.68
91 rss? ( dev-perl/XML-RSS )
92 samba? ( net-fs/samba )"
93
94 WEBAPP_MANUAL_SLOT="yes"
95 SLOT="0"
96
97 S=${WORKDIR}/${MY_P}
98
99 CONFDIR="/etc/BackupPC"
100 DATADIR="/var/lib/backuppc"
101 LOGDIR="/var/log/BackupPC"
102
103 pkg_setup() {
104 webapp_pkg_setup
105 enewgroup backuppc
106 enewuser backuppc -1 /bin/bash /var/lib/backuppc backuppc
107 }
108
109 src_unpack() {
110 unpack ${A}
111 cd "${S}"
112 }
113
114 src_prepare() {
115 epatch "${FILESDIR}/3.2.0/01-fix-configure.pl.patch"
116 epatch "${FILESDIR}/3.2.0/02-fix-config.pl-formatting.patch"
117 epatch "${FILESDIR}/3.2.0/03-reasonable-config.pl-defaults.patch"
118
119 # Fix the documentation location in the CGI interface
120 epatch "${FILESDIR}/3.2.0/04-add-docdir-marker.patch"
121 sed -i "s+__DOCDIR__+/usr/share/doc/${PF}+" "lib/BackupPC/CGI/View.pm"
122
123 epatch "${FILESDIR}/3.2.0/05-nicelevel.patch"
124 }
125
126 src_test() {
127 true
128 }
129
130 src_install() {
131 webapp_src_preinst
132
133 local myconf
134 myconf=""
135 if use samba ; then
136 myconf="--bin-path smbclient=$(type -p smbclient)"
137 myconf="${myconf} --bin-path nmblookup=$(type -p nmblookup)"
138 fi
139
140 ./configure.pl \
141 --batch \
142 --bin-path perl=$(type -p perl) \
143 --bin-path tar=$(type -p tar) \
144 --bin-path rsync=$(type -p rsync) \
145 --bin-path ping=$(type -p ping) \
146 --bin-path df=$(type -p df) \
147 --bin-path ssh=$(type -p ssh) \
148 --bin-path sendmail=$(type -p sendmail) \
149 --bin-path hostname=$(type -p hostname) \
150 --bin-path gzip=$(type -p gzip) \
151 --bin-path bzip2=$(type -p bzip2) \
152 --config-dir ${CONFDIR} \
153 --install-dir /usr \
154 --data-dir ${DATADIR} \
155 --hostname $(hostname) \
156 --uid-ignore \
157 --dest-dir "${D%/}" \
158 --html-dir ${MY_HTDOCSDIR}/image \
159 --html-dir-url /image \
160 --cgi-dir ${MY_HTDOCSDIR} \
161 --fhs \
162 ${myconf} || die "failed the configure.pl script"
163
164 ebegin "Installing documentation"
165
166 pod2man \
167 --section=8 \
168 --center="BackupPC manual" \
169 "${S}"/doc/BackupPC.pod backuppc.8 || die "failed to generate man page"
170
171 doman backuppc.8
172
173 # Place the documentation in the correct location
174 dodoc "${D}/usr/doc/BackupPC.html"
175 dodoc "${D}/usr/doc/BackupPC.pod"
176 rm -rf "${D}/usr/doc"
177
178 eend 0
179
180 # Setup directories
181 dodir ${CONFDIR}/pc
182
183 keepdir ${CONFDIR}
184 keepdir ${CONFDIR}/pc
185 keepdir ${DATADIR}/{trash,pool,pc,cpool}
186 keepdir ${LOGDIR}
187
188 ebegin "Setting up init.d/conf.d scripts"
189 newinitd "${S}"/init.d/gentoo-backuppc backuppc
190 newconfd "${S}"/init.d/gentoo-backuppc.conf backuppc
191 eend 0
192
193 ebegin "Setting up an apache instance for backuppc"
194
195 cp "${FILESDIR}/apache2-backuppc."{conf,init} "${WORKDIR}/"
196 cp "${FILESDIR}/httpd.conf" "${WORKDIR}/httpd.conf"
197 sed -i -e "s+HTDOCSDIR+${MY_HTDOCSDIR}+g" "${WORKDIR}/httpd.conf"
198 sed -i -e "s+AUTHFILE+${CONFDIR}/users.htpasswd+g" "${WORKDIR}/httpd.conf"
199
200 moduledir="/usr/lib/apache2/modules"
201
202 # Check if the Apache ServerRoot is real.
203 # This is sometimes broken on older amd64 systems.
204 # In this case we just patch our config file appropriately.
205 if [[ ! -d "/usr/lib/apache2" ]]; then
206 if [[ -d "/usr/lib64/apache2" ]]; then
207 sed -i -e "s+/usr/lib/apache2+/usr/lib64/apache2+g" "${WORKDIR}/httpd.conf"
208 sed -i -e "s+/usr/lib/apache2+/usr/lib64/apache2+g" "${WORKDIR}/apache2-backuppc.conf"
209 moduledir="/usr/lib64/apache2/modules"
210 fi
211 fi
212
213 # Check if we're using mod_cgid instead of mod_cgi
214 # This happens if you install apache with USE="threads"
215 if [[ -f "${moduledir}/mod_cgid.so" ]]; then
216 sed -i -e "s+mod_cgi+mod_cgid+g" "${WORKDIR}/httpd.conf"
217 sed -i -e "s+cgi_module+cgid_module+g" "${WORKDIR}/httpd.conf"
218 fi
219
220 # Install conf.d/init.d files for apache2-backuppc
221 if [ -e /etc/init.d/apache2 ]; then
222 newconfd "${WORKDIR}/apache2-backuppc.conf" apache2-backuppc
223 newinitd /etc/init.d/apache2 apache2-backuppc
224 else
225 newconfd "${WORKDIR}/apache2-backuppc.conf" apache2-backuppc
226 newinitd "${WORKDIR}/apache2-backuppc.init" apache2-backuppc
227 fi
228
229 insopts -m 0644
230 insinto ${CONFDIR}
231 doins "${WORKDIR}/httpd.conf"
232
233 eend $?
234
235 webapp_src_install || die "webapp_src_install"
236
237 # Make sure that the ownership is correct
238 chown -R backuppc:backuppc "${D}${CONFDIR}"
239 chown -R backuppc:backuppc "${D}${DATADIR}"
240 chown -R backuppc:backuppc "${D}${LOGDIR}"
241 }
242
243 pkg_postinst() {
244 # This is disabled since BackupPC doesn't need it
245 # webapp_pkg_postinst
246
247 elog "Installation finished, now may now start using BackupPC."
248 elog ""
249 elog "- Read the documentation in /usr/share/doc/${PF}/BackupPC.html"
250 elog " Please pay special attention to the security section."
251 elog ""
252 elog "- You can launch backuppc and it's apache web interface by running:"
253 elog " # /etc/init.d/backuppc start"
254 elog " # /etc/init.d/apache2-backuppc start"
255
256 if [[ ! -e /etc/runlevels/default/backuppc ]]; then
257 elog ""
258 elog "- You also might want to add these scripts to your default runlevel:"
259 elog " # rc-update add backuppc default"
260 elog " # rc-update add apache2-backuppc default"
261 fi
262
263 # Generate a new password if there's no auth file
264 if [[ ! -f "${CONFDIR}/users.htpasswd" ]]; then
265 adminuser="backuppc"
266 adminpass=$( makepasswd --chars=12 )
267 htpasswd -bc "${CONFDIR}/users.htpasswd" $adminuser $adminpass
268
269 elog ""
270 elog "- Created admin user $adminuser with password $adminpass"
271 elog " To add new users, run: "
272 elog " # htpasswd ${CONFDIR}/users.htpasswd newUser"
273 fi
274
275 if [[ -d "/etc/backuppc" ]]; then
276 ewarn ""
277 ewarn "Detected old config directory in /etc/backuppc"
278 ewarn "Please migrate relevant config files to ${CONFDIR} before starting backuppc"
279 fi
280 }