unbound/unbound.spec

360 lines
11 KiB
RPMSpec
Raw Normal View History

2019-09-30 11:18:56 -04:00
%{!?delete_la: %global delete_la find $RPM_BUILD_ROOT -type f -name "*.la" -delete}
Name: unbound
2023-12-26 17:32:11 +08:00
Version: 1.19.0
2023-03-07 07:55:15 +00:00
Release: 1
2019-09-30 11:18:56 -04:00
Summary: Unbound is a validating, recursive, caching DNS resolver
2022-11-08 03:35:07 +00:00
License: BSD-3-Clause
2019-09-30 11:18:56 -04:00
Url: https://nlnetlabs.nl/projects/unbound/about/
Source: https://nlnetlabs.nl/downloads/unbound/%{name}-%{version}.tar.gz
Source1: unbound.service
Source2: unbound.conf
Source3: root.key
Source4: unbound-keygen.service
Source5: tmpfiles-unbound.conf
Source6: example.com.key
Source7: example.com.conf
Source8: block-example.com.conf
Source9: https://data.iana.org/root-anchors/icannbundle.pem
Source10: root.anchor
Source11: unbound.sysconfig
Source12: unbound-anchor.timer
Source13: unbound-anchor.service
Patch1: unbound-remove-buildin-key.patch
BuildRequires: make flex swig pkgconfig systemd
2019-09-30 11:18:56 -04:00
BuildRequires: libevent-devel expat-devel openssl-devel python3-devel
2021-05-27 10:55:21 +08:00
BuildRequires: gcc
2019-09-30 11:18:56 -04:00
%{?systemd_requires}
2020-02-19 10:31:26 +08:00
Requires: %{name}-libs = %{version}-%{release}
2022-11-08 03:35:07 +00:00
Requires: openssl
2019-09-30 11:18:56 -04:00
%description
Unbound is a validating, recursive, caching DNS resolver. It is designed
to be fast and lean and incorporates modern features based on open standards.
To help increase online privacy, Unbound supports DNS-over-TLS which allows
clients to encrypt their communication. Unbound is available for most platforms
such as FreeBSD, OpenBSD, NetBSD, MacOS, Linux and Microsoft Windows.
Unbound is a totally free, open source software under the BSD license. It doesn't
make custom builds or provide specific features to paying customers only.
2020-02-19 10:31:26 +08:00
%package libs
Summary: Libraries for %{name}
2021-08-31 15:09:16 +08:00
Requires(pre): shadow-utils
2020-02-19 10:31:26 +08:00
%description libs
Libraries for %{name}.
2019-09-30 11:18:56 -04:00
%package devel
2020-02-19 10:31:26 +08:00
Summary: Libraries and header files
Requires: %{name}-libs = %{version}-%{release} openssl-devel pkgconfig
2019-09-30 11:18:56 -04:00
%description devel
Package devel includes libraries and header files for development with unbound.
%package -n python3-%{name}
2020-02-19 10:31:26 +08:00
Summary: The python3 module of unbound DNS resolver
Requires: %{name}-libs = %{version}-%{release}
2019-09-30 11:18:56 -04:00
%description -n python3-unbound
The python3 module of unbound DNS resolver.
%package help
Summary: Man pages for unbound
%description help
Package help includes includes man pages for unbound.
%prep
%setup -qcn %{name}-%{version}
pushd %{name}-%{version}
2020-07-28 18:48:55 +08:00
%autopatch -p1
2019-09-30 11:18:56 -04:00
cp -pr doc pythonmod libunbound ../
popd
%build
%global configure_args --with-libevent --with-pthreads --with-ssl \\\
--disable-rpath --disable-static \\\
--enable-relro-now --enable-pie \\\
--enable-subnet --enable-ipsecmod \\\
--with-conf-file=%{_sysconfdir}/%{name}/unbound.conf \\\
--with-pidfile=%{_rundir}/%{name}/%{name}.pid \\\
2019-09-30 11:18:56 -04:00
--enable-sha2 --disable-gost --enable-ecdsa \\\
--with-rootkey-file=%{_sharedstatedir}/unbound/root.key \\\
--enable-linux-ip-local-port-range
2019-09-30 11:18:56 -04:00
pushd %{name}-%{version}
2023-03-07 07:55:15 +00:00
%configure --with-pythonmodule --with-pyunbound PYTHON=%{__python3} --disable-sha1 %{configure_args}
2019-09-30 11:18:56 -04:00
%make_build
%make_build streamtcp
popd
%install
pushd %{name}-%{version}
%make_install unbound-event-install
install -m 0755 streamtcp $RPM_BUILD_ROOT%{_sbindir}/unbound-streamtcp
install -d -m 0755 $RPM_BUILD_ROOT%{_unitdir} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig
install -m 0644 testcode/streamtcp.1 $RPM_BUILD_ROOT%{_mandir}/man1/unbound-streamtcp.1
install -D -m 0644 contrib/libunbound.pc $RPM_BUILD_ROOT%{_libdir}/pkgconfig/libunbound.pc
popd
install -d -m 0755 $RPM_BUILD_ROOT%{_tmpfilesdir} $RPM_BUILD_ROOT%{_sharedstatedir}/unbound
install -m 0644 %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/unbound/
install -m 0644 %{SOURCE5} $RPM_BUILD_ROOT%{_tmpfilesdir}/unbound.conf
%if %{?openEuler:1}0
2019-09-30 11:18:56 -04:00
install -m 0644 %{SOURCE10} $RPM_BUILD_ROOT%{_sharedstatedir}/unbound/root.key
%else
install -m 0600 %{SOURCE10} $RPM_BUILD_ROOT%{_sharedstatedir}/unbound/root.key
%endif
2019-09-30 11:18:56 -04:00
install -p -m 0644 %{SOURCE1} $RPM_BUILD_ROOT%{_unitdir}/unbound.service
install -p -m 0755 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/unbound
install -p -m 0644 %{SOURCE4} $RPM_BUILD_ROOT%{_unitdir}/unbound-keygen.service
install -p -m 0644 %{SOURCE9} $RPM_BUILD_ROOT%{_sysconfdir}/unbound
install -p -m 0644 %{SOURCE11} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/unbound
install -p -m 0644 %{SOURCE12} $RPM_BUILD_ROOT%{_unitdir}/unbound-anchor.timer
install -p -m 0644 %{SOURCE13} $RPM_BUILD_ROOT%{_unitdir}/unbound-anchor.service
%delete_la
install -d $RPM_BUILD_ROOT%{_rundir}/unbound
2019-09-30 11:18:56 -04:00
install -d $RPM_BUILD_ROOT%{_sysconfdir}/unbound/{keys.d,conf.d,local.d}
install -p %{SOURCE6} $RPM_BUILD_ROOT%{_sysconfdir}/unbound/keys.d/
install -p %{SOURCE7} $RPM_BUILD_ROOT%{_sysconfdir}/unbound/conf.d/
install -p %{SOURCE8} $RPM_BUILD_ROOT%{_sysconfdir}/unbound/local.d/
echo ".so man8/unbound-control.8" > $RPM_BUILD_ROOT/%{_mandir}/man8/unbound-control-setup.8
2020-02-19 10:31:26 +08:00
%pre libs
2019-09-30 11:18:56 -04:00
getent group unbound >/dev/null || groupadd -r unbound
getent passwd unbound >/dev/null || \
useradd -r -g unbound -d %{_sysconfdir}/unbound -s /sbin/nologin \
-c "Unbound DNS resolver" unbound
%post
%systemd_post unbound.service
%systemd_post unbound-keygen.service
2020-02-19 10:31:26 +08:00
%post libs
2019-09-30 11:18:56 -04:00
%{?ldconfig}
%systemd_post unbound-anchor.timer
if [ "$1" -eq 1 ]; then
/bin/systemctl start unbound-anchor.timer >/dev/null 2>&1 || :
fi
%preun
%systemd_preun unbound.service
%systemd_preun unbound-keygen.service
2020-02-19 10:31:26 +08:00
%preun libs
2019-09-30 11:18:56 -04:00
%systemd_preun unbound-anchor.timer
%postun
%systemd_postun_with_restart unbound.service
%systemd_postun unbound-keygen.service
2020-02-19 10:31:26 +08:00
%postun libs
2019-09-30 11:18:56 -04:00
%{?ldconfig}
%systemd_postun_with_restart unbound-anchor.timer
%triggerun -- unbound < 1.4.12-4
/usr/bin/systemd-sysv-convert --save unbound >/dev/null 2>&1 ||:
/sbin/chkconfig --del unbound >/dev/null 2>&1 || :
/bin/systemctl try-restart unbound.service >/dev/null 2>&1 || :
/bin/systemctl try-restart unbound-keygen.service >/dev/null 2>&1 || :
%check
pushd %{name}-%{version}
make check
popd
%files
2019-12-26 19:37:03 +08:00
%defattr(-,root,root)
2019-09-30 11:18:56 -04:00
%doc doc/CREDITS doc/FEATURES doc/README doc/LICENSE
%attr(0644,root,root) %{_tmpfilesdir}/unbound.conf
%attr(0755,unbound,unbound) %dir %{_rundir}/%{name}
2019-09-30 11:18:56 -04:00
%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/%{name}/unbound.conf
%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/sysconfig/%{name}
2019-12-26 19:37:03 +08:00
%dir %attr(0755,root,unbound) %{_sysconfdir}/%{name}/keys.d
2019-09-30 11:18:56 -04:00
%attr(0644,root,unbound) %config(noreplace) %{_sysconfdir}/%{name}/keys.d/*.key
2019-12-26 19:37:03 +08:00
%dir %attr(0755,root,unbound) %{_sysconfdir}/%{name}/conf.d
2019-09-30 11:18:56 -04:00
%attr(0644,root,unbound) %config(noreplace) %{_sysconfdir}/%{name}/conf.d/*.conf
2019-12-26 19:37:03 +08:00
%dir %attr(0755,root,unbound) %{_sysconfdir}/%{name}/local.d
2019-09-30 11:18:56 -04:00
%attr(0644,root,unbound) %config(noreplace) %{_sysconfdir}/%{name}/local.d/*.conf
2020-02-19 10:31:26 +08:00
%{_unitdir}/%{name}.service
%{_unitdir}/%{name}-keygen.service
2019-09-30 11:18:56 -04:00
%ghost %attr(0640,root,unbound) %{_sysconfdir}/%{name}/unbound_control.pem
%ghost %attr(0640,root,unbound) %{_sysconfdir}/%{name}/unbound_control.key
%ghost %attr(0640,root,unbound) %{_sysconfdir}/%{name}/unbound_server.pem
%ghost %attr(0640,root,unbound) %{_sysconfdir}/%{name}/unbound_server.key
%{_sbindir}/*
2020-02-19 10:31:26 +08:00
%exclude %{_sbindir}/unbound-anchor
%files libs
%defattr(-,root,root)
%dir %attr(0755,root,root) %{_sysconfdir}/%{name}
%if %{?openEuler:1}0
2020-02-19 10:31:26 +08:00
%attr(0644,root,root) %config %{_sysconfdir}/%{name}/root.key
%dir %attr(0755,unbound,unbound) %{_sharedstatedir}/%{name}
%attr(0644,unbound,unbound) %config %{_sharedstatedir}/%{name}/root.key
%{_sysconfdir}/%{name}/icannbundle.pem
%else
%attr(0600,root,root) %config %{_sysconfdir}/%{name}/root.key
%dir %attr(0755,unbound,unbound) %{_sharedstatedir}/%{name}
%attr(0600,unbound,unbound) %config %{_sharedstatedir}/%{name}/root.key
%attr(0600,root,root) %{_sysconfdir}/%{name}/icannbundle.pem
%endif
2020-02-19 10:31:26 +08:00
%{_sbindir}/unbound-anchor
%{_libdir}/libunbound.so.*
%{_unitdir}/unbound-anchor.timer
%{_unitdir}/unbound-anchor.service
2019-09-30 11:18:56 -04:00
%files -n python3-unbound
2019-12-26 19:37:03 +08:00
%defattr(-,root,root)
2019-09-30 11:18:56 -04:00
%doc pythonmod/examples/* libunbound/python/examples/* pythonmod/LICENSE
%{python3_sitearch}/*
%files devel
2019-12-26 19:37:03 +08:00
%defattr(-,root,root)
2019-09-30 11:18:56 -04:00
%{_libdir}/libunbound.so
%{_libdir}/pkgconfig/*.pc
%{_includedir}/*
%files help
2019-12-26 19:37:03 +08:00
%defattr(-,root,root)
2019-12-13 16:13:11 +08:00
%{_mandir}/man*
2019-09-30 11:18:56 -04:00
%changelog
2023-12-26 17:32:11 +08:00
* Tue Dec 26 2023 gaihuiying <eaglegai@163.com> - 1.19.0-1
- Type:requirement
- CVE:NA
- SUG:NA
- DESC:update to 1.19.0
2023-03-07 07:55:15 +00:00
* Tue Mar 07 2023 gaihuiying <eaglegai@163.com> - 1.17.1-1
- Type:requirement
- CVE:NA
- SUG:NA
- DESC:update to 1.17.1
* Fri Mar 03 2023 gaihuiying <eaglegai@163.com> - 1.17.0-2
- Type:bugfix
- CVE:NA
- SUG:NA
- DESC:change run directory from /var/run to /run to fix "/usr/lib/tmpfiles.d/unbound.conf:1: xxxx"
2022-11-08 03:35:07 +00:00
* Tue Nov 08 2022 gaihuiying <eaglegai@163.com> - 1.17.0-1
- Type:requirement
- CVE:NA
- SUG:NA
- DESC:update to 1.17.0
2022-09-22 14:06:34 +08:00
* Thu Sep 22 2022 xingwei <xingwei14@h-partners.com> - 1.13.2-6
- Type:cves
- CVE:CVE-2022-3204
- SUG:NA
- DESC:fix CVE-2022-3204
* Wed Aug 03 2022 yanglu <yanglu72@h-partners.com> - 1.13.2-5
- Type:cves
- CVE:CVE-2022-30689 CVE-2022-30699
- SUG:NA
- DESC:fix CVE-2022-30689 and CVE-2022-30699
2022-08-02 02:44:42 +00:00
* Tue Aug 02 2022 gaihuiying <eaglegai@163.com> - 1.13.2-4
- Type:bugfix
- CVE:NA
- SUG:NA
- DESC:rebuild to 1.13.2-4
* Sat Jun 11 2022 gaihuiying <eaglegai@163.com> - 1.13.2-3
- Type:bugfix
- CVE:NA
- SUG:NA
- DESC:remove buildin key
add macros to control if key files permissons is 600 or 644
* Mon Mar 21 2022 gaihuiying <eaglegai@163.com> - 1.13.2-2
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:fix -q doesn't work when use with 'unbound-control stats_shm'
* Sat Feb 19 2022 gaihuiying <eaglegai@163.com> - 1.13.2-1
- Type:requirement
- ID:NA
- SUG:NA
- DESC:update unbound version to 1.13.2 and remove the dependency of python3.8
2021-08-31 15:09:16 +08:00
* Tue Aug 31 2021 gaihuiying <gaihuiying1@huawei.com> - 1.10.1-6
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:fix error when install unbound-libs
2021-08-27 06:58:56 +00:00
* Thu Aug 26 2021 chenyanpanHW <chenyanpan@huawei.com> - 1.10.1-5
- Type: requirement
- ID: NA
- SUG: NA
- DESC: unbound-libs remove Requires systemd
2021-05-27 10:55:21 +08:00
* Thu May 27 2021 lijingyuan <lijingyuan3@huawei.com> - 1.10.1-4
- Type:bufix
- ID:NA
- SUG:NA
- DESC:Add the compilation dependency of gcc.
2021-02-23 15:44:50 +08:00
* Tue Feb 23 2021 zhouyihang <zhouyihang3@huawei.com> - 1.10.1-3
- Type:CVE
- ID:NA
- SUG:NA
- DESC:fix CVE-2020-28935
* Thu Oct 29 2020 gaihuiying <gaihuiying1@huawei.com> - 1.10.1-2
- Type:requirement
- ID:NA
- SUG:NA
- DESC:remove python-universioned-command provided by python2
2020-07-28 18:48:55 +08:00
* Tue Jul 28 2020 gaihuiying <gaihuiying1@huawei.com> - 1.10.1-1
- Type:requirement
- ID:NA
- SUG:NA
- DESC:update unbound version to 1.10.1
2020-02-19 10:31:26 +08:00
* Wed Feb 19 2020 hexiujun <hexiujun1@huawei.com> - 1.7.3-14
- Type:enhancement
- ID:NA
- SUG:NA
- DESC:unpack libs subpackage
2020-01-11 22:54:59 +08:00
* Sat Jan 11 2020 zhangrui<zhangrui182@huawei.com> - 1.7.3-13
- Type:cves
- ID:CVE-2019-18934
- SUG:restart
- DESC:fix CVE-2019-18934
2019-12-26 19:37:03 +08:00
* Tue Dec 24 2019 openEuler Buildteam <buildteam@openeuler.org> - 1.7.3-12
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:change the jurisdiction for some path of files
2019-12-13 16:13:11 +08:00
* Wed Nov 20 2019 openEuler Buildteam <buildteam@openeuler.org> - 1.7.3-11
- Type: enhancement
- ID: NA
- SUG: NA
- DESC:modify the contents of help package
2019-09-30 11:18:56 -04:00
* Wed Sep 25 2019 Zaiwang Li <lizaiwang1@huawei.com> - 1.7.3-10
- Init Package