rpms/noip/EL-5 noip.patch, NONE, 1.1 noip.spec, NONE, 1.1 sources, 1.1, 1.2

Jussi Lehtola jussilehtola at fedoraproject.org
Fri Mar 27 20:48:03 UTC 2009


Author: jussilehtola

Update of /cvs/pkgs/rpms/noip/EL-5
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv14810/EL-5

Modified Files:
	sources 
Added Files:
	noip.patch noip.spec 
Log Message:
* Fri Mar 27 2009 Jussi Lehtola <jussi.lehtola at iki.fi> - 2.1.9-3
- Import to Fedora.


noip.patch:

--- NEW FILE noip.patch ---
diff -up noip-2.1.9/Makefile.orig noip-2.1.9/Makefile
--- noip-2.1.9/Makefile.orig	2008-11-22 00:27:15.000000000 +0200
+++ noip-2.1.9/Makefile	2009-03-14 01:56:38.000000000 +0200
@@ -3,8 +3,8 @@ CC=gcc
 PKG=noip-2.1.tgz
 
 PREFIX=/usr/local
-CONFDIR=${PREFIX}/etc
-BINDIR=${PREFIX}/bin
+CONFDIR=@SYSCONFDIR@
+BINDIR=@SBINDIR@
 
 # these defines are for Linux
 LIBS=
@@ -22,7 +22,7 @@ ARCH=linux
 # ARCH=sun
 
 ${TGT}: Makefile ${TGT}.c 
-	${CC} -Wall -g -D${ARCH} -DPREFIX=\"${PREFIX}\" ${TGT}.c -o ${TGT} ${LIBS}
+	${CC} @OPTFLAGS@ -D${ARCH} -DPREFIX=\"${PREFIX}\" ${TGT}.c -o ${TGT} ${LIBS}
 
 install: ${TGT} 
 	if [ ! -d ${BINDIR} ]; then mkdir -p ${BINDIR};fi
diff -up noip-2.1.9/noip2.c.orig noip-2.1.9/noip2.c
--- noip-2.1.9/noip2.c.orig	2008-11-22 00:19:54.000000000 +0200
+++ noip-2.1.9/noip2.c	2009-03-14 01:56:38.000000000 +0200
@@ -232,11 +232,8 @@
 #define HOST			1
 #define GROUP			2
 #define DOMAIN			3
-#ifndef PREFIX
-  #define PREFIX		"/usr/local"
-#endif
-#define CONFIG_FILEPATH		PREFIX"/etc"
-#define CONFIG_FILENAME		PREFIX"/etc/no-ip2.conf"
+#define CONFIG_FILEPATH		"/etc"
+#define CONFIG_FILENAME		"/etc/no-ip2.conf"
 #define CONFSTRLEN		1024
 #define MAX_DEVLEN		16
 #define MAX_INSTANCE		4
diff -up noip-2.1.9/redhat.noip.sh.orig noip-2.1.9/redhat.noip.sh
--- noip-2.1.9/redhat.noip.sh.orig	2003-07-28 13:47:03.000000000 +0300
+++ noip-2.1.9/redhat.noip.sh	2009-03-14 01:58:24.000000000 +0200
@@ -1,76 +1,105 @@
 #!/bin/sh
 #
-# chkconfig: 345 99 80
-# description: Starts and stops the no-ip.com Dynamic dns client daemon
+# noip		This shell script takes care of starting and stopping the noip
+#		client daemon.
 #
-# pidfile: /var/run/noipd.pid
-#
-# Written by serge at vanginderachter.be and tested on Redhat 8
-# ... and debugged by Uwe Dippel
-# 29-03-2003
-#
-# Source function library.
-if [ -f /etc/init.d/functions ] ; then
-  . /etc/init.d/functions
-elif [ -f /etc/rc.d/init.d/functions ] ; then
-  . /etc/rc.d/init.d/functions
-else
-  exit 0
-fi
-
-# Avoid using root's TMPDIR
-unset TMPDIR
+# chkconfig:   - 20 80
+# description: Starts and stops the noip client daemon.
 
-# Source networking configuration.
-. /etc/sysconfig/network
+### BEGIN INIT INFO
+# Provides: 
+# Required-Start:  $network
+# Required-Stop: 
+# Should-Start: 
+# Should-Stop: 
+# Default-Start: 
+# Default-Stop: 
+# Short-Description: 
+# Description:      
+### END INIT INFO
 
-# Check that networking is up.
-[ ${NETWORKING} = "no" ] && exit 0
+# Source function library.
+. /etc/rc.d/init.d/functions
 
-RETVAL=0
+exec="/usr/sbin/noip2"
+prog="noip2"
+config="/etc/no-ip2.conf"
+
+lockfile=/var/lock/subsys/$prog
 
 start() {
-	if [ -f /var/run/noipd.pid ] ; then
-		echo "no-ip client daemon already started" && exit 0
-	fi
-	echo -n $"Starting no-ip client daemon: "
-	daemon /usr/local/bin/noip2
-	echo
-	RETVAL=$?
-	/sbin/pidof noip2 > /var/run/noipd.pid
-}	
+    [ -x $exec ] || exit 5
+    [ -f $config ] || exit 6
+    # Check ownership of config file
+    chown noip: $config
+    echo -n $"Starting $prog: "
+    daemon --user noip /usr/sbin/noip2
+    retval=$?
+    echo
+    [ $retval -eq 0 ] && touch $lockfile
+    return $retval
+}
 
 stop() {
-	if [ -f /var/run/noipd.pid ] ; then
-		echo -n $"Stopping no-ip client daemon: "
-		killproc noip2 -TERM
-		echo
-		RETVAL=$?
-		rm -f /var/run/noipd.pid
-	else
-		echo "no-ip client daemon is not running" && exit 0
-	fi
-	return $RETVAL
-}	
+    echo -n $"Stopping $prog: "
+    killproc noip2 -TERM
+    retval=$?
+    echo
+    [ $retval -eq 0 ] && rm -f $lockfile
+    return $retval
+}
 
 restart() {
-	stop
-	start
-}	
+    stop
+    start
+}
+
+reload() {
+    restart
+}
+
+force_reload() {
+    restart
+}
+
+rh_status() {
+    # run checks to determine if the service is running or use generic status
+    status $prog
+}
+
+rh_status_q() {
+    rh_status >/dev/null 2>&1
+}
+
 
 case "$1" in
-  start)
-  	start
-	;;
-  stop)
-  	stop
-	;;
-  restart)
-  	restart
-	;;
-  *)
-	echo $"Usage: $0 {start|stop|restart}"
-	exit 1
+    start)
+        rh_status_q && exit 0
+        $1
+        ;;
+    stop)
+        rh_status_q || exit 0
+        $1
+        ;;
+    restart)
+        $1
+        ;;
+    reload)
+        rh_status_q || exit 7
+        $1
+        ;;
+    force-reload)
+        force_reload
+        ;;
+    status)
+        rh_status
+        ;;
+    condrestart|try-restart)
+        rh_status_q || exit 0
+        restart
+        ;;
+    *)
+        echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
+        exit 2
 esac
-
 exit $?


--- NEW FILE noip.spec ---
Name:		noip
Version:	2.1.9
Release:	3%{?dist}
Summary:	A dynamic DNS update client
Group:		System Environment/Daemons
License:	GPLv2+
URL:		http://www.no-ip.com
Source0:	http://www.no-ip.com/client/linux/noip-duc-linux.tar.gz
# Patch for Fedora specifics 
Patch0:		noip.patch
BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

Requires(pre):		shadow-utils
Requires(post):		chkconfig

Requires(preun):	chkconfig
# This is for /sbin/service
Requires(preun):	initscripts

%description
Keep your current IP address in sync with your No-IP host or domain with 
this Dynamic Update Client (DUC). The client continually checks for IP 
address changes in the background and automatically updates the DNS at 
No-IP whenever it changes.

N.B. You need to run
	%# noip2 -C
before starting the service.

%prep
%setup -q
%patch0 -p1
sed -i 's|@OPTFLAGS@|%{optflags}|g;s|@SBINDIR@|%{buildroot}%{_sbindir}|g;s|@SYSCONFDIR@|%{buildroot}%{_sysconfdir}|g' Makefile

%build
make %{?_smp_mflags}

%install
rm -rf %{buildroot}
install -D -p -m 755 noip2 %{buildroot}/%{_sbindir}/noip2

# Make dummy config file 
mkdir -p %{buildroot}/%{_sysconfdir}
touch %{buildroot}/%{_sysconfdir}/no-ip2.conf

# Install init script
install -D -p -m 755 redhat.noip.sh %{buildroot}%{_initrddir}/noip

# Make run directory
mkdir -p %{buildroot}/var/run/noip

%pre
# Add noip user & group
getent group noip >/dev/null || groupadd -r noip
getent passwd noip >/dev/null || \ 
	useradd -r -g noip -d /var/run/noip -s /sbin/nologin \
	-c "No-ip daemon user" noip
exit 0

%post
# This adds the proper /etc/rc*.d links for the script
/sbin/chkconfig --add noip 

%preun
if [ $1 = 0 ] ; then
	/sbin/service noip stop >/dev/null 2>&1
	/sbin/chkconfig --del noip
fi

%clean
rm -rf %{buildroot}

%files
%defattr(-,root,root,-)
%doc COPYING README.FIRST
%{_sbindir}/noip2
%attr(600,noip,noip) %config(noreplace) %{_sysconfdir}/no-ip2.conf
%attr(700,noip,noip) /var/run/noip
%{_initrddir}/noip

%changelog
* Sat Mar 14 2009 Jussi Lehtola - 2.1.9-3
- Fix initrd file.

* Thu Nov 27 2008 Jussi Lehtola - 2.1.9-2
- Add forgotten init file patch.

* Tue Nov 25 2008 Jussi Lehtola - 2.1.9-1
- Update to 2.1.9.

* Thu Nov 06 2008 Jussi Lehtola - 2.1.7-1
- First release.


Index: sources
===================================================================
RCS file: /cvs/pkgs/rpms/noip/EL-5/sources,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- sources	27 Mar 2009 20:29:24 -0000	1.1
+++ sources	27 Mar 2009 20:47:33 -0000	1.2
@@ -0,0 +1 @@
+eed8e9ef9edfb7ddc36e187de867fe64  noip-duc-linux.tar.gz




More information about the fedora-extras-commits mailing list