Makefile 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. pwd="$(shell pwd)"
  2. user="eeems"
  3. site="direct.eeems.ca"
  4. site2="withg.org"
  5. folder="/home/eeems/www/omni.eeems.ca/"
  6. folder2="/home/eeems/public_html/omni/"
  7. sshopt="-o LogLevel=error"
  8. all: clean packages repo update clean
  9. packages:
  10. @mkdir -p .repo/i686/
  11. @mkdir -p .repo/x86_64/
  12. @msg -a "0;31" -a "0;31" -m "Building Packages" -A ":::\t"
  13. - @cat packages.list | while read pkg; do\
  14. cd $$pkg;\
  15. make;\
  16. cp -p *-i686.pkg.tar.xz $(pwd)/.repo/i686/;\
  17. cp -p *-x86_64.pkg.tar.xz $(pwd)/.repo/x86_64/;\
  18. done;
  19. repo:
  20. @mkdir -p .repo/i686/
  21. @mkdir -p .repo/x86_64/
  22. @msg -a "0;31" -a "0;31" -m "Building Repo" -A ":::\t"
  23. @cd .repo/i686/;\
  24. repo-add omni.db.tar.gz *.xz;\
  25. rm -f omni.db
  26. @cd .repo/x86_64/;\
  27. repo-add omni.db.tar.gz *.xz;\
  28. rm -f omni.db
  29. update:
  30. @cp -R skel/* .repo/
  31. @chown -R $(user) .repo/
  32. @chmod -R 0777 .repo/
  33. @msg -a "0;31" -m "Uploading Files" -A ":::\t"
  34. -@ssh $(sshopt) $(user)@$(site) "cd $(folder)/;\
  35. rm -f i686/*;\
  36. rm -f x86_64/*;"
  37. -@ssh $(sshopt) $(user)@$(site2) "cd $(folder2)/;\
  38. rm -f i686/*;\
  39. rm -f x86_64/*;"
  40. @scp $(sshopt) -r .repo/* $(user)@$(site):$(folder)/
  41. @cp -R skel2/* .repo/
  42. @chown -R $(user) .repo/
  43. @chmod -R 0777 .repo/
  44. @scp $(sshopt) -r .repo/* $(user)@$(site2):$(folder2)/
  45. @ssh $(sshopt) $(user)@$(site) "cd $(folder);\
  46. chmod -R 0777 *;\
  47. cd $(folder)/i686;\
  48. rm -f omni.db;\
  49. link omni.db.tar.gz omni.db;\
  50. cd $(folder)/x86_64;\
  51. rm -f omni.db;\
  52. link omni.db.tar.gz omni.db";
  53. @ssh $(sshopt) $(user)@$(site2) "cd $(folder2);\
  54. chmod -R 0777 *;\
  55. cd $(folder2)/i686;\
  56. rm -f omni.db;\
  57. link omni.db.tar.gz omni.db;\
  58. cd $(folder2)/x86_64;\
  59. rm -f omni.db;\
  60. link omni.db.tar.gz omni.db";
  61. clean:
  62. @msg -a "0;31" -m "Removing all non-build files from $(pwd)" -A ":::\t"
  63. @rm ~/.makepkg.conf *.xz omni.db* -fv | awk '{print "\t",$$0}'
  64. @rm -rfv *~ | awk '{print "\t",$$0}'
  65. @rm .repo/ -rfv | awk '{print "\t",$$0}'
  66. clean-all: clean
  67. @msg -a "0;31" -a "0;31" -m "Cleaning Project folders" -A ":::\t"
  68. - @cat packages.list | while read pkg; do\
  69. cd $$pkg;\
  70. make clean;\
  71. done;