2
0

build.sh 473 B

12345678910111213141516171819202122232425262728
  1. #!/bin/bash
  2. set -euxo pipefail
  3. if ! rpm -qi openssl-devel; then
  4. exit 0
  5. fi
  6. find_tag() {
  7. git describe --always --tags --match='release-*' "$@"
  8. }
  9. spec=$HOME/rpmbuild/SPECS/tinc.spec
  10. version=$(find_tag HEAD | sed 's/-/_/g')
  11. version=${version//release_/}
  12. export CONFIG_SHELL=bash
  13. yum install -y rpmdevtools
  14. rpmdev-setuptree
  15. cp "$(dirname "$0")/tinc.spec" "$spec"
  16. sed -i "s/__VERSION__/$version/" "$spec"
  17. git clean -dfx
  18. cp -a . ~/rpmbuild/BUILD
  19. rpmbuild -bb "$spec"