Makefile 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. TOPDIR = $(shell pwd)
  2. DATE="date +%Y%m%d"
  3. PROGRAMNAME=helloworld
  4. RELEASE=0.0.1
  5. TMPDIR=/tmp
  6. BUILDDIR=build
  7. #PATH=$(shell printenv CCACHE_PATH):$(shell printenv PATH)
  8. #PATH=/usr/bin:$(shell printenv PATH)
  9. #PATH = $(PATH):/other/dir
  10. #PATH=$(shell printenv PATH)
  11. all: buildrpms
  12. build: gitfetch
  13. buildrpms
  14. #build: clean
  15. # echo $(TOPDIR)
  16. # echo "- Create Changelog file"
  17. # git shortlog > changelog.txt
  18. # echo "- Create new $(TMPDIR)/$(BUILDDIR)"
  19. # mkdir -p $(TMPDIR)/$(BUILDDIR)
  20. # mkdir -p $(TMPDIR)/$(BUILDDIR)/$(PROGRAMNAME)
  21. # echo "- Copy existing Kermit sources"
  22. # rsync -raC --exclude .git . $(TMPDIR)/$(BUILDDIR)/$(PROGRAMNAME)
  23. # echo "- Remove useless files"
  24. # rm -Rf $(TMPDIR)/$(BUILDDIR)/$(PROGRAMNAME)/src/sqlite.db
  25. # echo "- Rename $(PROGRAMNAME) in $(PROGRAMNAME)-$(RELEASE)"
  26. # # mv $(TMPDIR)/$(BUILDDIR)/$(PROGRAMNAME) $(TMPDIR)/$(BUILDDIR)/$(PROGRAMNAME)-$(RELEASE)
  27. # echo "- Compressing $(PROGRAMNAME) directory"
  28. # tar -czf $(PROGRAMNAME)-$(RELEASE).tar.gz -C $(TMPDIR)/$(BUILDDIR) $(PROGRAMNAME)/
  29. # echo "- Moving source package in dist dir"
  30. # mkdir -p ./dist
  31. # mv $(PROGRAMNAME)-$(RELEASE).tar.gz ./dist
  32. clean:
  33. # -rm -rf dist/
  34. # -rm -rf rpm-build/
  35. # -rm -rf $(TMPDIR)/$(BUILDDIR)
  36. clean_hard:
  37. clean_harder:
  38. clean_hardest: clean_rpms
  39. install: build manpage
  40. install_hard: clean_hard install
  41. install_harder: clean_harder install
  42. install_hardest: clean_harder clean_rpms rpms install_rpm restart
  43. install_rpm:
  44. restart:
  45. recombuild: install_harder restart
  46. clean_rpms:
  47. # -rpm -e kermit-webui
  48. sdist: messages
  49. new-rpms: bumprelease rpms
  50. pychecker:
  51. pyflakes:
  52. money: clean
  53. #async: install
  54. # /sbin/service httpd restart
  55. testit: clean
  56. unittest:
  57. buildrpms:
  58. /usr/bin/bash run.sh
  59. # mkdir -p rpm-build
  60. # cp dist/*.gz rpm-build/
  61. # rpmbuild --define "_topdir %(pwd)/rpm-build"
  62. # --define "_builddir %{_topdir}"
  63. # --define "_rpmdir %{_topdir}"
  64. # --define "_srcrpmdir %{_topdir}"
  65. # --define '_rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm'
  66. # --define "_specdir %{_topdir}"
  67. # --define "_sourcedir %{_topdir}"
  68. # --define "vendor Think"
  69. # -ba misc/specs/helloworld.spec
  70. #
  71. deployrpms:
  72. /usr/bin/bash deploy.sh
  73. gitfetch:
  74. rm -rf clone
  75. /usr/bin/git clone git@gitlab.ngtech.local:elico/squid-centos7-squid35-rpms.git clone
  76. mv clone build
  77. cd build
  78. # rm -fr .git
  79. # /usr/bin/git init
  80. # /usr/bin/git remote add origin git@gitlab.ngtech.local:elico/squid-centos7-squid35-rpms.git
  81. # /usr/bin/git fetch
  82. # /usr/bin/git reset --mixed origin/master
  83. # mv squid-centos7-squid35-rpms.git build
  84. #git.sh -i ~/.ssh/thatuserkey.pem clone thatuser@myserver.com:/git/repo.git
  85. crlfclean:
  86. sed -i 's/\r//g' SOURCES/*.patch
  87. sed -i 's/\r//g' SPECS/*.spec