makerpm.in 591 B

123456789101112131415161718192021222324252627282930
  1. #!/bin/sh
  2. set -u
  3. set -e
  4. trap onexit INT
  5. trap onexit TERM
  6. trap onexit EXIT
  7. TMPDIR=
  8. onexit()
  9. {
  10. if [ ! "$TMPDIR" = "" ]; then
  11. rm -rf $TMPDIR
  12. fi
  13. }
  14. if [ -f @PKGNAME@-@VERSION@.@RPMARCH@.rpm ]; then
  15. rm -f @PKGNAME@-@VERSION@.@RPMARCH@.rpm
  16. fi
  17. umask 022
  18. TMPDIR=`mktemp -d /tmp/@CMAKE_PROJECT_NAME@-build.XXXXXX`
  19. mkdir -p $TMPDIR/RPMS
  20. ln -fs `pwd` $TMPDIR/BUILD
  21. rpmbuild -bb --define "_blddir $TMPDIR/buildroot" --define "_topdir $TMPDIR" \
  22. --target @RPMARCH@ pkgscripts/rpm.spec; \
  23. cp $TMPDIR/RPMS/@RPMARCH@/@PKGNAME@-@VERSION@-@BUILD@.@RPMARCH@.rpm \
  24. @PKGNAME@-@VERSION@.@RPMARCH@.rpm