File noip2.spec of Package noip2

#
# Spec file for package noip2
#
# Copyright (c) 2009 Exata T.I., Maringa, PR, Brasil.
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#
# Please submit bugfixes or comments via http://bugs.opensuse.org
#


Name:           noip2
Version:        2.1.9
Release:        0
License:        GPL-2.0+
Summary:        No-IP dynamic DNS
Url:            http://www.no-ip.com
Group:          Productivity/Networking/DNS/Utilities
Source0:        noip-duc-linux.tar.bz2
Source1:        %{name}.init
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
PreReq:         %insserv_prereq

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

%prep
%setup -q -n noip-%{version}-1


%build
export CFLAGS="%{optflags}"
gcc $CFLAGS -Dlinux -DPREFIX=\"\" noip2.c -o noip2


%install
install -D -m 755 noip2 %{buildroot}%{_bindir}/noip2
install -D -m 755 %{SOURCE1} %{buildroot}%{_sysconfdir}/init.d/%{name}
install -d %{buildroot}%{_sbindir}
ln -s -f %{_sysconfdir}/init.d/%{name} %{buildroot}%{_sbindir}/rc%{name}
touch %{buildroot}%{_sysconfdir}/no-ip2.conf

%post
%{fillup_and_insserv -f %{name}}


%preun
%{stop_on_removal %{name}}


%postun
%{restart_on_update %{name}}
%{insserv_cleanup}


%clean
rm -rf %{buildroot}


%files
%defattr(-,root,root)
%doc COPYING README.FIRST
%{_bindir}/%{name}
%{_sbindir}/rc%{name}
%{_sysconfdir}/init.d/%{name}
%ghost %config(noreplace) %{_sysconfdir}/no-ip2.conf

%changelog
openSUSE Build Service is sponsored by