From 063640e2d2c5b48d447d8b28b7e8a49360d5dade Mon Sep 17 00:00:00 2001 From: Mikhail Novosyolov Date: Fri, 3 Jan 2020 22:33:06 +0300 Subject: [PATCH 1/8] rpm4 does not understand BuildRequires(check) --- libressl.spec | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libressl.spec b/libressl.spec index a7686b8..61eefe8 100644 --- a/libressl.spec +++ b/libressl.spec @@ -56,7 +56,7 @@ Summary: LibreSSL utils and libs coexisting with OpenSSL Name: libressl Version: %{base_version}.git%{git_date} -Release: 13 +Release: 14 # The code is distributed under ISC license except of original OpenSSL code License: ISC and BSD-like Group: System/Base @@ -88,7 +88,8 @@ Source25: test5.c Source29: test9.c # To get %%_openssldir and for %%check BuildRequires: openssl-devel -BuildRequires(check): gostsum +#BuildRequires(check) +BuildRequires: gostsum # readelf <...> | <...> BuildRequires: binutils grep gawk BuildRequires: chrpath From aa028f891964f860a972d7396b629da79d4a2114 Mon Sep 17 00:00:00 2001 From: Neal Gompa Date: Fri, 3 Jan 2020 15:47:13 -0500 Subject: [PATCH 2/8] More fixes for building on rpm4 --- libressl.spec | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/libressl.spec b/libressl.spec index 61eefe8..bd30c89 100644 --- a/libressl.spec +++ b/libressl.spec @@ -9,9 +9,13 @@ %define _obindir %{_oprefix}/bin %define _omandir %{_oprefix}/share/man %define _olibdir %{_oprefix}/%{_lib} +# We need to override macros set in platform %define _prefix /opt/libressl -# No need to have /opt/libressl/lib64, use /opt/libressl/lib -%define _libdir %{_prefix}/lib +%define _bindir %{_prefix}/bin +%define _libdir %{_prefix}/%{_lib} +%define _libexecdir %{_prefix}/libexec +%define _datadir %{_prefix}/share +%define _mandir %{_datadir}/man # Keep package docs in normal locations %define _defaultdocdir %{_oprefix}/share/doc # Disable /usr/share/spec-helper/relink_symlinks @@ -41,8 +45,8 @@ # We rename e.g. libtls.pc to libressl-tls.pc, make sure that we do not # get odd provides and break the repository if forgot to rename something. # Filter out provides like 'devel(libcrypto(64bit))' (they are in OpenSSL). -%define __noautoprov \ - '.*openssl.*|pkgconfig\\(lib(tls|crypro|ssl)\\)|devel\\(lib(tls|crypto|ssl).*\\).*' +%define __provides_exclude \ +'.*openssl.*|pkgconfig\\(lib(tls|crypro|ssl)\\)|devel\\(lib(tls|crypto|ssl).*\\).*' %define libcrypto_sover 46 %define libssl_sover 48 @@ -95,8 +99,7 @@ BuildRequires: binutils grep gawk BuildRequires: chrpath # This LibreSSL uses /etc/pki/tls from system OpenSSL # but most functions will work without its files -Suggests: openssl -Autoreq: 1 +Recommends: openssl %description LibreSSL utils and libs coexisting with OpenSSL. @@ -104,6 +107,7 @@ GOST is supported out of the box. %files %doc ChangeLog COPYING +%license COPYING # %%_bindir here is /opt/libressl/bin # %%_obindir is /usr/bin # %%_mandir is /opt/libressl/share/man @@ -121,7 +125,6 @@ GOST is supported out of the box. %package -n %{libcrypto_pkg} Summary: libcrypto library from LibreSSL Group: System/Libraries -Autoreq: 1 %description -n %{libcrypto_pkg} libcrypto library from LibreSSL @@ -133,7 +136,6 @@ libcrypto library from LibreSSL %package -n %{libssl_pkg} Summary: libssl library from LibreSSL Group: System/Libraries -Autoreq: 1 %description -n %{libssl_pkg} libssl library from LibreSSL @@ -145,7 +147,6 @@ libssl library from LibreSSL %package -n %{libtls_pkg} Summary: libtls library from LibreSSL Group: System/Libraries -Autoreq: 1 %description -n %{libtls_pkg} libtls library from LibreSSL @@ -180,7 +181,6 @@ Provides: devel(libressl-libtls%{b64}) Provides: devel(libressl-libcrypto%{b64}) Provides: devel(libressl-libssl%{b64}) %endif -Autoreq: 1 %description devel LibreSSL devel package. Devel libraries are in %{_libdir}, @@ -227,7 +227,6 @@ Provides: nc = %{EVRD} # Provide "netcat" but of a lower version than the real netcat # to allow other packages to depend from any variant of netcat Provides: netcat = 1.0 -Autoreq: 1 %description -n netcat-openbsd The nc package contains Netcat (the program is actually nc), a simple @@ -262,23 +261,23 @@ cat %{SOURCE1} | sed \ patch -p1 < 1.patch %build -%setup_compile_flags +%set_build_flags %serverbuild # Use the same %%_openssl dir with OpenSSL, but separate the config # (note that we patch libressl, X509_CONF_FILE is not upstream) export CFLAGS="$CFLAGS -DX509_CONF_FILE='\"%{_openssldir}/libressl.cnf\"'" autoreconf -if #patch2 # static libs are required for tests target in Makefile -%configure2_5x \ +%configure \ --enable-nc \ --enable-static \ --with-openssldir=%{_openssldir} -%make +%make_build %install set +f # explicitly enable shell globbing -%makeinstall_std +%make_install # Some ideas about mans are from ALT Linux spec install -m 0644 apps/nc/nc.1 %{buildroot}%{_mandir}/man1/nc.1 From e6dfd910875a6e70c013fd84478e33090b3db12a Mon Sep 17 00:00:00 2001 From: Neal Gompa Date: Fri, 3 Jan 2020 21:52:51 -0500 Subject: [PATCH 3/8] Add includedir override and fix pkgconfig file substitutions --- libressl.spec | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libressl.spec b/libressl.spec index bd30c89..1c80f76 100644 --- a/libressl.spec +++ b/libressl.spec @@ -12,6 +12,7 @@ # We need to override macros set in platform %define _prefix /opt/libressl %define _bindir %{_prefix}/bin +%define _includedir %{_prefix}/include %define _libdir %{_prefix}/%{_lib} %define _libexecdir %{_prefix}/libexec %define _datadir %{_prefix}/share @@ -60,7 +61,7 @@ Summary: LibreSSL utils and libs coexisting with OpenSSL Name: libressl Version: %{base_version}.git%{git_date} -Release: 14 +Release: 15 # The code is distributed under ISC license except of original OpenSSL code License: ISC and BSD-like Group: System/Base @@ -353,7 +354,7 @@ do # It is lost due to --exec_prefix=XXX in %%configure2_5x sed -i -r \ -e 's,^exec_prefix=.+,exec_prefix=${prefix},' \ - -e 's,^libdir=.+,libdir=${exec_prefix}/lib,' \ + -e 's,^libdir=.+,libdir=${exec_prefix}/%{_lib},' \ -e 's,^includedir=.+,includedir=${prefix}/include,' \ "$f" mv -v "$f" "libressl-${f}" From 485e3a3439523e141f1e281d4b50658f3d6a1658 Mon Sep 17 00:00:00 2001 From: Mikhail Novosyolov Date: Sat, 4 Jan 2020 14:22:10 +0300 Subject: [PATCH 4/8] /opt/libressl/lib is intentionally used for both 32 and 64 bit pkgs Fixes: e6dfd910875a6e70c013fd84478e33090b3db12a --- libressl.spec | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libressl.spec b/libressl.spec index 1c80f76..0ac4e5d 100644 --- a/libressl.spec +++ b/libressl.spec @@ -13,7 +13,7 @@ %define _prefix /opt/libressl %define _bindir %{_prefix}/bin %define _includedir %{_prefix}/include -%define _libdir %{_prefix}/%{_lib} +%define _libdir %{_prefix}/lib %define _libexecdir %{_prefix}/libexec %define _datadir %{_prefix}/share %define _mandir %{_datadir}/man @@ -61,7 +61,7 @@ Summary: LibreSSL utils and libs coexisting with OpenSSL Name: libressl Version: %{base_version}.git%{git_date} -Release: 15 +Release: 16 # The code is distributed under ISC license except of original OpenSSL code License: ISC and BSD-like Group: System/Base @@ -354,7 +354,7 @@ do # It is lost due to --exec_prefix=XXX in %%configure2_5x sed -i -r \ -e 's,^exec_prefix=.+,exec_prefix=${prefix},' \ - -e 's,^libdir=.+,libdir=${exec_prefix}/%{_lib},' \ + -e 's,^libdir=.+,libdir=${exec_prefix}/lib,' \ -e 's,^includedir=.+,includedir=${prefix}/include,' \ "$f" mv -v "$f" "libressl-${f}" From 486c5d396cc90042198aba6b9325f7912d1e794b Mon Sep 17 00:00:00 2001 From: NixTux Commit Bot Date: Sat, 4 Jan 2020 22:33:57 +0300 Subject: [PATCH 5/8] bot: rpm5 -> rpm4 (3) --- libressl.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libressl.spec b/libressl.spec index 0ac4e5d..55f645a 100644 --- a/libressl.spec +++ b/libressl.spec @@ -351,7 +351,7 @@ do exit 1 fi # Restore ability to work with custom prefix - # It is lost due to --exec_prefix=XXX in %%configure2_5x + # It is lost due to --exec_prefix=XXX in %%configure sed -i -r \ -e 's,^exec_prefix=.+,exec_prefix=${prefix},' \ -e 's,^libdir=.+,libdir=${exec_prefix}/lib,' \ From fcc56f236accecfcb7e51c3e07ae91a2eea2d236 Mon Sep 17 00:00:00 2001 From: Mikhail Novosyolov Date: Tue, 7 Jan 2020 00:27:43 +0300 Subject: [PATCH 6/8] fix typo in regerxp (noted by ngompa@) --- libressl.spec | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libressl.spec b/libressl.spec index 55f645a..b04c13c 100644 --- a/libressl.spec +++ b/libressl.spec @@ -46,8 +46,8 @@ # We rename e.g. libtls.pc to libressl-tls.pc, make sure that we do not # get odd provides and break the repository if forgot to rename something. # Filter out provides like 'devel(libcrypto(64bit))' (they are in OpenSSL). -%define __provides_exclude \ -'.*openssl.*|pkgconfig\\(lib(tls|crypro|ssl)\\)|devel\\(lib(tls|crypto|ssl).*\\).*' +%global __provides_exclude \ +'.*openssl.*|pkgconfig\\(lib(tls|crypto|ssl)\\)|devel\\(lib(tls|crypto|ssl).*\\).*' %define libcrypto_sover 46 %define libssl_sover 48 @@ -61,7 +61,7 @@ Summary: LibreSSL utils and libs coexisting with OpenSSL Name: libressl Version: %{base_version}.git%{git_date} -Release: 16 +Release: 20 # The code is distributed under ISC license except of original OpenSSL code License: ISC and BSD-like Group: System/Base From 922e214862647aff536dcfcabf4e6293ba9ac4bb Mon Sep 17 00:00:00 2001 From: Mikhail Novosyolov Date: Tue, 7 Jan 2020 01:04:30 +0300 Subject: [PATCH 7/8] RPM 5 currently does not understand %%license --- libressl.spec | 1 - 1 file changed, 1 deletion(-) diff --git a/libressl.spec b/libressl.spec index b04c13c..3f8c004 100644 --- a/libressl.spec +++ b/libressl.spec @@ -108,7 +108,6 @@ GOST is supported out of the box. %files %doc ChangeLog COPYING -%license COPYING # %%_bindir here is /opt/libressl/bin # %%_obindir is /usr/bin # %%_mandir is /opt/libressl/share/man From bcce10a2c4018284b314965c2b1492913d638712 Mon Sep 17 00:00:00 2001 From: Mikhail Novosyolov Date: Tue, 7 Jan 2020 01:25:39 +0300 Subject: [PATCH 8/8] redefine pkgconfig path for rpm4 to restore providing pkgconfig(libressl*) --- libressl.spec | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libressl.spec b/libressl.spec index 3f8c004..7be822c 100644 --- a/libressl.spec +++ b/libressl.spec @@ -19,6 +19,8 @@ %define _mandir %{_datadir}/man # Keep package docs in normal locations %define _defaultdocdir %{_oprefix}/share/doc +# RPM 4 by default looks for *.pc in %%_libdir which is redefined +%global __pkgconfig_path ^(%{_olibdir}/pkgconfig/.*\\.pc|%{_obindir}/pkg-config)$ # Disable /usr/share/spec-helper/relink_symlinks # to make sure that symlinks are not broken %define dont_relink 1 @@ -61,7 +63,7 @@ Summary: LibreSSL utils and libs coexisting with OpenSSL Name: libressl Version: %{base_version}.git%{git_date} -Release: 20 +Release: 21 # The code is distributed under ISC license except of original OpenSSL code License: ISC and BSD-like Group: System/Base