Patchwork [meta-oe,v3] add nostromo webserver

login
register
mail settings
Submitter Eric BENARD
Date Dec. 4, 2011, 4:20 p.m.
Message ID <1323015614-1952-1-git-send-email-eric@eukrea.com>
Download mbox | patch
Permalink /patch/16157/
State Superseded, archived
Headers show

Comments

Eric BENARD - Dec. 4, 2011, 4:20 p.m.
this recipe was imported from OE-classic and upgraded to latest
version

Signed-off-by: Eric Bénard <eric@eukrea.com>
---
 .../recipes-extended/nostromo/files/nhttpd.conf    |   55 ++++++++++++++++++++
 meta-oe/recipes-extended/nostromo/files/nostromo   |   34 ++++++++++++
 meta-oe/recipes-extended/nostromo/files/volatiles  |    2 +
 .../recipes-extended/nostromo/nostromo_1.9.5.bb    |   54 +++++++++++++++++++
 4 files changed, 145 insertions(+), 0 deletions(-)
 create mode 100644 meta-oe/recipes-extended/nostromo/files/nhttpd.conf
 create mode 100644 meta-oe/recipes-extended/nostromo/files/nostromo
 create mode 100644 meta-oe/recipes-extended/nostromo/files/volatiles
 create mode 100644 meta-oe/recipes-extended/nostromo/nostromo_1.9.5.bb
Koen Kooi - Dec. 4, 2011, 6 p.m.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Op 04-12-11 17:20, Eric Bénard schreef:

> +pkg_postinst_${PN}_prepend() { +    chown -R www-data:www-data
> ${localstatedir}/nostromo ${localstatedir}/log/nostromo
> ${localstatedir}/run/nostromo +    /etc/init.d/populate-volatile.sh
> update

The chown can be done in during build IIRC, the volation call needs to check
if /etc/init.d/populate-volatile.sh is actually available since it's a
sysvinit ism.

regards,

Koen

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (Darwin)
Comment: GPGTools - http://gpgtools.org

iEYEARECAAYFAk7btUkACgkQMkyGM64RGpGSKwCfcUN5iUmbzX1R7rsGlTMLIIS2
xKIAn0A9PT/UrgCAVRWKokhKh8BnLgHM
=hXmg
-----END PGP SIGNATURE-----
Eric BENARD - Dec. 6, 2011, 1:22 p.m.
Hi Koen,

is there anything left preventing pushing these 4 patches (pcsc-lite, atftp, 
net-snmp, nostromo) ?

Thanks
Eric
Koen Kooi - Dec. 6, 2011, 3:36 p.m.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Op 06-12-11 14:22, Eric Bénard schreef:
> Hi Koen,
> 
> is there anything left preventing pushing these 4 patches (pcsc-lite,
> atftp, net-snmp, nostromo) ?

No, I'll pull them in from patchwork now.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (Darwin)
Comment: GPGTools - http://gpgtools.org

iEYEARECAAYFAk7eNmcACgkQMkyGM64RGpHgZgCeKCaVS2BRqlV8ZRjLEmQwe+7B
OlwAoKVpNdyEIavJ2kVQ2NZZCTatXaAp
=bDQD
-----END PGP SIGNATURE-----
Eric BENARD - Dec. 6, 2011, 3:41 p.m.
Le 06/12/2011 16:36, Koen Kooi a écrit :
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Op 06-12-11 14:22, Eric Bénard schreef:
>> Hi Koen,
>>
>> is there anything left preventing pushing these 4 patches (pcsc-lite,
>> atftp, net-snmp, nostromo) ?
>
> No, I'll pull them in from patchwork now.
>
thanks
Eric

Patch

diff --git a/meta-oe/recipes-extended/nostromo/files/nhttpd.conf b/meta-oe/recipes-extended/nostromo/files/nhttpd.conf
new file mode 100644
index 0000000..6674bb6
--- /dev/null
+++ b/meta-oe/recipes-extended/nostromo/files/nhttpd.conf
@@ -0,0 +1,55 @@ 
+# MAIN [MANDATORY]
+
+servername		localhost
+#servername		www.nazgul.ch:8080
+serverlisten		*
+#serverlisten		81.221.21.250 127.0.0.1 ::1
+serveradmin		webmaster@localhost
+serverroot		/var/nostromo
+servermimes		/var/nostromo/conf/mimes
+docroot			/var/nostromo/htdocs
+docindex		index.html
+
+# LOGS [OPTIONAL]
+
+logpid			/var/run/nostromo/nhttpd.pid
+#logaccess		/var/log/nostromo/access_log
+
+# SETUID [RECOMMENDED]
+
+user			www-data
+
+# BASIC AUTHENTICATION [OPTIONAL]
+
+#htaccess		.htaccess
+#htpasswd		/var/nostromo/conf/.htpasswd
+#htpasswd		+bsdauth
+#htpasswd		+bsdauthnossl
+
+# SSL [OPTIONAL]
+
+#sslport		443
+#sslcert		/etc/ssl/server.crt
+#sslcertkey		/etc/ssl/server.key
+
+# CUSTOM RESPONSES [OPTIONAL]
+#
+# The custom responses are searched in the corresponding document root.
+
+#custom_401		custom_401.html
+#custom_403		custom_403.html
+#custom_404		custom_404.html
+
+# ALIASES [OPTIONAL]
+
+/icons			/var/nostromo/icons
+
+# VIRTUAL HOSTS [OPTIONAL]
+
+#www.rahel.ch		/var/nostromo/htdocs/www.rahel.ch
+#www.rahel.ch:8080	/var/nostromo/htdocs/www.rahel.ch
+
+# HOMEDIRS [OPTIONAL]
+
+#homedirs		/home
+#homedirs_public	public_www
diff --git a/meta-oe/recipes-extended/nostromo/files/nostromo b/meta-oe/recipes-extended/nostromo/files/nostromo
new file mode 100644
index 0000000..8a28868
--- /dev/null
+++ b/meta-oe/recipes-extended/nostromo/files/nostromo
@@ -0,0 +1,34 @@ 
+#!/bin/sh
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+DAEMON=nhttpd
+NAME=nhttpd
+DESC="Nostromo Web Server"
+OPTS="-c /etc/nhttpd.conf"
+
+case "$1" in
+  start)
+	echo -n "Starting $DESC: "
+	start-stop-daemon --start -x "$DAEMON" -- $OPTS
+	echo "$NAME."
+	;;
+  stop)
+	echo -n "Stopping $DESC: "
+	start-stop-daemon --stop -x "$DAEMON"
+	echo "$NAME."
+	;;
+  restart|force-reload)
+	echo -n "Restarting $DESC: "
+	start-stop-daemon --stop -x "$DAEMON"
+	sleep 1
+	start-stop-daemon --start -x "$DAEMON" -- $OPTS
+	echo "$NAME."
+	;;
+  *)
+	N=/etc/init.d/$NAME
+	echo "Usage: $N {start|stop|restart|force-reload}" >&2
+	exit 1
+	;;
+esac
+
+exit 0
diff --git a/meta-oe/recipes-extended/nostromo/files/volatiles b/meta-oe/recipes-extended/nostromo/files/volatiles
new file mode 100644
index 0000000..4092496
--- /dev/null
+++ b/meta-oe/recipes-extended/nostromo/files/volatiles
@@ -0,0 +1,2 @@ 
+d www-data www-data 0775 /var/run/nostromo none
+d www-data www-data 0775 /var/log/nostromo none
diff --git a/meta-oe/recipes-extended/nostromo/nostromo_1.9.5.bb b/meta-oe/recipes-extended/nostromo/nostromo_1.9.5.bb
new file mode 100644
index 0000000..ee326d2
--- /dev/null
+++ b/meta-oe/recipes-extended/nostromo/nostromo_1.9.5.bb
@@ -0,0 +1,54 @@ 
+HOMEPAGE = "http://www.nazgul.ch/dev_nostromo.html"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://src/nhttpd/main.c;beginline=2;endline=14;md5=e5ec3fa723b29b7d59d205afd8d36938"
+
+SRC_URI = "http://www.nazgul.ch/dev/${PN}-${PV}.tar.gz \
+           file://nhttpd.conf \
+           file://volatiles \
+           file://nostromo \
+           "
+
+TARGET_CC_ARCH += "${LDFLAGS}"
+
+DEPENDS = "openssl"
+
+inherit update-rc.d
+
+INITSCRIPT_NAME = "nostromo"
+INITSCRIPT_PARAMS = "defaults 70"
+
+do_compile() {
+    oe_runmake
+}
+
+do_install() {
+    install -d ${D}/${sbindir}
+    install -m 0755 src/nhttpd/nhttpd ${D}/${sbindir}/nhttpd
+    install -m 0755 src/tools/crypt ${D}/${sbindir}/crypt
+    install -d ${D}/${mandir}/man8
+    install -m 0444 src/nhttpd/nhttpd.8 ${D}/${mandir}/man8/nhttpd.8
+    install -d ${D}${localstatedir}/nostromo/conf
+    install -d ${D}${localstatedir}/nostromo/htdocs/cgi-bin
+    install -d ${D}${localstatedir}/nostromo/icons
+    install -d ${D}${localstatedir}/log/nostromo
+    install -d ${D}${localstatedir}/run/nostromo
+    install -d ${D}${sysconfdir}/init.d
+    install -m 0644 conf/mimes ${D}${localstatedir}/nostromo/conf/mimes
+    install -m 0644 ${WORKDIR}/nhttpd.conf ${D}${sysconfdir}
+    install -m 0755 ${WORKDIR}/nostromo ${D}${sysconfdir}/init.d
+    install -c -D -m 644 ${WORKDIR}/volatiles ${D}${sysconfdir}/default/volatiles/nostromo
+    install -m 0644 htdocs/index.html ${D}${localstatedir}/nostromo/htdocs/index.html
+    install -m 0644 htdocs/nostromo.gif ${D}${localstatedir}/nostromo/htdocs/nostromo.gif
+    install -m 0644 icons/dir.gif ${D}${localstatedir}/nostromo/icons/dir.gif
+    install -m 0644 icons/file.gif ${D}${localstatedir}/nostromo/icons/file.gif
+}
+
+pkg_postinst_${PN}_prepend() {
+    chown -R www-data:www-data  ${localstatedir}/nostromo ${localstatedir}/log/nostromo ${localstatedir}/run/nostromo
+    /etc/init.d/populate-volatile.sh update
+}
+
+SRC_URI[md5sum] = "dc6cfd6b5aae04c370c7f818fa7bde55"
+SRC_URI[sha256sum] = "5f62578285e02449406b46cf06a7888fe3dc4a90bedf58cc18523bad62f6b914"
+
+CONFFILES_${PN} += "/var/nostromo/conf/mimes ${sysconfdir}/nhttpd.conf"