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) 64e589
		cat > "${PKG_BASE_DIR}/${PKG_NAME}.spec" <
Lucio Andrés Illanes Albornoz (arab, vxp) 64e589
Name:           ${PKG_NAME}
Lucio Andrés Illanes Albornoz (arab, vxp) 64e589
Version:        ${PKG_VERSION}
Lucio Andrés Illanes Albornoz (arab, vxp) 64e589
Release:        1
Lucio Andrés Illanes Albornoz (arab, vxp) 64e589
Summary:        ${PKG_NAME} ${PKG_VERSION}
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) 64e589
Url:            ${PKG_URL}
Lucio Andrés Illanes Albornoz (arab, vxp) 64e589
Lucio Andrés Illanes Albornoz (arab, vxp) 64e589
%description
Lucio Andrés Illanes Albornoz (arab, vxp) 64e589
${PKG_NAME} ${PKG_VERSION}
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) 64e589
cp -pPr ${PKG_DESTDIR}/. .
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) 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) 64e589
		rpmbuild -bb --define="_topdir ${PREFIX_RPM}/${PKG_NAME}-${PKG_VERSION}" --nodeps "${PKG_BASE_DIR}/${PKG_NAME}.spec";
Lucio Andrés Illanes Albornoz (arab, vxp) 64e589
		find "${PREFIX_RPM}/${PKG_NAME}-${PKG_VERSION}/RPMS" -iname \*.rpm -exec cp -pP {} "${PREFIX_RPM}/" \;;
Lucio Andrés Illanes Albornoz (arab, vxp) 64e589
		ex_rtl_fileop rm "${PREFIX_RPM}/${PKG_NAME}-${PKG_VERSION}";
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