Abort on unknown/misspelled configuration options
[bpdyndnsd] / bpdyndnsd.spec
index 4caa531..1c5d578 100644 (file)
@@ -1,6 +1,6 @@
 Name:           bpdyndnsd
 Summary:        bpdyndnsd - bullet proof dyndns update daemon
-Version:        0.1
+Version:        1.0
 Release:        1
 License:        GPLv2 + Linking Exception
 Group:          Applications/Internet
@@ -9,41 +9,58 @@ URL:            www.intra2net.com
 Packager:       Bjoern Sikora <bjoern.sikora@intra2net.com>
 Source:         %{name}-%{version}.tar.gz
 PreReq:         tar
-BuildRoot:      /tmp/%{name}-%{version}-root
+BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildPreReq:    cmake >= 2.6
 BuildRequires:  boost-devel >= 1.37.0
-BuildRequires:  libcurl-devel >= 7.19.6 
+BuildRequires:  curl-devel >= 7.19.6 
 BuildRequires:  openssl-devel >= 0.9.8k
-Requires:       boost >= 1.37.0
-Requires:       libcurl >= 7.19.6 
+Requires:       boost-serialization >= 1.37.0
+Requires:       curl >= 7.19.6 
 Requires:       openssl >= 0.9.8k
 
 %description
-An bullet proof easy to use dynamic DNS update daemon. Although of the ease of use it's highly scalable and flexible for advanced configurations. At the moment it supports following protocols: DHS, DYNDNS, DYNS, EASYDNS, GNUDIP, ODS, TZO and ZONEEDIT. The IP address to update the dynamic DNS name can be determined either through the wan interface's IP itself or through a webcheck IP URL if located behind a NAT router. It's possible to use multiple services at the same time and for each configured service special parameters can be declared, such as the update interval, maximal number of updates in this interval or the DNS cache ttl. It's also possible to configure a HTTP proxy and the corresponding port. It fully supports IPv6.
+A bullet proof easy to use dynamic DNS update daemon. Although of the ease of use it's highly scalable and flexible for advanced configurations. At the moment it supports following protocols: DHS, DYNDNS, DYNS, EASYDNS, GNUDIP, ODS, TZO and ZONEEDIT. The IP address to update the dynamic DNS name can be determined either through the wan interface's IP itself or through a webcheck IP URL if located behind a NAT router. It's possible to use multiple services at the same time and for each configured service special parameters can be declared, such as the update interval, maximal number of updates within this interval or the DNS cache ttl. It's also possible to configure a HTTP proxy and the corresponding port. It fully supports IPv6.
 
 %prep
 %setup -q
 
 %build
+mkdir build
 cd build
-cmake ..
-make
+
+export CFLAGS="$RPM_OPT_FLAGS"
+export CXXFLAGS="$RPM_OPT_FLAGS"
+cmake -DCMAKE_INSTALL_PREFIX="/usr" ../
+
+make %{?_smp_mflags} VERBOSE=1
 
 %install
+cd build
 make DESTDIR=%{buildroot} install
+cd ..
 %{__mkdir_p} %{buildroot}/etc/bpdyndnsd
 install -m 640 config/bpdyndnsd.conf %{buildroot}/etc/bpdyndnsd/
 %{__mkdir_p} %{buildroot}/etc/init.d
 install -m 755 scripts/bpdyndnsd %{buildroot}/etc/init.d/
+%{__mkdir_p} %{buildroot}/usr/share/doc/%{name}-%{version}
+install -m 644 docs/* %{buildroot}/usr/share/doc/%{name}-%{version}/
+%{__mkdir_p} %{buildroot}/usr/share/doc/%{name}-%{version}/config_examples
+install -m 644 config_examples/* %{buildroot}/usr/share/doc/%{name}-%{version}/config_examples/
+%{__mkdir_p} %{buildroot}/etc/sysconfig
+install -m 644 config/bpdyndnsd %{buildroot}/etc/sysconfig/
+%{__mkdir_p} %{buildroot}/var/state/bpdyndnsd
 
 %clean
-#rm -rf $RPM_BUILD_ROOT
+rm -rf $RPM_BUILD_ROOT
 
 %post
 /sbin/chkconfig --add bpdyndnsd
 /sbin/chkconfig --level 345 bpdyndnsd on
 
 %files
-/etc/bpdyndnsd/bpdyndnsd.conf
+%config(noreplace) /etc/bpdyndnsd/bpdyndnsd.conf
+%config(noreplace) /etc/sysconfig/bpdyndnsd
 /etc/init.d/bpdyndnsd
-/usr/local/bin/bpdyndnsd
+/usr/bin/bpdyndnsd
+%doc /usr/share/doc/%{name}-%{version}
+%dir /var/state/bpdyndnsd