diff options
author | Leonardo Arena <rnalrd@alpinelinux.org> | 2017-07-20 11:48:12 +0000 |
---|---|---|
committer | Leonardo Arena <rnalrd@alpinelinux.org> | 2017-07-20 14:00:34 +0000 |
commit | a01e506e04855eb6b3a0589cfeeba667b49b575d (patch) | |
tree | 69a147d4bd2826e51f2bcf6526081a280309e334 /main/bacula | |
parent | 4388c2d4c492d82d3c339b51a1317b00f8a84ae6 (diff) | |
download | aports-a01e506e04855eb6b3a0589cfeeba667b49b575d.tar.bz2 aports-a01e506e04855eb6b3a0589cfeeba667b49b575d.tar.xz |
main/bacula: modernize APKBUILD, install default client conf file, disable check()
Diffstat (limited to 'main/bacula')
-rw-r--r-- | main/bacula/APKBUILD | 83 |
1 files changed, 44 insertions, 39 deletions
diff --git a/main/bacula/APKBUILD b/main/bacula/APKBUILD index 3f9ed57009..0f21a801d0 100644 --- a/main/bacula/APKBUILD +++ b/main/bacula/APKBUILD @@ -25,10 +25,13 @@ source="http://downloads.sourceforge.net/project/$pkgname/$pkgname/$pkgver/$pkgn bacula-fd-conf bacula-7.4.0-path-mounted.patch " +options="!check" #no test suite provided builddir="$srcdir/$pkgname-$pkgver" +_bworkdir="/var/lib/$pkgname" + prepare () { - default_prepare || return 1 + default_prepare cd "$builddir"/autoconf autoconf && cp configure ../ @@ -41,14 +44,14 @@ build() { --build=$CBUILD \ --host=$CHOST \ --prefix=/usr \ - --sysconfdir=/etc/bacula \ + --sysconfdir=/etc/$pkgname \ --localstatedir=/var \ --mandir=/usr/share/man \ --docdir=/usr/share/doc \ --infodir=/usr/share/info \ - --with-pid-dir=/var/run \ + --with-pid-dir=/var/run/$pkgname \ --with-subsys-dir=/var/lock/subsys \ - --with-logdir=/var/log/bacula \ + --with-logdir=/var/log/$pkgname \ --enable-largefile \ --enable-smartalloc \ --disable-nls \ @@ -56,18 +59,17 @@ build() { --with-postgresql \ --with-mysql \ --with-sqlite3 \ - --with-scriptdir=/etc/bacula/scripts \ - --with-working-dir=/var/lib/bacula \ - --with-dir-user=bacula \ - --with-dir-group=bacula \ - --with-archivedir=/var/lib/bacula/archive \ - --with-sd-user=bacula \ - --with-sd-group=bacula \ + --with-scriptdir=/etc/$pkgname/scripts \ + --with-working-dir=$_bworkdir \ + --with-dir-user=$pkgname \ + --with-dir-group=$pkgname \ + --with-archivedir=$_bworkdir/archive \ + --with-sd-user=$pkgname \ + --with-sd-group=$pkgname \ --with-fd-user=root \ - --with-fd-group=root \ - || return 1 + --with-fd-group=root - make NO_ECHO= || return 1 + make NO_ECHO= } package() { @@ -76,33 +78,33 @@ package() { make DESTDIR="$pkgdir" install 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 + install -Dm755 "$srcdir"/$pkgname-${daemon}-init \ + "$pkgdir"/etc/init.d/$pkgname-${daemon} + install -Dm644 "$srcdir"/$pkgname-${daemon}-conf \ + "$pkgdir"/etc/conf.d/$pkgname-${daemon} done install -Dm644 examples/sample-query.sql \ - "$pkgdir"/etc/bacula/scripts/query.sql || return 1 + "$pkgdir"/etc/$pkgname/scripts/query.sql # Fix correct log dir sed -i 's%/var/bacula/log%/var/log/bacula%' \ - "$pkgdir"/etc/bacula/bacula-dir.conf || return 1 + "$pkgdir"/etc/$pkgname/$pkgname-dir.conf # Install logrotate script - install -Dm644 scripts/logrotate $pkgdir/etc/logrotate.d/bacula || return 1 + install -Dm644 scripts/logrotate $pkgdir/etc/logrotate.d/$pkgname sed -i 's%/var/bacula/log%/var/log/bacula%' \ - "$pkgdir"/etc/logrotate.d/bacula || return 1 + "$pkgdir"/etc/logrotate.d/$pkgname # Use shell script for catalog backup instead of perl sed -i 's/make_catalog_backup.pl/make_catalog_backup/' \ - "$pkgdir"/etc/bacula/bacula-dir.conf || return 1 + "$pkgdir"/etc/$pkgname/$pkgname-dir.conf local dir - for dir in /var/lib/bacula /etc/bacula/scripts/make_catalog_backup* \ - /etc/bacula/scripts/mtx-changer* + for dir in $_bworkdir /etc/$pkgname/scripts/make_catalog_backup* \ + /etc/$pkgname/scripts/mtx-changer* do - chown bacula.bacula "$pkgdir"$dir || return 1 + chown $pkgusers.$pkggroups "$pkgdir"$dir done find "$pkgdir"/usr/lib -iname libbaccats* -type l -delete @@ -110,44 +112,44 @@ package() { _mv_backend() { mkdir -p "$subpkgdir"/usr/lib - mkdir -p "$subpkgdir"/etc/bacula/scripts + mkdir -p "$subpkgdir"/etc/$pkgname/scripts mv "$pkgdir"/usr/lib/libbaccats-${1}-${pkgver}.so \ - "$subpkgdir"/usr/lib || return 1 + "$subpkgdir"/usr/lib ln -s libbaccats-${pkgver}.so "$subpkgdir"/usr/lib/libbaccats.so ln -s libbaccats-${1}-${pkgver}.so \ "$subpkgdir"/usr/lib/libbaccats-${pkgver}.so - mv "$pkgdir"/etc/bacula/scripts/*_${1}_* \ - "$subpkgdir"/etc/bacula/scripts || return 1 + mv "$pkgdir"/etc/$pkgname/scripts/*_${1}_* \ + "$subpkgdir"/etc/$pkgname/scripts } mysql() { pkgdesc="Bacula MySQL backend" - depends="bacula" + depends="$pkgname" _mv_backend mysql } pgsql() { pkgdesc="Bacula PGSQL backend" - depends="bacula" + depends="$pkgname" pkgusers="postgres" - _mv_backend postgresql || return 1 + _mv_backend postgresql local file for file in create_postgresql_database make_postgresql_tables \ grant_postgresql_privileges do - chown postgres "$subpkgdir"/etc/bacula/scripts/$file || return 1 + chown postgres "$subpkgdir"/etc/$pkgname/scripts/$file done } sqlite() { pkgdesc="Bacula SQLite backend" - depends="bacula" + depends="$pkgname" _mv_backend sqlite3 } @@ -162,12 +164,15 @@ client() { pkgdesc="Bacula client" mkdir -p "$subpkgdir"/usr/sbin \ "$subpkgdir"/etc/conf.d \ - "$subpkgdir"/etc/init.d - for bin in bacula bacula-fd bconsole btraceback; do + "$subpkgdir"/etc/init.d \ + "$subpkgdir"/etc/$pkgname + for bin in $pkgname $pkgname-fd bconsole btraceback; do mv "$pkgdir"/usr/sbin/$bin "$subpkgdir"/usr/sbin done - mv "$pkgdir"/etc/conf.d/bacula-fd "$subpkgdir"/etc/conf.d - mv "$pkgdir"/etc/init.d/bacula-fd "$subpkgdir"/etc/init.d + mv "$pkgdir"/etc/conf.d/$pkgname-fd "$subpkgdir"/etc/conf.d + mv "$pkgdir"/etc/init.d/$pkgname-fd "$subpkgdir"/etc/init.d + mv "$pkgdir"/etc/$pkgname/$pkgname-fd.conf "$subpkgdir"/etc/$pkgname/ + install -d -o $pkgname -g $pkgname "$subpkgdir"/$_bworkdir } sha512sums="2dcffe3f02de8e7dedc11f58aeca58fb95486757579065564753376d3fab7699d7577c189d0d34f8490706d773cd6a95d42ef1f35facb95e6fff10dad085c0d0 bacula-7.4.7.tar.gz |