2017-04-28 19:29:25 +03:00
#!/usr/bin/bash
2021-02-03 21:11:41 +03:00
# OpenShift Prow jobs don't set $HOME, but we need
# one for cargo right now.
if test -z " $HOME " ; then
export HOME = $( mktemp -d -t --suffix .prowhome)
fi
2017-09-06 20:53:46 +03:00
pkg_upgrade( ) {
2019-09-06 22:20:48 +03:00
echo " Running dnf -y distro-sync... $( date) "
dnf -y distro-sync
echo " Done dnf -y distro-sync! $( date) "
2017-09-06 20:53:46 +03:00
}
2017-04-28 19:29:25 +03:00
make( ) {
2020-07-14 02:18:22 +03:00
/usr/bin/make -j ${ MAKE_JOBS :- $( getconf _NPROCESSORS_ONLN) } " $@ "
2017-04-28 19:29:25 +03:00
}
build( ) {
env NOCONFIGURE = 1 ./autogen.sh
2018-01-18 20:27:42 +03:00
./configure --prefix= /usr --libdir= /usr/lib64 --sysconfdir= /etc " $@ "
2017-09-19 17:40:35 +03:00
make V = 1
2017-04-28 19:29:25 +03:00
}
2017-09-19 17:40:35 +03:00
pkg_install( ) {
2019-09-06 22:20:48 +03:00
echo " Running dnf -y install... $( date) "
dnf -y install " $@ "
echo " Done running dnf -y install! $( date) "
2017-09-19 17:40:35 +03:00
}
2017-07-17 20:40:25 +03:00
2017-09-19 17:40:35 +03:00
pkg_builddep( ) {
2018-07-19 20:45:12 +03:00
echo " Running builddep... $( date) "
2017-09-19 17:40:35 +03:00
# This is sadly the only case where it's a different command
if test -x /usr/bin/dnf; then
dnf builddep -y " $@ "
2017-07-17 20:40:25 +03:00
else
2017-09-19 17:40:35 +03:00
yum-builddep -y " $@ "
2017-07-17 20:40:25 +03:00
fi
2018-07-19 20:45:12 +03:00
echo " Done running builddep! $( date) "
2017-09-19 17:40:35 +03:00
}
2017-04-28 19:29:25 +03:00
2017-09-19 17:40:35 +03:00
pkg_install_builddeps( ) {
2019-09-06 22:20:48 +03:00
pkg_install dnf-plugins-core 'dnf-command(builddep)'
# Base buildroot (but exclude fedora-release, conflicts with -container:
# https://bugzilla.redhat.com/show_bug.cgi?id=1649921)
pkg_install @buildsys-build --excludepkg fedora-release
2017-04-28 19:29:25 +03:00
# builddeps+runtime deps
2020-02-21 23:30:32 +03:00
if [ $# -ne 0 ] ; then
pkg_builddep " $@ "
pkg_install " $@ "
rpm -e " $@ "
fi
2017-04-28 19:29:25 +03:00
}