[csw-devel] SF.net SVN: gar:[2773] csw/mgar/pkg/nginx/trunk

aigoshin at users.sourceforge.net aigoshin at users.sourceforge.net
Fri Jan 9 18:40:31 CET 2009


Revision: 2773
          http://gar.svn.sourceforge.net/gar/?rev=2773&view=rev
Author:   aigoshin
Date:     2009-01-09 17:40:31 +0000 (Fri, 09 Jan 2009)

Log Message:
-----------
nginx: milestone 1

Modified Paths:
--------------
    csw/mgar/pkg/nginx/trunk/Makefile

Added Paths:
-----------
    csw/mgar/pkg/nginx/trunk/files/CSWnginx.gspec
    csw/mgar/pkg/nginx/trunk/files/cswnginx
    csw/mgar/pkg/nginx/trunk/files/cswnginx.xml
    csw/mgar/pkg/nginx/trunk/files/svc-cswnginx

Modified: csw/mgar/pkg/nginx/trunk/Makefile
===================================================================
--- csw/mgar/pkg/nginx/trunk/Makefile	2009-01-09 17:39:56 UTC (rev 2772)
+++ csw/mgar/pkg/nginx/trunk/Makefile	2009-01-09 17:40:31 UTC (rev 2773)
@@ -11,22 +11,25 @@
 MASTER_SITES = http://sysoev.ru/nginx/
 DISTFILES  = $(GARNAME)-$(GARVERSION).tar.gz
 DISTFILES += $(call admfiles,CSWnginx,)
+DISTFILES += cswnginx cswnginx.xml svc-cswnginx
 
 # We define upstream file regex so we can be notifed of new upstream software release
 UFILES_REGEX = -(\d+(?:\.\d+)*).tar.gz
 
-PREREQUISITE_PKGS = CSWpcre CSWosslrt CSWzlib
+REQUIRED_PKGS = CSWosslrt CSWpcre  CSWzlib
 
-CONFIGURE_ARGS += --prefix=$(prefix)
-CONFIGURE_ARGS += --conf-path=etc/nginx/nginx.conf
-CONFIGURE_ARGS += --sbin-path=sbin/nginx
-CONFIGURE_ARGS += --lock-path=var/run/nginx/nginx.lock
-CONFIGURE_ARGS += --pid-path=var/run/nginx/nginx.pid
-CONFIGURE_ARGS += --http-client-body-temp-path=var/spool/nginx/client
-CONFIGURE_ARGS += --http-fastcgi-temp-path=var/spool/nginx/fastcgi
-CONFIGURE_ARGS += --http-proxy-temp-path=var/spool/nginx/proxy
-CONFIGURE_ARGS += --error-log-path=var/log/nginx/error.log
-CONFIGURE_ARGS += --http-log-path=var/log/nginx/access.log
+GARCOMPILER = GNU
+
+CONFIGURE_ARGS += --prefix=$(prefix)/var/nginx
+CONFIGURE_ARGS += --conf-path=$(sysconfdir)/nginx/nginx.conf
+CONFIGURE_ARGS += --sbin-path=$(sbindir)/nginx
+CONFIGURE_ARGS += --lock-path=$(prefix)/var/run/nginx/nginx.lock
+CONFIGURE_ARGS += --pid-path=$(prefix)/var/run/nginx/nginx.pid
+CONFIGURE_ARGS += --http-client-body-temp-path=$(prefix)/var/spool/nginx/client
+CONFIGURE_ARGS += --http-fastcgi-temp-path=$(prefix)/var/spool/nginx/fastcgi
+CONFIGURE_ARGS += --http-proxy-temp-path=$(prefix)/var/spool/nginx/proxy
+CONFIGURE_ARGS += --error-log-path=$(prefix)/var/log/nginx/error.log
+CONFIGURE_ARGS += --http-log-path=$(prefix)/var/log/nginx/access.log
 CONFIGURE_ARGS += --with-cc-opt="-I/opt/csw/include/openssl"
 CONFIGURE_ARGS += --with-ld-opt="-L/opt/csw/lib"
 CONFIGURE_ARGS += --with-md5=YES
@@ -37,34 +40,25 @@
 CONFIGURE_ARGS += --with-http_flv_module
 CONFIGURE_ARGS += --with-http_stub_status_module
 
-include gar/category.mk
-
-# No test suite
 TEST_SCRIPTS =
 
-INSTALL_SCRIPTS = custom
+include gar/category.mk
 
 NGINXDOC=CHANGES CHANGES.ru LICENSE README
 
-install-custom:
-	ginstall -d $(DESTDIR)$(prefix)/etc
+post-install:
+	ginstall -d $(DESTDIR)$(sysconfdir)
+	ginstall -d $(DESTDIR)$(sharedstatedir)/nginx/contrib
+	ginstall -d $(DESTDIR)$(docdir)/nginx
 	ginstall -d $(DESTDIR)$(prefix)/sbin
 	ginstall -d $(DESTDIR)$(prefix)/var/nginx
-	ginstall -d $(DESTDIR)$(prefix)/var/nginx/html
 	ginstall -d $(DESTDIR)$(prefix)/var/nginx/sites
 	ginstall -d $(DESTDIR)$(prefix)/var/log/nginx
 	ginstall -d $(DESTDIR)$(prefix)/var/spool/nginx
 	ginstall -d $(DESTDIR)$(prefix)/var/spool/nginx/client
 	ginstall -d $(DESTDIR)$(prefix)/var/spool/nginx/fastcgi
 	ginstall -d $(DESTDIR)$(prefix)/var/spool/nginx/proxy
-	ginstall -d $(DESTDIR)$(prefix)/share/doc/nginx
 	cd $(WORKSRC); \
-	cp objs/nginx $(DESTDIR)$(prefix)/sbin; \
-	cp html/* $(DESTDIR)$(prefix)/var/nginx/html; \
-	cp conf/* $(DESTDIR)$(prefix)/etc; \
-	cp conf/fastcgi_params $(DESTDIR)$(prefix)/etc/fastcgi_params.default; \
-	cp conf/mime.types     $(DESTDIR)$(prefix)/etc/mime.types.default; \
-	cp conf/nginx.conf     $(DESTDIR)$(prefix)/etc/nginx.conf.default; \
-	cp $(NGINXDOC) $(DESTDIR)$(prefix)/share/doc/nginx; \
+	cp -r contrib/* $(DESTDIR)$(sharedstatedir)/nginx/contrib; \
+	cp $(NGINXDOC)  $(DESTDIR)$(docdir)/nginx; \
 	$(MAKECOOKIE)
-

Added: csw/mgar/pkg/nginx/trunk/files/CSWnginx.gspec
===================================================================
--- csw/mgar/pkg/nginx/trunk/files/CSWnginx.gspec	                        (rev 0)
+++ csw/mgar/pkg/nginx/trunk/files/CSWnginx.gspec	2009-01-09 17:40:31 UTC (rev 2773)
@@ -0,0 +1,10 @@
+%var            bitname nginx
+%var            pkgname CSWnginx
+%include        url file://%{PKGLIB}/csw_dyndepend.gspec
+%copyright      url file://%{WORKSRC}/LICENSE
+%var            SERVICE_CONF_FILES /opt/csw/etc/nginx/nginx.conf       
+%include        url file://%{PKGLIB}/smf_enabled.gspec
+%var            RC_INIT_SCRIPT     cswnginx
+%var            INIT_KILL_PRIO     16
+%var            INIT_START_PRIO    90
+%var            CAN_BE_AUTOENABLED no

Added: csw/mgar/pkg/nginx/trunk/files/cswnginx
===================================================================
--- csw/mgar/pkg/nginx/trunk/files/cswnginx	                        (rev 0)
+++ csw/mgar/pkg/nginx/trunk/files/cswnginx	2009-01-09 17:40:31 UTC (rev 2773)
@@ -0,0 +1,112 @@
+#!/bin/sh
+#
+# SMF Method file for nginx
+#
+
+NGINX=/opt/csw/sbin/nginx
+CFGFILE=/opt/csw/etc/nginx/nginx.conf
+VARRUNX=/opt/csw/var/run/nginx
+PIDFILE=${VARRUNX}/nginx.pid
+PIDFILO=${VARRUNX}/nginx.pid.oldbin
+
+[ ! -f ${NGINX} ]   && exit $NGINX
+[ ! -f ${CFGFILE} ] && exit $CFGFILE
+
+
+start() {
+	$NGINX
+	RETVAL=$?
+	return $RETVAL
+}
+
+stop() {
+	killpidf -TERM $PIDFILO
+	killpidf -TERM
+}
+
+check() {
+	MSG=`$NGINX -t 2>&1`
+	RETVAL=$?
+	[ $RETVAL -ne 0 ] && echo $MSG
+	return $RETVAL
+}
+
+killpidf() {
+	if [ "$2" != "" ]; then
+		PIDF=$2
+	else
+		PIDF=$PIDFILE
+	fi
+	if [ -s "$PIDF" ]; then
+		/bin/kill $1 `/usr/bin/cat $PIDF`
+		RETVAL=$?
+	else
+		RETVAL=1
+	fi
+	return $RETVAL
+}
+
+reload() {
+	killpidf -HUP
+	RETVAL=$?
+	return $RETVAL
+}
+
+restart() {
+	stop
+	start
+	RETVAL=$?
+	return $RETVAL
+}
+
+rotate() {
+	killpidf -USR1
+	RETVAL=$?
+	return $RETVAL
+}
+
+upgrade()
+{
+	killpidf -USR2
+	RETVAL=$?
+	return $RETVAL
+}
+
+
+case "$1" in
+start)
+	[ ! -d $VARRUNX ] && /bin/mkdir -p $VARRUNX
+	check
+	start
+	RETVAL=$?
+	;;
+stop)
+	stop
+	;;
+refresh|reload)
+	check
+	RETVAL=$?
+	[ $RETVAL -eq 0 ] && reload ||:
+	;;
+restart)
+	check
+	RETVAL=$?
+	[ $RETVAL -eq 0 ] && restart ||:
+	;;
+rotate)
+	rotate
+	RETVAL=$?
+	;;
+upgrade)
+	check
+	RETVAL=$?
+	[ $RETVAL -eq 0 ] && upgrade ||:
+	;;
+*)
+	echo "Usage: $0 {start|stop|refresh|reload|restart|rotate|upgrade}"
+	exit 1
+	;;
+esac
+
+RETVAL=$?
+exit $RETVAL


Property changes on: csw/mgar/pkg/nginx/trunk/files/cswnginx
___________________________________________________________________
Added: svn:executable
   + *

Added: csw/mgar/pkg/nginx/trunk/files/cswnginx.xml
===================================================================
--- csw/mgar/pkg/nginx/trunk/files/cswnginx.xml	                        (rev 0)
+++ csw/mgar/pkg/nginx/trunk/files/cswnginx.xml	2009-01-09 17:40:31 UTC (rev 2773)
@@ -0,0 +1,76 @@
+<?xml version="1.0"?>
+<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
+<!--
+	nginx manifest
+-->
+
+<service_bundle type='manifest' name='nginx'>
+
+<service
+        name='network/nginx'
+        type='service'
+        version='1'>
+
+        <instance name='nginx' enabled='false'>
+                <dependency name='loopback'
+                    grouping='require_all'
+                    restart_on='error'
+                    type='service'>
+                        <service_fmri value='svc:/network/loopback:default'/>
+                </dependency>
+
+                <dependency name='physical'
+                    grouping='optional_all'
+                    restart_on='error'
+                    type='service'>
+                        <service_fmri value='svc:/network/physical:default'/>
+                </dependency>
+
+                <dependency name='multiuser-server'
+                    grouping='require_all'
+                    restart_on='error'
+                    type='service'>
+                        <service_fmri value='svc:/milestone/multi-user-server:default'/>
+                </dependency>
+
+                <exec_method
+                        type='method'
+                        name='start'
+                        exec='/opt/csw/lib/svc/method/svc-cswnginx start'
+                        timeout_seconds='60' />
+
+                <exec_method
+                        type='method'
+                        name='stop'
+                        exec='/opt/csw/lib/svc/method/svc-cswnginx stop'
+                        timeout_seconds='60' />
+
+                <exec_method
+                        type='method'
+                        name='refresh'
+                        exec='/opt/csw/lib/svc/method/svc-cswnginx refresh'
+                        timeout_seconds='60' />
+
+                <property_group name='startd' type='framework'>
+                        <!-- sub-process core dumps shouldn't restart
+                                session -->
+                        <propval name='ignore_error' type='astring'
+                                value='core,signal' />
+                </property_group>
+
+        </instance>
+
+        <template>
+                <common_name>
+                        <loctext xml:lang='C'>
+                                nginx HTTP server and mail proxy server
+                        </loctext>
+                </common_name>
+                <documentation>
+                        <doc_link name='nginx docs'
+                                uri='http://sysoev.ru/nginx/docs/' />
+                </documentation>
+        </template>
+</service>
+
+</service_bundle>

Added: csw/mgar/pkg/nginx/trunk/files/svc-cswnginx
===================================================================
--- csw/mgar/pkg/nginx/trunk/files/svc-cswnginx	                        (rev 0)
+++ csw/mgar/pkg/nginx/trunk/files/svc-cswnginx	2009-01-09 17:40:31 UTC (rev 2773)
@@ -0,0 +1,112 @@
+#!/bin/sh
+#
+# SMF Method file for nginx
+#
+
+NGINX=/opt/csw/sbin/nginx
+CFGFILE=/opt/csw/etc/nginx/nginx.conf
+VARRUNX=/opt/csw/var/run/nginx
+PIDFILE=${VARRUNX}/nginx.pid
+PIDFILO=${VARRUNX}/nginx.pid.oldbin
+
+[ ! -f ${NGINX} ]   && exit $NGINX
+[ ! -f ${CFGFILE} ] && exit $CFGFILE
+
+
+start() {
+	$NGINX
+	RETVAL=$?
+	return $RETVAL
+}
+
+stop() {
+	killpidf -TERM $PIDFILO
+	killpidf -TERM
+}
+
+check() {
+	MSG=`$NGINX -t 2>&1`
+	RETVAL=$?
+	[ $RETVAL -ne 0 ] && echo $MSG
+	return $RETVAL
+}
+
+killpidf() {
+	if [ "$2" != "" ]; then
+		PIDF=$2
+	else
+		PIDF=$PIDFILE
+	fi
+	if [ -s "$PIDF" ]; then
+		/bin/kill $1 `/usr/bin/cat $PIDF`
+		RETVAL=$?
+	else
+		RETVAL=1
+	fi
+	return $RETVAL
+}
+
+reload() {
+	killpidf -HUP
+	RETVAL=$?
+	return $RETVAL
+}
+
+restart() {
+	stop
+	start
+	RETVAL=$?
+	return $RETVAL
+}
+
+rotate() {
+	killpidf -USR1
+	RETVAL=$?
+	return $RETVAL
+}
+
+upgrade()
+{
+	killpidf -USR2
+	RETVAL=$?
+	return $RETVAL
+}
+
+
+case "$1" in
+start)
+	[ ! -d $VARRUNX ] && /bin/mkdir -p $VARRUNX
+	check
+	start
+	RETVAL=$?
+	;;
+stop)
+	stop
+	;;
+refresh|reload)
+	check
+	RETVAL=$?
+	[ $RETVAL -eq 0 ] && reload ||:
+	;;
+restart)
+	check
+	RETVAL=$?
+	[ $RETVAL -eq 0 ] && restart ||:
+	;;
+rotate)
+	rotate
+	RETVAL=$?
+	;;
+upgrade)
+	check
+	RETVAL=$?
+	[ $RETVAL -eq 0 ] && upgrade ||:
+	;;
+*)
+	echo "Usage: $0 {start|stop|refresh|reload|restart|rotate|upgrade}"
+	exit 1
+	;;
+esac
+
+RETVAL=$?
+exit $RETVAL


Property changes on: csw/mgar/pkg/nginx/trunk/files/svc-cswnginx
___________________________________________________________________
Added: svn:executable
   + *


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the devel mailing list