-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild8.sh
executable file
·44 lines (30 loc) · 1.04 KB
/
build8.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
#!/usr/bin/env bash
set -ex ## we like things verbose
## ensure we have a full dev stack
sudo yum groupinstall -y "Development Tools"
## install other helpers
sudo yum install -y epel-release
# sudo dnf install dnf-plugins-core
sudo dnf config-manager --set-enabled powertools
sudo yum upgrade -y
sudo yum install -y mock rpmdevtools rpm-devel
## setup our build path
rpmdev-setuptree
## link the specs
ln -sf /tmp/build/SPECS/*.spec $HOME/rpmbuild/SPECS/
## link the sources
find /tmp/build/SOURCES \( -type f -o -type l \) -exec ln -sf {} $HOME/rpmbuild/SOURCES/ \;
## download sources
for spec in $HOME/rpmbuild/SPECS/*.spec; do
spectool -g -R $spec
done
## install build dependencies
sudo yum-builddep -y $HOME/rpmbuild/SPECS/*.spec
## build packages
rpmbuild -ba $HOME/rpmbuild/SPECS/*.spec
## copy built files out of the vagrant/docker environment
## skip if you are doing this manually
if [ -f /.dockerenv ]; then
sudo mkdir -p /tmp/build/artifacts/8
sudo cp -rf $HOME/rpmbuild/RPMS $HOME/rpmbuild/SRPMS /tmp/build/artifacts/8
fi