OpenPKG CVS Repository
http://cvs.openpkg.org/
____________________________________________________________________________
Server: cvs.openpkg.org Name: Thomas Lotterer
Root: /v/openpkg/cvs Email: [EMAIL PROTECTED]
Module: openpkg-src Date: 16-Mar-2005 14:44:52
Branch: HEAD Handle: 2005031613445200
Added files:
openpkg-src/ngircd fsl.ngircd ngircd.patch ngircd.spec rc.ngircd
Log:
new package: ngircd 0.8.3 (Next Generation IRC Server)
Summary:
Revision Changes Path
1.1 +16 -0 openpkg-src/ngircd/fsl.ngircd
1.1 +79 -0 openpkg-src/ngircd/ngircd.patch
1.1 +142 -0 openpkg-src/ngircd/ngircd.spec
1.1 +54 -0 openpkg-src/ngircd/rc.ngircd
____________________________________________________________________________
patch -p0 <<'@@ .'
Index: openpkg-src/ngircd/fsl.ngircd
============================================================================
$ cvs diff -u -r0 -r1.1 fsl.ngircd
--- /dev/null 2005-03-16 14:44:00 +0100
+++ fsl.ngircd 2005-03-16 14:44:52 +0100
@@ -0,0 +1,16 @@
+##
+## fsl.ngircd -- OSSP fsl configuration
+##
+
+ident (ngircd)/.+ q{
+ prefix(
+ prefix="%b %d %H:%M:%S %N <%L> $1[%P]: "
+ )
+ -> {
+ debug: file(
+ path="@l_prefix@/var/ngircd/log/ngircd.log",
+ perm=0600
+ )
+ }
+};
+
@@ .
patch -p0 <<'@@ .'
Index: openpkg-src/ngircd/ngircd.patch
============================================================================
$ cvs diff -u -r0 -r1.1 ngircd.patch
--- /dev/null 2005-03-16 14:44:00 +0100
+++ ngircd.patch 2005-03-16 14:44:52 +0100
@@ -0,0 +1,79 @@
+Index: src/ngircd/ngircd.c
+--- src/ngircd/ngircd.c.orig 2005-01-26 23:09:33 +0100
++++ src/ngircd/ngircd.c 2005-03-16 13:15:05 +0100
+@@ -77,6 +77,9 @@
+ #ifdef SNIFFER
+ NGIRCd_Sniffer = FALSE;
+ #endif
++#ifdef PID_FILE
++ NGIRCd_PidFile[0] = '/dev/null';
++#endif
+ strlcpy( NGIRCd_ConfFile, SYSCONFDIR, sizeof( NGIRCd_ConfFile ));
+ strlcat( NGIRCd_ConfFile, CONFIG_FILE, sizeof( NGIRCd_ConfFile ));
+
+@@ -139,6 +142,19 @@
+ Show_Version( );
+ exit( 1 );
+ }
++#ifdef PID_FILE
++ if( strcmp( argv[i], "--pidfile" ) == 0 )
++ {
++ if( i + 1 < argc )
++ {
++ /* Ok, there's an parameter left */
++ strlcpy( NGIRCd_PidFile, argv[i + 1],
sizeof( NGIRCd_PidFile ));
++
++ /* next parameter */
++ i++; ok = TRUE;
++ }
++ }
++#endif
+ }
+ else if(( argv[i][0] == '-' ) && ( argv[i][1] != '-' ))
+ {
+@@ -282,6 +298,21 @@
+
+ /* Child-Prozess initialisieren */
+ (VOID)setsid( );
++#ifdef PID_FILE
++ {
++ mode_t old_umask;
++ pid_t pid;
++ FILE *fp;
++
++ old_umask = umask((mode_t) 0022);
++ pid = getpid();
++ if ((fp = fopen(NGIRCd_PidFile, "w")) == NULL)
++ syslog(LOG_ERR, "cannot write PID file '%s'", PID_FILE);
++ fprintf(fp, "%ld\n", (long)pid);
++ fclose(fp);
++ umask(old_umask);
++ }
++#endif
+ chdir( "/" );
+ }
+
+@@ -565,6 +596,9 @@
+ puts( " -s, --sniffer enable network sniffer and display all IRC
traffic" );
+ #endif
+ puts( " -t, --configtest read, validate and display configuration;
then exit" );
++#ifdef PID_FILE
++ puts( " --pidfile <f> write PID into file" );
++#endif
+ puts( " --version output version information and exit" );
+ puts( " --help display this help and exit" );
+ } /* Show_Help */
+Index: src/ngircd/ngircd.h
+--- src/ngircd/ngircd.h.orig 2002-12-26 17:48:14 +0100
++++ src/ngircd/ngircd.h 2005-03-16 13:15:05 +0100
+@@ -45,6 +45,10 @@
+
+ GLOBAL CHAR NGIRCd_ConfFile[FNAME_LEN]; /* Konfigurationsdatei */
+
++#ifdef PID_FILE
++GLOBAL CHAR NGIRCd_PidFile[FNAME_LEN]; /* PID file */
++#endif
++
+ GLOBAL CHAR NGIRCd_ProtoID[COMMAND_LEN];/* Protokoll- und
Server-Identifikation */
+
+
@@ .
patch -p0 <<'@@ .'
Index: openpkg-src/ngircd/ngircd.spec
============================================================================
$ cvs diff -u -r0 -r1.1 ngircd.spec
--- /dev/null 2005-03-16 14:44:00 +0100
+++ ngircd.spec 2005-03-16 14:44:52 +0100
@@ -0,0 +1,142 @@
+##
+## ngircd.spec -- OpenPKG RPM Specification
+## Copyright (c) 2000-2005 The OpenPKG Project <http://www.openpkg.org/>
+## Copyright (c) 2000-2005 Ralf S. Engelschall <[EMAIL PROTECTED]>
+## Copyright (c) 2000-2005 Cable & Wireless <http://www.cw.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: ngircd
+Summary: Next Generation IRC Server
+URL: http://arthur.ath.cx/~alex/ngircd/
+Vendor: Alexander Barton
+Packager: The OpenPKG Project
+Distribution: OpenPKG
+Class: EVAL
+Group: Network
+License: GNU
+Version: 0.8.3
+Release: 20050316
+
+# package options
+%option with_fsl yes
+
+# list of sources
+Source0: ftp://ftp.berlios.de/pub/ngircd/ngircd-%{version}.tar.gz
+Source1: rc.ngircd
+Source2: fsl.ngircd
+Patch0: ngircd.patch
+
+# build information
+Prefix: %{l_prefix}
+BuildRoot: %{l_buildroot}
+BuildPreReq: OpenPKG, openpkg >= 20040130, zlib
+PreReq: OpenPKG, openpkg >= 20040130, zlib
+%if "%{with_fsl}" == "yes"
+BuildPreReq: fsl >= 1.2.0
+PreReq: fsl >= 1.2.0
+%endif
+AutoReq: no
+AutoReqProv: no
+
+%description
+ ngIRCd is an Open-Source server for the Internet Relay Chat (IRC)
+ It's written from scratch and not deduced from the "grandfather of
+ IRC daemons", the daemon of the IRCNet.
+
+%track
+ prog ngircd = {
+ version = %{version}
+ url = ftp://ftp.berlios.de/pub/ngircd/
+ regex = ngircd-(__VER__)\.tar\.gz
+ }
+
+%prep
+ %setup -q
+ %patch -p0
+ %{l_shtool} subst \
+ -e 's;^\(docdir = $(datadir)/\)doc/\($(PACKAGE)\);\1\2;' \
+ doc/Makefile.in
+
+%build
+ CC="%{l_cc}" \
+ CXX="%{l_cxx}" \
+ CFLAGS="%{l_cflags -O} -DPID_FILE" \
+ CXXFLAGS="%{l_cxxflags -O}" \
+ CPPFLAGS="%{l_cppflags}" \
+ LDFLAGS="%{l_ldflags} %{l_fsl_ldflags}" \
+ LIBS="%{l_fsl_libs}" \
+ ./configure \
+ --prefix=%{l_prefix} \
+ --sysconfdir=%{l_prefix}/etc/ngircd
+ %{l_make} %{l_mflags -O}
+
+%install
+ rm -rf $RPM_BUILD_ROOT
+ %{l_shtool} mkdir -f -p -m 755 \
+ $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \
+ $RPM_BUILD_ROOT%{l_prefix}/etc/ngircd \
+ $RPM_BUILD_ROOT%{l_prefix}/var/ngircd/run \
+ $RPM_BUILD_ROOT%{l_prefix}/var/ngircd/log
+ %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
+ %{l_shtool} echo \
+ 'Welcome to ngIRCd (%{l_openpkg_release -F "OpenPKG-%s"})' \
+ >$RPM_BUILD_ROOT%{l_prefix}/etc/ngircd/nircd.motd
+ strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
+
+ # add startup script
+ cp doc/sample-ngircd.conf ngircd.conf
+ %{l_shtool} install -c -m 600 \
+ -e 's|;\(Listen = \).*$|\1 127.0.0.1|' \
+ -e 's|;\(ServerUID = \).*$|\1 %{l_ruid}|' \
+ -e 's|;\(ServerGID = \).*$|\1 %{l_rgid}|' \
+ -e 's|;\(MotdFile = \).*$|\1 %{l_prefix}/etc/ngircd/nircd.motd|' \
+ ngircd.conf \
+ $RPM_BUILD_ROOT%{l_prefix}/etc/ngircd/
+
+ # add startup script
+ %{l_shtool} install -c -m 755 %{l_value -s -a} \
+ %{SOURCE rc.ngircd} \
+ $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
+
+ # install OSSP fsl configuration
+ %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/fsl
+ %{l_shtool} install -c -m 644 %{l_value -s -a} \
+ %{SOURCE fsl.ngircd} \
+ $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/
+
+ # determine installation files
+ %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
+ %{l_files_std} \
+ '%not %dir %{l_prefix}/etc/fsl' \
+ '%config %{l_prefix}/etc/fsl/fsl.ngircd' \
+ '%config %{l_prefix}/etc/ngircd/*' \
+ '%attr(0755,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/ngircd' \
+ '%attr(0755,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/ngircd/run' \
+ '%attr(0755,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/ngircd/log' \
+ '%not %dir %{l_prefix}/share/doc' \
+ '%doc %{l_prefix}/share/doc/ngircd/*'
+
+%files -f files
+
+%clean
+ rm -rf $RPM_BUILD_ROOT
+
@@ .
patch -p0 <<'@@ .'
Index: openpkg-src/ngircd/rc.ngircd
============================================================================
$ cvs diff -u -r0 -r1.1 rc.ngircd
--- /dev/null 2005-03-16 14:44:00 +0100
+++ rc.ngircd 2005-03-16 14:44:52 +0100
@@ -0,0 +1,54 @@
[EMAIL PROTECTED]@/lib/openpkg/bash @l_prefix@/etc/rc
+##
+## rc.ngircd -- Run-Commands
+##
+
+%config
+ ngircd_enable="$openpkg_rc_def"
+ ngircd_log_prolog="true"
+ ngircd_log_epilog="true"
+ ngircd_log_numfiles="10"
+ ngircd_log_minsize="1M"
+ ngircd_log_complevel="9"
+
+%common
+ ngircd_pidfile="@l_prefix@/var/ngircd/run/ngircd.pid"
+ ngircd_signal () {
+ [ -f $ngircd_pidfile ] && kill -$1 `cat $ngircd_pidfile`
+ }
+
+%status -u @l_susr@ -o
+ ngircd_usable="no"
+ ngircd_active="no"
+ @l_prefix@/sbin/ngircd -t >/dev/null 2>&1 && ngircd_usable="yes"
+ rcService ngircd enable yes && \
+ ngircd_signal 0 && ngircd_active="yes"
+ echo "ngircd_enable=\"$ngircd_enable\""
+ echo "ngircd_usable=\"$ngircd_usable\""
+ echo "ngircd_active=\"$ngircd_active\""
+
+%start -u @l_susr@
+ rcService ngircd enable yes || exit 0
+ @l_prefix@/sbin/ngircd --pidfile $ngircd_pidfile
+ exit 0
+
+%stop -u @l_susr@
+ rcService ngircd enable yes || exit 0
+ kill -TERM `cat $ngircd_pidfile`
+ rm -f $ngircd_pidfile 2>/dev/null || true
+ exit 0
+
+%restart -u @l_susr@
+ rcService ngircd enable yes || exit 0
+ rcService ngircd active no && exit 0
+ rc ngircd stop start
+
+%daily -u @l_susr@
+ rcService ngircd enable yes || exit 0
+ shtool rotate -f \
+ -n ${ngircd_log_numfiles} -s ${ngircd_log_minsize} -d \
+ -z ${ngircd_log_complevel} -o @l_rusr@ -g @l_rgrp@ -m 644 \
+ -P "${ngircd_log_prolog}" \
+ -E "${ngircd_log_epilog}" \
+ @l_prefix@/var/ngircd/log/ngircd.log
+
@@ .
______________________________________________________________________
The OpenPKG Project www.openpkg.org
CVS Repository Commit List [email protected]