packages: nstx/nstx.spec (NEW), nstx/nstxcd.init (NEW), nstx/nstxcd.sysconf...
glen
glen at pld-linux.org
Mon Nov 8 20:40:16 CET 2010
Author: glen Date: Mon Nov 8 19:40:16 2010 GMT
Module: packages Tag: HEAD
---- Log message:
- new, based on nstx-1.1-0.beta6.8mdv2010.0.src.rpm
---- Files affected:
packages/nstx:
nstx.spec (NONE -> 1.1) (NEW), nstxcd.init (NONE -> 1.1) (NEW), nstxcd.sysconfig (NONE -> 1.1) (NEW), nstxd.init (NONE -> 1.1) (NEW), nstxd.sysconfig (NONE -> 1.1) (NEW)
---- Diffs:
================================================================
Index: packages/nstx/nstx.spec
diff -u /dev/null packages/nstx/nstx.spec:1.1
--- /dev/null Mon Nov 8 20:40:16 2010
+++ packages/nstx/nstx.spec Mon Nov 8 20:40:10 2010
@@ -0,0 +1,105 @@
+# $Revision$, $Date$
+# TODO
+# - nstxd system user
+%define subver beta6
+%define rel 0.1
+Summary: Nameserver Transfer Protocol
+Name: nstx
+Version: 1.1
+Release: 0.%{subver}.%{rel}
+License: GPL
+Group: Networking
+URL: http://nstx.dereference.de/nstx/
+Source0: http://nstx.dereference.de/nstx/%{name}-%{version}-%{subver}.tar.bz2
+# Source0-md5: da6af7010de63590cc3000541ec5074f
+Source1: http://ftp.debian.org/debian/pool/main/n/nstx/%{name}_%{version}-%{subver}-5.diff.gz
+# Source1-md5: 0b7b4d4d3added258ff61b1c5357a1b9
+Source2: %{name}d.init
+Source3: %{name}d.sysconfig
+Source4: %{name}cd.init
+Source5: %{name}cd.sysconfig
+BuildRequires: rpmbuild(macros) >= 1.228
+Requires(post,preun): /sbin/chkconfig
+Requires: rc-scripts
+BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+NSTX (the Nameserver Transfer Protocol) makes it possible to create IP
+tunnels using DNS queries and replies for IP packet encapsulation
+where IP traffic other than DNS isn't possible.
+
+%package -n nstxcd
+Summary: Nstx (Tunnel IP over DNS)
+Group: Networking
+Requires(post,preun): /sbin/chkconfig
+Requires: rc-scripts
+
+%description -n nstxcd
+The nstx client.
+
+%prep
+%setup -q -n %{name}-%{version}-%{subver}
+%{__gzip} -dc %{SOURCE1} | %{__patch} %{S:0} -p1
+
+%build
+%{__make} \
+ CC="%{__cc}" \
+ CFLAGS="%{rpmcflags}"
+
+%install
+rm -rf $RPM_BUILD_ROOT
+install -d $RPM_BUILD_ROOT{%{_sbindir},%{_mandir}/man8,/etc/{rc.d/init.d,sysconfig}}
+install -p nstxd nstxcd $RPM_BUILD_ROOT%{_sbindir}
+cp -a *.8 $RPM_BUILD_ROOT%{_mandir}/man8
+install -p %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}d
+cp -a %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig
+install -p %{SOURCE4} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}cd
+cp -a %{SOURCE5} $RPM_BUILD_ROOT/etc/sysconfig
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%post
+/sbin/chkconfig --add nstxd
+%service nstxd restart
+
+%preun
+if [ "$1" = "0" ]; then
+ %service -q nstxd stop
+ /sbin/chkconfig --del nstxd
+fi
+
+%post -n nstxcd
+/sbin/chkconfig --add nstxcd
+%service nstxcd restart
+
+%preun -n nstxcd
+if [ "$1" = "0" ]; then
+ %service -q nstxcd stop
+ /sbin/chkconfig --del nstxcd
+fi
+
+%files
+%defattr(644,root,root,755)
+%doc README Changelog
+%attr(755,root,root) %{_sbindir}/nstxd
+%{_mandir}/man8/nstxd.8*
+%{_sysconfdir}/%{name}/nstxd.*
+%attr(754,root,root) /etc/rc.d/init.d/nstxd
+
+%files -n nstxcd
+%defattr(644,root,root,755)
+%doc README Changelog
+%attr(755,root,root) %{_sbindir}/nstxcd
+%{_mandir}/man8/nstxcd.8*
+%{_sysconfdir}/%{name}/nstxcd.*
+%attr(754,root,root) /etc/rc.d/init.d/nstxcd
+
+%define date %(echo `LC_ALL="C" date +"%a %b %d %Y"`)
+%changelog
+* %{date} PLD Team <feedback at pld-linux.org>
+All persons listed below can be reached at <cvs_login>@pld-linux.org
+
+$Log$
+Revision 1.1 2010/11/08 19:40:10 glen
+- new, based on nstx-1.1-0.beta6.8mdv2010.0.src.rpm
================================================================
Index: packages/nstx/nstxcd.init
diff -u /dev/null packages/nstx/nstxcd.init:1.1
--- /dev/null Mon Nov 8 20:40:16 2010
+++ packages/nstx/nstxcd.init Mon Nov 8 20:40:10 2010
@@ -0,0 +1,105 @@
+#!/bin/sh
+#
+# nstxcd start and stop the nstx IP over DNS client
+#
+# chkconfig: 345 20 80
+#
+# processname: nstxcd
+#
+# $Id$
+
+# Source function library
+. /etc/rc.d/init.d/functions
+
+# Get network config
+. /etc/sysconfig/network
+
+# Check that networking is up.
+if is_yes "${NETWORKING}"; then
+ if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
+ msg_network_down "nstxcd"
+ exit 1
+ fi
+else
+ exit 0
+fi
+
+# Get service config - may override defaults
+[ -f /etc/sysconfig/nstxcd ] && . /etc/sysconfig/nstxcd
+
+start() {
+ # Check if the service is already running?
+ if [ -f /var/lock/subsys/nstxcd ]; then
+ msg_already_running "nstxcd"
+ return
+ fi
+
+ msg_starting "nstxcd"
+ daemon --fork /usr/sbin/nstxcd $NSTX_OPTIONS $NSTX_DOMAIN $NSTX_DNS_SERVER
+ RETVAL=$?
+
+ sleep 1
+ if [ -n "$ifup_tun" ]; then
+ ifconfig $ifup_tun up $tun_ip_address netmask $tun_ip_netmask
+ fi
+
+ [ $RETVAL -eq 0 ] && touch /var/lock/subsys/nstxcd
+}
+
+stop() {
+ if [ ! -f /var/lock/subsys/nstxcd ]; then
+ msg_not_running "nstxcd"
+ return
+ fi
+
+ # Stop daemons.
+ msg_stopping "nstxcd"
+
+ if [ -n "$ifup_tun" ]; then
+ ifconfig $ifup_tun down >/dev/null 2>&1
+ fi
+
+ killproc nstxcd
+ rm -f /var/lock/subsys/nstxcd
+}
+
+condrestart() {
+ if [ ! -f /var/lock/subsys/nstxcd ]; then
+ msg_not_running "nstxcd"
+ RETVAL=$1
+ return
+ fi
+
+ stop
+ start
+}
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+ start)
+ start
+ ;;
+ stop)
+ stop
+ ;;
+ restart)
+ stop
+ start
+ ;;
+ try-restart)
+ condrestart 0
+ ;;
+ force-reload)
+ condrestart 7
+ ;;
+ status)
+ status nstxcd
+ RETVAL=$?
+ ;;
+ *)
+ msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"
+ exit 3
+esac
+
+exit $RETVAL
================================================================
Index: packages/nstx/nstxcd.sysconfig
diff -u /dev/null packages/nstx/nstxcd.sysconfig:1.1
--- /dev/null Mon Nov 8 20:40:16 2010
+++ packages/nstx/nstxcd.sysconfig Mon Nov 8 20:40:10 2010
@@ -0,0 +1,25 @@
+# Defaults for nstx initscript
+# sourced by /etc/rc.d/init.d/nstxcd
+# installed at /etc/sysconfig/nstx by the maintainer scripts
+
+#
+# This is a POSIX shell fragment
+#
+
+# The name of the domain for the tunnel - needed for client and server
+NSTX_DOMAIN=""
+
+# The IP address of the DNS server - needed for client only
+#NSTX_DNS_SERVER=`grep nameserver /etc/resolv.conf |head -1|awk '{print $2}'`
+#Using directly the ip of your gateway which runs the nstxd daemon could be faster
+#NSTX_DNS_SERVER=ip.of.your.nstxd
+
+
+# uncomment to bring up tun0 automatically
+#ifup_tun=tun0
+#tun_ip_address=10.0.0.2
+#tun_ip_netmask=255.255.255.0
+
+# uncomment to tell nstx to bind to a specific interface
+#NSTX_IFACE="1.2.3.4"
+
================================================================
Index: packages/nstx/nstxd.init
diff -u /dev/null packages/nstx/nstxd.init:1.1
--- /dev/null Mon Nov 8 20:40:16 2010
+++ packages/nstx/nstxd.init Mon Nov 8 20:40:10 2010
@@ -0,0 +1,109 @@
+#!/bin/sh
+#
+# nstxd start and stop the nstx IP over DNS daemon
+#
+# chkconfig: 345 20 80
+#
+# processname: nstxd
+#
+# $Id$
+
+# Source function library
+. /etc/rc.d/init.d/functions
+
+# Get network config
+. /etc/sysconfig/network
+
+# Check that networking is up.
+if is_yes "${NETWORKING}"; then
+ if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
+ msg_network_down "nstxd"
+ exit 1
+ fi
+else
+ exit 0
+fi
+
+# Get service config - may override defaults
+[ -f /etc/sysconfig/nstxd ] && . /etc/sysconfig/nstxd
+
+start() {
+ # Check if the service is already running?
+ if [ -f /var/lock/subsys/nstxd ]; then
+ msg_already_running "nstxd"
+ return
+ fi
+
+ if [ -n "$NSTX_IFACE" ]; then
+ OPTIONS="-i $NSTX_IFACE $NSTX_OPTIONS $NSTX_DOMAIN"
+ else
+ OPTIONS="$NSTX_OPTIONS $NSTX_DOMAIN"
+ fi
+
+ msg_starting "nstxd"
+ daemon /usr/sbin/nstxd $OPTIONS
+ RETVAL=$?
+
+ sleep 1
+ if [ -n "$ifup_tun" ]; then
+ ifconfig $ifup_tun up $tun_ip_address netmask $tun_ip_netmask
+ fi
+
+ [ $RETVAL -eq 0 ] && touch /var/lock/subsys/nstxd
+}
+
+stop() {
+ if [ ! -f /var/lock/subsys/nstxd ]; then
+ msg_not_running "nstxd"
+ return
+ fi
+
+ # Stop daemons.
+ msg_stopping "nstxd"
+ if [ -n "$ifup_tun" ]; then
+ ifconfig $ifup_tun down >/dev/null 2>&1
+ fi
+ killproc nstxd
+ rm -f /var/lock/subsys/nstxd
+}
+
+condrestart() {
+ if [ ! -f /var/lock/subsys/nstxd ]; then
+ msg_not_running "nstxd"
+ RETVAL=$1
+ return
+ fi
+
+ stop
+ start
+}
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+ start)
+ start
+ ;;
+ stop)
+ stop
+ ;;
+ restart)
+ stop
+ start
+ ;;
+ try-restart)
+ condrestart 0
+ ;;
+ force-reload)
+ condrestart 7
+ ;;
+ status)
+ status nstxd
+ RETVAL=$?
+ ;;
+ *)
+ msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"
+ exit 3
+esac
+
+exit $RETVAL
================================================================
Index: packages/nstx/nstxd.sysconfig
diff -u /dev/null packages/nstx/nstxd.sysconfig:1.1
--- /dev/null Mon Nov 8 20:40:16 2010
+++ packages/nstx/nstxd.sysconfig Mon Nov 8 20:40:10 2010
@@ -0,0 +1,19 @@
+# Defaults for nstx initscript
+# sourced by /etc/rc.d/init.d/nstxd
+# installed at /etc/sysconfig/nstx by the maintainer scripts
+
+#
+# This is a POSIX shell fragment
+#
+
+# The name of the domain for the tunnel - needed for client and server
+NSTX_DOMAIN=""
+
+# uncomment to bring up tun0 automatically
+#ifup_tun=tun0
+#tun_ip_address=10.0.0.1
+#tun_ip_netmask=255.255.255.0
+
+# uncomment to tell nstx to bind to a specific interface
+#NSTX_IFACE="1.2.3.4"
+
================================================================
More information about the pld-cvs-commit
mailing list