%ifos aix6.1 || %ifos aix7.1 %global p7build 1 %else %global p7build 0 %endif %define _libdir64 %{_prefix}/lib64 Name: pcre2 Version: 10.32 %if %{p7build} Release: 1.p7 %else Release: 1 %endif Summary: Perl-compatible regular expression library Group: System Environment/Libraries License: BSD URL: http://www.pcre.org/ Source0: ftp://ftp.csx.cam.ac.uk/pub/software/programming/%{name}/%{name}-%{version}.tar.bz2 Source1: ftp://ftp.csx.cam.ac.uk/pub/software/programming/%{name}/%{name}-%{version}.tar.bz2.sig Patch0: %{name}-%{version}-aix.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildRequires: patch %if %{p7build} %ifos aix6.1 Requires: AIX-rpm >= 6.1.8.0 %endif %ifos aix7.1 Requires: AIX-rpm >= 7.1.3.0 %endif %endif %description PCRE2 is a re-working of the original PCRE (Perl-compatible regular expression) library to provide an entirely new API. PCRE2 is written in C, and it has its own API. There are three sets of functions, one for the 8-bit library, which processes strings of bytes, one for the 16-bit library, which processes strings of 16-bit values, and one for the 32-bit library, which processes strings of 32-bit values. There are no C++ wrappers. The distribution does contain a set of C wrapper functions for the 8-bit library that are based on the POSIX regular expression API (see the pcre2posix man page). These can be found in a library called libpcre2posix. Note that this just provides a POSIX calling interface to PCRE2; the regular expressions themselves still follow Perl syntax and semantics. The POSIX API is restricted, and does not give full access to all of PCRE2's facilities. %package devel Summary: Development files for %{name} Group: Development/Libraries Requires: %{name} = %{version}-%{release} %description devel Development files (headers, libraries for dynamic linking, documentation) for %{name}. The header file for the POSIX-style functions is called pcre2posix.h. %package tools Summary: Auxiliary utilities for %{name} # pcre2test (linked to GNU readline): BSD (linked to GPLv3+) License: BSD and GPLv3+ Group: Development/Tools Requires: %{name} = %{version}-%{release} %if %{p7build} BuildRequires: bzip2 >= 1.0.5-3 %else BuildRequires: bzip2 >= 1.0.2-4 %endif BuildRequires: zlib-devel >= 1.2.3-7, readline-devel >= 7.0-3 %if %{p7build} Requires: bzip2 >= 1.0.5-3 %else Requires: bzip2 >= 1.0.2-4 %endif Requires: zlib >= 1.2.3-7, readline >= 7.0-3 %description tools Utilities demonstrating PCRE2 capabilities like pcre2grep or pcre2test. %prep export PATH=/opt/freeware/bin:$PATH %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 RM="/usr/bin/rm -f" 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-pcre2-8 \ --enable-pcre2-16 \ --enable-pcre2-32 \ --disable-debug \ --enable-jit \ --enable-pcre2grep-jit \ --disable-rebuild-chartables \ --enable-unicode \ --disable-newline-is-cr \ --enable-newline-is-lf \ --disable-bsr-anycrlf \ --disable-never-backslash-C \ --disable-ebcdic \ --enable-stack-for-recursion \ --enable-pcre2grep-libz \ --enable-pcre2grep-libbz2 \ --disable-pcre2test-libedit \ --enable-pcre2test-libreadline \ --disable-valgrind \ --disable-coverage make %{?_smp_mflags} 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} \ --libdir=%{_libdir} \ --mandir=%{_mandir} \ --enable-shared --disable-static \ --enable-pcre2-8 \ --enable-pcre2-16 \ --enable-pcre2-32 \ --disable-debug \ --enable-jit \ --enable-pcre2grep-jit \ --disable-rebuild-chartables \ --enable-unicode \ --disable-newline-is-cr \ --enable-newline-is-lf \ --disable-bsr-anycrlf \ --disable-never-backslash-C \ --disable-ebcdic \ --enable-stack-for-recursion \ --enable-pcre2grep-libz \ --enable-pcre2grep-libbz2 \ --disable-pcre2test-libedit \ --enable-pcre2test-libreadline \ --disable-valgrind \ --disable-coverage make %{?_smp_mflags} %install [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} export RM="/usr/bin/rm -f" cd 64bit export OBJECT_MODE=64 make install DESTDIR=${RPM_BUILD_ROOT} ( cd ${RPM_BUILD_ROOT}%{_bindir} for f in * ; do mv -f ${f} ${f}_64 done ) cd ../32bit export OBJECT_MODE=32 make install DESTDIR=${RPM_BUILD_ROOT} /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}-8.a ${RPM_BUILD_ROOT}%{_libdir64}/lib%{name}-8.so* /usr/bin/ar -X64 -q ${RPM_BUILD_ROOT}%{_libdir}/lib%{name}-16.a ${RPM_BUILD_ROOT}%{_libdir64}/lib%{name}-16.so* /usr/bin/ar -X64 -q ${RPM_BUILD_ROOT}%{_libdir}/lib%{name}-32.a ${RPM_BUILD_ROOT}%{_libdir64}/lib%{name}-32.so* /usr/bin/ar -X64 -q ${RPM_BUILD_ROOT}%{_libdir}/lib%{name}-posix.a ${RPM_BUILD_ROOT}%{_libdir64}/lib%{name}-posix.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 ) %clean [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %files %defattr(-,root,system) %doc 32bit/AUTHORS 32bit/ChangeLog 32bit/COPYING 32bit/NEWS 32bit/README %{_libdir}/*.a %{_libdir}/*.so* %{_libdir64}/*.so* /usr/lib/*.a /usr/lib/*.so* /usr/lib64/*.so* %files devel %defattr(-,root,system) %doc 32bit/doc/*.txt 32bit/doc/html %doc 32bit/HACKING 32bit/src/pcre2demo.c %{_bindir}/pcre2-config* %{_includedir}/* %{_libdir}/*.la %{_libdir64}/*.la %{_libdir}/pkgconfig/* %{_libdir64}/pkgconfig/* %{_mandir}/man1/pcre2-config.* %{_mandir}/man3/* /usr/bin/pcre2-config* /usr/include/* /usr/lib/*.la /usr/lib64/*.la %files tools %defattr(-,root,system) %{_bindir}/pcre2grep* %{_bindir}/pcre2test* %{_mandir}/man1/pcre2grep.* %{_mandir}/man1/pcre2test.* /usr/bin/pcre2grep* /usr/bin/pcre2test* %changelog * Wed Sep 19 2018 Michael Perzl - 10.32-1 - updated to version 10.32 * Tue Feb 20 2018 Michael Perzl - 10.31-1 - updated to version 10.31 * Tue Aug 22 2017 Michael Perzl - 10.30-1 - updated to version 10.30 * Thu Feb 23 2017 Michael Perzl - 10.23-1 - updated to version 10.23 * Thu Aug 25 2016 Michael Perzl - 10.22-1 - updated to version 10.22 * Tue Jul 05 2016 Michael Perzl - 10.21-1 - first version for AIX V5.1 and higher