%global with_python 0 %if %{with_python} %define python_sitearch %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)") %define python64_sitearch %(python_64 -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)") %endif %define _libdir64 %{_prefix}/lib64 Summary: Lowlevel DNS(SEC) library with API Name: ldns Version: 1.6.17 Release: 3 License: BSD Url: http://www.nlnetlabs.nl/%{name}/ Source0: http://www.nlnetlabs.nl/downloads/%{%name}/%{name}-%{version}.tar.gz Source1: http://www.nlnetlabs.nl/downloads/%{%name}/%{name}-%{version}.tar.gz.sha1 Patch0: %{name}-%{version}-aix.patch Group: System Environment/Libraries BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildRequires: libpcap-devel >= 1.7.4-1, openssl-devel >= 1.0.2j-2, doxygen, make %if %{with_python} BuildRequires: python-devel >= 2.6.2, swig %endif Requires: libpcap >= 1.7.4-1, openssl >= 1.0.2j-2 %description ldns is a library with the aim to simplify DNS programming in C. All low-level DNS/DNSSEC operations are supported. We also define a higher level API which allows a programmer to (for instance) create or sign packets. %package devel Summary: Development package that includes the ldns header files Group: Development/Libraries Requires: %{name} = %{version}-%{release} %description devel The devel package contains the ldns library and the include files. %if %{with_python} %package python Summary: Python extensions for ldns Group: Applications/System Requires: %{name} = %{version}-%{release} Requires: python >= 2.6.2 %description python Python extensions for ldns. %endif %prep %setup -q %patch0 mkdir ../32bit mv * ../32bit mv ../32bit . mkdir 64bit cd 32bit tar cf - . | (cd ../64bit ; tar xpf -) %build export CONFIG_SHELL=/usr/bin/ksh export CONFIG_ENV_ARGS=/usr/bin/ksh export CC="xlc_r" cd 64bit # first build the 64-bit version export LDFLAGS="-L/opt/freeware/lib64 -L/opt/freeware/lib -Wl,-blibpath:/opt/freeware/lib64:/opt/freeware/lib:/usr/lib:/lib -Wl,-bmaxdata:0x80000000" export OBJECT_MODE=64 ./configure \ --prefix=%{_prefix} \ --libdir=%{_libdir64} \ --mandir=%{_mandir} \ --enable-shared --disable-static \ --enable-sha2 \ --disable-gost \ --with-drill \ --without-examples \ --with-ssl=%{_prefix} \ %if %{with_python} --with-pyldns %endif gmake %{?_smp_mflags} gmake %{?_smp_mflags} doc cd ../32bit # now build the 32-bit version export LDFLAGS="-L/opt/freeware/lib -Wl,-blibpath:/opt/freeware/lib:/usr/lib:/lib -Wl,-bmaxdata:0x80000000" export OBJECT_MODE=32 ./configure \ --prefix=%{_prefix} \ --mandir=%{_mandir} \ --enable-shared --disable-static \ --enable-sha2 \ --disable-gost \ --with-drill \ --without-examples \ --with-ssl=%{_prefix} \ %if %{with_python} --with-pyldns %endif gmake %{?_smp_mflags} gmake %{?_smp_mflags} doc %install [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} cd 64bit export OBJECT_MODE=64 gmake DESTDIR=${RPM_BUILD_ROOT} install gmake DESTDIR=${RPM_BUILD_ROOT} install-doc ( cd ${RPM_BUILD_ROOT}%{_bindir} for f in * ; do mv -f ${f} ${f}_64 done ) cd ../32bit export OBJECT_MODE=32 gmake DESTDIR=${RPM_BUILD_ROOT} install gmake DESTDIR=${RPM_BUILD_ROOT} install-doc /usr/bin/strip -X32_64 ${RPM_BUILD_ROOT}%{_bindir}/* || : ( cd ${RPM_BUILD_ROOT}%{_libdir64} for f in *.a ; do /usr/bin/ar -X64 -x ${f} done cd ${RPM_BUILD_ROOT}%{_libdir} for f in *.a ; do /usr/bin/ar -X32 -x ${f} done ) # add the 64-bit shared objects to the shared libraries containing already the # 32-bit shared objects /usr/bin/ar -X64 -q ${RPM_BUILD_ROOT}%{_libdir}/lib%{name}.a ${RPM_BUILD_ROOT}%{_libdir64}/lib%{name}.so* ( cd ${RPM_BUILD_ROOT} for dir in bin include lib lib64 do mkdir -p usr/${dir} cd usr/${dir} ln -sf ../..%{_prefix}/${dir}/* . cd - done ) # don't package building script for install-doc in doc section rm doc/doxyparse.pl # remove double set of man pages rm -rf doc/man %clean [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %files %defattr(-,root,system) %doc 32bit/README 32bit/LICENSE %{_bindir}/drill* %{_libdir}/*.a %{_libdir}/*.so* %{_libdir64}/*.so* %{_mandir}/man1/drill* %{_mandir}/man3/* /usr/bin/drill* /usr/lib/*.a /usr/lib/*.so* /usr/lib64/*.so* %files devel %defattr(-,root,system,-) %doc 32bit/doc 32bit/Changelog 32bit/README %{_bindir}/ldns-config* %{_includedir}/* %{_libdir}/*.la %{_libdir64}/*.la %{_mandir}/man1/ldns-config* /usr/bin/ldns-config* /usr/include/* /usr/lib/*.la /usr/lib64/*.la %if %{with_python} %files python %defattr(-,root,system) %{python_sitearch}/* %endif %changelog * Wed Nov 16 2016 Michael Perzl - 1.6.17-3 - recompiled against latest versions * Fri Mar 04 2016 Michael Perzl - 1.6.17-2 - recompiled against latest versions * Thu Dec 11 2014 Michael Perzl - 1.6.17-1 - updated to version 1.6.17 * Thu Dec 13 2012 Michael Perzl - 1.6.16-1 - updated to version 1.6.16 * Fri Oct 19 2012 Michael Perzl - 1.6.13-1 - updated to version 1.6.13 * Tue Feb 14 2012 Michael Perzl - 1.6.12-1 - first version for AIX V5.1 and higher