aboutsummaryrefslogtreecommitdiffstats
path: root/testing/nut/APKBUILD
diff options
context:
space:
mode:
authorValery Kartel <valery.kartel@gmail.com>2017-04-21 16:37:33 +0300
committerLeonardo Arena <rnalrd@alpinelinux.org>2017-06-02 08:02:44 +0000
commit2275192021130da8e3bed22be2cd653ce9793a47 (patch)
treed334efe6a5bb25a24c2462d72e973071c06b3a0d /testing/nut/APKBUILD
parent1d0d9aded485e650569d95c479574a1ffc6fdb9a (diff)
downloadaports-2275192021130da8e3bed22be2cd653ce9793a47.tar.gz
aports-2275192021130da8e3bed22be2cd653ce9793a47.tar.bz2
aports-2275192021130da8e3bed22be2cd653ce9793a47.tar.xz
testing/nut: fix user creation in post-install
-- add nut home dir /var/lib/nut used for scheduler fix libexec and driver dirs (libexec -> lib) add using dns in init-scripts remove conf.d files from package because it have no sence for now cleanups in APKBUILD and init-scripts
Diffstat (limited to 'testing/nut/APKBUILD')
-rw-r--r--testing/nut/APKBUILD48
1 files changed, 23 insertions, 25 deletions
diff --git a/testing/nut/APKBUILD b/testing/nut/APKBUILD
index 4ec2f85cf5..7f31f5df18 100644
--- a/testing/nut/APKBUILD
+++ b/testing/nut/APKBUILD
@@ -3,19 +3,18 @@
# Maintainer: Kozak Ivan <kozak-iv@yandex.ru>
pkgname=nut
pkgver=2.7.4
-pkgrel=2
-pkgdesc="Network UPS tools - server"
+pkgrel=3
+pkgdesc="Network UPS tools"
url="http://www.networkupstools.org"
arch="all"
license="GPL"
depends_dev="libressl-dev libusb-compat-dev net-snmp-dev neon-dev"
makedepends="$depends_dev libtool autoconf automake"
-pkgusers="nut"
-pkggroups="nut"
+pkgusers=$pkgname
+pkggroups=$pkgname
install="$pkgname.pre-install"
subpackages="$pkgname-doc $pkgname-dev"
source="http://www.networkupstools.org/source/2.7/$pkgname-$pkgver.tar.gz
- nut.confd
upsd.initd
upsmon.initd
"
@@ -27,10 +26,10 @@ build() {
--build=$CBUILD \
--host=$CHOST \
--prefix=/usr \
- --libexecdir=/lib/nut \
+ --libexecdir=/usr/lib/nut \
--without-wrap \
- --with-user=nut \
- --with-group=nut \
+ --with-user=$pkgname \
+ --with-group=$pkgname \
--disable-static \
--with-serial \
--with-usb \
@@ -42,7 +41,7 @@ build() {
--without-freeipmi \
--with-libltdl \
--without-cgi \
- --with-drvpath=/usr/libexec/nut \
+ --with-drvpath=/usr/lib/nut \
--datadir=/usr/share/nut \
--sysconfdir=/etc/nut \
--with-statepath=/var/run/nut \
@@ -52,25 +51,24 @@ build() {
make || return 1
}
-package() {
- local i
- cd "$builddir"
-
- make DESTDIR="$pkgdir" install || return 1
- chmod -R 640 "$pkgdir"/etc/nut || return 1
- chown -R root:nut "$pkgdir"/etc/nut || return 1
+check() {
+ make -C "$builddir" check
+}
- for i in "$pkgdir"/etc/nut/*.sample; do
- mv $i ${i%.*} || return 1
- done
+package() {
+ make -C "$builddir" DESTDIR="$pkgdir" install || return 1
+ install -Dm755 "$srcdir"/upsd.initd "$pkgdir"/etc/init.d/nut-upsd || return 1
+ install -Dm755 "$srcdir"/upsmon.initd "$pkgdir"/etc/init.d/nut-upsmon || return 1
+ install -d -o $pkgname -g $pkgname "$pkgdir"/var/lib/$pkgname || return 1
- for i in upsd upsmon; do
- install -Dm 755 "$srcdir"/$i.initd "$pkgdir"/etc/init.d/nut-$i || return 1
- install -Dm 644 "$srcdir"/nut.confd "$pkgdir"/etc/conf.d/nut-$i || return 1
+ local file;
+ for file in "$pkgdir"/etc/nut/*.sample; do
+ chmod 640 $file || return 1
+ chown root:$pkgname $file || return 1
+ mv $file ${file%.sample} || return 1
done
}
sha512sums="320c4aff85d8a370c5eff77d33924fdfc3caf6a250620693cdd5bf3336b3a80d8a207488eee841bcf8b72fbad68fda4c074e63b99c56e7886716fc934122d11a nut-2.7.4.tar.gz
-de59b3ab84553780874aeb9edf5faaa1fe19144406f58d40e878cc4cf520440d95a57645a6e3fdd84fdec77c6840ab2185b9554a423f7b9b8b6bca4a1795fb78 nut.confd
-1a4b8ee42eb62b68170ef72e87115ae135905135d5d9bd48e837d18c73229c9da66e53cde4289faa1f4fdc2446195b3047bc1a66ae33bfb14cffb19dac403eb5 upsd.initd
-d80f35af1e8ea2bb0da35af6a9bd2bfbc3b92d0cc0765a4d10d6cdce925225bb8200c7d9d2d77b1e5cc47593198dec3678403358538401f97644c61d8516adfb upsmon.initd"
+f470da96f9d324173e9bd241146284793738f99f2314dfe41c3ac3d56234394609b47d7e593ce9940ec7ce74a26a8483d0911161a16402cd3cc25023ba991d4b upsd.initd
+32470ae473fc363131787cd57f13d40763898947d56d032790ba7f3a5eaa8038b602f7e395ca44f6c5adce8ee5ec496e30ca0eaadb3c78a38015677aea751e12 upsmon.initd"