Gentoo Archives: gentoo-commits

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