Add unit tests suite using cmocka library
[tinc] / .ci / package / rpm / build.sh
1 #!/bin/bash
2
3 set -euxo pipefail
4
5 if ! rpm -qi openssl-devel; then
6   exit 0
7 fi
8
9 find_tag() {
10   git describe --always --tags --match='release-*' "$@"
11 }
12
13 spec=$HOME/rpmbuild/SPECS/tinc.spec
14 version=$(find_tag HEAD | sed 's/-/_/g')
15 version=${version//release_/}
16
17 export CONFIG_SHELL=bash
18
19 yum install -y rpmdevtools
20 rpmdev-setuptree
21
22 cp "$(dirname "$0")/tinc.spec" "$spec"
23 sed -i "s/__VERSION__/$version/" "$spec"
24
25 git clean -dfx
26 cp -a . ~/rpmbuild/BUILD
27
28 rpmbuild -bb "$spec"