#3 Build so called export libs for clients
Closed 6 years ago by pemensik. Opened 6 years ago by landgraf.
rpms/ landgraf/bind private-pzhukov-bz1457871  into  master

file modified
+130 -3
@@ -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_dir:%global _export_dir /bind9-export/}

+ 

  %{?!SDB:       %global SDB       1}

  %{?!unittest:  %global unittest  1}

  %{?!systemtest:%global systemtest 0}
@@ -28,7 +34,7 @@ 

  Name:     bind

  License:  MPLv2.0

  Version:  9.11.2

- Release:  5%{?PATCHVER:.%{PATCHVER}}%{?PREVER:.%{PREVER}}%{?dist}

+ Release:  9%{?PATCHVER:.%{PATCHVER}}%{?PREVER:.%{PREVER}}%{?dist}

  Epoch:    32

  Url:      http://www.isc.org/products/BIND/

  Buildroot:%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -244,6 +250,10 @@ 

  Summary:  License of the BIND DNS suite

  Group:    Applications/System

  BuildArch:noarch

+ %if 0%{?fedora} >= 1

+ Obsoletes: bind99-license < 9.9.11-3

+ Provides:  bind99-license

+ %endif

  

  %description license

  Contains license of the BIND DNS suite.
@@ -379,6 +389,32 @@ 

  %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}

+ %if 0%{?fedora} >= 1

+ Obsoletes: bind99-libs < 9.9.11-3

+ Provides:  bind99-libs

+ %endif

+ 

+ %description export-libs

+ Set of ISC libraries for client applications (like ISC DHCP).

+ 

+ %package export-libs-devel

+ Summary:  Header files and libraries needed for BIND export libraries

+ Group:    Development/Libraries

+ Requires: bind-export-libs%{?_isa} = %{epoch}:%{version}-%{release}

+ %if 0%{?fedora} >= 1

+ Obsoletes: bind99-libs-devel < 9.9.11-3

+ Provides:  bind99-libs-devel

+ %endif

+ 

+ %description export-libs-devel

+ %{summary}

+ %endif

+ 

  %prep

  %setup -q -n %{name}-%{BINDVERSION}

  
@@ -456,6 +492,9 @@ 

  

  

  %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"
@@ -466,6 +505,8 @@ 

  

  libtoolize -c -f; aclocal -I libtool.m4 --force; autoconf -f

  

+ mkdir build

+ pushd build

  %configure \

    --with-python=%{__python3} \

    --with-libtool \
@@ -509,11 +550,18 @@ 

  ;

  make %{?_smp_mflags}

  

+ ### FIXME hack!!!

+ ### xsltproc doesn't find properly configured files

+ ### and use ones from source tree

+ ### copy generated files to the original location

+ cp -rv doc/* ../doc/

+ 

+ 

  # Regenerate dig.1 manpage

  pushd bin/dig

  make man

- popd

- pushd bin/python

+         popd

+         pushd bin/python

  make man

  popd

  
@@ -529,6 +577,43 @@ 

    popd

    popd

  %endif

+ popd

+ 

+ %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 \

+         --disable-epoll \

+         --disable-kqueue \

+         --libdir=%{_libdir}%{_export_dir} \

+         --includedir=%{_includedir}/%{_export_dir}/ \

+         --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 -i -e \

+ '/^SUBDIRS =/s/.*/SUBDIRS = make lib/i' \

+ Makefile

+ 

+ sed -i -e \

+ "/^SUBDIRS =/s/.*/SUBDIRS = %{bind_export_libs}/i" \

+ lib/Makefile

+ 

+ for lib in %{bind_export_libs}

+ do

+         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}
@@ -620,11 +705,24 @@ 

  %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 "%{_libdir}/%{_export_dir}" > %{buildroot}%{_sysconfdir}/ld.so.conf.d/%{name}-%{_arch}.conf

+ popd

+ %endif

  

  # Remove unwanted files

  rm -f ${RPM_BUILD_ROOT}/etc/bind.keys

  

+ 

  # Systemd unit files

  mkdir -p ${RPM_BUILD_ROOT}%{_unitdir}

  install -m 644 %{SOURCE37} ${RPM_BUILD_ROOT}%{_unitdir}
@@ -676,8 +774,10 @@ 

  # 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' '{}' ';';
@@ -827,6 +927,12 @@ 

  %postun pkcs11-libs -p /sbin/ldconfig

  %endif

  

+ %if %{with_export_libs}

+ %post export-libs -p /sbin/ldconfig

+ 

+ %postun export-libs -p /sbin/ldconfig

+ %endif

+ 

  %post chroot

  %systemd_post named-chroot.service

  if [ "$1" -gt 0 ]; then
@@ -1197,7 +1303,28 @@ 

  %{python3_sitelib}/*.egg-info

  %{python3_sitelib}/isc/

  

+ 

+ %if %{with_export_libs}

+ %files export-libs

+ %dir %{_libdir}/%{_export_dir}

+ %{_libdir}/%{_export_dir}/lib*.so.*

+ %config(noreplace) %{_sysconfdir}/ld.so.conf.d/%{name}-%{_arch}.conf

+ 

+ %files export-libs-devel

+ %{_includedir}/%{_export_dir}

+ %{_libdir}/%{_export_dir}/lib*.so

+ %endif

+ 

  %changelog

+ * Mon Jan 22 2018 Pavel Zhukov <pzhukov@redhat.com> - 32:9.11.2-9.P1

+ - Add obsoletes/provides tags for smooth update

+ 

+ * Fri Jan 19 2018 Pavel Zhukov <pzhukov@redhat.com> - 32:9.11.2-8.P1

+ - Build devel package for export-libs

+ 

+ * Thu Jan 18 2018 Pavel Zhukov <pzhukov@redhat.com> - 32:9.11.2-7.P1

+ - Build export libraries with disabled threads and selects

+ 

  * Tue Jan 16 2018 Petr Menšík <pemensik@redhat.com> - 32:9.11.2-5.P1

  - Fix CVE-2017-3145, rebase to 9.11.2-P1

  

We want to get rid of bind99 package to avoid high maintenance cost (all patches should be backported to both bind as well as bind99 packages). So "export libs" were built using current version of bind with disabled thread support. I've disabled epoll() and kqueue for now because they were not tested by Fedora QA (but they look working).
Announce is needed before merge as update will require --allowerasing flag (bind99-libs and bind99-license packages should be removed from all dhclient's systens).

1 new commit added

  • Add export-libs-devel package
6 years ago

1 new commit added

  • Obsolete/provide bind99 package for smooth update
6 years ago

1 new commit added

  • Add forgotten ldconfig for export-libs
6 years ago

Fixed update issue with Provides/Obsoletes so update should be smooth (sigh, tested on F27/F26) without passing --allowerasing flag
There're %if fedora check in the spec as bind99 is fedora only package and the check and all tags around can be dropped once we get rid of bind99 completely (or keep them for fedup'ed systems )

Unfortunately out-of-tree build broke integrated unit tests I recently enabled for each build.

Right. Kyafiles contain hardcoded filenames and should be adopted...

Merged manually with additional modifications. Last commit belonging to this merge request is commit 40e8ab1.

Pull-Request has been closed by pemensik

6 years ago
Metadata