Gentoo Archives: gentoo-commits

From: "Pacho Ramos (pacho)" <pacho@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in app-backup/backuppc: backuppc-3.2.1-r3.ebuild ChangeLog
Date: Tue, 01 Jul 2014 19:15:22
Message-Id: 20140701191517.E22EB2004E@flycatcher.gentoo.org
1 pacho 14/07/01 19:15:17
2
3 Modified: ChangeLog
4 Added: backuppc-3.2.1-r3.ebuild
5 Log:
6 Add unit file (#513850 by thorus90)
7
8 (Portage version: 2.2.10/cvs/Linux x86_64, signed Manifest commit with key A188FBD4)
9
10 Revision Changes Path
11 1.18 app-backup/backuppc/ChangeLog
12
13 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-backup/backuppc/ChangeLog?rev=1.18&view=markup
14 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-backup/backuppc/ChangeLog?rev=1.18&content-type=text/plain
15 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-backup/backuppc/ChangeLog?r1=1.17&r2=1.18
16
17 Index: ChangeLog
18 ===================================================================
19 RCS file: /var/cvsroot/gentoo-x86/app-backup/backuppc/ChangeLog,v
20 retrieving revision 1.17
21 retrieving revision 1.18
22 diff -u -r1.17 -r1.18
23 --- ChangeLog 7 Nov 2013 02:33:23 -0000 1.17
24 +++ ChangeLog 1 Jul 2014 19:15:17 -0000 1.18
25 @@ -1,6 +1,12 @@
26 # ChangeLog for app-backup/backuppc
27 -# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
28 -# $Header: /var/cvsroot/gentoo-x86/app-backup/backuppc/ChangeLog,v 1.17 2013/11/07 02:33:23 patrick Exp $
29 +# Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2
30 +# $Header: /var/cvsroot/gentoo-x86/app-backup/backuppc/ChangeLog,v 1.18 2014/07/01 19:15:17 pacho Exp $
31 +
32 +*backuppc-3.2.1-r3 (01 Jul 2014)
33 +
34 + 01 Jul 2014; Pacho Ramos <pacho@g.o> +backuppc-3.2.1-r3.ebuild,
35 + +files/backuppc.service:
36 + Add unit file (#513850 by thorus90)
37
38 07 Nov 2013; Patrick Lauer <patrick@g.o> backuppc-2.1.2-r1.ebuild:
39 Harmonize description, make repoman happier
40
41
42
43 1.1 app-backup/backuppc/backuppc-3.2.1-r3.ebuild
44
45 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-backup/backuppc/backuppc-3.2.1-r3.ebuild?rev=1.1&view=markup
46 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-backup/backuppc/backuppc-3.2.1-r3.ebuild?rev=1.1&content-type=text/plain
47
48 Index: backuppc-3.2.1-r3.ebuild
49 ===================================================================
50 # Copyright 1999-2014 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-r3.ebuild,v 1.1 2014/07/01 19:15:17 pacho Exp $
53
54 EAPI=5
55 inherit eutils systemd webapp user
56
57 MY_P="BackupPC-${PV}"
58
59 DESCRIPTION="A high-performance system for backing up computers to a server's disk."
60 HOMEPAGE="http://backuppc.sourceforge.net/"
61 SRC_URI="mirror://sourceforge/${PN}/${MY_P}.tar.gz
62 http://dev.gentooexperimental.org/~dreeevil/02-fix-config.pl-formatting.patch"
63
64 LICENSE="GPL-2"
65 KEYWORDS="~amd64 ~x86"
66
67 IUSE="rss samba"
68
69 DEPEND="dev-lang/perl
70 app-admin/apache-tools
71 app-admin/makepasswd"
72 RDEPEND="${DEPEND}
73 perl-core/IO-Compress
74 dev-perl/Archive-Zip
75 dev-perl/libwww-perl
76 >=app-arch/tar-1.13.20
77 app-arch/par2cmdline
78 app-arch/gzip
79 app-arch/bzip2
80 virtual/mta
81 www-apache/mod_perl
82 www-servers/apache
83 net-misc/rsync
84 >=dev-perl/File-RsyncP-0.68
85 rss? ( dev-perl/XML-RSS )
86 samba? ( net-fs/samba )"
87
88 WEBAPP_MANUAL_SLOT="yes"
89 SLOT="0"
90
91 S=${WORKDIR}/${MY_P}
92
93 CONFDIR="/etc/BackupPC"
94 DATADIR="/var/lib/backuppc"
95 LOGDIR="/var/log/BackupPC"
96
97 pkg_setup() {
98 webapp_pkg_setup
99 enewgroup backuppc
100 enewuser backuppc -1 /bin/bash /var/lib/backuppc backuppc
101 }
102
103 src_unpack() {
104 unpack ${A}
105 cd "${S}"
106 }
107
108 src_prepare() {
109 epatch "${FILESDIR}/3.2.0/01-fix-configure.pl.patch"
110 epatch "${DISTDIR}/02-fix-config.pl-formatting.patch"
111 epatch "${FILESDIR}/3.2.0/03-reasonable-config.pl-defaults.patch"
112
113 # Fix the documentation location in the CGI interface
114 epatch "${FILESDIR}/3.2.0/04-add-docdir-marker.patch"
115 sed -i "s+__DOCDIR__+/usr/share/doc/${PF}+" "lib/BackupPC/CGI/View.pm"
116
117 epatch "${FILESDIR}/3.2.0/05-nicelevel.patch"
118 sed -i -e 's/--chuid ${USER}//' "${S}"/init.d/src/gentoo-backuppc || die "Failed to fix the init script"
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 startup scripts"
184 newinitd "${S}"/init.d/gentoo-backuppc backuppc
185 newconfd "${S}"/init.d/gentoo-backuppc.conf backuppc
186 systemd_dounit "${FILESDIR}/${PN}.service"
187 eend 0
188
189 ebegin "Setting up an apache instance for backuppc"
190
191 cp "${FILESDIR}/apache2-backuppc."{conf,init} "${WORKDIR}/"
192 cp "${FILESDIR}/httpd.conf" "${WORKDIR}/httpd.conf"
193 sed -i -e "s+HTDOCSDIR+${MY_HTDOCSDIR}+g" "${WORKDIR}/httpd.conf"
194 sed -i -e "s+AUTHFILE+${CONFDIR}/users.htpasswd+g" "${WORKDIR}/httpd.conf"
195
196 moduledir="/usr/lib/apache2/modules"
197
198 # Check if the Apache ServerRoot is real.
199 # This is sometimes broken on older amd64 systems.
200 # In this case we just patch our config file appropriately.
201 if [[ ! -d "/usr/lib/apache2" ]]; then
202 if [[ -d "/usr/lib64/apache2" ]]; then
203 sed -i -e "s+/usr/lib/apache2+/usr/lib64/apache2+g" "${WORKDIR}/httpd.conf"
204 sed -i -e "s+/usr/lib/apache2+/usr/lib64/apache2+g" "${WORKDIR}/apache2-backuppc.conf"
205 moduledir="/usr/lib64/apache2/modules"
206 fi
207 fi
208
209 # Check if we're using mod_cgid instead of mod_cgi
210 # This happens if you install apache with USE="threads"
211 if [[ -f "${moduledir}/mod_cgid.so" ]]; then
212 sed -i -e "s+mod_cgi+mod_cgid+g" "${WORKDIR}/httpd.conf"
213 sed -i -e "s+cgi_module+cgid_module+g" "${WORKDIR}/httpd.conf"
214 fi
215
216 # Install conf.d/init.d files for apache2-backuppc
217 if [ -e /etc/init.d/apache2 ]; then
218 newconfd "${WORKDIR}/apache2-backuppc.conf" apache2-backuppc
219 newinitd /etc/init.d/apache2 apache2-backuppc
220 else
221 newconfd "${WORKDIR}/apache2-backuppc.conf" apache2-backuppc
222 newinitd "${WORKDIR}/apache2-backuppc.init" apache2-backuppc
223 fi
224
225 insopts -m 0644
226 insinto ${CONFDIR}
227 doins "${WORKDIR}/httpd.conf"
228
229 eend $?
230
231 webapp_src_install || die "webapp_src_install"
232
233 # Make sure that the ownership is correct
234 chown -R backuppc:backuppc "${D}${CONFDIR}"
235 chown -R backuppc:backuppc "${D}${DATADIR}"
236 chown -R backuppc:backuppc "${D}${LOGDIR}"
237 }
238
239 pkg_postinst() {
240 # This is disabled since BackupPC doesn't need it
241 # webapp_pkg_postinst
242
243 elog "Installation finished, now may now start using BackupPC."
244 elog ""
245 elog "- Read the documentation in /usr/share/doc/${PF}/BackupPC.html"
246 elog " Please pay special attention to the security section."
247 elog ""
248 elog "- You can launch backuppc and it's apache web interface by running:"
249 elog " # /etc/init.d/backuppc start"
250 elog " # /etc/init.d/apache2-backuppc start"
251
252 if [[ ! -e /etc/runlevels/default/backuppc ]]; then
253 elog ""
254 elog "- You also might want to add these scripts to your default runlevel:"
255 elog " # rc-update add backuppc default"
256 elog " # rc-update add apache2-backuppc default"
257 fi
258
259 # Generate a new password if there's no auth file
260 if [[ ! -f "${CONFDIR}/users.htpasswd" ]]; then
261 adminuser="backuppc"
262 adminpass=$( makepasswd --chars=12 )
263 htpasswd -bc "${CONFDIR}/users.htpasswd" $adminuser $adminpass
264
265 elog ""
266 elog "- Created admin user $adminuser with password $adminpass"
267 elog " To add new users, run: "
268 elog " # htpasswd ${CONFDIR}/users.htpasswd newUser"
269 fi
270
271 if [[ -d "/etc/backuppc" ]]; then
272 ewarn ""
273 ewarn "Detected old config directory in /etc/backuppc"
274 ewarn "Please migrate relevant config files to ${CONFDIR} before starting backuppc"
275 fi
276 elog "Warning: The default path changed from /var/lib/backuppc to /var/lib/BackupPC"
277 elog "To continue using the old path the config files need to contain something like this:"
278 elog "\$Conf{TopDir} = '/var/lib/backuppc/';"
279 }