# Tests by default. No tests: rpm -ba --define 'dotests 0' libtasn1*.spec %{!?dotests:%define DO_TESTS 1} %{?dotests:%define DO_TESTS 0} Summary: This is the ASN.1 library used in GNUTLS Name: libtasn1 Version: 4.19.0 Release: 1 License: LGPL Group: System Environment/Libraries URL: http://www.gnu.org/software/gnutls/download.html Source0: https://ftp.gnu.org/gnu/libtasn1/libtasn1-%{version}.tar.gz Source1: https://ftp.gnu.org/gnu/libtasn1/libtasn1-%{version}.tar.gz.sig Source2: %{name}.so.3-aix32 Source3: %{name}.so.3-aix64 Source4: getopt_long.c Patch0: libtasn1-4.19.0-getopt.patch BuildRequires: bison Requires: libgcc >= 10.3.0 %define _libdir64 %{_prefix}/lib64 %description This is the ASN.1 library used in GNUTLS. More up to date information can be found at http://www.gnu.org/software/gnutls and http://www.gnutls.org. The library is available as 32-bit and 64-bit. %package devel Summary: Files for development of applications which will use libtasn1 Group: Development/Libraries Requires: %{name} = %{version}-%{release} Requires: info Requires: /sbin/install-info %description devel This is the ASN.1 library used in GNUTLS. More up to date information can be found at http://www.gnu.org/software/gnutls and http://www.gnutls.org. This package contains files for development of applications which will use libtasn1. If you are compiling a 32-bit program, no special compiler options are needed. If you are compiling a 64-bit program, you have to compile and link your application with "xlc -q64" or "gcc -maix64". %package tools Summary: Some ASN.1 tools Group: Applications/Text Requires: %{name} = %{version}-%{release} %description tools This is the ASN.1 library used in GNUTLS. More up to date information can be found at http://www.gnu.org/software/gnutls and http://www.gnutls.org. This package contains tools using the libtasn library. %prep %setup -q %patch0 cp %{SOURCE4} . # Duplicate source for 32 & 64 bits rm -rf /tmp/%{name}-%{version}-32bit mkdir /tmp/%{name}-%{version}-32bit mv * /tmp/%{name}-%{version}-32bit mkdir 32bit mv /tmp/%{name}-%{version}-32bit/* 32bit rm -rf /tmp/%{name}-%{version}-32bit mkdir 64bit cp -rp 32bit/* 64bit/ %build export PATH=/opt/freeware/bin:/usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin:. export CONFIG_SHELL=/usr/bin/ksh export CONFIG_ENV_ARGS=/usr/bin/ksh export CFLAGS="-O2" # setup environment for 32-bit and 64-bit builds export RM="/usr/bin/rm -f" export AR="/usr/bin/ar -X32_64" export NM="/usr/bin/nm -X32_64" # first build the 64-bit version cd 64bit #export CC="/usr/vac/bin/xlc_r -q64" export CC="gcc -maix64 -D_LARGE_FILES" export OBJECT_MODE=64 ./configure \ --prefix=%{_prefix} \ --mandir=%{_prefix}/man \ --infodir=%{_prefix}/info \ --libdir=%{_libdir64} \ --enable-shared --enable-static make %{?_smp_mflags} if [ "%{DO_TESTS}" == 1 ] then (gmake -k check || true) fi # now build the 32-bit version cd ../32bit #export CC="/usr/vac/bin/xlc_r -q32" export CC="gcc -maix32 -D_LARGE_FILES" export OBJECT_MODE=32 ./configure \ --prefix=%{_prefix} \ --mandir=%{_prefix}/man \ --infodir=%{_prefix}/info \ --libdir=%{_libdir} \ --enable-shared --enable-static make %{?_smp_mflags} if [ "%{DO_TESTS}" == 1 ] then (gmake -k check || true) fi %install [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} export AR="/usr/bin/ar -X32_64" cd 64bit export OBJECT_MODE=64 make install DESTDIR=${RPM_BUILD_ROOT} cd ../32bit export OBJECT_MODE=32 make install DESTDIR=${RPM_BUILD_ROOT} # add the 64-bit shared objects to the shared library containing already the # 32-bit shared objects ${AR} -x ${RPM_BUILD_ROOT}%{_libdir64}/%{name}.a ${AR} -q ${RPM_BUILD_ROOT}%{_libdir}/%{name}.a %{name}.so* # Add the older 2.1.X version shared members for compatibility with older apps # (make sure they're set for LOADONLY with 'strip -e') cp %{SOURCE2} %{name}.so.3 /usr/bin/strip -X32 -e %{name}.so.3 /usr/bin/ar -X32 -q ${RPM_BUILD_ROOT}%{_libdir}/%{name}.a %{name}.so.3 cp %{SOURCE3} %{name}.so.3 /usr/bin/strip -X64 -e %{name}.so.3 /usr/bin/ar -X64 -q ${RPM_BUILD_ROOT}%{_libdir}/%{name}.a %{name}.so.3 rm -f ${RPM_BUILD_ROOT}%{_libdir64}/%{name}.a cd ${RPM_BUILD_ROOT}%{_libdir64} ln -s %{_libdir}/%{name}.a . cd - gzip --best ${RPM_BUILD_ROOT}%{_infodir}/*.info rm -f ${RPM_BUILD_ROOT}%{_infodir}/dir ( cd ${RPM_BUILD_ROOT} for dir in bin include lib do mkdir -p usr/${dir} cd usr/${dir} ln -sf ../..%{_prefix}/${dir}/* . cd - done ) %post devel /sbin/install-info %{_infodir}/%{name}.info.gz %{_infodir}/dir || : %preun devel if [ "$1" = 0 ]; then /sbin/install-info --delete %{_infodir}/%{name}.info.gz %{_infodir}/dir || : fi %clean [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %files %defattr(-,root,system,-) %doc 32bit/doc/TODO 32bit/doc/COPYING %doc 32bit/AUTHORS 32bit/ChangeLog 32bit/NEWS 32bit/README.md 32bit/THANKS %{_libdir}/*.a %{_libdir64}/*.a /usr/lib/*.a %files tools %defattr(-,root,system,-) %{_bindir}/asn1* %{_mandir}/man1/* /usr/bin/asn1* %files devel %defattr(-,root,system,-) %{_libdir}/pkgconfig/*.pc %{_includedir}/* %{_infodir}/*.info.* %{_mandir}/man3/* /usr/include/* %changelog * Fri Jun 09 2023 Raghu N Arava - libtasn1-4.19.0-1 - Update to version libtasn1-4.19.0-1 * Thu May 14 2020 Ashwini Chandrappa - 4.16.0-1 - Updated to version 4.16.0 * Tue Nov 08 2016 Ravi Hirekurabar 4.9-2 - Updated to 4.9 * Fri Aug 19 2016 Maximilien Faure 4.8-2 - Initial port on AIX 6.1 * Thu Jun 23 2016 Maximilien Faure 3.3-1 - Update for compliance * Wed Jun 21 2013 Gerard Visiedo 3.3-1 - Initial port on Aix6.1 * Wed Jun 15 2011 Gerard Visiedo 2.9-1 - Initial port on Aix5.3