Sophie

Sophie

distrib > Mandriva > 2009.0 > i586 > by-pkgid > 1ac9ed09c05a8e3bf87293ab9bf3b19c > files > 6

unbound-1.0.2-3mdv2009.0.src.rpm

%define major 0
%define libname %mklibname %{name} %{major}
%define develname %mklibname -d %{name}

Summary:	Validating, recursive, and caching DNS resolver
Name:		unbound
Version:	1.0.2
Release:	%mkrel 3
Group:		System/Servers
License:	BSD
URL:		http://www.unbound.net/
Source0:	http://www.unbound.net/downloads/unbound-%{version}.tar.gz
Source1:	unbound.init
Source2:    unbound.mandriva.conf
Patch0:		unbound-1.0.0_stupid_rpath.patch
Patch1:		unbound-1.0.0_preserve_cflags.patch
Requires(post): rpm-helper
Requires(preun): rpm-helper
Requires(pre): rpm-helper
Requires(postun): rpm-helper
BuildRequires:	bison
BuildRequires:	doxygen
BuildRequires:	flex
BuildRequires:	libevent-devel
BuildRequires:	ldns-devel >= 1.3.0
BuildRequires:	libtool
BuildRequires:	openssl-devel
BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-buildroot

%description
Unbound is a validating, recursive, and caching DNS resolver.

%package -n	%{libname}
Summary:	Shared library from unbound
Group:		System/Libraries

%description -n	%{libname}
A validating, recursive, and caching DNS resolver

%package -n	%{develname}
Summary:	Development files for libunbound
Group:		Development/C
Requires:	%{libname} = %{version}-%{release}
Provides:	%{name} = %{version}-%{release}

%description -n	%{develname}
A validating, recursive, and caching DNS resolver

%prep

%setup -q
%patch0
%patch1

cp %{SOURCE1} unbound.init

rm -f ldns-src.tar.gz

%build

%configure2_5x \
    --disable-rpath \
    --with-ssl=%{_prefix} \
    --with-pthreads \
    --with-libevent=%{_prefix} \
    --with-ldns=%{_prefix}

%make
make doc

%install
rm -rf %{buildroot}

install -d %{buildroot}%{_initrddir}
install -d %{buildroot}%{_localstatedir}/unbound
install -d %{buildroot}/var/run//unbound

%makeinstall_std

install -m0755 unbound.init %{buildroot}%{_initrddir}/unbound

install -m0644 %{SOURCE2} %{buildroot}/%{_sysconfdir}/%name/

echo "# place here local modification of the configuration" > %{buildroot}/%{_sysconfdir}/%name/unbound.local.conf

perl -pi -e '$. eq 1 && print "include: /etc/unbound/unbound.mandriva.conf\n"' %{buildroot}/%{_sysconfdir}/%name/%name.conf
perl -pi -e '$. eq 1 && print "include: /etc/unbound/unbound.local.conf\n"' %{buildroot}/%{_sysconfdir}/%name/%name.conf

%pre
%_pre_useradd unbound %{_localstatedir}/unbound /bin/false

%postun
%_postun_userdel unbound

%post
%_post_service unbound

%preun
%_preun_service unbound

%post -n %{libname} -p /sbin/ldconfig

%postun -n %{libname} -p /sbin/ldconfig

%clean
rm -rf %{buildroot}

%files
%defattr(-,root,root,-)
%doc doc/CREDITS doc/Changelog doc/FEATURES doc/LICENSE doc/README doc/README.tests
%doc doc/example.conf doc/plan doc/requirements.txt
%{_initrddir}/unbound
%attr(-,root,unbound) %dir %{_sysconfdir}/unbound
%attr(-,root,unbound) %config(noreplace) %{_sysconfdir}/unbound/*
%{_sbindir}/unbound
%{_sbindir}/unbound-checkconf
%{_sbindir}/unbound-host
%{_mandir}/man1/*
%{_mandir}/man5/*
%{_mandir}/man8/*
%attr(0750,unbound,unbound) %dir %{_localstatedir}/unbound
%attr(0750,unbound,unbound) %dir /var/run/unbound

%files -n %{libname}
%doc LICENSE README
%defattr(-,root,root,-)
%{_libdir}/lib*so.%{major}*

%files -n %{develname}
%defattr(-,root,root,-)
%doc doc/html/* doc/README.svn doc/TODO
%{_includedir}/*.h
%{_libdir}/lib*.so
%{_libdir}/lib*.*a
%{_mandir}/man3/*


%changelog
* Sun Sep 21 2008 Michael Scherer <misc@mandriva.org> 1.0.2-3mdv2009.0
+ Revision: 286382
- fix initscript, by declaring a pidfile location, removing chroot, and creating a directory
  with proper permission. I have also added two configfile to minimize modification on
  upstream configuration file

* Tue Sep 16 2008 Michael Scherer <misc@mandriva.org> 1.0.2-2mdv2009.0
+ Revision: 285119
- fix the initscript, the end was missing and thus, rpmlint and pcrsys were complaining

* Sun Sep 07 2008 Oden Eriksson <oeriksson@mandriva.com> 1.0.2-1mdv2009.0
+ Revision: 282300
- 1.0.2

* Wed Jul 16 2008 Michael Scherer <misc@mandriva.org> 1.0.1-1mdv2009.0
+ Revision: 236606
- update to 1.0.1
- remove patch 2, already applied upstream

* Fri May 30 2008 Oden Eriksson <oeriksson@mandriva.com> 1.0.0-0.2mdv2009.0
+ Revision: 213460
- fix deps
- bump release
- fix a typo
- import unbound


* Fri May 30 2008 Oden Eriksson <oeriksson@mandriva.com> 1.0.0-0.1mdv2009.0
- initial Mandriva package (opensuse import)