diff --git a/README.rst b/README.rst index fc64959..758affa 100644 --- a/README.rst +++ b/README.rst @@ -370,6 +370,11 @@ The options that can be set in ``options.conf`` are as follows: If this option is set, then ``%define keepstatic 1`` is emitted in the ``.spec``. As a result, any static archive (``.a``) files will not be removed by rpmbuild. +**32bit** + + This option will trigger the creation of 32-bit libraries for a 32-bit + build. + Name and version resolution =========================== diff --git a/tests/testfiles/c-helloworld-32/Makefile b/tests/testfiles/c-helloworld-32/Makefile new file mode 100644 index 0000000..d8ca5e9 --- /dev/null +++ b/tests/testfiles/c-helloworld-32/Makefile @@ -0,0 +1,9 @@ +DESTDIR ?= +PREFIX ?= /usr/local + +helloworld: + gcc main.c -o helloworld + +install: helloworld + install -m 0755 -d $(DESTDIR)$(PREFIX)/bin + install -m 0755 helloworld $(DESTDIR)$(PREFIX)/bin diff --git a/tests/testfiles/c-helloworld-32/autospecdir/buildreq_add b/tests/testfiles/c-helloworld-32/autospecdir/buildreq_add new file mode 100644 index 0000000..8007d88 --- /dev/null +++ b/tests/testfiles/c-helloworld-32/autospecdir/buildreq_add @@ -0,0 +1,3 @@ +# This file contains additional build requirements that did not get +# picked up automatically. One name per line, no whitespace. +xz diff --git a/tests/testfiles/c-helloworld-32/autospecdir/buildreq_ban b/tests/testfiles/c-helloworld-32/autospecdir/buildreq_ban new file mode 100644 index 0000000..bf7accf --- /dev/null +++ b/tests/testfiles/c-helloworld-32/autospecdir/buildreq_ban @@ -0,0 +1,2 @@ +# This file contains build requirements that get picked up but are +# undesirable. One entry per line, no whitespace. diff --git a/tests/testfiles/c-helloworld-32/autospecdir/c-helloworld-32.license b/tests/testfiles/c-helloworld-32/autospecdir/c-helloworld-32.license new file mode 100644 index 0000000..e219275 --- /dev/null +++ b/tests/testfiles/c-helloworld-32/autospecdir/c-helloworld-32.license @@ -0,0 +1 @@ +GPL-3.0 diff --git a/tests/testfiles/c-helloworld-32/autospecdir/options.conf b/tests/testfiles/c-helloworld-32/autospecdir/options.conf new file mode 100644 index 0000000..8e3e69a --- /dev/null +++ b/tests/testfiles/c-helloworld-32/autospecdir/options.conf @@ -0,0 +1,11 @@ +[autospec] +32bit = true +allow_test_failures = false +asneeded = false +broken_c++ = false +broken_parallel_build = false +conservative_flags = false +fast-math = false +funroll-loops = false +insecure_build = false + diff --git a/tests/testfiles/c-helloworld-32/autospecdir/pkgconfig_add b/tests/testfiles/c-helloworld-32/autospecdir/pkgconfig_add new file mode 100644 index 0000000..dd3b77c --- /dev/null +++ b/tests/testfiles/c-helloworld-32/autospecdir/pkgconfig_add @@ -0,0 +1,2 @@ +# This file contains additional pkgconfig build requirements that did +# not get picked up automatically. One name per line, no whitespace. diff --git a/tests/testfiles/c-helloworld-32/autospecdir/pkgconfig_ban b/tests/testfiles/c-helloworld-32/autospecdir/pkgconfig_ban new file mode 100644 index 0000000..859fae4 --- /dev/null +++ b/tests/testfiles/c-helloworld-32/autospecdir/pkgconfig_ban @@ -0,0 +1,2 @@ +# This file contains pkgconfig build requirements that get picked up +# but are undesirable. One entry per line, no whitespace. diff --git a/tests/testfiles/c-helloworld-32/conf-expectations b/tests/testfiles/c-helloworld-32/conf-expectations new file mode 100644 index 0000000..60239ca --- /dev/null +++ b/tests/testfiles/c-helloworld-32/conf-expectations @@ -0,0 +1,36 @@ +[autospec] +# build 32 bit libraries +32bit = true +# allow package to build with test failures +allow_test_failures = false +# unset %build ld_as_needed variable +asneeded = false +# extend flags with '-std=gnu++98 +broken_c++ = false +# disable parallelization during build +broken_parallel_build = false +# set conservative build flags +conservative_flags = false +# pass -ffast-math to compiler +fast-math = false +# optimize build for speed over size +funroll-loops = false +# set flags to smallest -02 flags possible +insecure_build = false +# do not remove static libraries +keepstatic = false +# do not require autostart suepackage +no_autostart = false +# optimize build for size over speed +optimize_size = false +# set profile for pgo +pgo = false +# do not run test suite +skip_tests = false +# configure build for avx2 +use_avx2 = false +# add clang flags +use_clang = false +# configure build for lto +use_lto = false + diff --git a/tests/testfiles/c-helloworld-32/expectations.py b/tests/testfiles/c-helloworld-32/expectations.py new file mode 100644 index 0000000..509a58e --- /dev/null +++ b/tests/testfiles/c-helloworld-32/expectations.py @@ -0,0 +1,23 @@ +""" +This file, expectations.py, defines expected test results and is not added to +the test source tarball. +""" +import os + +buildreqs = ['xz', + 'gcc-dev32', + 'gcc-libgcc32', + 'gcc-libstdc++32', + 'glibc-dev32', + 'glibc-libc32'] + +license = 'GPL-3.0' +with open('tests/testfiles/c-helloworld-32/spec-expectations', 'r') as spec: + specfile = spec.read() +specfile = specfile.replace('{}', os.getcwd()).split('\n') + +with open('tests/testfiles/c-helloworld-32/conf-expectations', 'r') as conf: + conffile = conf.read() +conffile = conffile.split('\n') + +output_strings = [] diff --git a/tests/testfiles/c-helloworld-32/main.c b/tests/testfiles/c-helloworld-32/main.c new file mode 100644 index 0000000..2d63c24 --- /dev/null +++ b/tests/testfiles/c-helloworld-32/main.c @@ -0,0 +1,3 @@ +#include +int main(){printf("Hello World\n");} + diff --git a/tests/testfiles/c-helloworld-32/spec-expectations b/tests/testfiles/c-helloworld-32/spec-expectations new file mode 100644 index 0000000..07a556c --- /dev/null +++ b/tests/testfiles/c-helloworld-32/spec-expectations @@ -0,0 +1,48 @@ +# +# This file is auto-generated. DO NOT EDIT +# Generated by: autospec.py +# +Name : c-helloworld-32 +Version : 1 +Release : 1 +URL : file://{}/tests/testfiles/c-helloworld-32.tar.gz +Source0 : file://{}/tests/testfiles/c-helloworld-32.tar.gz +Summary : No detailed summary available +Group : Development/Tools +License : GPL-3.0 +BuildRequires : gcc-dev32 +BuildRequires : gcc-libgcc32 +BuildRequires : gcc-libstdc++32 +BuildRequires : glibc-dev32 +BuildRequires : glibc-libc32 +BuildRequires : xz + +%description +No detailed description available + +%prep +%setup -q -n c-helloworld-32 +pushd .. +cp -a c-helloworld-32 build32 +popd + +%build +export LANG=C +make V=1 %{?_smp_mflags} + +%install +rm -rf %{buildroot} +pushd ../build32/ +%make_install32 +if [ -d %{buildroot}/usr/lib32/pkgconfig ] +then +pushd %{buildroot}/usr/lib32/pkgconfig +for i in *.pc ; do mv $i 32$i ; done +popd +fi +popd +%make_install + +%files +%defattr(-,root,root,-) +/usr/local/bin/helloworld diff --git a/tests/testfiles/c-helloworld-opts/conf-expectations b/tests/testfiles/c-helloworld-opts/conf-expectations index 8f93698..9ffc4e2 100644 --- a/tests/testfiles/c-helloworld-opts/conf-expectations +++ b/tests/testfiles/c-helloworld-opts/conf-expectations @@ -1,4 +1,6 @@ [autospec] +# build 32 bit libraries +32bit = false # allow package to build with test failures allow_test_failures = true # unset %build ld_as_needed variable diff --git a/tests/testfiles/c-helloworld/conf-expectations b/tests/testfiles/c-helloworld/conf-expectations index b590556..caba8c6 100644 --- a/tests/testfiles/c-helloworld/conf-expectations +++ b/tests/testfiles/c-helloworld/conf-expectations @@ -1,4 +1,6 @@ [autospec] +# build 32 bit libraries +32bit = false # allow package to build with test failures allow_test_failures = false # unset %build ld_as_needed variable diff --git a/tests/testfiles/libjpeg-turbo/conf-expectations b/tests/testfiles/libjpeg-turbo/conf-expectations index 8024caf..ef03910 100644 --- a/tests/testfiles/libjpeg-turbo/conf-expectations +++ b/tests/testfiles/libjpeg-turbo/conf-expectations @@ -1,4 +1,6 @@ [autospec] +# build 32 bit libraries +32bit = false # allow package to build with test failures allow_test_failures = false # unset %build ld_as_needed variable diff --git a/tests/testfiles/py-helloworld/conf-expectations b/tests/testfiles/py-helloworld/conf-expectations index b590556..caba8c6 100644 --- a/tests/testfiles/py-helloworld/conf-expectations +++ b/tests/testfiles/py-helloworld/conf-expectations @@ -1,4 +1,6 @@ [autospec] +# build 32 bit libraries +32bit = false # allow package to build with test failures allow_test_failures = false # unset %build ld_as_needed variable