summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorLucio Andrés Illanes Albornoz (arab, vxp) <lucio@lucioillanes.de>2018-05-14 14:32:26 +0000
committerLucio Andrés Illanes Albornoz (arab, vxp) <lucio@lucioillanes.de>2018-05-14 14:32:26 +0000
commit64e5893f142c75912beafe39715da53647dd2ee4 (patch)
tree78cbbdde98371f6d58e1ef406e9b99c0dc6de3aa
parent7f17bb6c4d94b00e724fa8672da50cd33d6d6c91 (diff)
downloadmidipix_build-64e5893f142c75912beafe39715da53647dd2ee4.tar.bz2
midipix_build-64e5893f142c75912beafe39715da53647dd2ee4.tar.xz
Adds --rpm: [b]uild RPM packages for each package built; selects host_tools_rpm.
-rwxr-xr-xbuild.sh8
-rw-r--r--etc/build.usage5
-rw-r--r--patches/rpm-4.14.1.local.patch5
l---------patches/rpm_host-4.14.1.local.patch1
-rw-r--r--subr/build_args.subr1
-rw-r--r--subr/build_init.subr3
-rw-r--r--subr/pkg_install.subr28
-rw-r--r--vars/build.vars31
-rw-r--r--vars/midipix.vars1
9 files changed, 75 insertions, 8 deletions
diff --git a/build.sh b/build.sh
index e9651025..c22ff945 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 3522e9ad..523b8fc5 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] [<target>[ ..]]
+ [--as-needed] [--debug-minipix] [--rpm] [<target>[ ..]]
-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.
<target>[ ..] 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 904ee921..122f5a95 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 00000000..171da06e
--- /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 a483c99f..b1d778f0 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 053b8374..a6513f83 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 dd007abe..17b4d04b 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" <<EOF
+Name: ${PKG_NAME}
+Version: ${PKG_VERSION}
+Release: 1
+Summary: ${PKG_NAME} ${PKG_VERSION}
+License: Unknown
+Group: Applications
+Url: ${PKG_URL}
+
+%description
+${PKG_NAME} ${PKG_VERSION}
+
+%prep
+%build
+%install
+cp -pPr ${PKG_DESTDIR}/. .
+
+%post
+%postun
+%files
+%changelog
+
+EOF
+ rpmbuild -bb --define="_topdir ${PREFIX_RPM}/${PKG_NAME}-${PKG_VERSION}" --nodeps "${PKG_BASE_DIR}/${PKG_NAME}.spec";
+ find "${PREFIX_RPM}/${PKG_NAME}-${PKG_VERSION}/RPMS" -iname \*.rpm -exec cp -pP {} "${PREFIX_RPM}/" \;;
+ ex_rtl_fileop rm "${PREFIX_RPM}/${PKG_NAME}-${PKG_VERSION}";
+ fi;
};
# vim:filetype=sh
diff --git a/vars/build.vars b/vars/build.vars
index 0ac43c63..44e89c25 100644
--- a/vars/build.vars
+++ b/vars/build.vars
@@ -46,6 +46,33 @@ HOST_TOOLS_PREFIX="${PREFIX}";
: ${PKG_PKGCONF_HOST_MAKEFLAGS_INSTALL_EXTRA:=prefix=};
#
+# Build target host_tools_rpm
+#
+HOST_TOOLS_RPM_BUILD_TYPE="host";
+HOST_TOOLS_RPM_CONFIGURE_ARGS="--disable-nls --prefix=${PREFIX}";
+HOST_TOOLS_RPM_MAKEFLAGS_INSTALL_EXTRA="prefix=";
+HOST_TOOLS_RPM_PACKAGES="libarchive_host libressl_host lmdb_host popt_host rpm_host";
+HOST_TOOLS_RPM_PREFIX="${PREFIX}";
+: ${PKG_LIBARCHIVE_HOST_SHA256SUM:=ed2dbd6954792b2c054ccf8ec4b330a54b85904a80cef477a1c74643ddafa0ce};
+: ${PKG_LIBARCHIVE_HOST_VERSION:=3.3.2};
+: ${PKG_LIBARCHIVE_HOST_URL:=http://www.libarchive.org/downloads/libarchive-${PKG_LIBARCHIVE_HOST_VERSION}.tar.gz};
+: ${PKG_LIBRESSL_HOST_SHA256SUM:=917a8779c342177ff3751a2bf955d0262d1d8916a4b408930c45cef326700995};
+: ${PKG_LIBRESSL_HOST_VERSION:=2.7.2};
+: ${PKG_LIBRESSL_HOST_URL:=http://ftp.eu.openbsd.org/pub/OpenBSD/LibreSSL/libressl-${PKG_LIBRESSL_HOST_VERSION}.tar.gz};
+: ${PKG_LMDB_HOST_URLS_GIT:="lmdb=https://github.com/Redfoxmoon3/lmdb.git@mdb.master"};
+: ${PKG_LMDB_HOST_IN_TREE:=1};
+: ${PKG_POPT_HOST_SHA256SUM:=e728ed296fe9f069a0e005003c3d6b2dde3d9cad453422a10d6558616d304cc8};
+: ${PKG_POPT_HOST_VERSION:=1.16};
+: ${PKG_POPT_HOST_URL:=http://rpm5.org/files/popt/popt-${PKG_POPT_HOST_VERSION}.tar.gz};
+: ${PKG_RPM_HOST_SHA256SUM:=43f40e2ccc3ca65bd3238f8c9f8399d4957be0878c2e83cba2746d2d0d96793b};
+: ${PKG_RPM_HOST_VERSION:=4.14.1};
+: ${PKG_RPM_HOST_URL:=http://ftp.rpm.org/releases/rpm-${PKG_RPM_HOST_VERSION%.*}.x/rpm-${PKG_RPM_HOST_VERSION}.tar.bz2};
+: ${PKG_RPM_HOST_CFLAGS_CONFIGURE:="-I${PREFIX}/include"};
+: ${PKG_RPM_HOST_CONFIGURE_ARGS_EXTRA:="-without-lua --enable-ndb --enable-lmdb --enable-bdb=no --with-crypto=openssl --with-vendor=midipix"};
+: ${PKG_RPM_HOST_LDFLAGS_CONFIGURE:="-L${PREFIX}/lib"};
+: ${PKG_RPM_HOST_ENV_VARS_EXTRA:="PKG_CONFIG_PATH=${PREFIX}/lib/pkgconfig"};
+
+#
# Build target host_toolchain_deps
#
HOST_TOOLCHAIN_DEPS_BUILD_TYPE="host";
@@ -394,8 +421,6 @@ NATIVE_PACKAGES_DEPS_PYTHON="${PREFIX}/bin/python";
: ${PKG_LIBZ_VERSION:=1.2.8.2015.12.26};
: ${PKG_LIBZ_URL:=https://sortix.org/libz/release/libz-${PKG_LIBZ_VERSION}.tar.gz};
: ${PKG_LIBZ_CONFIGURE_ARGS:=--host=${DEFAULT_TARGET} --prefix= --target=${DEFAULT_TARGET}};
-: ${PKG_LMDB_URLS_GIT:="lmdb=https://github.com/Redfoxmoon3/lmdb.git@mdb.master"};
-: ${PKG_LMDB_IN_TREE:=1};
: ${PKG_LIBPNG_SHA256SUM:=2f1e960d92ce3b3abd03d06dfec9637dfbd22febf107a536b44f7a47c60659f6};
: ${PKG_LIBPNG_VERSION:=1.6.34};
: ${PKG_LIBPNG_URL:=https://sourceforge.mirrorservice.org/l/li/libpng/libpng16/${PKG_LIBPNG_VERSION}/libpng-${PKG_LIBPNG_VERSION}.tar.xz};
@@ -1277,7 +1302,7 @@ INVARIANTS_PACKAGES="invariants_digest invariants_gitref invariants_tarballs";
# Build targets
#
TARGETS_DEFAULT="
-host_tools host_toolchain_deps host_toolchain host_toolchain_mingw32
+host_tools host_tools_rpm host_toolchain_deps host_toolchain host_toolchain_mingw32
native_tools native_toolchain_deps native_toolchain native_toolchain_mingw32 native_runtime
host_packages_deps native_packages_deps native_packages_deps_x11
native_packages
diff --git a/vars/midipix.vars b/vars/midipix.vars
index d48cfe88..0e89c409 100644
--- a/vars/midipix.vars
+++ b/vars/midipix.vars
@@ -15,6 +15,7 @@
: ${PREFIX_MINGW32:=${PREFIX}/x86_64-w64-mingw32};
: ${PREFIX_MINIPIX:=${PREFIX}/minipix};
: ${PREFIX_NATIVE:=${PREFIX}/native};
+: ${PREFIX_RPM:=${PREFIX}/rpm};
: ${BUILD_DLCACHEDIR:=${PREFIX_ROOT}/dlcache};
: ${BUILD_WORKDIR:=${PREFIX}/tmp};
: ${DEFAULT_LOG_ENV_VARS:="