Skip to contentSkip to conversation

package/nginx: new package

PATCH New Samuel Martin 2 participants 2 messages Oct 5, 2014

lore
Share & tools
lore
#0 lore raw

PATCH v6 1/1 package/nginx: new package

nginx module selection is, by default, the same as the one sets by the upstream configure script.

Patches improving the cross-compilation support have already been sent upstream for integration [1-5].

All these patches are needed because nginx uses its own handwritten build-system, which is cross-platform, but does not properly support cross-compilation.

Fixes bug: #3427 [6]

[1] http://mailman.nginx.org/pipermail/nginx-devel/2014-August/005722.html
[2] http://mailman.nginx.org/pipermail/nginx-devel/2014-August/005724.html
[3] http://mailman.nginx.org/pipermail/nginx-devel/2014-August/005725.html
[4] http://mailman.nginx.org/pipermail/nginx-devel/2014-August/005723.html
[5] http://mailman.nginx.org/pipermail/nginx-devel/2014-August/005726.html
[6] https://bugs.uclibc.org/show_bug.cgi?id=3427

Cc Daniele Salvatore Albano <[email protected]>
Cc Maxime Hadjinlian <[email protected]>
Cc Johan Oudinet <[email protected]>
Cc Thomas Petazzoni <[email protected]>
Cc Gustavo Zacarias <[email protected]>

---
changes v5 -> v6:
- update NGINX_{DEPENDENCIES,CONF_OPTS} wrt to SPDY changes in v5

changes v4 -> v5:
- rebase
- rename NGINX_*_OPT -> NGINX_*_OPTS
- fix missing 'select ...' (GustavoZ)
- add 'mkdir ...' logdir and tmpdir in nginx service files (GustavoZ)

changes v3 -> v4:

- rebase
- bump to latest stable version
- fix sysv init script (JohanO)
- fix misc. paths (prefix, sbin, log, temp., etc) (JohanO)
- update nginx.service

changes v2 -> v3:
- rollback to stable release (1.6.0) instead of latest one (Gustavo)
- add comments in nginx.mk
- extend commit log

changes v1 -> v2:
- add SSL module knobs (ThomasP)
- turn all BR2_PACKAGE_* symbols fully uppercase (ThomasP)
- add pid file option to start-stop-daemon (ThomasP)
- do not pass default "-I..." "-L..." locations (ThomasP)
- fix --prefix (ThomasP)
- fix missing brackets

---
 package/Config.in                                  |   1 +
 package/nginx/Config.in                            | 326 +++++++++++++++++++++
 package/nginx/S50nginx                             |  25 ++
 ...izeof-rework-autotest-to-be-cross-compila.patch |  88 ++++++
 ...e-add-mechanism-allowing-to-force-feature.patch | 135 +++++++++
 ...x_feature_run_force_result-for-each-featu.patch | 209 +++++++++++++
 ...bxslt-conf-allow-to-override-ngx_feature_.patch |  42 +++
 ...nix-make-sys_nerr-guessing-cross-friendly.patch | 133 +++++++++
 package/nginx/nginx.logrotate                      |   9 +
 package/nginx/nginx.mk                             | 240 +++++++++++++++
 package/nginx/nginx.service                        |  15 +
 11 files changed, 1223 insertions(+)
 create mode 100644 package/nginx/Config.in
 create mode 100755 package/nginx/S50nginx
 create mode 100644 package/nginx/nginx-0001-auto-type-sizeof-rework-autotest-to-be-cross-compila.patch
 create mode 100644 package/nginx/nginx-0002-auto-feature-add-mechanism-allowing-to-force-feature.patch
 create mode 100644 package/nginx/nginx-0003-auto-set-ngx_feature_run_force_result-for-each-featu.patch
 create mode 100644 package/nginx/nginx-0004-auto-lib-libxslt-conf-allow-to-override-ngx_feature_.patch
 create mode 100644 package/nginx/nginx-0005-auto-unix-make-sys_nerr-guessing-cross-friendly.patch
 create mode 100644 package/nginx/nginx.logrotate
 create mode 100644 package/nginx/nginx.mk
 create mode 100644 package/nginx/nginx.service
package/Config.in +1 -0
index 6f55e02..215068f 100644
@@ -1036,6 +1036,7 @@ endif
 	source "package/network-manager/Config.in"
 	source "package/nfacct/Config.in"
 	source "package/nftables/Config.in"
+	source "package/nginx/Config.in"
 	source "package/ngircd/Config.in"
 	source "package/ngrep/Config.in"
 	source "package/nmap/Config.in"
package/nginx/Config.in new file +326 -0

326 lines not on this page · raw message

package/nginx/S50nginx new file +25 -0
new file mode 100755
index 0000000..f555d93
@@ -0,0 +1,25 @@
+#!/bin/sh
+#
+# Start/stop nginx
+#
+
+PIDFILE=/var/run/nginx.pid
+
+case "$1" in
+  start)
+	echo "Starting nginx..."
+	mkdir -p /var/log/nginx /var/tmp/nginx
+	start-stop-daemon -S -x /usr/sbin/nginx -p $PIDFILE
+	;;
+  stop)
+	echo -n "Stopping nginx..."
+	start-stop-daemon -K -o -p $PIDFILE
+	;;
+  restart|reload)
+	"$0" stop
+	"$0" start
+	;;
+  *)
+	echo "Usage: $0 {start|stop|restart}"
+	exit 1
+esac
package/nginx/nginx-0001-auto-type-sizeof-rework-autotest-to-be-cross-compila.patch new file +88 -0

88 lines not on this page · raw message

package/nginx/nginx-0002-auto-feature-add-mechanism-allowing-to-force-feature.patch new file +135 -0

135 lines not on this page · raw message

package/nginx/nginx-0003-auto-set-ngx_feature_run_force_result-for-each-featu.patch new file +209 -0

209 lines not on this page · raw message

package/nginx/nginx-0004-auto-lib-libxslt-conf-allow-to-override-ngx_feature_.patch new file +42 -0

42 lines not on this page · raw message

package/nginx/nginx-0005-auto-unix-make-sys_nerr-guessing-cross-friendly.patch new file +133 -0

133 lines not on this page · raw message

package/nginx/nginx.logrotate new file +9 -0
new file mode 100644
index 0000000..e0fa9ec
@@ -0,0 +1,9 @@
+/var/log/nginx/*log {
+	missingok
+	create 640 http log
+	sharedscripts
+	compress
+	postrotate
+		test ! -r /var/run/nginx.pid || kill -USR1 `cat /var/run/nginx.pid`
+	endscript
+}
package/nginx/nginx.mk new file +240 -0

240 lines not on this page · raw message

package/nginx/nginx.service new file +15 -0
new file mode 100644
index 0000000..619755f
@@ -0,0 +1,15 @@
+[Unit]
+Description=A high performance web server and a reverse proxy server
+After=syslog.target network.target
+
+[Service]
+Type=forking
+PIDFile=/var/run/nginx.pid
+ExecStartPre=/usr/bin/mkdir -p /var/log/nginx /var/tmp/nginx; /usr/sbin/nginx -t -q -g 'pid /var/run/nginx.pid; daemon on; master_process on;'
+ExecStart=/usr/sbin/nginx -g 'pid /var/run/nginx.pid; daemon on; master_process on;'
+ExecReload=/usr/sbin/nginx -g 'pid /var/run/nginx.pid; daemon on; master_process on;' -s reload
+ExecStop=/usr/sbin/nginx -g 'pid /var/run/nginx.pid;' -s quit
+PrivateDevices=yes
+
+[Install]
+WantedBy=multi-user.target
Signature · 1 line
2.1.2
#1 lore raw

PATCH v6 1/1 package/nginx: new package

Dear Samuel Martin,

Quoted 19 lines · Samuel Martin

nginx module selection is, by default, the same as the one sets by the upstream configure script.

Patches improving the cross-compilation support have already been sent upstream for integration [1-5].

All these patches are needed because nginx uses its own handwritten build-system, which is cross-platform, but does not properly support cross-compilation.

Fixes bug: #3427 [6]

[1] http://mailman.nginx.org/pipermail/nginx-devel/2014-August/005722.html
[2] http://mailman.nginx.org/pipermail/nginx-devel/2014-August/005724.html
[3] http://mailman.nginx.org/pipermail/nginx-devel/2014-August/005725.html
[4] http://mailman.nginx.org/pipermail/nginx-devel/2014-August/005723.html
[5] http://mailman.nginx.org/pipermail/nginx-devel/2014-August/005726.html
[6] https://bugs.uclibc.org/show_bug.cgi?id=3427

Quoted 6 lines
Cc Daniele Salvatore Albano <[email protected]>
Cc Maxime Hadjinlian <[email protected]>
Cc Johan Oudinet <[email protected]>
Cc Thomas Petazzoni <[email protected]>
Cc Gustavo Zacarias <[email protected]>

Thanks, patch applied.

I have a couple of comments though, maybe to address as followup patches:

* Why is the package installing a logrotate file? I don't think any other Buildroot package does that. Maybe it's a good idea, but shouldn't it be conditional on whether a logrotate implementation is installed?

* It might be good to add the hash file.

* When running nginx, I get the following error/warnings:

nginx (526): undefined instruction: pc=76de93ac

Code: 00000000 f26ee1fe e12fff1e ee190f1d (e12fff1e) 

warning: process `nginx' used the deprecated sysctl system call with 1.33.

It seems to run fine, though, but that's a bit scary. It happens with the following configuration:

BR2_arm=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y
BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y BR2_TOOLCHAIN_EXTERNAL_URL="http://autobuild.buildroot.org/toolchains/tarballs/br-arm-full-2014.08.tar.bz2" BR2_TOOLCHAIN_EXTERNAL_HEADERS_3_16=y
BR2_TOOLCHAIN_EXTERNAL_LARGEFILE=y
BR2_TOOLCHAIN_EXTERNAL_INET_IPV6=y
BR2_TOOLCHAIN_EXTERNAL_LOCALE=y
# BR2_TOOLCHAIN_EXTERNAL_HAS_THREADS_DEBUG is not set
BR2_TOOLCHAIN_EXTERNAL_INET_RPC=y
BR2_TOOLCHAIN_EXTERNAL_CXX=y
BR2_TARGET_GENERIC_GETTY_PORT="ttyAMA0"
BR2_PACKAGE_NGINX=y
BR2_PACKAGE_NGINX_HTTP_CACHE=y
BR2_PACKAGE_NGINX_HTTP_SSL_MODULE=y
BR2_PACKAGE_NGINX_HTTP_SPDY_MODULE=y
BR2_PACKAGE_NGINX_HTTP_REALIP_MODULE=y
BR2_PACKAGE_NGINX_HTTP_ADDITION_MODULE=y
BR2_PACKAGE_NGINX_HTTP_XSLT_MODULE=y
BR2_PACKAGE_NGINX_HTTP_IMAGE_FILTER_MODULE=y
BR2_PACKAGE_NGINX_HTTP_SUB_MODULE=y
BR2_PACKAGE_NGINX_HTTP_DAV_MODULE=y
BR2_PACKAGE_NGINX_HTTP_FLV_MODULE=y
BR2_PACKAGE_NGINX_HTTP_MP4_MODULE=y
BR2_PACKAGE_NGINX_HTTP_GUNZIP_MODULE=y
BR2_PACKAGE_NGINX_HTTP_GZIP_STATIC_MODULE=y
BR2_PACKAGE_NGINX_HTTP_AUTH_REQUEST_MODULE=y
BR2_PACKAGE_NGINX_HTTP_RANDOM_INDEX_MODULE=y
BR2_PACKAGE_NGINX_HTTP_SECURE_LINK_MODULE=y
BR2_PACKAGE_NGINX_HTTP_DEGRADATION_MODULE=y
BR2_PACKAGE_NGINX_HTTP_STUB_STATUS_MODULE=y
BR2_PACKAGE_NGINX_MAIL=y
BR2_PACKAGE_NGINX_MAIL_SSL_MODULE=y
BR2_PACKAGE_NGINX_RTSIG_MODULE=y
BR2_PACKAGE_NGINX_SELECT_MODULE=y
BR2_PACKAGE_NGINX_POLL_MODULE=y

Tested under Qemu vexpress.

Thanks,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com