Gentoo Archives: gentoo-commits

From: "Thomas Beierlein (tomjbe)" <tomjbe@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in app-backup/bacula: ChangeLog bacula-7.0.5-r1.ebuild
Date: Fri, 28 Nov 2014 09:59:32
Message-Id: 20141128095929.7C502B13D@oystercatcher.gentoo.org
1 tomjbe 14/11/28 09:59:29
2
3 Modified: ChangeLog
4 Added: bacula-7.0.5-r1.ebuild
5 Log:
6 Fixes systemd tmpfile for bacula-clientonly (bug #528398). Thanks for reporting to D. Griffin
7
8 (Portage version: 2.2.14/cvs/Linux x86_64, signed Manifest commit with key 0x762053D5)
9
10 Revision Changes Path
11 1.169 app-backup/bacula/ChangeLog
12
13 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-backup/bacula/ChangeLog?rev=1.169&view=markup
14 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-backup/bacula/ChangeLog?rev=1.169&content-type=text/plain
15 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-backup/bacula/ChangeLog?r1=1.168&r2=1.169
16
17 Index: ChangeLog
18 ===================================================================
19 RCS file: /var/cvsroot/gentoo-x86/app-backup/bacula/ChangeLog,v
20 retrieving revision 1.168
21 retrieving revision 1.169
22 diff -u -r1.168 -r1.169
23 --- ChangeLog 3 Nov 2014 11:04:55 -0000 1.168
24 +++ ChangeLog 28 Nov 2014 09:59:29 -0000 1.169
25 @@ -1,6 +1,12 @@
26 # ChangeLog for app-backup/bacula
27 # Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2
28 -# $Header: /var/cvsroot/gentoo-x86/app-backup/bacula/ChangeLog,v 1.168 2014/11/03 11:04:55 titanofold Exp $
29 +# $Header: /var/cvsroot/gentoo-x86/app-backup/bacula/ChangeLog,v 1.169 2014/11/28 09:59:29 tomjbe Exp $
30 +
31 +*bacula-7.0.5-r1 (28 Nov 2014)
32 +
33 + 28 Nov 2014; Thomas Beierlein <tomjbe@g.o> +bacula-7.0.5-r1.ebuild:
34 + Fixes systemd tmpfile for bacula-clientonly (bug #528398). Thanks for
35 + reporting to D. Griffin
36
37 03 Nov 2014; Aaron W. Swenson <titanofold@g.o> bacula-5.0.3-r3.ebuild,
38 bacula-5.2.12.ebuild, bacula-5.2.13.ebuild, bacula-5.2.13-r2.ebuild,
39
40
41
42 1.1 app-backup/bacula/bacula-7.0.5-r1.ebuild
43
44 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-backup/bacula/bacula-7.0.5-r1.ebuild?rev=1.1&view=markup
45 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-backup/bacula/bacula-7.0.5-r1.ebuild?rev=1.1&content-type=text/plain
46
47 Index: bacula-7.0.5-r1.ebuild
48 ===================================================================
49 # Copyright 1999-2014 Gentoo Foundation
50 # Distributed under the terms of the GNU General Public License v2
51 # $Header: /var/cvsroot/gentoo-x86/app-backup/bacula/bacula-7.0.5-r1.ebuild,v 1.1 2014/11/28 09:59:29 tomjbe Exp $
52
53 EAPI="5"
54
55 inherit eutils multilib qt4-r2 systemd user
56
57 MY_PV=${PV/_beta/-b}
58 MY_P=${PN}-${MY_PV}
59
60 DESCRIPTION="Featureful client/server network backup suite"
61 HOMEPAGE="http://www.bacula.org/"
62 SRC_URI="mirror://sourceforge/bacula/${MY_P}.tar.gz"
63
64 LICENSE="AGPL-3"
65 SLOT="0"
66 KEYWORDS="~amd64 ~ppc ~sparc ~x86"
67 IUSE="acl bacula-clientonly bacula-nodir bacula-nosd examples ipv6 logwatch mysql postgres qt4 readline +sqlite3 ssl static tcpd vim-syntax X"
68
69 DEPEND="
70 dev-libs/gmp
71 !bacula-clientonly? (
72 postgres? ( virtual/postgresql[threads] )
73 mysql? ( virtual/mysql )
74 sqlite3? ( dev-db/sqlite:3 )
75 !bacula-nodir? ( virtual/mta )
76 )
77 qt4? (
78 dev-qt/qtsvg:4
79 x11-libs/qwt:5
80 )
81 logwatch? ( sys-apps/logwatch )
82 tcpd? ( >=sys-apps/tcp-wrappers-7.6 )
83 readline? ( >=sys-libs/readline-4.1 )
84 static? (
85 acl? ( virtual/acl[static-libs] )
86 sys-libs/zlib[static-libs]
87 dev-libs/lzo[static-libs]
88 sys-libs/ncurses[static-libs]
89 ssl? ( dev-libs/openssl[static-libs] )
90 )
91 !static? (
92 acl? ( virtual/acl )
93 sys-libs/zlib
94 dev-libs/lzo
95 sys-libs/ncurses
96 ssl? ( dev-libs/openssl )
97 )"
98 RDEPEND="${DEPEND}
99 !bacula-clientonly? (
100 !bacula-nosd? (
101 sys-block/mtx
102 app-arch/mt-st
103 )
104 )
105 vim-syntax? ( || ( app-editors/vim app-editors/gvim ) )"
106
107 REQUIRED_USE="|| ( ^^ ( mysql postgres sqlite3 ) bacula-clientonly )
108 static? ( bacula-clientonly )"
109
110 S=${WORKDIR}/${MY_P}
111
112 pkg_setup() {
113 #XOR and !bacula-clientonly controlled by REQUIRED_USE
114 use mysql && export mydbtype="mysql"
115 use postgres && export mydbtype="postgresql"
116 use sqlite3 && export mydbtype="sqlite3"
117
118 # create the daemon group and user
119 if [ -z "$(egetent group bacula 2>/dev/null)" ]; then
120 enewgroup bacula
121 einfo
122 einfo "The group 'bacula' has been created. Any users you add to this"
123 einfo "group have access to files created by the daemons."
124 einfo
125 fi
126
127 if use bacula-clientonly && use static && use qt4; then
128 ewarn
129 ewarn "Building statically linked 'bat' is not supported. Ignorig 'qt4' useflag."
130 ewarn
131 fi
132
133 if ! use bacula-clientonly; then
134 if [ -z "$(egetent passwd bacula 2>/dev/null)" ]; then
135 enewuser bacula -1 -1 /var/lib/bacula bacula,disk,tape,cdrom,cdrw
136 einfo
137 einfo "The user 'bacula' has been created. Please see the bacula manual"
138 einfo "for information about running bacula as a non-root user."
139 einfo
140 fi
141 fi
142 }
143
144 src_prepare() {
145 # adjusts default configuration files for several binaries
146 # to /etc/bacula/<config> instead of ./<config>
147 pushd src >&/dev/null || die
148 for f in console/console.c dird/dird.c filed/filed.c \
149 stored/bcopy.c stored/bextract.c stored/bls.c \
150 stored/bscan.c stored/btape.c stored/stored.c \
151 qt-console/main.cpp; do
152 sed -i -e 's|^\(#define CONFIG_FILE "\)|\1/etc/bacula/|g' "${f}" \
153 || die "sed on ${f} failed"
154 done
155 popd >&/dev/null || die
156
157 # bug 466688 drop deprecated categories from Desktop file
158 sed -i -e 's/Application;//' scripts/bat.desktop.in || die
159
160 # bug 466690 Use CXXFLAGS instead of CFLAGS
161 sed -i -e 's/@CFLAGS@/@CXXFLAGS@/' autoconf/Make.common.in || die
162
163 # drop automatic install of unneeded documentation (for bug 356499)
164 epatch "${FILESDIR}"/5.2.3/${PN}-5.2.3-doc.patch
165
166 # bug #310087
167 epatch "${FILESDIR}"/5.2.3/${PN}-5.2.3-as-needed.patch
168
169 # bug #311161
170 epatch "${FILESDIR}"/5.2.3/${PN}-5.2.3-lib-search-path.patch
171
172 # bat needs to respect LDFLAGS
173 epatch "${FILESDIR}"/5.2.3/${PN}-5.2.3-ldflags.patch
174
175 # bug #328701
176 epatch "${FILESDIR}"/5.2.3/${PN}-5.2.3-openssl-1.patch
177
178 epatch "${FILESDIR}"/7.0.2/${PN}-7.0.2-fix-static.patch
179
180 # do not strip binaries
181 sed -i -e "s/strip /# strip /" src/filed/Makefile.in || die
182 sed -i -e "s/strip /# strip /" src/console/Makefile.in || die
183
184 # fix file not found error during make depend
185 epatch "${FILESDIR}"/7.0.2/${PN}-7.0.2-depend.patch
186
187 # Fix systemd unit files:
188 # bug 497748
189 sed -i -e '/Requires/d' platforms/systemd/*.service.in || die
190 sed -i -e '/StandardOutput/d' platforms/systemd/*.service.in || die
191 # bug 504370
192 sed -i -e '/Alias=bacula-dir/d' platforms/systemd/bacula-dir.service.in || die
193
194 # Fix tmpfiles config for client-only (no bacula user) install
195 # NOTE: Change only first occurance (user) not second (group)
196 # bug 528398
197 if use bacula-clientonly; then
198 sed -i -e 's/bacula/root/' platforms/systemd/bacula.conf.in || die
199 fi
200 }
201
202 src_configure() {
203 local myconf=''
204
205 if use bacula-clientonly; then
206 myconf="${myconf} \
207 $(use_enable bacula-clientonly client-only) \
208 $(use_enable !static libtool) \
209 $(use_enable static static-cons) \
210 $(use_enable static static-fd)"
211 else
212 myconf="${myconf} \
213 $(use_enable !bacula-nodir build-dird) \
214 $(use_enable !bacula-nosd build-stored)"
215 # bug #311099
216 # database support needed by dir-only *and* sd-only
217 # build as well (for building bscan, btape, etc.)
218 myconf="${myconf} \
219 --with-${mydbtype} \
220 --enable-batch-insert"
221 fi
222
223 # do not build bat if 'static' clientonly
224 if ! use bacula-clientonly || ! use static; then
225 myconf="${myconf} \
226 $(use_enable qt4 bat)"
227 fi
228
229 myconf="${myconf} \
230 $(use_with X x) \
231 $(use_enable !readline conio) \
232 $(use_enable readline) \
233 $(use_with readline readline /usr) \
234 $(use_with ssl openssl) \
235 $(use_enable ipv6) \
236 $(use_enable acl) \
237 $(use_with tcpd tcp-wrappers)"
238
239 econf \
240 --libdir=/usr/$(get_libdir) \
241 --docdir=/usr/share/doc/${PF} \
242 --htmldir=/usr/share/doc/${PF}/html \
243 --with-pid-dir=/var/run \
244 --sysconfdir=/etc/bacula \
245 --with-subsys-dir=/var/lock/subsys \
246 --with-working-dir=/var/lib/bacula \
247 --with-logdir=/var/lib/bacula \
248 --with-scriptdir=/usr/libexec/bacula \
249 --with-systemd=$(systemd_get_unitdir) \
250 --with-dir-user=bacula \
251 --with-dir-group=bacula \
252 --with-sd-user=root \
253 --with-sd-group=bacula \
254 --with-fd-user=root \
255 --with-fd-group=bacula \
256 --enable-smartalloc \
257 --disable-afs \
258 --host=${CHOST} \
259 ${myconf}
260 # correct configuration for QT based bat
261 if use qt4 ; then
262 pushd src/qt-console
263 eqmake4
264 popd
265 fi
266 }
267
268 src_compile() {
269 # Make build log verbose (bug #447806)
270 emake NO_ECHO=""
271 }
272
273 src_install() {
274 emake DESTDIR="${D}" install
275 doicon scripts/bacula.png
276
277 # install bat icon and desktop file when enabled
278 # (for some reason ./configure doesn't pick this up)
279 if use qt4 && ! use static ; then
280 doicon src/qt-console/images/bat_icon.png
281 domenu scripts/bat.desktop
282 fi
283
284 # remove some scripts we don't need at all
285 rm -f "${D}"/usr/libexec/bacula/{bacula,bacula-ctl-dir,bacula-ctl-fd,bacula-ctl-sd,startmysql,stopmysql}
286
287 # rename statically linked apps
288 if use bacula-clientonly && use static ; then
289 pushd "${D}"/usr/sbin || die
290 mv static-bacula-fd bacula-fd || die
291 mv static-bconsole bconsole || die
292 popd || die
293 fi
294
295 # extra files which 'make install' doesn't cover
296 if ! use bacula-clientonly; then
297 # the database update scripts
298 diropts -m0750
299 insinto /usr/libexec/bacula/updatedb
300 insopts -m0754
301 doins "${S}"/updatedb/*
302 fperms 0640 /usr/libexec/bacula/updatedb/README
303
304 # the logrotate configuration
305 # (now unconditional wrt bug #258187)
306 diropts -m0755
307 insinto /etc/logrotate.d
308 insopts -m0644
309 newins "${S}"/scripts/logrotate bacula
310
311 # the logwatch scripts
312 if use logwatch; then
313 diropts -m0750
314 dodir /etc/log.d/scripts/services
315 dodir /etc/log.d/scripts/shared
316 dodir /etc/log.d/conf/logfiles
317 dodir /etc/log.d/conf/services
318 pushd "${S}"/scripts/logwatch >&/dev/null || die
319 emake DESTDIR="${D}" install
320 popd >&/dev/null || die
321 fi
322 fi
323
324 if ! use qt4; then
325 rm -vf "${D}"/usr/share/man/man1/bat.1*
326 fi
327 rm -vf "${D}"/usr/share/man/man1/bacula-tray-monitor.1*
328 if use bacula-clientonly || use bacula-nodir; then
329 rm -vf "${D}"/usr/share/man/man8/bacula-dir.8*
330 rm -vf "${D}"/usr/share/man/man8/dbcheck.8*
331 rm -vf "${D}"/usr/share/man/man1/bsmtp.1*
332 rm -vf "${D}"/usr/libexec/bacula/create_*_database
333 rm -vf "${D}"/usr/libexec/bacula/drop_*_database
334 rm -vf "${D}"/usr/libexec/bacula/make_*_tables
335 rm -vf "${D}"/usr/libexec/bacula/update_*_tables
336 rm -vf "${D}"/usr/libexec/bacula/drop_*_tables
337 rm -vf "${D}"/usr/libexec/bacula/grant_*_privileges
338 rm -vf "${D}"/usr/libexec/bacula/*_catalog_backup
339 fi
340 if use bacula-clientonly || use bacula-nosd; then
341 rm -vf "${D}"/usr/share/man/man8/bacula-sd.8*
342 rm -vf "${D}"/usr/share/man/man8/bcopy.8*
343 rm -vf "${D}"/usr/share/man/man8/bextract.8*
344 rm -vf "${D}"/usr/share/man/man8/bls.8*
345 rm -vf "${D}"/usr/share/man/man8/bscan.8*
346 rm -vf "${D}"/usr/share/man/man8/btape.8*
347 rm -vf "${D}"/usr/libexec/bacula/disk-changer
348 rm -vf "${D}"/usr/libexec/bacula/mtx-changer
349 rm -vf "${D}"/usr/libexec/bacula/dvd-handler
350 fi
351
352 # documentation
353 dodoc ChangeLog ReleaseNotes SUPPORT technotes
354
355 # install examples (bug #457504)
356 if use examples; then
357 docinto examples/
358 dodoc -r examples/*
359 fi
360
361 # vim-files
362 if use vim-syntax; then
363 insinto /usr/share/vim/vimfiles/syntax
364 doins scripts/bacula.vim
365 insinto /usr/share/vim/vimfiles/ftdetect
366 newins scripts/filetype.vim bacula_ft.vim
367 fi
368
369 # setup init scripts
370 myscripts="bacula-fd"
371 if ! use bacula-clientonly; then
372 if ! use bacula-nodir; then
373 myscripts="${myscripts} bacula-dir"
374 fi
375 if ! use bacula-nosd; then
376 myscripts="${myscripts} bacula-sd"
377 fi
378 fi
379 for script in ${myscripts}; do
380 # copy over init script and config to a temporary location
381 # so we can modify them as needed
382 cp "${FILESDIR}/${script}".confd "${T}/${script}".confd || die "failed to copy ${script}.confd"
383 cp "${FILESDIR}/${script}".initd "${T}/${script}".initd || die "failed to copy ${script}.initd"
384
385 # now set the database dependancy for the director init script
386 case "${script}" in
387 bacula-dir)
388 case "${mydbtype}" in
389 sqlite3)
390 # sqlite3 databases don't have a daemon
391 sed -i -e 's/need "%database%"/:/g' "${T}/${script}".initd || die
392 ;;
393 *)
394 # all other databases have daemons
395 sed -i -e "s:%database%:${mydbtype}:" "${T}/${script}".initd || die
396 ;;
397 esac
398 ;;
399 *)
400 ;;
401 esac
402
403 # install init script and config
404 newinitd "${T}/${script}".initd "${script}"
405 newconfd "${T}/${script}".confd "${script}"
406 done
407
408 systemd_dounit "${S}"/platforms/systemd/bacula-{dir,fd,sd}.service
409 systemd_dotmpfilesd "${S}"/platforms/systemd/bacula.conf
410
411 # make sure the working directory exists
412 diropts -m0750
413 keepdir /var/lib/bacula
414
415 # make sure bacula group can execute bacula libexec scripts
416 fowners -R root:bacula /usr/libexec/bacula
417 }
418
419 pkg_postinst() {
420 if use bacula-clientonly; then
421 fowners root:bacula /var/lib/bacula
422 else
423 fowners bacula:bacula /var/lib/bacula
424 fi
425
426 if ! use bacula-clientonly && ! use bacula-nodir; then
427 einfo
428 einfo "If this is a new install, you must create the ${mydbtype} databases with:"
429 einfo " /usr/libexec/bacula/create_${mydbtype}_database"
430 einfo " /usr/libexec/bacula/make_${mydbtype}_tables"
431 einfo " /usr/libexec/bacula/grant_${mydbtype}_privileges"
432 einfo
433 fi
434
435 if use sqlite3; then
436 einfo
437 einfo "Be aware that Bacula does not officially support SQLite database anymore."
438 einfo "Best use it only for a client-only installation. See Bug #445540."
439 einfo
440 fi
441
442 einfo "Please note that 'bconsole' will always be installed. To compile 'bat'"
443 einfo "you have to enable 'USE=qt4'."
444 einfo
445 }