Blob Blame History Raw
#
# Copyright (c) 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023 LucĂ­a Andrea Illanes Albornoz <lucia@luciaillanes.de>
# set +o errexit -o noglob -o nounset is assumed.
#

pkg_install_rpm() {
	local	_pir_group_name="${1}" _pir_pkg_name="${2}" _pir_restart_at="${3}"	\
		_pir_rc=0 _pir_url="" _pir_version="" _pir_version_rpm="";

	if rtl_lmatch \$ARG_DIST "rpm" ","\
	&& [ "${PKG_RPM_DISABLE:-0}" -eq 0 ]\
	&& command which rpmbuild >/dev/null 2>&1;
	then
		ex_rtl_expand_rpm_version						\
			\$_pir_url \$_pir_version \$_pir_version_rpm			\
			"${PKG_BASE_DIR}/${PKG_SUBDIR}"					\
			"${PKG_URL:-}" "${DEFAULT_GITROOT_HEAD}" "${PKG_URLS_GIT:-}"	\
			"${PKG_VERSION:-}" || return 1;
		ex_rtl_build_rpm							\
			"${PKG_DESTDIR}"						\
			"${PKG_NAME}"							\
			"${PREFIX_RPM}"							\
			"${MIDIPIX_BUILD_PWD}/etc/package.spec"				\
			"${PKG_BASE_DIR}/${PKG_NAME}-${_pir_version_rpm}.spec"		\
			"${BUILD_WORKDIR}"						\
			"${PREFIX_RPM}/${PKG_NAME}-${_pir_version_rpm}"			\
			"${_pir_url}"							\
			"${_pir_version}" "${_pir_version_rpm}" || return 1;
	fi;

	return 0;
};

# vim:filetype=sh textwidth=0