Blame subr/pkg_install.subr

Lucio Andrés Illanes Albornoz (arab, vxp) 570129
#
Lucio Andrés Illanes Albornoz (arab, vxp) 802215
# set -o errexit -o noglob are assumed.
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
#
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
Lucio Andrés Illanes Albornoz (arab, vxp) f539a4
pkg_install() {
Lucio Andrés Illanes Albornoz (arab, vxp) ec19f0
	ex_rtl_fileop mkdir "${PKG_PREFIX}";
Lucio Andrés Illanes Albornoz (arab, vxp) 79f0aa
	find "${PKG_DESTDIR}"				\
Lucio Andrés Illanes Albornoz (arab, vxp) b598a7
		-type d -exec chmod 0755 {} \;;
Lucio Andrés Illanes Albornoz (arab, vxp) 79f0aa
	find "${PKG_DESTDIR}"				\
Lucio Andrés Illanes Albornoz (arab, vxp) 22222c
		\( -not -perm /0111 \)			\
Lucio Andrés Illanes Albornoz (arab, vxp) b598a7
		-type f -exec chmod 0644 {} \;;
Lucio Andrés Illanes Albornoz (arab, vxp) 79f0aa
	find "${PKG_DESTDIR}"				\
Lucio Andrés Illanes Albornoz (arab, vxp) 22222c
		-perm /0111 -type f -exec chmod 0755 {} \;;
Lucio Andrés Illanes Albornoz (arab, vxp) 19ab70
	tar -C "${PKG_DESTDIR}" -cpf - .		|\
Lucio Andrés Illanes Albornoz (arab, vxp) 71b9ce
		tar -C "${PKG_PREFIX}" --overwrite -xpf -;
Lucio Andrés Illanes Albornoz (arab, vxp) 19ab70
	if [ "${ARG_PACKAGE:-0}" -eq 1 ]; then
Lucio Andrés Illanes Albornoz (arab, vxp) 19ab70
		tar -C "${PKG_DESTDIR}" -cpf - .	|\
Lucio Andrés Illanes Albornoz (arab, vxp) 19ab70
			gzip -c -9 - > "${PKG_BASE_DIR}/${PKG_NAME}.tgz"
Lucio Andrés Illanes Albornoz (arab, vxp) 19ab70
	fi;
Lucio Andrés Illanes Albornoz (arab, vxp) cc1256
	if [ "${ARG_RPM:-0}" -eq 1 ]\
Lucio Andrés Illanes Albornoz (arab, vxp) cc1256
	&& [ -x "$(which rpmbuild 2>/dev/null)" ]; then
Lucio Andrés Illanes Albornoz (arab, vxp) 61bb4f
		cat > "${PKG_BASE_DIR}/${PKG_NAME}-${PKG_VERSION:-Unknown}.spec" <
Lucio Andrés Illanes Albornoz (arab, vxp) 64e589
Name:           ${PKG_NAME}
Lucio Andrés Illanes Albornoz (arab, vxp) e6f54e
Version:        ${PKG_VERSION:-Unknown}
Lucio Andrés Illanes Albornoz (arab, vxp) 64e589
Release:        1
Lucio Andrés Illanes Albornoz (arab, vxp) e6f54e
Summary:        ${PKG_NAME} ${PKG_VERSION:-Unknown}
Lucio Andrés Illanes Albornoz (arab, vxp) 64e589
License:        Unknown
Lucio Andrés Illanes Albornoz (arab, vxp) 64e589
Group:          Applications
Lucio Andrés Illanes Albornoz (arab, vxp) d1cb7c
Url:            ${PKG_URL:-${PKG_URLS_GIT:-Unknown}}
Lucio Andrés Illanes Albornoz (arab, vxp) 64e589
Lucio Andrés Illanes Albornoz (arab, vxp) 64e589
%description
Lucio Andrés Illanes Albornoz (arab, vxp) e6f54e
${PKG_NAME} ${PKG_VERSION:-Unknown}
Lucio Andrés Illanes Albornoz (arab, vxp) 64e589
Lucio Andrés Illanes Albornoz (arab, vxp) 64e589
%prep
Lucio Andrés Illanes Albornoz (arab, vxp) 64e589
%build
Lucio Andrés Illanes Albornoz (arab, vxp) 64e589
%install
Lucio Andrés Illanes Albornoz (arab, vxp) 444f7d
rm -rf "\${RPM_BUILD_ROOT}"
Lucio Andrés Illanes Albornoz (arab, vxp) 444f7d
mkdir -p "\${RPM_BUILD_ROOT}"
Lucio Andrés Illanes Albornoz (arab, vxp) 444f7d
cp -pPr "${PKG_DESTDIR}/." "\${RPM_BUILD_ROOT}"
Lucio Andrés Illanes Albornoz (arab, vxp) 64e589
Lucio Andrés Illanes Albornoz (arab, vxp) 64e589
%post
Lucio Andrés Illanes Albornoz (arab, vxp) 64e589
%postun
Lucio Andrés Illanes Albornoz (arab, vxp) 64e589
%files
Lucio Andrés Illanes Albornoz (arab, vxp) 444f7d
/
Lucio Andrés Illanes Albornoz (arab, vxp) 444f7d
Lucio Andrés Illanes Albornoz (arab, vxp) 64e589
%changelog
Lucio Andrés Illanes Albornoz (arab, vxp) 64e589
Lucio Andrés Illanes Albornoz (arab, vxp) 64e589
EOF
Lucio Andrés Illanes Albornoz (arab, vxp) 61bb4f
		rpmbuild -bb --define="_topdir ${PREFIX_RPM}/${PKG_NAME}-${PKG_VERSION:-Unknown}" --nodeps "${PKG_BASE_DIR}/${PKG_NAME}-${PKG_VERSION:-Unknown}.spec";
Lucio Andrés Illanes Albornoz (arab, vxp) e6f54e
		find "${PREFIX_RPM}/${PKG_NAME}-${PKG_VERSION:-Unknown}/RPMS" -iname \*.rpm -exec cp -pP {} "${PREFIX_RPM}/" \;;
Lucio Andrés Illanes Albornoz (arab, vxp) e6f54e
		ex_rtl_fileop rm "${PREFIX_RPM}/${PKG_NAME}-${PKG_VERSION:-Unknown}";
Lucio Andrés Illanes Albornoz (arab, vxp) 61bb4f
		ex_rtl_fileop cp "${PKG_BASE_DIR}/${PKG_NAME}-${PKG_VERSION:-Unknown}.spec" "${PREFIX_RPM}/";
Lucio Andrés Illanes Albornoz (arab, vxp) 64e589
	fi;
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
};
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
# vim:filetype=sh