summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorLucio Andrés Illanes Albornoz (arab, vxp) <lucio@lucioillanes.de>2018-05-14 16:32:51 +0000
committerLucio Andrés Illanes Albornoz (arab, vxp) <lucio@lucioillanes.de>2018-05-14 16:32:51 +0000
commit9b7922e6a3a3702c472298dc1285c2b5e69a0113 (patch)
treec39d8f51985ec9101bca5bdfb8d3e1c46cc459e3
parent1370c20b02caedff60e8db282d4e16615ff6e7c7 (diff)
downloadmidipix_build-9b7922e6a3a3702c472298dc1285c2b5e69a0113.tar.bz2
midipix_build-9b7922e6a3a3702c472298dc1285c2b5e69a0113.tar.xz
subr/pkg_install.subr: fixup ${PKG_VERSION} for rpmbuild(8).
-rw-r--r--subr/pkg_install.subr15
1 files changed, 9 insertions, 6 deletions
diff --git a/subr/pkg_install.subr b/subr/pkg_install.subr
index 5518e03a..7394fc65 100644
--- a/subr/pkg_install.subr
+++ b/subr/pkg_install.subr
@@ -3,6 +3,7 @@
#
pkg_install() {
+ local _pkg_version_rpm="";
ex_rtl_fileop mkdir "${PKG_PREFIX}";
find "${PKG_DESTDIR}" \
-type d -exec chmod 0755 {} \;;
@@ -19,9 +20,11 @@ pkg_install() {
fi;
if [ "${ARG_RPM:-0}" -eq 1 ]\
&& [ -x "$(which rpmbuild 2>/dev/null)" ]; then
- cat > "${PKG_BASE_DIR}/${PKG_NAME}-${PKG_VERSION:-Unknown}.spec" <<EOF
+ _pkg_version_rpm="${PKG_VERSION:-Unknown}";
+ _pkg_version_rpm="${_pkg_version_rpm%%-*}";
+ cat > "${PKG_BASE_DIR}/${PKG_NAME}-${_pkg_version_rpm}.spec" <<EOF
Name: ${PKG_NAME}
-Version: ${PKG_VERSION:-Unknown}
+Version: ${_pkg_version_rpm}
Release: 1
Summary: ${PKG_NAME} ${PKG_VERSION:-Unknown}
License: Unknown
@@ -46,10 +49,10 @@ cp -pPr "${PKG_DESTDIR}/." "\${RPM_BUILD_ROOT}"
%changelog
EOF
- rpmbuild -bb --define="_topdir ${PREFIX_RPM}/${PKG_NAME}-${PKG_VERSION:-Unknown}" --nodeps "${PKG_BASE_DIR}/${PKG_NAME}-${PKG_VERSION:-Unknown}.spec";
- find "${PREFIX_RPM}/${PKG_NAME}-${PKG_VERSION:-Unknown}/RPMS" -iname \*.rpm -exec cp -pP {} "${PREFIX_RPM}/" \;;
- ex_rtl_fileop rm "${PREFIX_RPM}/${PKG_NAME}-${PKG_VERSION:-Unknown}";
- ex_rtl_fileop cp "${PKG_BASE_DIR}/${PKG_NAME}-${PKG_VERSION:-Unknown}.spec" "${PREFIX_RPM}/";
+ rpmbuild -bb --define="_topdir ${PREFIX_RPM}/${PKG_NAME}-${_pkg_version_rpm}" --nodeps "${PKG_BASE_DIR}/${PKG_NAME}-${_pkg_version_rpm}.spec";
+ find "${PREFIX_RPM}/${PKG_NAME}-${_pkg_version_rpm}/RPMS" -iname \*.rpm -exec cp -pP {} "${PREFIX_RPM}/" \;;
+ ex_rtl_fileop rm "${PREFIX_RPM}/${PKG_NAME}-${_pkg_version_rpm}";
+ ex_rtl_fileop cp "${PKG_BASE_DIR}/${PKG_NAME}-${_pkg_version_rpm}.spec" "${PREFIX_RPM}/";
fi;
};