aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2015-03-24 07:58:07 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2015-03-24 07:58:45 +0000
commit968b8aa5e3dcade268c50c9c1299693d4e2255a1 (patch)
treec6814f7a73a0cd391bde30fb1d070e227a06a5f2 /main
parent86a8e29be8a181997c0d95f6b15550cff478a30c (diff)
downloadaports-968b8aa5e3dcade268c50c9c1299693d4e2255a1.tar.bz2
aports-968b8aa5e3dcade268c50c9c1299693d4e2255a1.tar.xz
main/nginx: fix path locations
Diffstat (limited to 'main')
-rw-r--r--main/nginx/APKBUILD49
-rw-r--r--main/nginx/nginx.initd40
2 files changed, 52 insertions, 37 deletions
diff --git a/main/nginx/APKBUILD b/main/nginx/APKBUILD
index e2a688b739..3077614731 100644
--- a/main/nginx/APKBUILD
+++ b/main/nginx/APKBUILD
@@ -5,11 +5,13 @@
pkgname=nginx
pkgver=1.6.2
_nginxrtmpver=1.1.6
-pkgrel=2
+pkgrel=3
pkgdesc="lightweight HTTP and reverse proxy server"
url="http://www.nginx.org"
arch="all"
license="Custom"
+pkgusers="nginx"
+pkggroups="nginx"
install="$pkgname.pre-install $pkgname.pre-upgrade"
makedepends="pcre-dev openssl-dev zlib-dev"
subpackages="$pkgname-doc $pkgname-vim:vim"
@@ -33,19 +35,28 @@ prepare() {
done
}
+_rundir=/var/run/$pkgname
+_logdir=/var/log/$pkgname
+_homedir=/var/lib/$pkgname
+_tmpdir=$_homedir/tmp
+_datadir=/usr/share/$pkgname
+_confdir=/etc/$pkgname
build() {
cd "$_builddir"
./configure \
- --prefix=/usr \
- --conf-path=/etc/$pkgname/$pkgname.conf \
- --pid-path=/var/run/$pkgname.pid \
- --lock-path=/var/run/$pkgname.lock \
- --error-log-path=/var/log/$pkgname/error.log \
- --http-log-path=/var/log/$pkgname/access.log \
- --http-client-body-temp-path=/tmp/$pkgname/client-body \
- --http-proxy-temp-path=/tmp/$pkgname/proxy \
- --http-fastcgi-temp-path=/tmp/$pkgname/fastcgi \
+ --prefix=$_datadir \
+ --sbin-path=/usr/sbin/$pkgname \
+ --conf-path=$_confdir/$pkgname.conf \
+ --pid-path=$_rundir/$pkgname.pid \
+ --lock-path=$_rundir/$pkgname.lock \
+ --error-log-path=$_logdir/error.log \
+ --http-log-path=$_logdir/access.log \
+ --http-client-body-temp-path=$_tmpdir/client_body \
+ --http-proxy-temp-path=$_tmpdir/proxy \
+ --http-fastcgi-temp-path=$_tmpdir/fastcgi \
+ --http-uwsgi-temp-path=$_tmpdir/uwsgi \
+ --http-scgi-temp-path=$_tmpdir/scgi \
--user=nginx \
--group=nginx \
--with-ipv6 \
@@ -64,13 +75,21 @@ build() {
package() {
cd "$_builddir"
- make DESTDIR="$pkgdir" install
+ make DESTDIR="$pkgdir" INSTALLDIRS=vendor install || return 1
install -m755 -D "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname
- install -m644 -D "$srcdir"/$pkgname.logrotate "$pkgdir"/etc/logrotate.d/$pkgname
+ install -m644 -D "$srcdir"/$pkgname.logrotate \
+ "$pkgdir"/etc/logrotate.d/$pkgname
install -m644 -D LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
install -m644 -D man/$pkgname.8 "$pkgdir"/usr/share/man/man8/$pkgname.8
+
+ install -d -m0755 "$pkgdir"/$_confdir/conf.d || return 1
+ install -d -m0755 "$pkgdir"/$_confdir/default.d || return 1
+ install -d -m0755 "$pkgdir"/var/www/localhost/htdocs || return 1
+ install -d -m0700 "$pkgdir"/$_homedir || return 1
+ install -d -m0700 "$pkgdir"/$_tmpdir || return 1
+ install -d -m0700 "$pkgdir"/$_logdir || return 1
}
vim() {
@@ -90,17 +109,17 @@ md5sums="d1b55031ae6e4bce37f8776b94d8b930 nginx-1.6.2.tar.gz
ceca9874cd89e6027fae8178f5c3af86 nginx-rtmp-module-1.1.6.tar.gz
3aeb488921109e60d02ed64d36790aeb musl-crypt-fix.patch
801a87f7f9d27f8ad85b41a78b4c4461 ipv6.patch
-9f5db5e24ce9f671978eb3b1b5e6e817 nginx.initd
+8c586f7a2fdce37e16717b76acccf471 nginx.initd
d3f30c25c84c55252a6babd9e9b0325b nginx.logrotate"
sha256sums="b5608c2959d3e7ad09b20fc8f9e5bd4bc87b3bc8ba5936a513c04ed8f1391a18 nginx-1.6.2.tar.gz
4039d1e7febd93188f729b594772d04d8a1137b2e90b12fa53bb061f200add87 nginx-rtmp-module-1.1.6.tar.gz
8c398640bd379c1c6a2fafcd2b3848a72902e47924e8e2490b312c141eec5d70 musl-crypt-fix.patch
a24ef5843ae0afa538b00c37eb7da7870f9d7f146f52a9668678f7296cf71d9b ipv6.patch
-4feea52915e03ab14ad985254b81a762ee29b9553993b63dd49bedb24a3ae416 nginx.initd
+d358482795e5f550852652ad246c4e1c8253355fdb26cc58f6d849a2a507f6c2 nginx.initd
6b89872994508cc7b4b225bca3301d7942767f37b8b691134141d95995740890 nginx.logrotate"
sha512sums="5698655ebe847bab7cc2531711f02e17257e361559ecf13d424019a5f8f07f54e78c4c73f97e5de063c4a70d13a236ca855b73a962053cd21d44f9621a5ac600 nginx-1.6.2.tar.gz
6db0cc5a3cff600a836483f9cc4ff76860e9c893167561ad818cb41e2eb4fa31af8a4213e42c7c5766e389aed0ad713cffe776aa4bc4ebf279dd63eb65d4162c nginx-rtmp-module-1.1.6.tar.gz
21114c775e4bdd1f7b8b9abc143284945e96ed1d8c49904ddf918abad87b16253f918ba47976cd2df32f0fdb8a7dad399d4200e879db2da6cf93a28aab236a75 musl-crypt-fix.patch
68d64a84568ec2df0366925ab282a05ebe21a85044b6c7844a47573cfd8cc8ed119cc772358bc3fff36e2d4fdf583a730592825f5f98632993ca86d1f8438d5f ipv6.patch
-3f302d782f81cb70634bcdf079c842b0783d8d492c3d2a9bb8e54aae0392818ee8ab2d85d2b718a3563c48edeb349f8443487d631310fcca7b70f91967417d47 nginx.initd
+fd7ceddee6e75e6c799fe9ec14e2ef7295f93b5c511f8f79a9f5fda9eaf0677d66d26184eea32f12479c620d8956cd657670c67e04d2d014447b441990996412 nginx.initd
fda91710185d6b801dd746c8c3678b5719b408de0b715bef7b1985f1ee17db1e8378d440759ea6234b1f70454a35870a2917bd1d6cd309ddc70e1c066fc8d4b8 nginx.logrotate"
diff --git a/main/nginx/nginx.initd b/main/nginx/nginx.initd
index 6c47db1d1c..f3fd6b65f1 100644
--- a/main/nginx/nginx.initd
+++ b/main/nginx/nginx.initd
@@ -6,31 +6,26 @@
extra_started_commands="upgrade reload"
extra_commands="configtest"
+conffile=/etc/nginx/nginx.conf
+
+pidfile=/var/run/nginx/nginx.pid
+command=/usr/sbin/nginx
+command_args="-c $conffile"
+
+
depend() {
need net
use dns logger netmount
}
-start() {
+start_pre() {
configtest || return 1
- ebegin "Starting nginx"
- start-stop-daemon --start --pidfile /var/run/nginx.pid \
- --exec /usr/sbin/nginx -- -c /etc/nginx/nginx.conf
- eend $? "Failed to start nginx"
-}
-
-stop() {
- configtest || return 1
- ebegin "Stopping nginx"
- start-stop-daemon --stop --pidfile /var/run/nginx.pid
- eend $? "Failed to stop nginx"
- rm -f /var/run/nginx.pid
}
reload() {
configtest || return 1
ebegin "Refreshing nginx' configuration"
- kill -HUP `cat /var/run/nginx.pid` &>/dev/null
+ kill -HUP `cat $pidfile` &>/dev/null
eend $? "Failed to reload nginx"
}
@@ -39,26 +34,26 @@ upgrade() {
ebegin "Upgrading nginx"
einfo "Sending USR2 to old binary"
- kill -USR2 `cat /var/run/nginx.pid` &>/dev/null
+ kill -USR2 `cat $pidfile` &>/dev/null
einfo "Sleeping 3 seconds before pid-files checking"
sleep 3
- if [ ! -f /var/run/nginx.pid.oldbin ]; then
- eerror "File with old pid not found"
+ if [ ! -f $pidfile.oldbin ]; then
+ eerror "File with old pid ($pidfile.oldbin) not found"
return 1
fi
- if [ ! -f /var/run/nginx.pid ]; then
+ if [ ! -f $pidfile ]; then
eerror "New binary failed to start"
return 1
fi
einfo "Sleeping 3 seconds before WINCH"
- sleep 3 ; kill -WINCH `cat /var/run/nginx.pid.oldbin`
+ sleep 3 ; kill -WINCH `cat $pidfile.oldbin`
einfo "Sending QUIT to old binary"
- kill -QUIT `cat /var/run/nginx.pid.oldbin`
+ kill -QUIT `cat $pidfile.oldbin`
einfo "Upgrade completed"
@@ -67,7 +62,8 @@ upgrade() {
configtest() {
ebegin "Checking nginx' configuration"
- mkdir -p /tmp/nginx
- /usr/sbin/nginx -c /etc/nginx/nginx.conf -tq
+ checkpath --directory --owner nginx:nginx ${pidfile%/*}
+ $command -c $conffile -tq
eend $? "failed, please correct errors above"
}
+