Makefile 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. # Makefile for django Organice themes
  2. #
  3. # variables
  4. SHELL = /bin/bash
  5. .PHONY: help assets bootstrap bumpver clean release setuptools
  6. help:
  7. @echo "Please use \`make <target>' where <target> is one of"
  8. @echo " assets to build all static assets (combined/minified CSS, JavaScript, etc.)"
  9. @echo " bootstrap to update Sass, Compass, UglifyJS, and bootstrap-sass on your (Ubuntu) system"
  10. @echo " bumpver to bump the version number, commit and tag for releasing"
  11. @echo " clean to remove build files and folders"
  12. @echo " install to install this project including its dependencies"
  13. @echo " uninstall to uninstall this package using pip"
  14. @echo " release to package a new release, and upload it to pypi.org"
  15. @echo " setuptools to install setuptools or repair a broken pip installation"
  16. assets: #bootstrap
  17. @echo "Building assets..."
  18. cd */static && compass clean && compass compile
  19. cd */static/js && \
  20. BOOTSTRAP_JS_DIR=$(shell find $(shell gem environment gemdir)/gems/ \
  21. -name bootstrap-sass-*)/vendor/assets/javascripts/bootstrap/ && \
  22. uglifyjs -o scripts.js \
  23. {jquery,jquery-ui,profile}.js \
  24. ../todo/js/jquery.tablednd_0_5.js \
  25. $$BOOTSTRAP_JS_DIR/{affix,alert,carousel,dropdown,scrollspy}.js
  26. bootstrap:
  27. @echo "Updating your system-wide bootstrap-sass installation... (may require your password)"
  28. gem list &> /dev/null || sudo apt-get install -y ruby
  29. yes | sudo gem uninstall sass sass-css-importer compass bootstrap-sass
  30. sudo gem install compass bootstrap-sass --no-rdoc --no-ri
  31. sudo gem install --pre sass-css-importer --no-rdoc --no-ri
  32. @gem list
  33. @echo
  34. @echo "Updating uglify-js v2 for Bootstrap JavaScript minification... (may require your password)"
  35. npm list &> /dev/null || sudo apt-get install -y npm
  36. sudo npm uninstall -g uglify-js
  37. sudo npm install -g uglify-js
  38. bumpver:
  39. @echo "Not implemented yet. Install pypi package instead: \`pip install bumpversion'"
  40. clean:
  41. rm -rf build/ dist/ *.egg-info/ */static/.sass-cache
  42. install: setuptools
  43. python setup.py install
  44. uninstall:
  45. @PKG_NAME=$${PWD##*/} && pip freeze | sed 's/==.*$$//' | grep $$PKG_NAME &> /dev/null \
  46. && pip uninstall -y $$PKG_NAME \
  47. || echo "Package $$PKG_NAME not installed."
  48. release: setuptools clean
  49. python setup.py sdist upload
  50. setuptools:
  51. python -c 'import setuptools' || \
  52. curl -s -S https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py | python
  53. rm -f setuptools-*.zip