aboutsummaryrefslogtreecommitdiffstats
path: root/main/bacula
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2016-09-14 00:08:05 +0200
committerJakub Jirutka <jakub@jirutka.cz>2016-09-14 00:08:38 +0200
commit2a055a0e5067cdceba6c11507888076b489b9895 (patch)
tree5b8ebf77b6d34e8e82895d5f8ed63661a593ca26 /main/bacula
parent60b8d7ad47d34d8b4dda7bd5c959de49e6b4a944 (diff)
downloadaports-2a055a0e5067cdceba6c11507888076b489b9895.tar.bz2
aports-2a055a0e5067cdceba6c11507888076b489b9895.tar.xz
main/bacula: improve abuild
Diffstat (limited to 'main/bacula')
-rw-r--r--main/bacula/APKBUILD85
1 files changed, 46 insertions, 39 deletions
diff --git a/main/bacula/APKBUILD b/main/bacula/APKBUILD
index f0f7b0fcdd..1b57416adf 100644
--- a/main/bacula/APKBUILD
+++ b/main/bacula/APKBUILD
@@ -1,6 +1,6 @@
# Contributor: Ɓukasz Jendrysik <scadu@yandex.com>
# Maintainer: Leonardo Arena <rnalrd@alpinelinux.org>
-pkgname="bacula"
+pkgname=bacula
pkgver=7.4.3
pkgrel=0
pkgdesc="Enterprise ready, network based backup program"
@@ -8,14 +8,13 @@ url="http://www.bacula.org"
arch="all"
license="AGPL3"
depends=""
-depends_dev=""
-makedepends="$depends_dev autoconf mariadb-dev ncurses-dev openssl-dev
- postgresql-dev sqlite-dev zlib-dev lzo-dev"
+makedepends="autoconf mariadb-dev ncurses-dev openssl-dev postgresql-dev
+ sqlite-dev zlib-dev lzo-dev"
install="$pkgname.pre-install $pkgname.post-upgrade"
subpackages="$pkgname-doc $pkgname-mysql $pkgname-pgsql $pkgname-sqlite"
pkgusers="bacula"
pkggroups="bacula"
-somask="libbaccats-${pkgver}.so"
+somask="libbaccats-$pkgver.so"
source="http://downloads.sourceforge.net/project/$pkgname/$pkgname/$pkgver/$pkgname-$pkgver.tar.gz
bacula-dir-init
bacula-dir-conf
@@ -25,23 +24,18 @@ source="http://downloads.sourceforge.net/project/$pkgname/$pkgname/$pkgver/$pkgn
bacula-fd-conf
bacula-7.4.0-path-mounted.patch
"
-
-_builddir="$srcdir/$pkgname-$pkgver"
+builddir="$srcdir/$pkgname-$pkgver"
prepare () {
- cd "$_builddir"
- for i in $source; do
- case $i in
- *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
- esac
- done
+ default_prepare || return 1
- cd "$_builddir"/autoconf
+ cd "$builddir"/autoconf
autoconf && cp configure ../
}
build() {
- cd "$srcdir/$pkgname-$pkgver"
+ cd "$builddir"
+
./configure \
--build=$CBUILD \
--host=$CHOST \
@@ -76,53 +70,62 @@ build() {
}
package() {
- cd "$srcdir/$pkgname-$pkgver"
+ cd "$builddir"
+
make DESTDIR="$pkgdir" install
- for DAEMON in dir sd fd
- do
- install -Dm755 "$srcdir"/bacula-${DAEMON}-init \
- "$pkgdir"/etc/init.d/bacula-${DAEMON}
- install -Dm644 "$srcdir"/bacula-${DAEMON}-conf \
- "$pkgdir"/etc/conf.d/bacula-${DAEMON}
+ local daemon; for daemon in dir sd fd; do
+ install -Dm755 "$srcdir"/bacula-${daemon}-init \
+ "$pkgdir"/etc/init.d/bacula-${daemon} || return 1
+ install -Dm644 "$srcdir"/bacula-${daemon}-conf \
+ "$pkgdir"/etc/conf.d/bacula-${daemon} || return 1
done
+
install -Dm644 examples/sample-query.sql \
- "$pkgdir"/etc/bacula/scripts/query.sql
+ "$pkgdir"/etc/bacula/scripts/query.sql || return 1
+
# Fix correct log dir
- sed -i -e 's%/var/bacula/log%/var/log/bacula%' \
- "$pkgdir"/etc/bacula/bacula-dir.conf
+ sed -i 's%/var/bacula/log%/var/log/bacula%' \
+ "$pkgdir"/etc/bacula/bacula-dir.conf || return 1
+
# Install logrotate script
- install -Dm644 scripts/logrotate $pkgdir/etc/logrotate.d/bacula
- sed -i -e 's%/var/bacula/log%/var/log/bacula%' \
- "$pkgdir"/etc/logrotate.d/bacula
+ install -Dm644 scripts/logrotate $pkgdir/etc/logrotate.d/bacula || return 1
+ sed -i 's%/var/bacula/log%/var/log/bacula%' \
+ "$pkgdir"/etc/logrotate.d/bacula || return 1
+
# Use shell script for catalog backup instead of perl
- sed -i -e 's/make_catalog_backup.pl/make_catalog_backup/' \
- "$pkgdir"/etc/bacula/bacula-dir.conf
+ sed -i 's/make_catalog_backup.pl/make_catalog_backup/' \
+ "$pkgdir"/etc/bacula/bacula-dir.conf || return 1
+
+ local dir
for dir in /var/lib/bacula /etc/bacula/scripts/make_catalog_backup* \
- /etc/bacula/scripts/mtx-changer*
+ /etc/bacula/scripts/mtx-changer*
do
chown bacula.bacula "$pkgdir"$dir || return 1
done
+
find "$pkgdir"/usr/lib -iname libbaccats* -type l -delete
}
_mv_backend() {
mkdir -p "$subpkgdir"/usr/lib
mkdir -p "$subpkgdir"/etc/bacula/scripts
+
mv "$pkgdir"/usr/lib/libbaccats-${1}-${pkgver}.so \
- "$subpkgdir"/usr/lib || return 1
+ "$subpkgdir"/usr/lib || return 1
+
ln -s libbaccats-${pkgver}.so "$subpkgdir"/usr/lib/libbaccats.so
ln -s libbaccats-${1}-${pkgver}.so \
- "$subpkgdir"/usr/lib/libbaccats-${pkgver}.so
- #mv "$pkgdir"/usr/lib/libbaccats-${1}.so \
- # "$subpkgdir"/usr/lib/libbaccats.so || return 1
+ "$subpkgdir"/usr/lib/libbaccats-${pkgver}.so
+
mv "$pkgdir"/etc/bacula/scripts/*_${1}_* \
- "$subpkgdir"/etc/bacula/scripts || return 1
+ "$subpkgdir"/etc/bacula/scripts || return 1
}
mysql() {
pkgdesc="Bacula MySQL backend"
depends="bacula"
+
_mv_backend mysql
}
@@ -130,17 +133,21 @@ pgsql() {
pkgdesc="Bacula PGSQL backend"
depends="bacula"
pkgusers="postgres"
- _mv_backend postgresql
+
+ _mv_backend postgresql || return 1
+
+ local file
for file in create_postgresql_database make_postgresql_tables \
- grant_postgresql_privileges
+ grant_postgresql_privileges
do
- chown postgres "$subpkgdir"/etc/bacula/scripts/$file
+ chown postgres "$subpkgdir"/etc/bacula/scripts/$file || return 1
done
}
sqlite() {
pkgdesc="Bacula SQLite backend"
depends="bacula"
+
_mv_backend sqlite3
}