Makefile 876 B

123456789101112131415161718192021222324252627282930
  1. # For COPR builds directly from git.
  2. #
  3. # https://docs.pagure.org/copr.copr/user_documentation.html#make-srpm
  4. #
  5. ifeq ($(findstring mingw-openconnect,$(spec)),)
  6. TARGET=openconnect
  7. else
  8. TARGET=mingw-openconnect
  9. endif
  10. srpm: /usr/bin/git
  11. git config --global --add safe.directory "*"
  12. ./mkspec.sh $(TARGET)
  13. set -x; if grep -q "global gitsnapshot 1" $(TARGET).spec; then \
  14. tarprefix=$$(sed -n '/^%global snapcommit /s/.* //p' $(TARGET).spec); \
  15. tarname=$${tarprefix:0:7}; \
  16. else \
  17. tarprefix=$$(sed -n '/^%global tagver /s/.* //p' $(TARGET).spec); \
  18. tarname=$${tarprefix}; \
  19. fi; \
  20. git archive --prefix=openconnect-$${tarname}/ HEAD -o .copr/openconnect-$${tarname}.tar.gz
  21. rpmbuild -bs $(TARGET).spec --define "_sourcedir .copr" --define "_srcrpmdir $(outdir)"
  22. /usr/bin/git:
  23. dnf install git
  24. build: srpm
  25. rpmbuild -bb $(TARGET).spec --define "_sourcedir `pwd`/.copr"