Gentoo Archives: gentoo-commits

From: "Wolfram Schlich (wschlich)" <wschlich@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in app-backup/bacula: ChangeLog bacula-2.2.8-r1.ebuild
Date: Tue, 29 Apr 2008 10:00:55
Message-Id: E1Jqmdl-0007f5-N7@stork.gentoo.org
1 wschlich 08/04/29 10:00:49
2
3 Modified: ChangeLog
4 Added: bacula-2.2.8-r1.ebuild
5 Log:
6 incorporate upstream release patches
7 (Portage version: 2.1.5_rc4)
8
9 Revision Changes Path
10 1.53 app-backup/bacula/ChangeLog
11
12 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-backup/bacula/ChangeLog?rev=1.53&view=markup
13 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-backup/bacula/ChangeLog?rev=1.53&content-type=text/plain
14 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-backup/bacula/ChangeLog?r1=1.52&r2=1.53
15
16 Index: ChangeLog
17 ===================================================================
18 RCS file: /var/cvsroot/gentoo-x86/app-backup/bacula/ChangeLog,v
19 retrieving revision 1.52
20 retrieving revision 1.53
21 diff -u -r1.52 -r1.53
22 --- ChangeLog 22 Mar 2008 18:05:17 -0000 1.52
23 +++ ChangeLog 29 Apr 2008 10:00:49 -0000 1.53
24 @@ -1,6 +1,15 @@
25 # ChangeLog for app-backup/bacula
26 # Copyright 2002-2008 Gentoo Foundation; Distributed under the GPL v2
27 -# $Header: /var/cvsroot/gentoo-x86/app-backup/bacula/ChangeLog,v 1.52 2008/03/22 18:05:17 wschlich Exp $
28 +# $Header: /var/cvsroot/gentoo-x86/app-backup/bacula/ChangeLog,v 1.53 2008/04/29 10:00:49 wschlich Exp $
29 +
30 +*bacula-2.2.8-r1 (29 Apr 2008)
31 +
32 + 29 Apr 2008; Wolfram Schlich <wschlich@g.o>
33 + +files/2.2.8/2.2.8-bacula-conf.patch, +files/2.2.8/2.2.8-jobmedia.patch,
34 + +files/2.2.8/2.2.8-jobmedia-fix.patch,
35 + +files/2.2.8/2.2.8-pool-source.patch, +files/2.2.8/2.2.8-strip-path.patch,
36 + +bacula-2.2.8-r1.ebuild:
37 + incorporate upstream release patches
38
39 22 Mar 2008; Wolfram Schlich <wschlich@g.o> bacula-2.2.8.ebuild:
40 depend on latex2html emerged with USE=png (bug #200562)
41
42
43
44 1.1 app-backup/bacula/bacula-2.2.8-r1.ebuild
45
46 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-backup/bacula/bacula-2.2.8-r1.ebuild?rev=1.1&view=markup
47 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-backup/bacula/bacula-2.2.8-r1.ebuild?rev=1.1&content-type=text/plain
48
49 Index: bacula-2.2.8-r1.ebuild
50 ===================================================================
51 # Copyright 1999-2008 Gentoo Foundation
52 # Distributed under the terms of the GNU General Public License v2
53 # $Header: /var/cvsroot/gentoo-x86/app-backup/bacula/bacula-2.2.8-r1.ebuild,v 1.1 2008/04/29 10:00:49 wschlich Exp $
54
55 #
56 # TODO:
57 # - install stuff from examples/:
58 # - examples/nagios/ + add nagios USE flag etc.
59 # (see also example/reports/check_bacula_pools.sh which is newer
60 # than examples/nagios/check_bacula_pools.sh)
61 # - examples/autochangers/
62 # - examples/devices/
63 # - examples/python/
64 # - examples/reports/baculareport.pl
65 # - correctly filter unneeded /usr/libexec/bacula/ stuff depending
66 # on selected USE flags, e.g. bacula-clientonly
67 # - install bacula-web and/or bweb from bacula-gui package
68 #
69
70 inherit eutils
71
72 IUSE="bacula-clientonly bacula-console bacula-nodir bacula-nosd bacula-split-init doc gnome ipv6 logrotate logwatch mysql postgres python qt4 readline sqlite sqlite3 ssl static tcpd wxwindows X"
73 KEYWORDS="~amd64 ~hppa ~ppc ~sparc ~x86"
74
75 DESCRIPTION="Featureful client/server network backup suite"
76 HOMEPAGE="http://www.bacula.org/"
77
78 DOC_VER="${PV}"
79 SRC_URI="mirror://sourceforge/bacula/${P}.tar.gz
80 doc? ( mirror://sourceforge/bacula/${PN}-docs-${DOC_VER}.tar.bz2 )"
81
82 LICENSE="GPL-2"
83 SLOT="0"
84
85 DEPEND="
86 >=sys-libs/zlib-1.1.4
87 dev-libs/gmp
88 !bacula-clientonly? (
89 postgres? ( >=dev-db/postgresql-7.4.0 )
90 mysql? ( virtual/mysql )
91 sqlite? ( =dev-db/sqlite-2* )
92 sqlite3? ( >=dev-db/sqlite-3.0.0 )
93 virtual/mta
94 )
95 bacula-console? (
96 wxwindows? ( =x11-libs/wxGTK-2.6* )
97 qt4? (
98 =x11-libs/qt-4*
99 >=x11-libs/qwt-5
100 )
101 gnome? (
102 >=gnome-base/libgnome-2
103 x11-libs/gksu
104 )
105 )
106 ssl? ( dev-libs/openssl )
107 logrotate? ( app-admin/logrotate )
108 logwatch? ( sys-apps/logwatch )
109 tcpd? ( >=sys-apps/tcp-wrappers-7.6 )
110 readline? ( >=sys-libs/readline-4.1 )
111 doc? (
112 virtual/ghostscript
113 dev-tex/latex2html
114 )"
115 RDEPEND="${DEPEND}
116 !bacula-clientonly? (
117 sys-block/mtx
118 app-arch/mt-st
119 )"
120
121 pkg_setup() {
122 local dbnum
123 declare -i dbnum=0
124 if ! useq bacula-clientonly; then
125 if useq mysql; then
126 export mydbtype='mysql'
127 let dbnum++
128 fi
129 if useq postgres; then
130 export mydbtype='postgresql'
131 let dbnum++
132 fi
133 if useq sqlite; then
134 export mydbtype='sqlite'
135 let dbnum++
136 fi
137 if useq sqlite3; then
138 export mydbtype='sqlite3'
139 let dbnum++
140 fi
141 if [[ "${dbnum}" -lt 1 ]]; then
142 eerror
143 eerror "To use ${P} it is required to set a database in the USE flags."
144 eerror "Supported databases are mysql, postgresql, sqlite, sqlite3"
145 eerror
146 die "No database type selected."
147 elif [[ "${dbnum}" -gt 1 ]]; then
148 eerror
149 eerror "You have set ${P} to use multiple database types."
150 eerror "I don't know which to set as the default!"
151 eerror "You can use /etc/portage/package.use to set per-package USE flags"
152 eerror "Set it so only one database type, mysql, postgres, sqlite, sqlite3"
153 eerror
154 die "Multiple database types selected."
155 fi
156 fi
157
158 # create the daemon group and user
159 if [ -z "$(egetent group bacula)" ]; then
160 enewgroup bacula
161 einfo
162 einfo "The group 'bacula' has been created. Any users you add to this"
163 einfo "group have access to files created by the daemons."
164 einfo
165 fi
166 if ! useq bacula-clientonly; then
167 if [ -z "$(egetent passwd bacula)" ]; then
168 enewuser bacula -1 -1 /var/lib/bacula bacula,disk,tape,cdrom,cdrw
169 einfo
170 einfo "The user 'bacula' has been created. Please see the bacula manual"
171 einfo "for information about running bacula as a non-root user."
172 einfo
173 fi
174 fi
175 }
176
177 src_unpack() {
178 unpack ${A}
179 cd "${S}"
180
181 # adjusts default configuration files for several binaries
182 # to /etc/bacula/<config> instead of ./<config>
183 pushd src && epatch "${FILESDIR}/${PV}/${PN}"-default-configs.patch && popd
184
185 # replaces (deprecated) gnomesu with gksu in the gnome menu files
186 useq bacula-console && useq gnome && epatch "${FILESDIR}/${PV}/${PN}"-gnomesu2gksu.diff
187
188 # Apply patches from bacula-patches at
189 # http://sourceforge.net/project/showfiles.php?group_id=50727&package_id=93946
190 epatch "${FILESDIR}"/${PV}/${PV}-bacula-conf.patch
191 epatch "${FILESDIR}"/${PV}/${PV}-jobmedia.patch
192 epatch "${FILESDIR}"/${PV}/${PV}-jobmedia-fix.patch
193 epatch "${FILESDIR}"/${PV}/${PV}-pool-source.patch
194 epatch "${FILESDIR}"/${PV}/${PV}-strip-path.patch
195 }
196
197 src_compile() {
198 if useq doc && has_version dev-tex/latex2html && ! built_with_use dev-tex/latex2html png; then
199 eerror "${PN} needs the PNG support of latex2html"
200 eerror "Please re-emerge dev-tex/latex2html with USE=png"
201 die "need dev-tex/latex2html built with png USE flag"
202 fi
203
204 local myconf=''
205
206 if useq bacula-clientonly; then
207 myconf="${myconf} \
208 $(use_enable bacula-clientonly client-only) \
209 $(use_enable static static-fd)"
210 else
211 myconf="${myconf} \
212 --with-${mydbtype} \
213 $(use_enable static static-tools) \
214 $(use_enable static static-fd) \
215 $(use_enable !bacula-nodir build-dird) \
216 $(use_enable !bacula-nosd build-stored)"
217 if ! useq bacula-nodir; then
218 myconf="${myconf} $(use_enable static static-dir)"
219 fi
220 if ! useq bacula-nosd; then
221 myconf="${myconf} $(use_enable static static-sd)"
222 fi
223
224 fi
225
226 if useq bacula-console; then
227 if useq qt4 && has_version '<x11-libs/qwt-5'; then
228 eerror "x11-libs/qwt found in a version < 5, thus the"
229 eerror "compilation of 'bat' would fail (see"
230 eerror "http://bugs.gentoo.org/188477#c11 for details)."
231 eerror "please either unmerge <x11-libs/qwt-5 or disable"
232 eerror "the qt4 USE flag to disable building 'bat'."
233 die "incompatible slotted qwt version found"
234 fi
235 myconf="${myconf} \
236 $(use_with X x) \
237 $(use_enable gnome) \
238 $(use_enable gnome tray-monitor) \
239 $(use_enable wxwindows bwx-console) \
240 $(use_enable qt4 bat) \
241 $(use_enable static static-cons)"
242 fi
243
244 myconf="${myconf} \
245 $(use_with python) \
246 $(use_enable readline) \
247 $(use_with readline readline /usr) \
248 $(use_with ssl openssl) \
249 $(use_enable ipv6) \
250 $(use_with tcpd tcp-wrappers)"
251
252 ./configure \
253 --prefix=/usr \
254 --mandir=/usr/share/man \
255 --with-pid-dir=/var/run \
256 --sysconfdir=/etc/bacula \
257 --infodir=/usr/share/info \
258 --with-subsys-dir=/var/lock/subsys \
259 --with-working-dir=/var/lib/bacula \
260 --with-scriptdir=/usr/libexec/bacula \
261 --with-dir-user=bacula \
262 --with-dir-group=bacula \
263 --with-sd-user=root \
264 --with-sd-group=bacula \
265 --with-fd-user=root \
266 --with-fd-group=bacula \
267 --enable-smartalloc \
268 --host=${CHOST} \
269 ${myconf} \
270 || die "configure failed"
271
272 emake || die "emake failed"
273
274 # build docs from bacula-docs tarball
275 if useq doc; then
276 pushd "${WORKDIR}/${PN}-docs-${DOC_VER}"
277
278 ./configure \
279 --with-bacula="${S}" \
280 || die "configure for bacula-docs failed"
281
282 # the main Makefile tries to build stuff in
283 # ./developer/ and ./bacula-web/, which is
284 # unfortunately broken in 2.0.3, so we only
285 # build stuff in ./manual/, which works.
286 pushd manual
287 emake -j1 || die "emake for bacula-docs failed"
288 popd
289
290 popd
291 fi
292 }
293
294 src_install() {
295 emake DESTDIR="${D}" install || die "emake install failed"
296
297 # install bat when enabled (for some reason ./configure doesn't pick this up)
298 if useq bacula-console && useq qt4; then
299 dosbin "${S}"/src/qt-console/bat
300 fi
301
302 # remove some scripts we don't need at all
303 rm -f "${D}"/usr/libexec/bacula/{bacula,bacula-ctl-dir,bacula-ctl-fd,bacula-ctl-sd,startmysql,stopmysql}
304
305 # rename statically linked apps
306 if useq static; then
307 pushd "${D}"/usr/sbin
308 mv static-bacula-fd bacula-fd
309 mv static-bconsole bconsole
310 if ! useq bacula-clientonly; then
311 mv static-bacula-dir bacula-dir
312 mv static-bacula-sd bacula-sd
313 fi
314 if useq bacula-console && useq gnome; then
315 mv static-gnome-console gnome-console
316 fi
317 if useq bacula-console && useq qt4; then
318 mv static-bat bat
319 fi
320 popd
321 fi
322
323 # gnome-console menu entries using gksu
324 if useq bacula-console && useq gnome; then
325 emake DESTDIR="${D}" install-menu-xsu \
326 || die "Failed to install gnome menu files"
327 fi
328
329 # extra files which 'make install' doesn't cover
330 if ! useq bacula-clientonly; then
331 # the database update scripts
332 diropts -m0750
333 insinto /usr/libexec/bacula/updatedb
334 insopts -m0754
335 doins "${S}"/updatedb/*
336 fperms 0640 /usr/libexec/bacula/updatedb/README
337
338 # the logrotate configuration
339 if useq logrotate; then
340 diropts -m0755
341 insinto /etc/logrotate.d
342 insopts -m0644
343 newins "${S}"/scripts/logrotate bacula
344 fi
345
346 # the logwatch scripts
347 if useq logwatch; then
348 diropts -m0750
349 dodir /etc/log.d/scripts/services
350 dodir /etc/log.d/conf/logfiles
351 dodir /etc/log.d/conf/services
352 cd "${S}"/scripts/logwatch
353 emake DESTDIR="${D}" install || die "Failed to install logwatch scripts"
354 cd "${S}"
355 fi
356 fi
357
358 # documentation
359 for d in "${S}"/{ChangeLog,LICENSE,README,ReleaseNotes,SUPPORT,kernstodo,projects}; do
360 dodoc "${d}"
361 done
362 # TODO FIXME: developers and bacula-web documentation is broken with 2.0.3 :-(
363 if useq doc; then
364 #! dodoc "${WORKDIR}/${PN}-docs-${DOC_VER}"/developers/developers.pdf
365 dodoc "${WORKDIR}/${PN}-docs-${DOC_VER}"/manual/bacula.pdf
366 diropts -m0755
367 #! dodir /usr/share/doc/"${PF}"/developers
368 dodir /usr/share/doc/"${PF}"/manual
369 insopts -m0644
370 #! insinto /usr/share/doc/"${PF}"/developers
371 #! doins "${WORKDIR}/${PN}-docs-${DOC_VER}"/developers/developers/*
372 insinto /usr/share/doc/"${PF}"/manual
373 doins "${WORKDIR}/${PN}-docs-${DOC_VER}"/manual/bacula/*
374 fi
375
376 # setup init scripts
377 myservices="fd"
378 if ! useq bacula-clientonly; then
379 if ! useq bacula-nodir; then
380 myservices="${myservices} dir"
381 fi
382 if ! useq bacula-nosd; then
383 myservices="${myservices} sd"
384 fi
385 fi
386 if useq bacula-split-init; then
387 myscripts=""
388 for service in ${myservices}; do
389 myscripts="${myscripts} bacula-${service}"
390 done
391 else
392 myscripts="bacula-all"
393 fi
394 for script in ${myscripts}; do
395 # copy over init script and config to a temporary location
396 # so we can modify them as needed
397 cp "${FILESDIR}/${PV}/${script}"-conf "${T}/${script}".conf
398 cp "${FILESDIR}/${PV}/${script}"-init "${T}/${script}".init
399 # set database dependancy for the all-in-one and director init scripts
400 case "${mydbtype}" in
401 sqlite*)
402 # sqlite + sqlite3 databases don't have daemons
403 sed -i -e "s:%database%::" "${T}/${script}".init
404 ;;
405 *)
406 # all other databases have daemons
407 sed -i -e "s:%database%:${mydbtype}:" "${T}/${script}".init
408 ;;
409 esac
410 # set services for the all-in-one init script
411 sed -i -e "s:%services%:${myservices}:" "${T}/${script}".conf
412 # install init script and config
413 newinitd "${T}/${script}".init "${script}"
414 newconfd "${T}/${script}".conf "${script}"
415 done
416
417 # make sure the working directory exists
418 diropts -m0750
419 keepdir /var/lib/bacula
420
421 # make sure bacula group can execute bacula libexec scripts
422 fowners root:bacula /usr/libexec/bacula/*
423 }
424
425 pkg_postinst() {
426 if useq bacula-clientonly; then
427 fowners root:bacula /var/lib/bacula
428 else
429 fowners bacula:bacula /var/lib/bacula
430 fi
431
432 if ! useq bacula-clientonly && ! useq bacula-nodir; then
433 einfo
434 einfo "If this is a new install, you must create the ${mydbtype} databases with:"
435 einfo " /usr/libexec/bacula/create_${mydbtype}_database"
436 einfo " /usr/libexec/bacula/make_${mydbtype}_tables"
437 einfo " /usr/libexec/bacula/grant_${mydbtype}_privileges"
438 einfo
439 einfo "If you're upgrading from a major release, you must upgrade your bacula catalog database."
440 einfo "Please read the manual chapter for how to upgrade your database."
441 einfo "You can find database upgrade scripts in /usr/libexec/bacula/updatedb."
442 einfo
443 fi
444 }
445
446
447
448 --
449 gentoo-commits@l.g.o mailing list