Explorar o código

new package: whoson 2.02a (WHOSON daemon for POP before SMTP)

Michael van Elst %!s(int64=23) %!d(string=hai) anos
pai
achega
d963dc8b81
Modificáronse 4 ficheiros con 273 adicións e 0 borrados
  1. 17 0
      whoson/fsl.whoson
  2. 29 0
      whoson/rc.whoson
  3. 90 0
      whoson/whoson.patch
  4. 137 0
      whoson/whoson.spec

+ 17 - 0
whoson/fsl.whoson

@@ -0,0 +1,17 @@
+##
+##  fsl.sasl -- OSSP fsl configuration for Cyrus SASL
+##
+
+ident (whosond)/.+ q{
+    prefix(
+        prefix="%b %d %H:%M:%S %N <%L> $1[%P]: ",
+        timezone=local
+    ) 
+    -> {
+        debug: file(
+            path="@l_prefix@/var/whoson/log/whosond.log", 
+            append=1, perm=0600
+        );
+    }
+};
+

+ 29 - 0
whoson/rc.whoson

@@ -0,0 +1,29 @@
+#!@l_prefix@/lib/openpkg/bash @l_prefix@/etc/rc
+##
+##  rc.whoson -- Whoson Administration Run-Commands
+##
+
+%config
+	whoson_enable="yes"
+
+%common
+	whoson_pidfile="@l_prefix@/var/whoson/whoson.pid"
+
+%start -p 200 -u @l_susr@
+	opServiceEnabled whoson || exit 0
+	@l_prefix@/sbin/whosond >$whoson_pidfile
+	exit 0
+
+%stop -p 200 -u @l_susr@
+	opServiceEnabled whoson || exit 0
+    kill -TERM `cat $whoson_pidfile`
+    rm -f $whoson_pidfile
+	exit 0
+
+%restart -u @l_susr@
+	opServiceEnabled whoson || exit 0
+    kill -TERM `cat $whoson_pidfile`
+    sleep 2
+    rm -f $whoson_pidfile
+	@l_prefix@/sbin/whosond
+

+ 90 - 0
whoson/whoson.patch

@@ -0,0 +1,90 @@
+--- Makefile.in.dist	Tue Apr 15 14:50:22 2003
++++ Makefile.in	Tue Apr 15 14:50:58 2003
+@@ -698,10 +698,10 @@
+ 
+ 
+ install-data-hook:
+-	if test -f $(DEFAULT_CONFIG); then \
+-		$(ECHO) "$(DEFAULT_CONFIG) exists, not overwritten"; \
++	if test -f $(DESTDIR)$(DEFAULT_CONFIG); then \
++		$(ECHO) "$(DESTDIR)$(DEFAULT_CONFIG) exists, not overwritten"; \
+ 	else \
+-		$(INSTALL_DATA) $(srcdir)/whoson.conf $(DEFAULT_CONFIG); \
++		$(INSTALL_DATA) $(srcdir)/whoson.conf $(DESTDIR)$(DEFAULT_CONFIG); \
+ 	fi; \
+ 	for f in $(MAN3XTRA); do \
+ 		rm -f $(DESTDIR)$(man3dir)/$$f; \
+--- whosond.c.dist	Tue Apr 15 14:37:01 2003
++++ whosond.c	Tue Apr 15 14:38:32 2003
+@@ -153,6 +153,8 @@
+ 	if (daemon) {
+ 		int child;
+ 		if ((child=fork()) > 0) {
++            printf("%d\n",child);
++            fflush(stdout);
+ 			sleep(1);
+ 			return 0;
+ 		} else if (child < 0) {
+--- whoson.conf.dist	Tue Apr 15 15:16:43 2003
++++ whoson.conf	Tue Apr 15 16:51:52 2003
+@@ -13,13 +13,13 @@
+ # stream socket.  "port" is the name of the socket.
+ 
+ client	unix
+-	port=/var/run/whoson.s
++	port=@l_prefix@/var/whoson/run/whoson.s
+ 
+ # Connect to the server running on the same machine via a unix domain
+ # datagram socket.  "port" is the name of the socket.
+ 
+ client	unixd
+-	port=/var/run/whoson.d
++	port=@l_prefix@/var/whoson/run/whoson.d
+ 	maxtries=5
+ 	inittimeout=100000
+ 
+@@ -39,7 +39,7 @@
+ # Connect to the server over the TCP protocol.
+ 
+ client	tcp port=9876
+-	address=194.67.3.216
++	address=127.0.0.1
+ 
+ # There may be any number of any type entries.
+ # Stream protocols (tcp and unix) allow for persistent connections
+@@ -62,23 +62,25 @@
+ 	port=9876
+ 	listenq=5
+ 	keepalive=150
+-	allow=123.45.67.0/24		# Allow the the whole network
+-	deny=123.45.67.89/32		# except these ..
+-	deny=123.45.67.90/32		#		.. two machines
+-server	unix port=/var/run/whoson.s keepalive=150
++	#allow=123.45.67.0/24		# Allow the the whole network
++	#deny=123.45.67.89/32		# except these ..
++	#deny=123.45.67.90/32		#		.. two machines
++    allow=127.0.0.1/32
++server	unix port=@l_prefix@/var/whoson/run/whoson.s keepalive=150
+ 	listenq=5
+-server	unixd port=/var/run/whoson.d
++server	unixd port=@l_prefix@/var/whoson/run/whoson.d
+ server	udp port=9876
+-	allow=0.0.0.0/0			# open to the world.  Don't do that!
++	#allow=0.0.0.0/0			# open to the world.  Don't do that!
++	allow=127.0.0.1/32
+ 
+ # "global" pseudo server that does not listen; it is only used to set
+ # global configuration parameters.  "ttl" - how many seconds
+ # inserted entries will live in the database if not deleted explicitely.
+ 
+ server	global ttl=600			# 10 minutes
+-	chroot=/some/empty/directory	# chdir and chroot here
+-	group=nobody			# change group id and
+-	user=nobody			# user id after bind()ing
+-	cachesize=100000		# max. number of entries to keep
++	chroot=@l_prefix@/var/whoson/empty/	# chdir and chroot here
++	group=@l_rgrp@    			# change group id and
++	user=@l_rusr@			    # user id after bind()ing
++	cachesize=100000		    # max. number of entries to keep
+ 
+ # end of config

+ 137 - 0
whoson/whoson.spec

@@ -0,0 +1,137 @@
+##
+##  whoson.spec -- OpenPKG RPM Specification
+##  Copyright (c) 2000-2003 Cable & Wireless Deutschland GmbH
+##  Copyright (c) 2000-2003 The OpenPKG Project <http://www.openpkg.org/>
+##  Copyright (c) 2000-2003 Ralf S. Engelschall <rse@engelschall.com>
+##
+##  Permission to use, copy, modify, and distribute this software for
+##  any purpose with or without fee is hereby granted, provided that
+##  the above copyright notice and this permission notice appear in all
+##  copies.
+##
+##  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+##  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+##  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+##  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
+##  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+##  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+##  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+##  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+##  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+##  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+##  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+##  SUCH DAMAGE.
+##
+
+#   package information
+Name:         whoson
+Summary:      WHOSON daemon for POP before SMTP
+URL:          http://whoson.sourceforge.net/
+Vendor:       Eugene Crosser
+Packager:     The OpenPKG Project
+Distribution: OpenPKG [EVAL]
+Group:        Mail
+License:      GPL
+Version:      2.02a
+Release:      20030415
+
+#   package options
+%option       with_perl no
+
+#   list of sources
+Source0:      http://osdn.dl.sourceforge.net/sourceforge/whoson/whoson-%{version}.tar.gz
+Source1:      rc.whoson
+Source2:      fsl.whoson
+Patch0:       whoson.patch
+
+#   build information
+Prefix:       %{l_prefix}
+BuildRoot:    %{l_buildroot}
+BuildPreReq:  OpenPKG, openpkg >= 20030103, fsl
+PreReq:       OpenPKG, openpkg >= 20030103, fsl
+%if "%{with_perl}" == "yes"
+BuildPreReq:  perl, perl-openpkg
+PreReq:       perl, perl-openpkg
+%endif
+AutoReq:      no
+AutoReqProv:  no
+
+%description
+    Whoson (WHO iS ONline) is a proposed Internet protocol that
+    allows Internet server programs know if a particular (dynamically
+    allocated) IP address is currently allocated to a known (trusted)
+    user and, optionally, the identity of the said user.
+
+%prep
+    %setup -q
+    %patch -p0
+
+%build
+    %{l_shtool} subst \
+        -e 's;@l_prefix@;%{l_prefix};g' \
+        -e 's;@l_rusr@;%{l_rusr};g' \
+        -e 's;@l_rgrp@;%{l_rgrp};g' \
+        whoson.conf
+
+    CC="%{l_cc}" \
+    CFLAGS="%{l_cflags -O}" \
+    CPPFLAGS="%{l_cppflags}" \
+    LDFLAGS="%{l_ldflags} `%{l_prefix}/bin/fsl-config --all --ldflags`" \
+    LIBS="`%{l_prefix}/bin/fsl-config --all --libs`" \
+    ./configure \
+        --prefix="%{l_prefix}" \
+        --with-config="%{l_prefix}/etc/whoson/whoson.conf" \
+        --enable-static \
+        --disable-shared
+    %{l_make} %{l_mflags -O}
+
+%install
+    rm -rf $RPM_BUILD_ROOT
+
+%if "%{with_perl}" == "yes"
+    ( cd WHOSON
+      %{l_prefix}/bin/perl-openpkg prolog
+      %{l_prefix}/bin/perl-openpkg install
+      %{l_prefix}/bin/perl-openpkg epilog
+    ) || exit $?
+%endif
+
+    %{l_shtool} mkdir -f -p -m 755 \
+        $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \
+        $RPM_BUILD_ROOT%{l_prefix}/etc/fsl \
+        $RPM_BUILD_ROOT%{l_prefix}/etc/whoson \
+        $RPM_BUILD_ROOT%{l_prefix}/var/whoson/run \
+        $RPM_BUILD_ROOT%{l_prefix}/var/whoson/log \
+        $RPM_BUILD_ROOT%{l_prefix}/var/whoson/empty
+
+    %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
+
+    #   tidy installation area
+    strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
+    rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/*.la
+
+    #   add startup script
+    %{l_shtool} install -c -m 755 \
+        -e 's;@l_prefix@;%{l_prefix};g' \
+        -e 's;@l_susr@;%{l_susr};g' \
+        %{SOURCE rc.whoson} \
+        $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
+
+    #   add fsl configuration
+    %{l_shtool} install -c -m 755 \
+        -e 's;@l_prefix@;%{l_prefix};g' \
+        %{SOURCE fsl.whoson} \
+        $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/
+
+    %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} \
+        '%attr(0750,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/whoson' \
+        '%attr(0750,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/whoson/run' \
+        '%attr(0750,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/whoson/log' \
+        '%attr(0700,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/whoson/empty' \
+        '%config %{l_prefix}/etc/whoson/*'
+
+%files -f files
+
+%clean
+    rm -rf $RPM_BUILD_ROOT
+