-
Notifications
You must be signed in to change notification settings - Fork 198
/
Copy pathlibbuild.sh
62 lines (54 loc) · 1.56 KB
/
libbuild.sh
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/usr/bin/bash
# SPDX-License-Identifier: Apache-2.0 OR MIT
# OpenShift Prow jobs don't set $HOME, but we need
# one for cargo right now.
if test -z "$HOME" || test ! -w "$HOME"; then
export HOME=$(mktemp -d -t --suffix .prowhome)
fi
pkg_upgrade() {
echo "Running dnf -y distro-sync... $(date)"
time dnf -y distro-sync
echo "Done dnf -y distro-sync! $(date)"
}
make() {
time /usr/bin/make -j ${MAKE_JOBS:-$(getconf _NPROCESSORS_ONLN)} "$@"
}
build() {
env NOCONFIGURE=1 ./autogen.sh
time ./configure --prefix=/usr --libdir=/usr/lib64 --sysconfdir=/etc "$@"
time make V=1
}
pkg_install() {
echo "Running dnf -y install... $(date)"
time dnf -y install "$@"
echo "Done running dnf -y install! $(date)"
}
pkg_builddep_spec() {
if test -x /usr/bin/dnf5; then
# copr build dnf5 environment deps
dnf install -y 'dnf5-command(builddep)'
dnf builddep -y "$@"
else
dnf builddep -y --spec "$@"
fi
}
pkg_builddep() {
# This is sadly the only case where it's a different command
if test -x /usr/bin/dnf; then
time dnf builddep -y "$@"
else
time yum-builddep -y "$@"
fi
}
pkg_install_builddeps() {
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
# builddeps+runtime deps
if [ $# -ne 0 ]; then
pkg_builddep "$@"
pkg_install "$@"
time rpm -e "$@"
fi
}