Blob Blame History Raw
Name:		noip
Version:	2.1.9
Release:	5%{?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

%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 Sep 26 2009 Jussi Lehtola <jussilehtola@fedoraproject.org> - 2.1.9-5
- Remove exit statement from %%pre.

* Sat Jul 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.1.9-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild

* Sat Mar 14 2009 Jussi Lehtola <jussilehtola@fedoraproject.org> - 2.1.9-3
- Fix initrd file.

* Thu Nov 27 2008 Jussi Lehtola <jussilehtola@fedoraproject.org> - 2.1.9-2
- Add forgotten init file patch.

* Tue Nov 25 2008 Jussi Lehtola <jussilehtola@fedoraproject.org> - 2.1.9-1
- Update to 2.1.9.

* Thu Nov 06 2008 Jussi Lehtola <jussilehtola@fedoraproject.org> - 2.1.7-1
- First release.