From 64e5893f142c75912beafe39715da53647dd2ee4 Mon Sep 17 00:00:00 2001 From: Lucio Andrés Illanes Albornoz (arab, vxp) Date: May 14 2018 14:32:26 +0000 Subject: Adds --rpm: [b]uild RPM packages for each package built; selects host_tools_rpm. --- diff --git a/build.sh b/build.sh index e965102..c22ff94 100755 --- a/build.sh +++ b/build.sh @@ -15,6 +15,10 @@ buildp_dispatch() { && [ "${ARG_RESTART}" != ALL ]; then _build_tgt_pkg_names=""; for _build_tgt_lc in ${BUILD_TARGETS:-${TARGETS_DEFAULT}}; do + if [ "${_build_tgt_lc}" = "host_tools_rpm" ] \ + && [ "${ARG_RPM:-0}" -eq 0 ]; then + continue; + fi; _build_tgt_uc="$(ex_rtl_toupper "${_build_tgt_lc}")"; _build_tgt_pkg_names="${_build_tgt_pkg_names:+${_build_tgt_pkg_names} }$(ex_rtl_get_var_unsafe ${_build_tgt_uc}_PACKAGES)"; done; @@ -24,6 +28,10 @@ buildp_dispatch() { fi; fi; for _build_tgt_lc in ${BUILD_TARGETS:-${TARGETS_DEFAULT}}; do + if [ "${_build_tgt_lc}" = "host_tools_rpm" ] \ + && [ "${ARG_RPM}" -eq 0 ]; then + continue; + fi; ex_pkg_dispatch "${_build_tgt_lc}" \ "${ARG_RESTART}" "${ARG_RESTART_AT}" \ buildp_dispatch; diff --git a/etc/build.usage b/etc/build.usage index 3522e9a..523b8fc 100644 --- a/etc/build.usage +++ b/etc/build.usage @@ -2,7 +2,7 @@ usage: ./build.sh [-4|6] [-a nt32|nt64] [-b debug|release] [-c] [-C dir[,..]] [-h] [-N] [-P [jobs]] [-r ALL[:step,..]] [-r name[,..][:step,..]] [-R] [-t[.gz|.bz2|.xz] [-v[v[v]]] [-x] - [--as-needed] [--debug-minipix] [[ ..]] + [--as-needed] [--debug-minipix] [--rpm] [[ ..]] -4|-6 Force IPv[46] when downloading files. -a nt32|nt64 Selects 32-bit or 64-bit architecture; defaults to nt64. -b debug|release Selects debug or release build; defaults to debug. @@ -39,8 +39,9 @@ usage: ./build.sh [-4|6] [-a nt32|nt64] [-b debug|release] -x Set xtrace during package builds; implies -vv. --as-needed Don't build unless the midipix_build repository has received new commits. --debug-minipix Don't strip(1) minipix binaries to facilitate debugging minipix. + --rpm Build RPM packages for each package built; selects host_tools_rpm. [ ..] One of: - host or host_tools, host_toolchain_deps, host_toolchain, host_toolchain_mingw32, + host or host_tools, host_tools_rpm, host_toolchain_deps, host_toolchain, host_toolchain_mingw32, native or native_tools, native_toolchain_deps, native_toolchain, native_toolchain_mingw32, native_runtime, packages_deps or host_packages_deps, native_packages_deps, native_packages_deps_x11, packages or native_packages, or dist. diff --git a/patches/rpm-4.14.1.local.patch b/patches/rpm-4.14.1.local.patch index 904ee92..122f5a9 100644 --- a/patches/rpm-4.14.1.local.patch +++ b/patches/rpm-4.14.1.local.patch @@ -287,12 +287,11 @@ Only in rpm-4.14.1: macros.in.orig diff -ru rpm-4.14.1.orig/rpmio/digest_openssl.c rpm-4.14.1/rpmio/digest_openssl.c --- rpm-4.14.1.orig/rpmio/digest_openssl.c 2017-10-05 12:04:57.554602041 +0200 +++ rpm-4.14.1/rpmio/digest_openssl.c 2018-04-01 02:39:06.081268659 +0200 -@@ -175,8 +175,11 @@ +@@ -175,8 +175,10 @@ case PGPHASHALGO_RIPEMD160: return EVP_ripemd160(); -+/* This should be a ifndef libressl... */ -+#ifndef __midipix__ ++#ifndef LIBRESSL_VERSION_NUMBER case PGPHASHALGO_MD2: return EVP_md2(); +#endif diff --git a/patches/rpm_host-4.14.1.local.patch b/patches/rpm_host-4.14.1.local.patch new file mode 120000 index 0000000..171da06 --- /dev/null +++ b/patches/rpm_host-4.14.1.local.patch @@ -0,0 +1 @@ +rpm-4.14.1.local.patch \ No newline at end of file diff --git a/subr/build_args.subr b/subr/build_args.subr index a483c99..b1d778f 100644 --- a/subr/build_args.subr +++ b/subr/build_args.subr @@ -11,6 +11,7 @@ BUILD_ARGS_SPEC=" ARG_CLEAN_BUILDS:arg:-C: ARG_AS_NEEDED:--as-needed: ARG_DEBUG_MINIPIX:--debug-minipix: + ARG_RPM:--rpm: ARG_OFFLINE:-N: ARG_PACKAGE:-p: ARG_PARALLEL:optarg:-P:auto diff --git a/subr/build_init.subr b/subr/build_init.subr index 053b837..a6513f8 100644 --- a/subr/build_init.subr +++ b/subr/build_init.subr @@ -55,6 +55,9 @@ build_init() { done; ex_rtl_unset_vars $(ex_rtl_lfilter_not "${_env_vars}" "${_env_vars_except}"); ex_rtl_fileop mkdir "${BUILD_DLCACHEDIR}" "${BUILD_WORKDIR}"; + if [ "${ARG_RPM:-0}" -eq 1 ]; then + ex_rtl_fileop mkdir "${PREFIX_RPM}"; + fi; if [ -e "${DEFAULT_BUILD_STATUS_IN_PROGRESS_FNAME}" ]; then ex_rtl_log_msg failexit "Error: another build targeting this architecture and build type is currently in progress."; else diff --git a/subr/pkg_install.subr b/subr/pkg_install.subr index dd007ab..17b4d04 100644 --- a/subr/pkg_install.subr +++ b/subr/pkg_install.subr @@ -17,6 +17,34 @@ pkg_install() { tar -C "${PKG_DESTDIR}" -cpf - . |\ gzip -c -9 - > "${PKG_BASE_DIR}/${PKG_NAME}.tgz" fi; + if [ "${ARG_RPM:-0}" -eq 1 ]; then + cat > "${PKG_BASE_DIR}/${PKG_NAME}.spec" <