1 |
commit: 2fd476c49cbe901271b0109205d37455f6aae5b3 |
2 |
Author: Thomas Beierlein <tomjbe <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Dec 24 13:02:41 2016 +0000 |
4 |
Commit: Thomas Beierlein <tomjbe <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Dec 24 13:05:29 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2fd476c4 |
7 |
|
8 |
app-backup/bacula: Fix setting of soname for libbaccats-${db}.so |
9 |
|
10 |
Package-Manager: Portage-2.3.3, Repoman-2.3.1 |
11 |
|
12 |
app-backup/bacula/bacula-7.4.3-r1.ebuild | 413 +++++++++++++++++++++++ |
13 |
app-backup/bacula/bacula-7.4.4-r2.ebuild | 413 +++++++++++++++++++++++ |
14 |
app-backup/bacula/files/bacula-fix-sonames.patch | 36 ++ |
15 |
3 files changed, 862 insertions(+) |
16 |
|
17 |
diff --git a/app-backup/bacula/bacula-7.4.3-r1.ebuild b/app-backup/bacula/bacula-7.4.3-r1.ebuild |
18 |
new file mode 100644 |
19 |
index 00000000..20158e5 |
20 |
--- /dev/null |
21 |
+++ b/app-backup/bacula/bacula-7.4.3-r1.ebuild |
22 |
@@ -0,0 +1,413 @@ |
23 |
+# Copyright 1999-2016 Gentoo Foundation |
24 |
+# Distributed under the terms of the GNU General Public License v2 |
25 |
+# $Id$ |
26 |
+ |
27 |
+EAPI="5" |
28 |
+ |
29 |
+inherit eutils multilib qt4-r2 systemd user libtool |
30 |
+ |
31 |
+MY_PV=${PV/_beta/-b} |
32 |
+MY_P=${PN}-${MY_PV} |
33 |
+ |
34 |
+DESCRIPTION="Featureful client/server network backup suite" |
35 |
+HOMEPAGE="http://www.bacula.org/" |
36 |
+SRC_URI="mirror://sourceforge/bacula/${MY_P}.tar.gz" |
37 |
+ |
38 |
+LICENSE="AGPL-3" |
39 |
+SLOT="0" |
40 |
+KEYWORDS="~amd64 ~ppc ~sparc ~x86" |
41 |
+IUSE="acl bacula-clientonly bacula-nodir bacula-nosd examples ipv6 libressl logwatch mysql postgres qt4 readline +sqlite ssl static tcpd vim-syntax X" |
42 |
+ |
43 |
+DEPEND=" |
44 |
+ dev-libs/gmp:0 |
45 |
+ !bacula-clientonly? ( |
46 |
+ postgres? ( dev-db/postgresql:*[threads] ) |
47 |
+ mysql? ( virtual/mysql ) |
48 |
+ sqlite? ( dev-db/sqlite:3 ) |
49 |
+ !bacula-nodir? ( virtual/mta ) |
50 |
+ ) |
51 |
+ qt4? ( |
52 |
+ dev-qt/qtsvg:4 |
53 |
+ x11-libs/qwt:5 |
54 |
+ ) |
55 |
+ logwatch? ( sys-apps/logwatch ) |
56 |
+ tcpd? ( >=sys-apps/tcp-wrappers-7.6 ) |
57 |
+ readline? ( sys-libs/readline:0 ) |
58 |
+ static? ( |
59 |
+ acl? ( virtual/acl[static-libs] ) |
60 |
+ sys-libs/zlib[static-libs] |
61 |
+ dev-libs/lzo[static-libs] |
62 |
+ sys-libs/ncurses:=[static-libs] |
63 |
+ ssl? ( |
64 |
+ !libressl? ( dev-libs/openssl:0=[static-libs] ) |
65 |
+ libressl? ( dev-libs/libressl:0=[static-libs] ) |
66 |
+ ) |
67 |
+ ) |
68 |
+ !static? ( |
69 |
+ acl? ( virtual/acl ) |
70 |
+ sys-libs/zlib |
71 |
+ dev-libs/lzo |
72 |
+ sys-libs/ncurses:= |
73 |
+ ssl? ( |
74 |
+ !libressl? ( dev-libs/openssl:0= ) |
75 |
+ libressl? ( dev-libs/libressl:0= ) |
76 |
+ ) |
77 |
+ )" |
78 |
+RDEPEND="${DEPEND} |
79 |
+ !bacula-clientonly? ( |
80 |
+ !bacula-nosd? ( |
81 |
+ sys-block/mtx |
82 |
+ app-arch/mt-st |
83 |
+ ) |
84 |
+ ) |
85 |
+ vim-syntax? ( || ( app-editors/vim app-editors/gvim ) )" |
86 |
+ |
87 |
+REQUIRED_USE="|| ( ^^ ( mysql postgres sqlite ) bacula-clientonly ) |
88 |
+ static? ( bacula-clientonly )" |
89 |
+ |
90 |
+S=${WORKDIR}/${MY_P} |
91 |
+ |
92 |
+pkg_setup() { |
93 |
+ #XOR and !bacula-clientonly controlled by REQUIRED_USE |
94 |
+ use mysql && export mydbtype="mysql" |
95 |
+ use postgres && export mydbtype="postgresql" |
96 |
+ use sqlite && export mydbtype="sqlite3" |
97 |
+ |
98 |
+ # create the daemon group and user |
99 |
+ if [ -z "$(egetent group bacula 2>/dev/null)" ]; then |
100 |
+ enewgroup bacula |
101 |
+ einfo |
102 |
+ einfo "The group 'bacula' has been created. Any users you add to this" |
103 |
+ einfo "group have access to files created by the daemons." |
104 |
+ einfo |
105 |
+ fi |
106 |
+ |
107 |
+ if use bacula-clientonly && use static && use qt4; then |
108 |
+ ewarn |
109 |
+ ewarn "Building statically linked 'bat' is not supported. Ignorig 'qt4' useflag." |
110 |
+ ewarn |
111 |
+ fi |
112 |
+ |
113 |
+ if ! use bacula-clientonly; then |
114 |
+ if [ -z "$(egetent passwd bacula 2>/dev/null)" ]; then |
115 |
+ enewuser bacula -1 -1 /var/lib/bacula bacula,disk,tape,cdrom,cdrw |
116 |
+ einfo |
117 |
+ einfo "The user 'bacula' has been created. Please see the bacula manual" |
118 |
+ einfo "for information about running bacula as a non-root user." |
119 |
+ einfo |
120 |
+ fi |
121 |
+ fi |
122 |
+} |
123 |
+ |
124 |
+src_prepare() { |
125 |
+ # adjusts default configuration files for several binaries |
126 |
+ # to /etc/bacula/<config> instead of ./<config> |
127 |
+ pushd src >&/dev/null || die |
128 |
+ for f in console/console.c dird/dird.c filed/filed.c \ |
129 |
+ stored/bcopy.c stored/bextract.c stored/bls.c \ |
130 |
+ stored/bscan.c stored/btape.c stored/stored.c \ |
131 |
+ qt-console/main.cpp; do |
132 |
+ sed -i -e 's|^\(#define CONFIG_FILE "\)|\1/etc/bacula/|g' "${f}" \ |
133 |
+ || die "sed on ${f} failed" |
134 |
+ done |
135 |
+ popd >&/dev/null || die |
136 |
+ |
137 |
+ # bug 466688 drop deprecated categories from Desktop file |
138 |
+ sed -i -e 's/Application;//' scripts/bat.desktop.in || die |
139 |
+ |
140 |
+ # bug 466690 Use CXXFLAGS instead of CFLAGS |
141 |
+ sed -i -e 's/@CFLAGS@/@CXXFLAGS@/' autoconf/Make.common.in || die |
142 |
+ |
143 |
+ # drop automatic install of unneeded documentation (for bug 356499) |
144 |
+ epatch "${FILESDIR}"/7.2.0/${PN}-7.2.0-doc.patch |
145 |
+ |
146 |
+ # bug #310087 |
147 |
+ epatch "${FILESDIR}"/5.2.3/${PN}-5.2.3-as-needed.patch |
148 |
+ |
149 |
+ # bug #311161 |
150 |
+ epatch "${FILESDIR}"/5.2.3/${PN}-5.2.3-lib-search-path.patch |
151 |
+ |
152 |
+ # bat needs to respect LDFLAGS |
153 |
+ epatch "${FILESDIR}"/5.2.3/${PN}-5.2.3-ldflags.patch |
154 |
+ |
155 |
+ # bug #328701 |
156 |
+ epatch "${FILESDIR}"/5.2.3/${PN}-5.2.3-openssl-1.patch |
157 |
+ |
158 |
+ epatch "${FILESDIR}"/7.2.0/${PN}-7.2.0-fix-static.patch |
159 |
+ |
160 |
+ # fix soname in libbaccat.so bug #602952 |
161 |
+ epatch "${FILESDIR}/bacula-fix-sonames.patch" |
162 |
+ |
163 |
+ # do not strip binaries |
164 |
+ sed -i -e "s/strip /# strip /" src/filed/Makefile.in || die |
165 |
+ sed -i -e "s/strip /# strip /" src/console/Makefile.in || die |
166 |
+ |
167 |
+ # fix file not found error during make depend |
168 |
+ epatch "${FILESDIR}"/7.0.2/${PN}-7.0.2-depend.patch |
169 |
+ |
170 |
+ # Fix systemd unit files: |
171 |
+ # bug 497748 |
172 |
+ sed -i -e '/Requires/d' platforms/systemd/*.service.in || die |
173 |
+ sed -i -e '/StandardOutput/d' platforms/systemd/*.service.in || die |
174 |
+ # bug 504370 |
175 |
+ sed -i -e '/Alias=bacula-dir/d' platforms/systemd/bacula-dir.service.in || die |
176 |
+ # bug 584442 and 504368 |
177 |
+ sed -i -e 's/@dir_user@/root/g' platforms/systemd/bacula-dir.service.in || die |
178 |
+ |
179 |
+ # fix bundled libtool (bug 466696) |
180 |
+ # But first move directory with M4 macros out of the way. |
181 |
+ # It is only needed by autoconf and gives errors during elibtoolize. |
182 |
+ mv autoconf/libtool autoconf/libtool1 || die |
183 |
+ elibtoolize |
184 |
+} |
185 |
+ |
186 |
+src_configure() { |
187 |
+ local myconf='' |
188 |
+ |
189 |
+ if use bacula-clientonly; then |
190 |
+ myconf="${myconf} \ |
191 |
+ $(use_enable bacula-clientonly client-only) \ |
192 |
+ $(use_enable !static libtool) \ |
193 |
+ $(use_enable static static-cons) \ |
194 |
+ $(use_enable static static-fd)" |
195 |
+ else |
196 |
+ myconf="${myconf} \ |
197 |
+ $(use_enable !bacula-nodir build-dird) \ |
198 |
+ $(use_enable !bacula-nosd build-stored)" |
199 |
+ # bug #311099 |
200 |
+ # database support needed by dir-only *and* sd-only |
201 |
+ # build as well (for building bscan, btape, etc.) |
202 |
+ myconf="${myconf} \ |
203 |
+ --with-${mydbtype} \ |
204 |
+ --enable-batch-insert" |
205 |
+ fi |
206 |
+ |
207 |
+ # do not build bat if 'static' clientonly |
208 |
+ if ! use bacula-clientonly || ! use static; then |
209 |
+ myconf="${myconf} \ |
210 |
+ $(use_enable qt4 bat)" |
211 |
+ fi |
212 |
+ |
213 |
+ myconf="${myconf} \ |
214 |
+ $(use_with X x) \ |
215 |
+ $(use_enable !readline conio) \ |
216 |
+ $(use_enable readline) \ |
217 |
+ $(use_with readline readline /usr) \ |
218 |
+ $(use_with ssl openssl) \ |
219 |
+ $(use_enable ipv6) \ |
220 |
+ $(use_enable acl) \ |
221 |
+ $(use_with tcpd tcp-wrappers)" |
222 |
+ |
223 |
+ econf \ |
224 |
+ --libdir=/usr/$(get_libdir) \ |
225 |
+ --docdir=/usr/share/doc/${PF} \ |
226 |
+ --htmldir=/usr/share/doc/${PF}/html \ |
227 |
+ --with-pid-dir=/var/run \ |
228 |
+ --sysconfdir=/etc/bacula \ |
229 |
+ --with-subsys-dir=/var/lock/subsys \ |
230 |
+ --with-working-dir=/var/lib/bacula \ |
231 |
+ --with-logdir=/var/lib/bacula \ |
232 |
+ --with-scriptdir=/usr/libexec/bacula \ |
233 |
+ --with-systemd=$(systemd_get_unitdir) \ |
234 |
+ --with-dir-user=bacula \ |
235 |
+ --with-dir-group=bacula \ |
236 |
+ --with-sd-user=root \ |
237 |
+ --with-sd-group=bacula \ |
238 |
+ --with-fd-user=root \ |
239 |
+ --with-fd-group=bacula \ |
240 |
+ --enable-smartalloc \ |
241 |
+ --disable-afs \ |
242 |
+ --host=${CHOST} \ |
243 |
+ ${myconf} |
244 |
+ # correct configuration for QT based bat |
245 |
+ if use qt4 ; then |
246 |
+ pushd src/qt-console |
247 |
+ eqmake4 |
248 |
+ popd |
249 |
+ fi |
250 |
+} |
251 |
+ |
252 |
+src_compile() { |
253 |
+ # Make build log verbose (bug #447806) |
254 |
+ emake NO_ECHO="" |
255 |
+} |
256 |
+ |
257 |
+src_install() { |
258 |
+ emake DESTDIR="${D}" install |
259 |
+ doicon scripts/bacula.png |
260 |
+ |
261 |
+ # install bat icon and desktop file when enabled |
262 |
+ # (for some reason ./configure doesn't pick this up) |
263 |
+ if use qt4 && ! use static ; then |
264 |
+ doicon src/qt-console/images/bat_icon.png |
265 |
+ domenu scripts/bat.desktop |
266 |
+ fi |
267 |
+ |
268 |
+ # remove some scripts we don't need at all |
269 |
+ rm -f "${D}"/usr/libexec/bacula/{bacula,bacula-ctl-dir,bacula-ctl-fd,bacula-ctl-sd,startmysql,stopmysql} |
270 |
+ |
271 |
+ # rename statically linked apps |
272 |
+ if use bacula-clientonly && use static ; then |
273 |
+ pushd "${D}"/usr/sbin || die |
274 |
+ mv static-bacula-fd bacula-fd || die |
275 |
+ mv static-bconsole bconsole || die |
276 |
+ popd || die |
277 |
+ fi |
278 |
+ |
279 |
+ # extra files which 'make install' doesn't cover |
280 |
+ if ! use bacula-clientonly; then |
281 |
+ # the database update scripts |
282 |
+ diropts -m0750 |
283 |
+ insinto /usr/libexec/bacula/updatedb |
284 |
+ insopts -m0754 |
285 |
+ doins "${S}"/updatedb/* |
286 |
+ fperms 0640 /usr/libexec/bacula/updatedb/README |
287 |
+ |
288 |
+ # the logrotate configuration |
289 |
+ # (now unconditional wrt bug #258187) |
290 |
+ diropts -m0755 |
291 |
+ insinto /etc/logrotate.d |
292 |
+ insopts -m0644 |
293 |
+ newins "${S}"/scripts/logrotate bacula |
294 |
+ |
295 |
+ # the logwatch scripts |
296 |
+ if use logwatch; then |
297 |
+ diropts -m0750 |
298 |
+ dodir /etc/log.d/scripts/services |
299 |
+ dodir /etc/log.d/scripts/shared |
300 |
+ dodir /etc/log.d/conf/logfiles |
301 |
+ dodir /etc/log.d/conf/services |
302 |
+ pushd "${S}"/scripts/logwatch >&/dev/null || die |
303 |
+ emake DESTDIR="${D}" install |
304 |
+ popd >&/dev/null || die |
305 |
+ fi |
306 |
+ fi |
307 |
+ |
308 |
+ if ! use qt4; then |
309 |
+ rm -vf "${D}"/usr/share/man/man1/bat.1* |
310 |
+ fi |
311 |
+ rm -vf "${D}"/usr/share/man/man1/bacula-tray-monitor.1* |
312 |
+ if use bacula-clientonly || use bacula-nodir; then |
313 |
+ rm -vf "${D}"/usr/share/man/man8/bacula-dir.8* |
314 |
+ rm -vf "${D}"/usr/share/man/man8/dbcheck.8* |
315 |
+ rm -vf "${D}"/usr/share/man/man1/bsmtp.1* |
316 |
+ rm -vf "${D}"/usr/libexec/bacula/create_*_database |
317 |
+ rm -vf "${D}"/usr/libexec/bacula/drop_*_database |
318 |
+ rm -vf "${D}"/usr/libexec/bacula/make_*_tables |
319 |
+ rm -vf "${D}"/usr/libexec/bacula/update_*_tables |
320 |
+ rm -vf "${D}"/usr/libexec/bacula/drop_*_tables |
321 |
+ rm -vf "${D}"/usr/libexec/bacula/grant_*_privileges |
322 |
+ rm -vf "${D}"/usr/libexec/bacula/*_catalog_backup |
323 |
+ fi |
324 |
+ if use bacula-clientonly || use bacula-nosd; then |
325 |
+ rm -vf "${D}"/usr/share/man/man8/bacula-sd.8* |
326 |
+ rm -vf "${D}"/usr/share/man/man8/bcopy.8* |
327 |
+ rm -vf "${D}"/usr/share/man/man8/bextract.8* |
328 |
+ rm -vf "${D}"/usr/share/man/man8/bls.8* |
329 |
+ rm -vf "${D}"/usr/share/man/man8/bscan.8* |
330 |
+ rm -vf "${D}"/usr/share/man/man8/btape.8* |
331 |
+ rm -vf "${D}"/usr/libexec/bacula/disk-changer |
332 |
+ rm -vf "${D}"/usr/libexec/bacula/mtx-changer |
333 |
+ rm -vf "${D}"/usr/libexec/bacula/dvd-handler |
334 |
+ fi |
335 |
+ |
336 |
+ # documentation |
337 |
+ dodoc ChangeLog ReleaseNotes SUPPORT |
338 |
+ |
339 |
+ # install examples (bug #457504) |
340 |
+ if use examples; then |
341 |
+ docinto examples/ |
342 |
+ dodoc -r examples/* |
343 |
+ fi |
344 |
+ |
345 |
+ # vim-files |
346 |
+ if use vim-syntax; then |
347 |
+ insinto /usr/share/vim/vimfiles/syntax |
348 |
+ doins scripts/bacula.vim |
349 |
+ insinto /usr/share/vim/vimfiles/ftdetect |
350 |
+ newins scripts/filetype.vim bacula_ft.vim |
351 |
+ fi |
352 |
+ |
353 |
+ # setup init scripts |
354 |
+ myscripts="bacula-fd" |
355 |
+ if ! use bacula-clientonly; then |
356 |
+ if ! use bacula-nodir; then |
357 |
+ myscripts="${myscripts} bacula-dir" |
358 |
+ fi |
359 |
+ if ! use bacula-nosd; then |
360 |
+ myscripts="${myscripts} bacula-sd" |
361 |
+ fi |
362 |
+ fi |
363 |
+ for script in ${myscripts}; do |
364 |
+ # copy over init script and config to a temporary location |
365 |
+ # so we can modify them as needed |
366 |
+ cp "${FILESDIR}/${script}".confd "${T}/${script}".confd || die "failed to copy ${script}.confd" |
367 |
+ cp "${FILESDIR}/${script}".initd "${T}/${script}".initd || die "failed to copy ${script}.initd" |
368 |
+ |
369 |
+ # now set the database dependancy for the director init script |
370 |
+ case "${script}" in |
371 |
+ bacula-dir) |
372 |
+ case "${mydbtype}" in |
373 |
+ sqlite3) |
374 |
+ # sqlite databases don't have a daemon |
375 |
+ sed -i -e 's/need "%database%"/:/g' "${T}/${script}".initd || die |
376 |
+ ;; |
377 |
+ *) |
378 |
+ # all other databases have daemons |
379 |
+ sed -i -e "s:%database%:${mydbtype}:" "${T}/${script}".initd || die |
380 |
+ ;; |
381 |
+ esac |
382 |
+ ;; |
383 |
+ *) |
384 |
+ ;; |
385 |
+ esac |
386 |
+ |
387 |
+ # install init script and config |
388 |
+ newinitd "${T}/${script}".initd "${script}" |
389 |
+ newconfd "${T}/${script}".confd "${script}" |
390 |
+ done |
391 |
+ |
392 |
+ systemd_dounit "${S}"/platforms/systemd/bacula-{dir,fd,sd}.service |
393 |
+ |
394 |
+ # make sure the working directory exists |
395 |
+ diropts -m0750 |
396 |
+ keepdir /var/lib/bacula |
397 |
+ |
398 |
+ # make sure bacula group can execute bacula libexec scripts |
399 |
+ fowners -R root:bacula /usr/libexec/bacula |
400 |
+} |
401 |
+ |
402 |
+pkg_postinst() { |
403 |
+ if use bacula-clientonly; then |
404 |
+ fowners root:bacula /var/lib/bacula |
405 |
+ else |
406 |
+ fowners bacula:bacula /var/lib/bacula |
407 |
+ fi |
408 |
+ |
409 |
+ if ! use bacula-clientonly && ! use bacula-nodir; then |
410 |
+ einfo |
411 |
+ einfo "If this is a new install, you must create the ${mydbtype} databases with:" |
412 |
+ einfo " /usr/libexec/bacula/create_${mydbtype}_database" |
413 |
+ einfo " /usr/libexec/bacula/make_${mydbtype}_tables" |
414 |
+ einfo " /usr/libexec/bacula/grant_${mydbtype}_privileges" |
415 |
+ einfo |
416 |
+ |
417 |
+ ewarn "ATTENTION!" |
418 |
+ ewarn "The format of the database may have changed." |
419 |
+ ewarn "If you just upgraded from a version below 7.2.0 you must run" |
420 |
+ ewarn "'update_bacula_tables' now." |
421 |
+ ewarn "Make sure to have a backup of your catalog before." |
422 |
+ ewarn |
423 |
+ fi |
424 |
+ |
425 |
+ if use sqlite; then |
426 |
+ einfo |
427 |
+ einfo "Be aware that Bacula does not officially support SQLite database anymore." |
428 |
+ einfo "Best use it only for a client-only installation. See Bug #445540." |
429 |
+ einfo |
430 |
+ fi |
431 |
+ |
432 |
+ einfo "Please note that 'bconsole' will always be installed. To compile 'bat'" |
433 |
+ einfo "you have to enable 'USE=qt4'." |
434 |
+ einfo |
435 |
+} |
436 |
|
437 |
diff --git a/app-backup/bacula/bacula-7.4.4-r2.ebuild b/app-backup/bacula/bacula-7.4.4-r2.ebuild |
438 |
new file mode 100644 |
439 |
index 00000000..81baf89 |
440 |
--- /dev/null |
441 |
+++ b/app-backup/bacula/bacula-7.4.4-r2.ebuild |
442 |
@@ -0,0 +1,413 @@ |
443 |
+# Copyright 1999-2016 Gentoo Foundation |
444 |
+# Distributed under the terms of the GNU General Public License v2 |
445 |
+# $Id$ |
446 |
+ |
447 |
+EAPI="5" |
448 |
+ |
449 |
+inherit eutils multilib qt4-r2 systemd user libtool |
450 |
+ |
451 |
+MY_PV=${PV/_beta/-b} |
452 |
+MY_P=${PN}-${MY_PV} |
453 |
+ |
454 |
+DESCRIPTION="Featureful client/server network backup suite" |
455 |
+HOMEPAGE="http://www.bacula.org/" |
456 |
+SRC_URI="mirror://sourceforge/bacula/${MY_P}.tar.gz" |
457 |
+ |
458 |
+LICENSE="AGPL-3" |
459 |
+SLOT="0" |
460 |
+KEYWORDS="~amd64 ~ppc ~sparc ~x86" |
461 |
+IUSE="acl bacula-clientonly bacula-nodir bacula-nosd examples ipv6 libressl logwatch mysql postgres qt4 readline +sqlite ssl static tcpd vim-syntax X" |
462 |
+ |
463 |
+DEPEND=" |
464 |
+ dev-libs/gmp:0 |
465 |
+ !bacula-clientonly? ( |
466 |
+ postgres? ( dev-db/postgresql:=[threads] ) |
467 |
+ mysql? ( virtual/mysql ) |
468 |
+ sqlite? ( dev-db/sqlite:3 ) |
469 |
+ !bacula-nodir? ( virtual/mta ) |
470 |
+ ) |
471 |
+ qt4? ( |
472 |
+ dev-qt/qtsvg:4 |
473 |
+ x11-libs/qwt:5 |
474 |
+ ) |
475 |
+ logwatch? ( sys-apps/logwatch ) |
476 |
+ tcpd? ( >=sys-apps/tcp-wrappers-7.6 ) |
477 |
+ readline? ( sys-libs/readline:0 ) |
478 |
+ static? ( |
479 |
+ acl? ( virtual/acl[static-libs] ) |
480 |
+ sys-libs/zlib[static-libs] |
481 |
+ dev-libs/lzo[static-libs] |
482 |
+ sys-libs/ncurses:=[static-libs] |
483 |
+ ssl? ( |
484 |
+ !libressl? ( dev-libs/openssl:0=[static-libs] ) |
485 |
+ libressl? ( dev-libs/libressl:0=[static-libs] ) |
486 |
+ ) |
487 |
+ ) |
488 |
+ !static? ( |
489 |
+ acl? ( virtual/acl ) |
490 |
+ sys-libs/zlib |
491 |
+ dev-libs/lzo |
492 |
+ sys-libs/ncurses:= |
493 |
+ ssl? ( |
494 |
+ !libressl? ( dev-libs/openssl:0= ) |
495 |
+ libressl? ( dev-libs/libressl:0= ) |
496 |
+ ) |
497 |
+ )" |
498 |
+RDEPEND="${DEPEND} |
499 |
+ !bacula-clientonly? ( |
500 |
+ !bacula-nosd? ( |
501 |
+ sys-block/mtx |
502 |
+ app-arch/mt-st |
503 |
+ ) |
504 |
+ ) |
505 |
+ vim-syntax? ( || ( app-editors/vim app-editors/gvim ) )" |
506 |
+ |
507 |
+REQUIRED_USE="|| ( ^^ ( mysql postgres sqlite ) bacula-clientonly ) |
508 |
+ static? ( bacula-clientonly )" |
509 |
+ |
510 |
+S=${WORKDIR}/${MY_P} |
511 |
+ |
512 |
+pkg_setup() { |
513 |
+ #XOR and !bacula-clientonly controlled by REQUIRED_USE |
514 |
+ use mysql && export mydbtype="mysql" |
515 |
+ use postgres && export mydbtype="postgresql" |
516 |
+ use sqlite && export mydbtype="sqlite3" |
517 |
+ |
518 |
+ # create the daemon group and user |
519 |
+ if [ -z "$(egetent group bacula 2>/dev/null)" ]; then |
520 |
+ enewgroup bacula |
521 |
+ einfo |
522 |
+ einfo "The group 'bacula' has been created. Any users you add to this" |
523 |
+ einfo "group have access to files created by the daemons." |
524 |
+ einfo |
525 |
+ fi |
526 |
+ |
527 |
+ if use bacula-clientonly && use static && use qt4; then |
528 |
+ ewarn |
529 |
+ ewarn "Building statically linked 'bat' is not supported. Ignorig 'qt4' useflag." |
530 |
+ ewarn |
531 |
+ fi |
532 |
+ |
533 |
+ if ! use bacula-clientonly; then |
534 |
+ if [ -z "$(egetent passwd bacula 2>/dev/null)" ]; then |
535 |
+ enewuser bacula -1 -1 /var/lib/bacula bacula,disk,tape,cdrom,cdrw |
536 |
+ einfo |
537 |
+ einfo "The user 'bacula' has been created. Please see the bacula manual" |
538 |
+ einfo "for information about running bacula as a non-root user." |
539 |
+ einfo |
540 |
+ fi |
541 |
+ fi |
542 |
+} |
543 |
+ |
544 |
+src_prepare() { |
545 |
+ # adjusts default configuration files for several binaries |
546 |
+ # to /etc/bacula/<config> instead of ./<config> |
547 |
+ pushd src >&/dev/null || die |
548 |
+ for f in console/console.c dird/dird.c filed/filed.c \ |
549 |
+ stored/bcopy.c stored/bextract.c stored/bls.c \ |
550 |
+ stored/bscan.c stored/btape.c stored/stored.c \ |
551 |
+ qt-console/main.cpp; do |
552 |
+ sed -i -e 's|^\(#define CONFIG_FILE "\)|\1/etc/bacula/|g' "${f}" \ |
553 |
+ || die "sed on ${f} failed" |
554 |
+ done |
555 |
+ popd >&/dev/null || die |
556 |
+ |
557 |
+ # bug 466688 drop deprecated categories from Desktop file |
558 |
+ sed -i -e 's/Application;//' scripts/bat.desktop.in || die |
559 |
+ |
560 |
+ # bug 466690 Use CXXFLAGS instead of CFLAGS |
561 |
+ sed -i -e 's/@CFLAGS@/@CXXFLAGS@/' autoconf/Make.common.in || die |
562 |
+ |
563 |
+ # drop automatic install of unneeded documentation (for bug 356499) |
564 |
+ epatch "${FILESDIR}"/7.2.0/${PN}-7.2.0-doc.patch |
565 |
+ |
566 |
+ # bug #310087 |
567 |
+ epatch "${FILESDIR}"/5.2.3/${PN}-5.2.3-as-needed.patch |
568 |
+ |
569 |
+ # bug #311161 |
570 |
+ epatch "${FILESDIR}"/5.2.3/${PN}-5.2.3-lib-search-path.patch |
571 |
+ |
572 |
+ # bat needs to respect LDFLAGS |
573 |
+ epatch "${FILESDIR}"/5.2.3/${PN}-5.2.3-ldflags.patch |
574 |
+ |
575 |
+ # bug #328701 |
576 |
+ epatch "${FILESDIR}"/5.2.3/${PN}-5.2.3-openssl-1.patch |
577 |
+ |
578 |
+ epatch "${FILESDIR}"/7.2.0/${PN}-7.2.0-fix-static.patch |
579 |
+ |
580 |
+ # fix soname in libbaccat.so bug #602952 |
581 |
+ epatch "${FILESDIR}/bacula-fix-sonames.patch" |
582 |
+ |
583 |
+ # do not strip binaries |
584 |
+ sed -i -e "s/strip /# strip /" src/filed/Makefile.in || die |
585 |
+ sed -i -e "s/strip /# strip /" src/console/Makefile.in || die |
586 |
+ |
587 |
+ # fix file not found error during make depend |
588 |
+ epatch "${FILESDIR}"/7.0.2/${PN}-7.0.2-depend.patch |
589 |
+ |
590 |
+ # Fix systemd unit files: |
591 |
+ # bug 497748 |
592 |
+ sed -i -e '/Requires/d' platforms/systemd/*.service.in || die |
593 |
+ sed -i -e '/StandardOutput/d' platforms/systemd/*.service.in || die |
594 |
+ # bug 504370 |
595 |
+ sed -i -e '/Alias=bacula-dir/d' platforms/systemd/bacula-dir.service.in || die |
596 |
+ # bug 584442 and 504368 |
597 |
+ sed -i -e 's/@dir_user@/root/g' platforms/systemd/bacula-dir.service.in || die |
598 |
+ |
599 |
+ # fix bundled libtool (bug 466696) |
600 |
+ # But first move directory with M4 macros out of the way. |
601 |
+ # It is only needed by autoconf and gives errors during elibtoolize. |
602 |
+ mv autoconf/libtool autoconf/libtool1 || die |
603 |
+ elibtoolize |
604 |
+} |
605 |
+ |
606 |
+src_configure() { |
607 |
+ local myconf='' |
608 |
+ |
609 |
+ if use bacula-clientonly; then |
610 |
+ myconf="${myconf} \ |
611 |
+ $(use_enable bacula-clientonly client-only) \ |
612 |
+ $(use_enable !static libtool) \ |
613 |
+ $(use_enable static static-cons) \ |
614 |
+ $(use_enable static static-fd)" |
615 |
+ else |
616 |
+ myconf="${myconf} \ |
617 |
+ $(use_enable !bacula-nodir build-dird) \ |
618 |
+ $(use_enable !bacula-nosd build-stored)" |
619 |
+ # bug #311099 |
620 |
+ # database support needed by dir-only *and* sd-only |
621 |
+ # build as well (for building bscan, btape, etc.) |
622 |
+ myconf="${myconf} \ |
623 |
+ --with-${mydbtype} \ |
624 |
+ --enable-batch-insert" |
625 |
+ fi |
626 |
+ |
627 |
+ # do not build bat if 'static' clientonly |
628 |
+ if ! use bacula-clientonly || ! use static; then |
629 |
+ myconf="${myconf} \ |
630 |
+ $(use_enable qt4 bat)" |
631 |
+ fi |
632 |
+ |
633 |
+ myconf="${myconf} \ |
634 |
+ $(use_with X x) \ |
635 |
+ $(use_enable !readline conio) \ |
636 |
+ $(use_enable readline) \ |
637 |
+ $(use_with readline readline /usr) \ |
638 |
+ $(use_with ssl openssl) \ |
639 |
+ $(use_enable ipv6) \ |
640 |
+ $(use_enable acl) \ |
641 |
+ $(use_with tcpd tcp-wrappers)" |
642 |
+ |
643 |
+ econf \ |
644 |
+ --libdir=/usr/$(get_libdir) \ |
645 |
+ --docdir=/usr/share/doc/${PF} \ |
646 |
+ --htmldir=/usr/share/doc/${PF}/html \ |
647 |
+ --with-pid-dir=/var/run \ |
648 |
+ --sysconfdir=/etc/bacula \ |
649 |
+ --with-subsys-dir=/var/lock/subsys \ |
650 |
+ --with-working-dir=/var/lib/bacula \ |
651 |
+ --with-logdir=/var/lib/bacula \ |
652 |
+ --with-scriptdir=/usr/libexec/bacula \ |
653 |
+ --with-systemd=$(systemd_get_unitdir) \ |
654 |
+ --with-dir-user=bacula \ |
655 |
+ --with-dir-group=bacula \ |
656 |
+ --with-sd-user=root \ |
657 |
+ --with-sd-group=bacula \ |
658 |
+ --with-fd-user=root \ |
659 |
+ --with-fd-group=bacula \ |
660 |
+ --enable-smartalloc \ |
661 |
+ --disable-afs \ |
662 |
+ --host=${CHOST} \ |
663 |
+ ${myconf} |
664 |
+ # correct configuration for QT based bat |
665 |
+ if use qt4 ; then |
666 |
+ pushd src/qt-console |
667 |
+ eqmake4 |
668 |
+ popd |
669 |
+ fi |
670 |
+} |
671 |
+ |
672 |
+src_compile() { |
673 |
+ # Make build log verbose (bug #447806) |
674 |
+ emake NO_ECHO="" |
675 |
+} |
676 |
+ |
677 |
+src_install() { |
678 |
+ emake DESTDIR="${D}" install |
679 |
+ doicon scripts/bacula.png |
680 |
+ |
681 |
+ # install bat icon and desktop file when enabled |
682 |
+ # (for some reason ./configure doesn't pick this up) |
683 |
+ if use qt4 && ! use static ; then |
684 |
+ doicon src/qt-console/images/bat_icon.png |
685 |
+ domenu scripts/bat.desktop |
686 |
+ fi |
687 |
+ |
688 |
+ # remove some scripts we don't need at all |
689 |
+ rm -f "${D}"/usr/libexec/bacula/{bacula,bacula-ctl-dir,bacula-ctl-fd,bacula-ctl-sd,startmysql,stopmysql} |
690 |
+ |
691 |
+ # rename statically linked apps |
692 |
+ if use bacula-clientonly && use static ; then |
693 |
+ pushd "${D}"/usr/sbin || die |
694 |
+ mv static-bacula-fd bacula-fd || die |
695 |
+ mv static-bconsole bconsole || die |
696 |
+ popd || die |
697 |
+ fi |
698 |
+ |
699 |
+ # extra files which 'make install' doesn't cover |
700 |
+ if ! use bacula-clientonly; then |
701 |
+ # the database update scripts |
702 |
+ diropts -m0750 |
703 |
+ insinto /usr/libexec/bacula/updatedb |
704 |
+ insopts -m0754 |
705 |
+ doins "${S}"/updatedb/* |
706 |
+ fperms 0640 /usr/libexec/bacula/updatedb/README |
707 |
+ |
708 |
+ # the logrotate configuration |
709 |
+ # (now unconditional wrt bug #258187) |
710 |
+ diropts -m0755 |
711 |
+ insinto /etc/logrotate.d |
712 |
+ insopts -m0644 |
713 |
+ newins "${S}"/scripts/logrotate bacula |
714 |
+ |
715 |
+ # the logwatch scripts |
716 |
+ if use logwatch; then |
717 |
+ diropts -m0750 |
718 |
+ dodir /etc/log.d/scripts/services |
719 |
+ dodir /etc/log.d/scripts/shared |
720 |
+ dodir /etc/log.d/conf/logfiles |
721 |
+ dodir /etc/log.d/conf/services |
722 |
+ pushd "${S}"/scripts/logwatch >&/dev/null || die |
723 |
+ emake DESTDIR="${D}" install |
724 |
+ popd >&/dev/null || die |
725 |
+ fi |
726 |
+ fi |
727 |
+ |
728 |
+ if ! use qt4; then |
729 |
+ rm -vf "${D}"/usr/share/man/man1/bat.1* |
730 |
+ fi |
731 |
+ rm -vf "${D}"/usr/share/man/man1/bacula-tray-monitor.1* |
732 |
+ if use bacula-clientonly || use bacula-nodir; then |
733 |
+ rm -vf "${D}"/usr/share/man/man8/bacula-dir.8* |
734 |
+ rm -vf "${D}"/usr/share/man/man8/dbcheck.8* |
735 |
+ rm -vf "${D}"/usr/share/man/man1/bsmtp.1* |
736 |
+ rm -vf "${D}"/usr/libexec/bacula/create_*_database |
737 |
+ rm -vf "${D}"/usr/libexec/bacula/drop_*_database |
738 |
+ rm -vf "${D}"/usr/libexec/bacula/make_*_tables |
739 |
+ rm -vf "${D}"/usr/libexec/bacula/update_*_tables |
740 |
+ rm -vf "${D}"/usr/libexec/bacula/drop_*_tables |
741 |
+ rm -vf "${D}"/usr/libexec/bacula/grant_*_privileges |
742 |
+ rm -vf "${D}"/usr/libexec/bacula/*_catalog_backup |
743 |
+ fi |
744 |
+ if use bacula-clientonly || use bacula-nosd; then |
745 |
+ rm -vf "${D}"/usr/share/man/man8/bacula-sd.8* |
746 |
+ rm -vf "${D}"/usr/share/man/man8/bcopy.8* |
747 |
+ rm -vf "${D}"/usr/share/man/man8/bextract.8* |
748 |
+ rm -vf "${D}"/usr/share/man/man8/bls.8* |
749 |
+ rm -vf "${D}"/usr/share/man/man8/bscan.8* |
750 |
+ rm -vf "${D}"/usr/share/man/man8/btape.8* |
751 |
+ rm -vf "${D}"/usr/libexec/bacula/disk-changer |
752 |
+ rm -vf "${D}"/usr/libexec/bacula/mtx-changer |
753 |
+ rm -vf "${D}"/usr/libexec/bacula/dvd-handler |
754 |
+ fi |
755 |
+ |
756 |
+ # documentation |
757 |
+ dodoc ChangeLog ReleaseNotes SUPPORT |
758 |
+ |
759 |
+ # install examples (bug #457504) |
760 |
+ if use examples; then |
761 |
+ docinto examples/ |
762 |
+ dodoc -r examples/* |
763 |
+ fi |
764 |
+ |
765 |
+ # vim-files |
766 |
+ if use vim-syntax; then |
767 |
+ insinto /usr/share/vim/vimfiles/syntax |
768 |
+ doins scripts/bacula.vim |
769 |
+ insinto /usr/share/vim/vimfiles/ftdetect |
770 |
+ newins scripts/filetype.vim bacula_ft.vim |
771 |
+ fi |
772 |
+ |
773 |
+ # setup init scripts |
774 |
+ myscripts="bacula-fd" |
775 |
+ if ! use bacula-clientonly; then |
776 |
+ if ! use bacula-nodir; then |
777 |
+ myscripts="${myscripts} bacula-dir" |
778 |
+ fi |
779 |
+ if ! use bacula-nosd; then |
780 |
+ myscripts="${myscripts} bacula-sd" |
781 |
+ fi |
782 |
+ fi |
783 |
+ for script in ${myscripts}; do |
784 |
+ # copy over init script and config to a temporary location |
785 |
+ # so we can modify them as needed |
786 |
+ cp "${FILESDIR}/${script}".confd "${T}/${script}".confd || die "failed to copy ${script}.confd" |
787 |
+ cp "${FILESDIR}/newscripts/${script}".initd "${T}/${script}".initd || die "failed to copy ${script}.initd" |
788 |
+ |
789 |
+ # now set the database dependancy for the director init script |
790 |
+ case "${script}" in |
791 |
+ bacula-dir) |
792 |
+ case "${mydbtype}" in |
793 |
+ sqlite3) |
794 |
+ # sqlite databases don't have a daemon |
795 |
+ sed -i -e 's/need "%database%"/:/g' "${T}/${script}".initd || die |
796 |
+ ;; |
797 |
+ *) |
798 |
+ # all other databases have daemons |
799 |
+ sed -i -e "s:%database%:${mydbtype}:" "${T}/${script}".initd || die |
800 |
+ ;; |
801 |
+ esac |
802 |
+ ;; |
803 |
+ *) |
804 |
+ ;; |
805 |
+ esac |
806 |
+ |
807 |
+ # install init script and config |
808 |
+ newinitd "${T}/${script}".initd "${script}" |
809 |
+ newconfd "${T}/${script}".confd "${script}" |
810 |
+ done |
811 |
+ |
812 |
+ systemd_dounit "${S}"/platforms/systemd/bacula-{dir,fd,sd}.service |
813 |
+ |
814 |
+ # make sure the working directory exists |
815 |
+ diropts -m0750 |
816 |
+ keepdir /var/lib/bacula |
817 |
+ |
818 |
+ # make sure bacula group can execute bacula libexec scripts |
819 |
+ fowners -R root:bacula /usr/libexec/bacula |
820 |
+} |
821 |
+ |
822 |
+pkg_postinst() { |
823 |
+ if use bacula-clientonly; then |
824 |
+ fowners root:bacula /var/lib/bacula |
825 |
+ else |
826 |
+ fowners bacula:bacula /var/lib/bacula |
827 |
+ fi |
828 |
+ |
829 |
+ if ! use bacula-clientonly && ! use bacula-nodir; then |
830 |
+ einfo |
831 |
+ einfo "If this is a new install, you must create the ${mydbtype} databases with:" |
832 |
+ einfo " /usr/libexec/bacula/create_${mydbtype}_database" |
833 |
+ einfo " /usr/libexec/bacula/make_${mydbtype}_tables" |
834 |
+ einfo " /usr/libexec/bacula/grant_${mydbtype}_privileges" |
835 |
+ einfo |
836 |
+ |
837 |
+ ewarn "ATTENTION!" |
838 |
+ ewarn "The format of the database may have changed." |
839 |
+ ewarn "If you just upgraded from a version below 7.2.0 you must run" |
840 |
+ ewarn "'update_bacula_tables' now." |
841 |
+ ewarn "Make sure to have a backup of your catalog before." |
842 |
+ ewarn |
843 |
+ fi |
844 |
+ |
845 |
+ if use sqlite; then |
846 |
+ einfo |
847 |
+ einfo "Be aware that Bacula does not officially support SQLite database anymore." |
848 |
+ einfo "Best use it only for a client-only installation. See Bug #445540." |
849 |
+ einfo |
850 |
+ fi |
851 |
+ |
852 |
+ einfo "Please note that 'bconsole' will always be installed. To compile 'bat'" |
853 |
+ einfo "you have to enable 'USE=qt4'." |
854 |
+ einfo |
855 |
+} |
856 |
|
857 |
diff --git a/app-backup/bacula/files/bacula-fix-sonames.patch b/app-backup/bacula/files/bacula-fix-sonames.patch |
858 |
new file mode 100644 |
859 |
index 00000000..d05b2b9 |
860 |
--- /dev/null |
861 |
+++ b/app-backup/bacula/files/bacula-fix-sonames.patch |
862 |
@@ -0,0 +1,36 @@ |
863 |
+=== modified file 'autoconf/ltmain.sh' |
864 |
+--- autoconf/ltmain.sh 2011-11-06 20:34:58 +0000 |
865 |
++++ autoconf/ltmain.sh 2012-02-09 17:27:13 +0000 |
866 |
+@@ -2428,6 +2428,7 @@ |
867 |
+ -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries |
868 |
+ -shared only do dynamic linking of libtool libraries |
869 |
+ -shrext SUFFIX override the standard shared library file extension |
870 |
++ -soname SONAME override the standard shared object name |
871 |
+ -static do not do any dynamic linking of uninstalled libtool libraries |
872 |
+ -static-libtool-libs |
873 |
+ do not do any dynamic linking of libtool libraries |
874 |
+@@ -5422,6 +5423,11 @@ |
875 |
+ prev= |
876 |
+ continue |
877 |
+ ;; |
878 |
++ soname) |
879 |
++ soname_spec="$arg" |
880 |
++ prev= |
881 |
++ continue |
882 |
++ ;; |
883 |
+ weak) |
884 |
+ func_append weak_libs " $arg" |
885 |
+ prev= |
886 |
+@@ -5741,6 +5747,11 @@ |
887 |
+ continue |
888 |
+ ;; |
889 |
+ |
890 |
++ -soname) |
891 |
++ prev=soname |
892 |
++ continue |
893 |
++ ;; |
894 |
++ |
895 |
+ -static | -static-libtool-libs) |
896 |
+ # The effects of -static are defined in a previous loop. |
897 |
+ # We used to do the same as -all-static on platforms that |
898 |
+ |