Build export libs and deprecate bind99

This commit is contained in:
Pavel Zhukov 2018-01-18 12:25:25 +01:00 committed by Petr Menšík
parent a10892eed8
commit 028f8c2ce4

View File

@ -6,6 +6,12 @@
#%%global PREVER rc1
%global BINDVERSION %{version}%{?PREVER}%{?PATCHVER:-%{PATCHVER}}
%global with_export_libs 1
## The order of libs is important. See lib/Makefile.in for details
%define bind_export_libs isc dns isccfg irs
%{!?_export_libdir:%global _export_libdir %{_libdir}/%{name}-export}
%{?!SDB: %global SDB 1}
%{?!unittest: %global unittest 1}
%{?!systemtest:%global systemtest 0}
@ -32,7 +38,7 @@ Summary: The Berkeley Internet Name Domain (BIND) DNS (Domain Name System) serv
Name: bind
License: MPLv2.0
Version: 9.11.2
Release: 7%{?PATCHVER:.%{PATCHVER}}%{?PREVER:.%{PREVER}}%{?dist}
Release: 8%{?PATCHVER:.%{PATCHVER}}%{?PREVER:.%{PREVER}}%{?dist}
Epoch: 32
Url: http://www.isc.org/products/BIND/
Buildroot:%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@ -383,6 +389,18 @@ BuildArch: noarch
%description -n python3-bind
This package provides a module which allows commands to be sent to rndc directly from Python programs.
%if %{with_export_libs}
%package export-libs
Summary: ISC libs for DHCP application
Group: System Environment/Libraries
Requires: bind-license = %{epoch}:%{version}-%{release}
Conflicts: bind99-libs
%description export-libs
## TBD
%{summary}
%endif
%prep
%setup -q -n %{name}-%{BINDVERSION}
@ -460,6 +478,9 @@ done
%build
## We use out of tree configure/build for export libs
%define _configure "../configure"
export CFLAGS="$CFLAGS $RPM_OPT_FLAGS"
export CPPFLAGS="$CPPFLAGS -DDIG_SIGCHASE"
export STD_CDEFINES="$CPPFLAGS"
@ -470,6 +491,8 @@ version
libtoolize -c -f; aclocal -I libtool.m4 --force; autoconf -f
mkdir build
pushd build
%configure \
--with-python=%{__python3} \
--with-libtool \
@ -512,6 +535,12 @@ libtoolize -c -f; aclocal -I libtool.m4 --force; autoconf -f
--enable-full-report \
;
make %{?_smp_mflags}
### FIXME hack!!!
### make doesn't find properly configured files
### and use ones from source tree
cp -rv doc/* ../doc/
popd
# Regenerate dig.1 manpage
pushd bin/dig
@ -534,6 +563,35 @@ popd
popd
%endif
%if %{with_export_libs}
## Create export libs ##
mkdir -p export-libs
pushd export-libs
## minimal subset of options to make clients aka dhcp working
%{configure} \
--with-libtool \
--disable-static \
--libdir=%{_export_libdir} \
--includedir=%{_includedir}/removeme/ \
--disable-threads \
--enable-full-report
## We don't want to build other libs than -export twice
## FIXME this should be in patch instead of SED'ing
## but do we really like/want to patch generated files?
sed '/^SUBDIRS =/s/.*/SUBDIRS = make lib/i' -i Makefile
sed "/^SUBDIRS =/s/.*/SUBDIRS = %{bind_export_libs}/i" -i lib/Makefile
for lib in %{bind_export_libs}
do
echo "Replacing ${lib} with ${lib}-export"
find . -name Makefile -exec sed "s/lib${lib}\./lib${lib}-export\./g" -i {} \;
done;
make %{?_smp_mflags}
popd
## End of export libs
%endif
%check
%if %{PKCS11}
# Tests require initialization of pkcs11 token
@ -624,10 +682,24 @@ touch ${RPM_BUILD_ROOT}/%{chroot_sdb_prefix}/etc/named.conf
%endif
#end sdb-chroot
pushd build
make DESTDIR=${RPM_BUILD_ROOT} install
popd
%if %{with_export_libs}
pushd export-libs
## -lirs-export -ldns-export -lisccfg-export -lisc-export
## install -d -m 0755 ${RPM_BUILD_ROOT}/%{_libdir}/%{name}-export/
make DESTDIR=${RPM_BUILD_ROOT} install
mkdir -p %{buildroot}%{_sysconfdir}/ld.so.conf.d
echo "%{_export_libdir}" > %{buildroot}%{_sysconfdir}/ld.so.conf.d/%{name}-%{_arch}.conf
popd
%endif
# Remove unwanted files
rm -f ${RPM_BUILD_ROOT}/etc/bind.keys
rm -rf ${RPM_BUILD_ROOT}/%{_includedir}/removeme
# Systemd unit files
mkdir -p ${RPM_BUILD_ROOT}%{_unitdir}
@ -680,8 +752,10 @@ install -m 644 %{SOURCE12} contrib/sdb/pgsql/
# Install isc/errno2result.h header
install -m 644 lib/isc/unix/errno2result.h ${RPM_BUILD_ROOT}%{_includedir}/bind9/isc
pushd build
# Files required to run test-suite outside of build tree:
cp -fp config.h ${RPM_BUILD_ROOT}/%{_includedir}/bind9
popd
# Remove libtool .la files:
find ${RPM_BUILD_ROOT}/%{_libdir} -name '*.la' -exec '/bin/rm' '-f' '{}' ';';
@ -1194,7 +1268,17 @@ rm -rf ${RPM_BUILD_ROOT}
%{python3_sitelib}/*.egg-info
%{python3_sitelib}/isc/
%if %{with_export_libs}
%files export-libs
%{_export_libdir}
%config(noreplace) %{_sysconfdir}/ld.so.conf.d/%{name}-%{_arch}.conf
%endif
%changelog
* Wed Feb 07 2018 Pavel Zhukov <pzhukov@redhat.com> - 32:9.11.2-8.P1
- Build export libraries
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 32:9.11.2-7.P1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild