summaryrefslogtreecommitdiffhomepage
path: root/subr/pkg_install.subr
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 /subr/pkg_install.subr
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.
Diffstat (limited to 'subr/pkg_install.subr')
-rw-r--r--subr/pkg_install.subr28
1 files changed, 28 insertions, 0 deletions
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