From 051823a3bc39d942a8e060a2ced6409561d911052100c239fa4712207ef5d9c0 Mon Sep 17 00:00:00 2001 From: Marguerite Su Date: Sun, 21 Feb 2016 11:32:03 +0000 Subject: [PATCH] Accepting request 360010 from home:darix:branches:server:dns - revert the previous change which would not solve the problem as the library package requires the unbound-anchor package instead introduce a libunbound-devel-mini package which holds the shared library and devel files with a minimal build requires. unbound-devel and libunbound-devel-mini both provide libunbound-devel. Please use that symbol as a buildrequires in your spec files. OBS-URL: https://build.opensuse.org/request/show/360010 OBS-URL: https://build.opensuse.org/package/show/server:dns/unbound?expand=0&rev=32 --- libunbound-devel-mini-rpmlintrc | 1 + ...d.changes => libunbound-devel-mini.changes | 8 + libunbound-devel-mini.spec | 108 +++++ libunbound.spec | 442 ------------------ unbound.changes | 12 + unbound.spec | 110 ++--- 6 files changed, 166 insertions(+), 515 deletions(-) create mode 100644 libunbound-devel-mini-rpmlintrc rename libunbound.changes => libunbound-devel-mini.changes (98%) create mode 100644 libunbound-devel-mini.spec delete mode 100644 libunbound.spec diff --git a/libunbound-devel-mini-rpmlintrc b/libunbound-devel-mini-rpmlintrc new file mode 100644 index 0000000..9123fec --- /dev/null +++ b/libunbound-devel-mini-rpmlintrc @@ -0,0 +1 @@ +addFilter('shlib-policy-name-error') diff --git a/libunbound.changes b/libunbound-devel-mini.changes similarity index 98% rename from libunbound.changes rename to libunbound-devel-mini.changes index 336000c..8a62bc3 100644 --- a/libunbound.changes +++ b/libunbound-devel-mini.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Wed Feb 17 15:55:34 UTC 2016 - mrueckert@suse.de + +- revert the previous change which would not solve the problem as + the library package requires the unbound-anchor package + instead introduce a libunbound-devel-mini package which holds the + shared library and devel files with a minimal build requires. + ------------------------------------------------------------------- Thu Feb 4 13:01:35 UTC 2016 - meissner@suse.com diff --git a/libunbound-devel-mini.spec b/libunbound-devel-mini.spec new file mode 100644 index 0000000..6c9a141 --- /dev/null +++ b/libunbound-devel-mini.spec @@ -0,0 +1,108 @@ +# +# spec file for package libunbound +# +# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany. +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# + + +%bcond_without python +%bcond_without munin +%bcond_without hardened_build + +%define ldns_version 1.6.16 + +# +Name: libunbound-devel-mini +Version: 1.5.7 +Release: 0 +# +# +BuildRoot: %{_tmppath}/%{name}-%{version}-build +BuildRequires: flex +BuildRequires: ldns-devel >= %{ldns_version} +BuildRequires: libevent-devel +BuildRequires: libexpat-devel +BuildRequires: openssl-devel +Requires: this-is-only-for-build-envs +Conflicts: unbound-devel +Provides: libunbound-devel = %{version}-%{release} +# +Url: http://www.unbound.net/ +Source: http://www.unbound.net/downloads/unbound-%{version}.tar.gz +Source5: root.key +Source6: dlv.isc.org.key +# From http://data.iana.org/root-anchors/icannbundle.pem +Source12: icannbundle.pem +Source13: root.anchor + +Summary: Just a devel package for build loops +License: BSD-3-Clause +Group: Productivity/Networking/DNS/Servers + +%description +Unbound is a validating, recursive, and caching DNS(SEC) resolver. + +The C implementation of Unbound is developed and maintained by NLnet +Labs. It is based on ideas and algorithms taken from a java prototype +developed by Verisign labs, Nominet, Kirei and ep.net. + +Unbound is designed as a set of modular components, so that also +DNSSEC (secure DNS) validation and stub-resolvers (that do not run +as a server, but are linked into an application) are easily possible. + +%prep +%setup -n unbound-%version + +%build +export CFLAGS="%{optflags}" +export CXXFLAGS="%{optflags}" +%configure \ + --disable-rpath \ + --with-libevent \ + --with-pthreads \ + --disable-static \ + --with-ldns=%{_prefix} \ + --enable-sha2 \ + --enable-gost \ + --enable-ecdsa \ + --enable-event-api \ + --enable-pie \ + --enable-relro-now \ + --with-conf-file=%{_sysconfdir}/%{name}/unbound.conf \ + --with-pidfile=%{piddir}%{name}/%{name}.pid \ + --without-pythonmodule --without-pyunbound \ + --with-libunbound-only \ + --with-rootkey-file=%{_sharedstatedir}/unbound/root.key + +%{__make} %{?_smp_mflags} + +%install +make install DESTDIR="%{buildroot}" +rm -rf %{buildroot}%{_mandir} %{buildroot}%{_libdir}/*.la + +%check +# it currently fails in the ldns unit test. which is weird as both come from the same project +make check ||: + +%post -p /sbin/ldconfig +%postun -p /sbin/ldconfig + +%files +%defattr(-,root,root,-) +%{_libdir}/libunbound.so.* +%{_includedir}/unbound.h +%{_includedir}/unbound-event.h +%{_libdir}/libunbound.so + +%changelog diff --git a/libunbound.spec b/libunbound.spec deleted file mode 100644 index 98dfe2b..0000000 --- a/libunbound.spec +++ /dev/null @@ -1,442 +0,0 @@ -# -# spec file for package libunbound -# -# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany. -# -# All modifications and additions to the file contributed by third parties -# remain the property of their copyright owners, unless otherwise agreed -# upon. The license for this file, and modifications and additions to the -# file, is the same license as for the pristine package itself (unless the -# license for the pristine package is not an Open Source License, in which -# case the license is the MIT License). An "Open Source License" is a -# license that conforms to the Open Source Definition (Version 1.9) -# published by the Open Source Initiative. - -# Please submit bugfixes or comments via http://bugs.opensuse.org/ -# - - -%bcond_without python -%bcond_without munin -%bcond_without hardened_build - -%if 0%{?suse_version} > 1320 -%bcond_without dnstap -%else -%bcond_with dnstap -%endif - -%if 0%{?suse_version} >= 1230 -%bcond_without systemd -%else -%bcond_with systemd -%endif - -# only needed for < 1310 -%{!?_tmpfilesdir:%global _tmpfilesdir /usr/lib/tmpfiles.d} - -# -%define _sharedstatedir /var/lib/ -%define ldns_version 1.6.16 -%define fwdir /etc/sysconfig/SuSEfirewall2.d/services - -# -%if 0%{?suse_version} > 1220 -%define piddir /run -%else -%define piddir %{_localstatedir}/run -%endif - -%if %{with python} -%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} -%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")} -%endif - -Name: libunbound -Version: 1.5.7 -Release: 0 -# -# -BuildRoot: %{_tmppath}/%{name}-%{version}-build -BuildRequires: flex -BuildRequires: ldns-devel >= %{ldns_version} -BuildRequires: libevent-devel -BuildRequires: libexpat-devel -BuildRequires: openssl-devel -%if %name == "unbound" -BuildRequires: python-devel -%if %{with python} -BuildRequires: swig -%endif -%if %{with dnstap} -BuildRequires: libfstrm-devel -BuildRequires: libprotobuf-c-devel >= 1.0.0 -BuildRequires: protobuf-c >= 1.0.0 -%endif -PreReq: pwdutils -Requires: ldns >= %{ldns_version} -# until we figured something else out for the unbound-anchor part in the systemd unit file -Requires: sudo -%if %{with systemd} -BuildRequires: systemd-devel -%{?systemd_requires} -%endif -%endif -# -Url: http://www.unbound.net/ -Source: http://www.unbound.net/downloads/unbound-%{version}.tar.gz -Source1: unbound.service -Source2: unbound.conf -Source3: unbound.munin -Source4: unbound_munin_ -Source5: root.key -Source6: dlv.isc.org.key -Source7: unbound-keygen.service -Source8: tmpfiles-unbound.conf -Source9: example.com.key -Source10: example.com.conf -Source11: block-example.com.conf -# From http://data.iana.org/root-anchors/icannbundle.pem -Source12: icannbundle.pem -Source13: root.anchor -Source14: unbound.sysconfig -Source15: unbound.cron -Source16: unbound-munin.README -Source17: unbound.firewall - -Summary: Validating, recursive, and caching DNS(SEC) resolver -License: BSD-3-Clause -Group: Productivity/Networking/DNS/Servers - -%description -Unbound is a validating, recursive, and caching DNS(SEC) resolver. - -The C implementation of Unbound is developed and maintained by NLnet -Labs. It is based on ideas and algorithms taken from a java prototype -developed by Verisign labs, Nominet, Kirei and ep.net. - -Unbound is designed as a set of modular components, so that also -DNSSEC (secure DNS) validation and stub-resolvers (that do not run -as a server, but are linked into an application) are easily possible. - -%define libname libunbound2 -%if %name == "libunbound" -%package -n %{libname} -Requires: %{name}-anchor >= %{version} -# -Summary: Shared library from unbound -Group: Development/Libraries/C and C++ - -%description -n %{libname} -Unbound is a validating, recursive, and caching DNS(SEC) resolver. - -This package holds the shared library from unbound. - -%package devel -Requires: %{libname} = %{version} -Requires: ldns-devel >= %{ldns_version} -Requires: openssl-devel -# -Summary: Development files for libunbound -Group: Development/Libraries/C and C++ - -%description devel -Unbound is a validating, recursive, and caching DNS(SEC) resolver. - -This package holds the development files to work with libunbound. - -%else - -%if %{with_munin} -%package munin -Summary: Plugin for the munin / munin-node monitoring package -Group: System Environment/Daemons -Requires: %{name} = %{version} -Requires: bc -Requires: munin-node -BuildArch: noarch - -%description munin -Unbound is a validating, recursive, and caching DNS(SEC) resolver. - -This package holds the plugin for the munin / munin-node monitoring package -%endif - -%package anchor -# -Requires: cron -Summary: Unbound Anchor cert management tools -Group: Productivity/Networking/DNS/Servers - -%description anchor -Unbound is a validating, recursive, and caching DNS(SEC) resolver. - -This package contains the tools to manage the anchor certs. - -%if %{with python} -%package python -Summary: Python modules and extensions for unbound -Group: Applications/System -Requires: %{libname} = %{version} - -%description python -Unbound is a validating, recursive, and caching DNS(SEC) resolver. - -This package holds the Python modules and extensions for unbound. -%endif - -%endif - -%prep -%setup -n unbound-%version - -%build -export CFLAGS="%{optflags}" -export CXXFLAGS="%{optflags}" -%configure \ - --disable-rpath \ - --with-libevent \ - --with-pthreads \ - --disable-static \ - --with-ldns=%{_prefix} \ - --enable-sha2 \ - --enable-gost \ - --enable-ecdsa \ - --enable-event-api \ - --enable-pie \ - --enable-relro-now \ - --with-conf-file=%{_sysconfdir}/%{name}/unbound.conf \ - --with-pidfile=%{piddir}%{name}/%{name}.pid \ -%if %name == "unbound" -%if %{with dnstap} - --enable-dnstap \ -%endif -%if %{with python} - --with-pythonmodule --with-pyunbound \ -%endif -%else - --without-pythonmodule --without-pyunbound \ -%endif - --with-rootkey-file=%{_sharedstatedir}/unbound/root.key - -%{__make} %{?_smp_mflags} -%{__make} %{?_smp_mflags} streamtcp - -%install -make install DESTDIR="%{buildroot}" - -%if %name == "unbound" -install -d -m 0750 %{buildroot}/var/lib/unbound -install -d 0755 %{buildroot}%{_unitdir} -install -p -m 0644 %{SOURCE1} %{buildroot}%{_unitdir}/unbound.service -install -p -m 0644 %{SOURCE7} %{buildroot}%{_unitdir}/unbound-keygen.service -install -p -m 0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/unbound -install -p -m 0644 %{SOURCE12} %{buildroot}%{_sysconfdir}/unbound -install -D -p -m 0644 %{SOURCE14} %{buildroot}/var/adm/fillup-templates/sysconfig.%{name} -ln -sf /usr/sbin/service %{buildroot}%{_sbindir}/rcunbound -ln -sf /usr/sbin/service %{buildroot}%{_sbindir}/rcunbound-keygen - -install -p -m 0644 %{SOURCE16} . -install -d 0755 %{buildroot}%{_sysconfdir}/cron.d -install -p -m 0644 %{SOURCE15} %{buildroot}%{_sysconfdir}/cron.d/unbound-anchor - -install -d 0755 %{buildroot}%{fwdir} -install -p -m 0644 %{SOURCE17} %{buildroot}%{fwdir}/%{name} - -%if %{with munin} -# Install munin plugin and its softlinks -install -d 0755 %{buildroot}%{_sysconfdir}/munin/plugin-conf.d -install -p -m 0644 %{SOURCE3} %{buildroot}%{_sysconfdir}/munin/plugin-conf.d/unbound -install -d 0755 %{buildroot}%{_datadir}/munin/plugins/ -install -p -m 0755 %{SOURCE4} %{buildroot}%{_datadir}/munin/plugins/unbound -for plugin in unbound_munin_hits unbound_munin_queue unbound_munin_memory unbound_munin_by_type unbound_munin_by_class unbound_munin_by_opcode unbound_munin_by_rcode unbound_munin_by_flags unbound_munin_histogram; do - ln -s unbound %{buildroot}%{_datadir}/munin/plugins/$plugin -done -%endif - -# install streamtcp used for monitoring / debugging unbound's port 80/443 modes -install -m 0755 streamtcp %{buildroot}%{_sbindir}/unbound-streamtcp -# install streamtcp man page -install -m 0644 testcode/streamtcp.1 %{buildroot}/%{_mandir}/man1/unbound-streamtcp.1 - -# Install tmpfiles.d config -install -d -m 0755 %{buildroot}%{_tmpfilesdir}/ \ - %{buildroot}%{_sharedstatedir}/unbound -install -m 0644 %{SOURCE8} %{buildroot}%{_tmpfilesdir}/unbound.conf - -# install root and DLV key - we keep a copy of the root key in old location, -# in case user has changed the configuration and we wouldn't update it there -install -m 0644 %{SOURCE5} %{SOURCE6} %{buildroot}%{_sysconfdir}/unbound/ -install -m 0644 %{SOURCE13} %{buildroot}%{_sharedstatedir}/unbound/root.key - -# remove static library from install (fedora packaging guidelines) -rm %{buildroot}%{_libdir}/*.la -%if %{with python} -rm %{buildroot}%{python_sitearch}/*.la -%endif - -# create softlink for all functions of libunbound man pages -for mpage in ub_ctx ub_result ub_ctx_create ub_ctx_delete ub_ctx_set_option ub_ctx_get_option ub_ctx_config ub_ctx_set_fwd ub_ctx_resolvconf ub_ctx_hosts ub_ctx_add_ta ub_ctx_add_ta_file ub_ctx_trustedkeys ub_ctx_debugout ub_ctx_debuglevel ub_ctx_async ub_poll ub_wait ub_fd ub_process ub_resolve ub_resolve_async ub_cancel ub_resolve_free ub_strerror ub_ctx_print_local_zones ub_ctx_zone_add ub_ctx_zone_remove ub_ctx_data_add ub_ctx_data_remove; -do - echo ".so man3/libunbound.3" > %{buildroot}%{_mandir}/man3/${mpage}.3 ; -done - -mkdir -p %{buildroot}%{piddir}/%{name} - -# Install directories for easier config file drop in - -mkdir -p %{buildroot}%{_sysconfdir}/unbound/{keys.d,conf.d,local.d} -install -m 0640 -p %{SOURCE9} %{buildroot}%{_sysconfdir}/unbound/keys.d/ -install -m 0640 -p %{SOURCE10} %{buildroot}%{_sysconfdir}/unbound/conf.d/ -install -m 0640 -p %{SOURCE11} %{buildroot}%{_sysconfdir}/unbound/local.d/ - -# Link unbound-control-setup.8 manpage to unbound-control.8 -echo ".so man8/unbound-control.8" > %{buildroot}/%{_mandir}/man8/unbound-control-setup.8 - -###### split out library things. - -rm -rf %{buildroot}%{_mandir}/man3 -rm -rf %{buildroot}%{_includedir}/ -rm -rf %{buildroot}%{_libdir}/libunbound*.so* - -%else -rm -rf %{buildroot}%{_sysconfdir}/ -rm -rf %{buildroot}%{_bindir}/ -rm -rf %{buildroot}%{_sbindir}/ -rm -rf %{buildroot}%{_libdir}/libunbound.la -rm -rf %{buildroot}%{_mandir}/man1 -rm -rf %{buildroot}%{_mandir}/man5 -rm -rf %{buildroot}%{_mandir}/man8 - -%endif - -%check -# it currently fails in the ldns unit test. which is weird as both come from the same project -make check ||: - -%if %name == "unbound" -%pre anchor -/usr/sbin/groupadd -r unbound >/dev/null 2>&1 || : -/usr/sbin/useradd -g unbound -s /bin/false -r -c "unbound caching dns server" -d /var/lib/unbound unbound >/dev/null 2>&1 || : - -%pre -%if %{with systemd} -%service_add_pre unbound-keygen.service unbound.service -%endif - -%post -%fillup_only %{name} -%if %{with systemd} -systemd-tmpfiles --create %{_tmpfilesdir}/unbound.conf || : -%service_add_post unbound-keygen.service unbound.service -%endif - -%preun -%if %{with systemd} -%service_del_preun unbound-keygen.service unbound.service -%else -%stop_on_removal %{name} -%endif - -%postun -%if %{with systemd} -%service_del_postun unbound-keygen.service unbound.service -%else -%restart_on_update %{name} -%{insserv_cleanup} -%endif - -%else - -%post -n %{libname} -p /sbin/ldconfig -%postun -n %{libname} -p /sbin/ldconfig - -%endif - -%if %name == "unbound" -%files -%defattr(-,root,root,-) -%doc doc/README doc/CREDITS doc/LICENSE doc/FEATURES -%attr(0755,unbound,unbound) %ghost %dir %{piddir}/%{name} -%attr(0640,root,unbound) %config(noreplace) %{_sysconfdir}/%{name}/unbound.conf -%dir %attr(-,root,unbound) %{_sysconfdir}/%{name}/keys.d -%attr(0660,root,unbound) %config(noreplace) %{_sysconfdir}/%{name}/keys.d/*.key -%dir %attr(-,root,unbound) %{_sysconfdir}/%{name}/conf.d -%attr(0660,root,unbound) %config(noreplace) %{_sysconfdir}/%{name}/conf.d/*.conf -%dir %attr(-,root,unbound) %{_sysconfdir}/%{name}/local.d -%attr(0660,root,unbound) %config(noreplace) %{_sysconfdir}/%{name}/local.d/*.conf -%{_sbindir}/unbound -%{_sbindir}/unbound-checkconf -%{_sbindir}/unbound-host -%{_sbindir}/unbound-control -%{_sbindir}/unbound-control-setup -%{_sbindir}/unbound-streamtcp -%{_mandir}/man1/unbound-host.1* -%{_mandir}/man5/unbound.conf.5* -%{_mandir}/man8/unbound.8* -%{_mandir}/man8/unbound-checkconf.8* -%{_mandir}/man8/unbound-control-setup.8* -%{_mandir}/man8/unbound-control.8* -%{_mandir}/man1/unbound-streamtcp.1* -/var/adm/fillup-templates/sysconfig.%{name} -%if %{with systemd} -%{_tmpfilesdir}/unbound.conf -%{_unitdir}/unbound-keygen.service -%{_unitdir}/unbound.service -%endif -%{_sbindir}/rcunbound -%{_sbindir}/rcunbound-keygen -%dir %{fwdir} -%config %{fwdir}/%{name} - -%if %{with python} -%files python -%defattr(-,root,root,-) -%{python_sitearch}/* -%doc libunbound/python/examples/* -%doc pythonmod/examples/* -%endif - -%if %{with munin} -%files munin -%defattr(-,root,root,-) -%dir %{_sysconfdir}/munin/ -%dir %{_sysconfdir}/munin/plugin-conf.d/ -%config(noreplace) %{_sysconfdir}/munin/plugin-conf.d/unbound -%dir %{_datadir}/munin/ -%dir %{_datadir}/munin/plugins/ - %{_datadir}/munin/plugins/unbound* -%doc unbound-munin.README -%endif - -%files anchor -%defattr(-,root,root,-) -%dir %{_sysconfdir}/%{name}/ -%{_sbindir}/unbound-anchor -%config %{_sysconfdir}/%{name}/icannbundle.pem -%config %{_sysconfdir}/cron.d/unbound-anchor -%dir %attr(-,unbound,unbound) %{_sharedstatedir}/%{name} -%attr(0640,unbound,unbound) %config(noreplace) %{_sharedstatedir}/%{name}/root.key -%attr(0640,root,unbound) %config(noreplace) %{_sysconfdir}/%{name}/dlv.isc.org.key -# just left for backwards compat with user changed unbound.conf files - format is different! -%attr(0640,root,unbound) %config(noreplace) %{_sysconfdir}/%{name}/root.key -%{_mandir}/man8/unbound-anchor.8* -%doc doc/README doc/LICENSE - -%else - -%files -n %{libname} -%defattr(-,root,root,-) -%{_libdir}/libunbound.so.* - -%files devel -%defattr(-,root,root,-) -%{_includedir}/unbound.h -%{_includedir}/unbound-event.h -%{_libdir}/libunbound.so -%{_mandir}/man3/libunbound.3* -%{_mandir}/man3/ub_*.3* - -%endif - -%changelog diff --git a/unbound.changes b/unbound.changes index 336000c..f2f57a8 100644 --- a/unbound.changes +++ b/unbound.changes @@ -1,3 +1,15 @@ +------------------------------------------------------------------- +Wed Feb 17 15:55:34 UTC 2016 - mrueckert@suse.de + +- revert the previous change which would not solve the problem as + the library package requires the unbound-anchor package + instead introduce a libunbound-devel-mini package which holds the + shared library and devel files with a minimal build requires. + + unbound-devel and libunbound-devel-mini both provide + libunbound-devel. Please use that symbol as a buildrequires in + your spec files. + ------------------------------------------------------------------- Thu Feb 4 13:01:35 UTC 2016 - meissner@suse.com diff --git a/unbound.spec b/unbound.spec index 8cdd3f8..baf3f03 100644 --- a/unbound.spec +++ b/unbound.spec @@ -63,16 +63,15 @@ BuildRequires: ldns-devel >= %{ldns_version} BuildRequires: libevent-devel BuildRequires: libexpat-devel BuildRequires: openssl-devel -%if %name == "unbound" BuildRequires: python-devel +%if %{with dnstap} +BuildRequires: protobuf-c >= 1.0.0 +BuildRequires: libprotobuf-c-devel >= 1.0.0 +BuildRequires: libfstrm-devel +%endif %if %{with python} BuildRequires: swig %endif -%if %{with dnstap} -BuildRequires: libfstrm-devel -BuildRequires: libprotobuf-c-devel >= 1.0.0 -BuildRequires: protobuf-c >= 1.0.0 -%endif PreReq: pwdutils Requires: ldns >= %{ldns_version} # until we figured something else out for the unbound-anchor part in the systemd unit file @@ -81,7 +80,6 @@ Requires: sudo BuildRequires: systemd-devel %{?systemd_requires} %endif -%endif # Url: http://www.unbound.net/ Source: http://www.unbound.net/downloads/unbound-%{version}.tar.gz @@ -120,7 +118,6 @@ DNSSEC (secure DNS) validation and stub-resolvers (that do not run as a server, but are linked into an application) are easily possible. %define libname libunbound2 -%if %name == "libunbound" %package -n %{libname} Requires: %{name}-anchor >= %{version} # @@ -132,21 +129,6 @@ Unbound is a validating, recursive, and caching DNS(SEC) resolver. This package holds the shared library from unbound. -%package devel -Requires: %{libname} = %{version} -Requires: ldns-devel >= %{ldns_version} -Requires: openssl-devel -# -Summary: Development files for libunbound -Group: Development/Libraries/C and C++ - -%description devel -Unbound is a validating, recursive, and caching DNS(SEC) resolver. - -This package holds the development files to work with libunbound. - -%else - %if %{with_munin} %package munin Summary: Plugin for the munin / munin-node monitoring package @@ -162,6 +144,20 @@ Unbound is a validating, recursive, and caching DNS(SEC) resolver. This package holds the plugin for the munin / munin-node monitoring package %endif +%package devel +Requires: %{libname} = %{version} +Requires: ldns-devel >= %{ldns_version} +Requires: openssl-devel +Provides: libunbound-devel = %{version}-%{release} +# +Summary: Development files for libunbound +Group: Development/Libraries/C and C++ + +%description devel +Unbound is a validating, recursive, and caching DNS(SEC) resolver. + +This package holds the development files to work with libunbound. + %package anchor # Requires: cron @@ -185,10 +181,8 @@ Unbound is a validating, recursive, and caching DNS(SEC) resolver. This package holds the Python modules and extensions for unbound. %endif -%endif - %prep -%setup -n unbound-%version +%setup %build export CFLAGS="%{optflags}" @@ -205,17 +199,13 @@ export CXXFLAGS="%{optflags}" --enable-event-api \ --enable-pie \ --enable-relro-now \ - --with-conf-file=%{_sysconfdir}/%{name}/unbound.conf \ - --with-pidfile=%{piddir}%{name}/%{name}.pid \ -%if %name == "unbound" %if %{with dnstap} --enable-dnstap \ %endif + --with-conf-file=%{_sysconfdir}/%{name}/unbound.conf \ + --with-pidfile=%{piddir}%{name}/%{name}.pid \ %if %{with python} --with-pythonmodule --with-pyunbound \ -%endif -%else - --without-pythonmodule --without-pyunbound \ %endif --with-rootkey-file=%{_sharedstatedir}/unbound/root.key @@ -224,8 +214,6 @@ export CXXFLAGS="%{optflags}" %install make install DESTDIR="%{buildroot}" - -%if %name == "unbound" install -d -m 0750 %{buildroot}/var/lib/unbound install -d 0755 %{buildroot}%{_unitdir} install -p -m 0644 %{SOURCE1} %{buildroot}%{_unitdir}/unbound.service @@ -293,28 +281,13 @@ install -m 0640 -p %{SOURCE11} %{buildroot}%{_sysconfdir}/unbound/local.d/ # Link unbound-control-setup.8 manpage to unbound-control.8 echo ".so man8/unbound-control.8" > %{buildroot}/%{_mandir}/man8/unbound-control-setup.8 -###### split out library things. - -rm -rf %{buildroot}%{_mandir}/man3 -rm -rf %{buildroot}%{_includedir}/ -rm -rf %{buildroot}%{_libdir}/libunbound*.so* - -%else -rm -rf %{buildroot}%{_sysconfdir}/ -rm -rf %{buildroot}%{_bindir}/ -rm -rf %{buildroot}%{_sbindir}/ -rm -rf %{buildroot}%{_libdir}/libunbound.la -rm -rf %{buildroot}%{_mandir}/man1 -rm -rf %{buildroot}%{_mandir}/man5 -rm -rf %{buildroot}%{_mandir}/man8 - -%endif - %check # it currently fails in the ldns unit test. which is weird as both come from the same project make check ||: -%if %name == "unbound" +%clean +%{__rm} -rf %{buildroot} + %pre anchor /usr/sbin/groupadd -r unbound >/dev/null 2>&1 || : /usr/sbin/useradd -g unbound -s /bin/false -r -c "unbound caching dns server" -d /var/lib/unbound unbound >/dev/null 2>&1 || : @@ -346,14 +319,9 @@ systemd-tmpfiles --create %{_tmpfilesdir}/unbound.conf || : %{insserv_cleanup} %endif -%else - %post -n %{libname} -p /sbin/ldconfig %postun -n %{libname} -p /sbin/ldconfig -%endif - -%if %name == "unbound" %files %defattr(-,root,root,-) %doc doc/README doc/CREDITS doc/LICENSE doc/FEATURES @@ -389,6 +357,10 @@ systemd-tmpfiles --create %{_tmpfilesdir}/unbound.conf || : %dir %{fwdir} %config %{fwdir}/%{name} +%files -n %{libname} +%defattr(-,root,root,-) +%{_libdir}/libunbound.so.* + %if %{with python} %files python %defattr(-,root,root,-) @@ -409,6 +381,14 @@ systemd-tmpfiles --create %{_tmpfilesdir}/unbound.conf || : %doc unbound-munin.README %endif +%files devel +%defattr(-,root,root,-) +%{_includedir}/unbound.h +%{_includedir}/unbound-event.h +%{_libdir}/libunbound.so +%{_mandir}/man3/libunbound.3* +%{_mandir}/man3/ub_*.3* + %files anchor %defattr(-,root,root,-) %dir %{_sysconfdir}/%{name}/ @@ -423,20 +403,4 @@ systemd-tmpfiles --create %{_tmpfilesdir}/unbound.conf || : %{_mandir}/man8/unbound-anchor.8* %doc doc/README doc/LICENSE -%else - -%files -n %{libname} -%defattr(-,root,root,-) -%{_libdir}/libunbound.so.* - -%files devel -%defattr(-,root,root,-) -%{_includedir}/unbound.h -%{_includedir}/unbound-event.h -%{_libdir}/libunbound.so -%{_mandir}/man3/libunbound.3* -%{_mandir}/man3/ub_*.3* - -%endif - %changelog