Cameron Banta: 1 main/nginx New package 3 files changed, 127 insertions(+), 0 deletions(-)
Copy & paste the following snippet into your terminal to import this patchset into git:
curl -s https://lists.alpinelinux.org/~alpine/devel/patches/150/mbox | git am -3Learn more about email & git
--- main/nginx/APKBUILD | 58 ++++++++++++++++++++++++++++++++++++++++++++ main/nginx/nginx.confd | 7 +++++ main/nginx/nginx.initd | 62 ++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 127 insertions(+), 0 deletions(-) create mode 100644 main/nginx/APKBUILD create mode 100644 main/nginx/nginx.confd create mode 100644 main/nginx/nginx.initd diff --git a/main/nginx/APKBUILD b/main/nginx/APKBUILD
Natanael Copa <ncopa@alpinelinux.org>We normally add new packages to testing/ first
new file mode 100644 index 0000000..b35beab --- /dev/null +++ b/main/nginx/APKBUILD @@ -0,0 +1,58 @@ +# Contributor: Cameron Banta <cbanta@gmail.com> +# Maintainer: Cameron Banta <cbanta@gmail.com> +pkgname=nginx +pkgver=0.8.53 +pkgrel=0 +pkgdesc="nginx [engine x] is a HTTP and reverse proxy server" +url="nginx.org" +license="Custom" +depends= +makedepends="pcre-dev openssl-dev libcrypto1.0 zlib-dev" +#install="$pkgname.pre-install $pkgname.post-install" +install= +subpackages= +source="http://nginx.org/download/$pkgname-$pkgver.tar.gz + nginx.initd + nginx.confd + $install + " + +# append extra dependencies to -dev subpackage +# remove if not used. +# depends_dev="somepackage-dev"
Natanael Copa <ncopa@alpinelinux.org>The 3 comment lines above should be removed.
+ +_builddir="$srcdir"/$pkgname-$pkgver +
Natanael Copa <ncopa@alpinelinux.org>[cutted the part that looked good]
+prepare() { + cd "$_builddir" + # apply patches here +} + +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 \ + --with-http_ssl_module \ + --with-http_gzip_static_module \ + --http-client-body-temp-path=/tmp/$pkgname/client-body \ + --http-proxy-temp-path=/tmp/$pkgname/proxy \ + --http-fastcgi-temp-path=/tmp/$pkgname/fastcgi \ + || return 1 + make || return 1 +} + +package() { + cd "$_builddir" + make DESTDIR="$pkgdir" install + + install -m755 -D "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname + install -m644 -D "$srcdir"/$pkgname.confd "$pkgdir"/etc/conf.d/$pkgname +} + +md5sums="717eaea1b34e8663849f64b9aa05a9da nginx-0.8.53.tar.gz +17e4af92572333c32fed04e2e0fc9b7e nginx.initd +cbcac88f5b728b1441891947a4babbcb nginx.confd" diff --git a/main/nginx/nginx.confd b/main/nginx/nginx.confd new file mode 100644 index 0000000..486252b --- /dev/null +++ b/main/nginx/nginx.confd @@ -0,0 +1,7 @@ +# Sample conf.d file for alpine linux + +# +# Specify daemon options here. +# + +sample_opts="" diff --git a/main/nginx/nginx.initd b/main/nginx/nginx.initd new file mode 100644 index 0000000..0464f5c --- /dev/null +++ b/main/nginx/nginx.initd @@ -0,0 +1,62 @@ +#! /bin/sh
Natanael Copa <ncopa@alpinelinux.org>Should be #!/sbin/runscript
+ +### BEGIN INIT INFO +# Provides: nginx +# Required-Start: $all +# Required-Stop: $all +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: starts the nginx web server +# Description: starts nginx using start-stop-daemon +### END INIT INFO
Natanael Copa <ncopa@alpinelinux.org>No. We use openrc (like gentoo) which does not understand the above service dependency info. The init.d needs to be rewritten to fit the rest of the system. Thanks! -ncCameron Banta <cbanta@gmail.com>Ok, I'm looking for the gentoo init script. -Cameron --- Unsubscribe: alpine-devel+unsubscribe@lists.alpinelinux.org Help: alpine-devel+help@lists.alpinelinux.org ------ Unsubscribe: alpine-devel+unsubscribe@lists.alpinelinux.org Help: alpine-devel+help@lists.alpinelinux.org ---
+ +PATH=/usr/sbin:/usr/bin:/sbin:/bin:/usr/sbin:/usr/bin +DAEMON=/usr/sbin/nginx +NAME=nginx +DESC=nginx + +test -x $DAEMON || exit 0 + +# Include nginx defaults if available +if [ -f /etc/conf.d/nginx ] ; then + . /etc/conf.d/nginx +fi + +set -e + +case "$1" in + start) + echo -n "Starting $DESC: " + start-stop-daemon --start --quiet --pidfile /var/run/nginx.pid \ + --exec $DAEMON -- $DAEMON_OPTS + echo "$NAME." + ;; + stop) + echo -n "Stopping $DESC: " + start-stop-daemon --stop --quiet --pidfile /var/run/nginx.pid \ + --exec $DAEMON + echo "$NAME." + ;; + restart|force-reload) + echo -n "Restarting $DESC: " + start-stop-daemon --stop --quiet --pidfile \ + /var/run/nginx.pid --exec $DAEMON + sleep 1 + start-stop-daemon --start --quiet --pidfile \ + /var/run/nginx.pid --exec $DAEMON -- $DAEMON_OPTS + echo "$NAME." + ;; + reload) + echo -n "Reloading $DESC configuration: " + start-stop-daemon --stop --signal HUP --quiet --pidfile /var/run/nginx.pid \ + --exec $DAEMON + echo "$NAME." + ;; + *) + N=/etc/init.d/$NAME + echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2 + exit 1 + ;; +esac + +exit 0 -- 1.7.3.2 --- Unsubscribe: alpine-devel+unsubscribe@lists.alpinelinux.org Help: alpine-devel+help@lists.alpinelinux.org ---
Natanael Copa <ncopa@alpinelinux.org>Thanks for the apkbuild. We are in the middle of the 2.1 release. Is the release worth delaying for this package? On Mon, 2010-11-01 at 15:20 +0000, Cameron Banta wrote: