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