summaryrefslogtreecommitdiffhomepage
path: root/subr.pkg/pkg_install_rpm.subr
blob: 83b6841ff66de427eb219aabac1c0a0dad17192a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#
# 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}"						\
			"${DEFAULT_RPM_JOBS_MAX}" "${DEFAULT_RPM_JOBS_SEMAPHORE}"	\
			"${DEFAULT_RPM_JOBS_WAIT}"					\
			"${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