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:        2
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.gz
Source1:        %{name}.service
%if 0%{?suse_version} >= 1210
BuildRequires:  systemd-rpm-macros
%endif
BuildRoot:      %{_tmppath}/%{name}-%{version}-build


%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}/%{name}
install -D -m 644 %{SOURCE1} %{buildroot}%{_unitdir}/%{name}.service
install -d %{buildroot}%{_sysconfdir}
touch %{buildroot}%{_sysconfdir}/no-ip2.conf
%__chmod 600 %{buildroot}%{_sysconfdir}/no-ip2.conf

%pre
%service_add_pre %{name}.service

%post
%service_add_post %{name}.service

%preun
%service_del_preun %{name}.service

%postun
%service_del_postun %{name}.service


%clean
rm -rf %{buildroot}


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

%changelog
openSUSE Build Service is sponsored by