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