Blob Blame History Raw
Name:           ez-ipupdate
Version:        3.0.11
Release:        0.fdr.0.5.b8.2
Epoch:          0
Summary:        Client for Dynamic DNS Services

Group:          Applications/Internet
License:        GPL
URL:            http://www.gusnet.cx/proj/ez-ipupdate/
Source0:        http://www.gusnet.cx/proj/ez-ipupdate/dist/ez-ipupdate-3.0.11b8.tar.gz
Source1:        %{name}.init
Patch0:         http://ftp.debian.org/debian/pool/main/e/ez-ipupdate/ez-ipupdate_3.0.11b8-6.diff.gz
Patch1:         %{name}-pidfile.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

Requires(post,preun): /sbin/chkconfig
Requires(pre):        /usr/sbin/useradd, /usr/sbin/groupadd
Requires(postun):     /usr/sbin/userdel, /usr/sbin/groupdel

%description
ez-ipupdate is a small utility for updating your host name for any of the
dynamic DNS service offered at: 
  * http://www.ez-ip.net
  * http://www.justlinux.com
  * http://www.dhs.org
  * http://www.dyndns.org
  * http://www.ods.org
  * http://gnudip.cheapnet.net (GNUDip)
  * http://www.dyn.ca (GNUDip)
  * http://www.tzo.com
  * http://www.easydns.com
  * http://www.dyns.cx
  * http://www.hn.org
  * http://www.zoneedit.com
It is pure C and works on Linux, *BSD and Solaris.
Don't forget to create your own config file to %{_sysconfdir}/ez-ipupdate.conf.
You can find some example in %{_docdir}/%{name}-%{version}.

# -----------------------------------------------------------------------------

%prep
%setup -q -n %{name}-%{version}b8
%patch0 -p1
%patch1 -p0
touch stamp-h.in

# -----------------------------------------------------------------------------

%build
%configure
make %{?_smp_mflags}

# -----------------------------------------------------------------------------

%install
rm -rf $RPM_BUILD_ROOT

%makeinstall bindir=$RPM_BUILD_ROOT%{_sbindir}

mkdir -p $RPM_BUILD_ROOT%{_mandir}/man8
cp -p ez-ipupdate.8 $RPM_BUILD_ROOT%{_mandir}/man8

mkdir -p $RPM_BUILD_ROOT%{_initrddir}
perl -pe \
  's|/var/|%{_localstatedir}/|g ;
   s|/usr/sbin/|%{_sbindir}/|g ;
   s|/etc/([^ir])|%{_sysconfdir}/$1|g ;
   s|/etc/rc\.d/init\.d/|%{_initrddir}/|g' \
  < %{SOURCE1} > $RPM_BUILD_ROOT%{_initrddir}/ez-ipupdate

mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/cache/ez-ipupdate
> $RPM_BUILD_ROOT%{_localstatedir}/cache/ez-ipupdate/default-cache

mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}
> $RPM_BUILD_ROOT%{_sysconfdir}/ez-ipupdate.conf

# Create a dedicated dir for the pid file so we can run as non-root.
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/run/ez-ipupdate

# -----------------------------------------------------------------------------

%clean
rm -rf $RPM_BUILD_ROOT

# -----------------------------------------------------------------------------

%pre
/usr/sbin/groupadd -r ez-ipupd >/dev/null 2>&1 || :
/usr/sbin/useradd -r -M -d %{_localstatedir}/cache/ez-ipupdate -g ez-ipupd \
  -s /sbin/nologin -c "Dynamic DNS Client" ez-ipupd >/dev/null 2>&1 || :

%post
/sbin/chkconfig --add ez-ipupdate

%preun
if [ "$1" = "0" ]; then
  %{_initrddir}/ez-ipupdate stop >/dev/null 2>&1 || :
  /sbin/chkconfig --del ez-ipupdate
fi

%postun
if [ "$1" = "0" ]; then
  /usr/sbin/userdel ez-ipupd >/dev/null 2>&1 || :
  /usr/sbin/groupdel ez-ipupd >/dev/null 2>&1 || :
elif [ "$1" -ge 1 ]; then
  %{_initrddir}/ez-ipupdate condrestart >/dev/null
fi

# -----------------------------------------------------------------------------

%files
%defattr(0644,root,root,0755)
%doc CHANGELOG COPYING README example-*.conf
%{_mandir}/*/*
%defattr(0755,root,root,0755)
%attr(0755,root,root) %{_sbindir}/*
%attr(0755,root,root) %{_initrddir}/*
%defattr(0644,ez-ipupd,ez-ipupd,0755)
%dir %{_localstatedir}/cache/ez-ipupdate
%ghost %{_localstatedir}/cache/ez-ipupdate/default-cache
%dir %{_localstatedir}/run/ez-ipupdate
%ghost %attr(0640,root,ez-ipupd) %config(noreplace,missingok) %{_sysconfdir}/ez-ipupdate.conf

# -----------------------------------------------------------------------------

%changelog
* Sat Jul 19 2003 Ville Skyttä <ville.skytta at iki.fi> - 0:3.0.11-0.fdr.0.5.b8
- Update patch from Debian to 3.0.11b8-6 (bug 337).
- Revert default-cache to %%ghost (it's not a %%config file).

* Sat Jul 19 2003 Ville Skyttä <ville.skytta at iki.fi> - 0:3.0.11-0.fdr.0.4.b8
- Own (ghost/config) %%{_sysconfdir}/ez-ipupdate.conf (bug 337).
- Change default-cache to ghost/config.

* Tue Jun 17 2003 Ville Skyttä <ville.skytta at iki.fi> - 0:3.0.11-0.fdr.0.3.b8
- Fix "service ez-update status" hang if no cache-file is specified,
  thanks to Michael Schwendt for the catch (#337).
- Try to show last IP update from "service ez-ipupdate status" only if the
  config file is readable.

* Thu Jun  5 2003 Ville Skyttä <ville.skytta at iki.fi> - 0:3.0.11-0.fdr.0.2.b8
- Fix bad in files section (#337).

* Tue May 27 2003 Ville Skyttä <ville.skytta at iki.fi> - 0:3.0.11-0.fdr.0.1.b8
- First build, based on Debian's 3.0.11b8_2 and Rudolf Kastl's work.