Makefile 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. #
  2. # Makefile for debianqueued -- only targets for package maintainance
  3. #
  4. # $Id: Makefile,v 1.10 1998/03/25 09:21:01 ftplinux Exp $
  5. #
  6. # $Log: Makefile,v $
  7. # Revision 1.10 1998/03/25 09:21:01 ftplinux
  8. # Implemented snapshot target
  9. #
  10. # Revision 1.9 1998/03/23 14:10:28 ftplinux
  11. # $$num in make upload needs braces because _ follows
  12. #
  13. # Revision 1.8 1997/12/16 13:20:57 ftplinux
  14. # add _all to changes name in upload target
  15. #
  16. # Revision 1.7 1997/11/20 15:34:11 ftplinux
  17. # upload target should copy only current release to queue dir
  18. #
  19. # Revision 1.6 1997/09/29 14:28:38 ftplinux
  20. # Also fill in Version: for .changes file
  21. #
  22. # Revision 1.5 1997/09/25 11:33:48 ftplinux
  23. # Added automatic adding of release number to ChangeLog
  24. #
  25. # Revision 1.4 1997/08/18 11:29:11 ftplinux
  26. # Include new release number in message of cvs commits
  27. #
  28. # Revision 1.3 1997/08/12 10:39:08 ftplinux
  29. # Added generation of .changes file in 'dist' target; added 'upload'
  30. # target (using the queue :-)
  31. #
  32. # Revision 1.2 1997/08/12 10:01:32 ftplinux
  33. # Fixed dist target to work (last checkin was needed to test it at all)
  34. #
  35. #
  36. CVS = cvs
  37. RELNUMFILE = release-num
  38. # files that contain the release number
  39. FILES_WITH_NUM = debianqueued dqueued-watcher
  40. # name of cvs module
  41. MODULE = debianqueued
  42. .PHONY: default release dist
  43. default:
  44. @echo "Nothing to make -- the Makefile is only for maintainance purposes"
  45. @exit 1
  46. # Usage:
  47. # make release (use number from file release-num)
  48. # or
  49. # make release RELNUM=x.y (writes new number to release-num)
  50. release:
  51. if cvs status $(RELNUMFILE) | grep -q Up-to-date; then true; else \
  52. echo "$(RELNUMFILE) needs commit first"; exit 1; \
  53. fi
  54. ifdef RELNUM
  55. echo $(RELNUM) >$(RELNUMFILE)
  56. cvs commit -m "Bumped release number to `cat $(RELNUMFILE)`" $(RELNUMFILE)
  57. endif
  58. perl -pi -e "s/Release: \S+/Release: `cat $(RELNUMFILE)`/;" \
  59. $(FILES_WITH_NUM)
  60. cvs commit -m "Bumped release number to `cat $(RELNUMFILE)`" $(FILES_WITH_NUM)
  61. if grep -q "Version `cat release-num` released" ChangeLog; then true; else \
  62. mv ChangeLog ChangeLog.orig; \
  63. echo "" >ChangeLog; \
  64. echo "-- Version `cat $(RELNUMFILE)` released" >>ChangeLog; \
  65. echo "" >>ChangeLog; \
  66. cat ChangeLog.orig >>ChangeLog; \
  67. rm ChangeLog.orig; \
  68. cvs commit -m "Bumped release number to `cat $(RELNUMFILE)`" ChangeLog; \
  69. fi
  70. cvs tag release-`cat $(RELNUMFILE) | sed 's/\./-/'`
  71. dist:
  72. set -e; \
  73. num=`cat $(RELNUMFILE)`; name=debianqueued-$$num; \
  74. mkdir tmp; \
  75. (cd tmp; cvs export -r release-`echo $$num | sed 's/\./-/'` $(MODULE); \
  76. mv $(MODULE) $$name; \
  77. tar cvf ../../$$name.tar $$name); \
  78. gzip -9f ../$$name.tar; \
  79. rm -rf tmp; \
  80. file=../$$name.tar.gz; \
  81. md5=`md5sum $$file | awk -e '{print $$1}'`; \
  82. size=`ls -l $$file | awk -e '{print $$4}'`; \
  83. chfile=../debianqueued_`cat $(RELNUMFILE)`_all.changes; \
  84. sed -e "s/^Date: .*/Date: `822-date`/" -e "s/Version: .*/Version: `cat $(RELNUMFILE)`/" <changes-template >$$chfile; \
  85. echo " $$md5 $$size byhand - $$name.tar.gz" >>$$chfile; \
  86. pgp -u 'Roman Hodek' +clearsig=on -fast <$$chfile >$$chfile.asc; \
  87. mv $$chfile.asc $$chfile
  88. # can only be used on ftp.uni-erlangen.de :-)
  89. upload:
  90. set -e; \
  91. num=`cat $(RELNUMFILE)`; \
  92. cp ../debianqueued-$$num.tar.gz ../debianqueued_$${num}_all.changes $$HOME/Linux/debian/UploadQueue
  93. # make snapshot from current sources
  94. snapshot:
  95. set -e; \
  96. modified=`cvs status 2>/dev/null | awk '/Status:/ { if ($$4 != "Up-to-date") print $$2 }'`; \
  97. if [ "x$$modified" != "x" ]; then \
  98. echo "There are modified files: $$modified"; \
  99. echo "Commit first"; \
  100. exit 1; \
  101. fi; \
  102. name=debianqueued-snapshot-`date +%y%m%d`; \
  103. rm -rf tmp; \
  104. mkdir tmp; \
  105. (cd tmp; cvs export -D now $(MODULE); \
  106. mv $(MODULE) $$name; \
  107. tar cvf ../../$$name.tar $$name); \
  108. gzip -9f ../$$name.tar; \
  109. rm -rf tmp