|
| 1 | +#/*************************************************************************** |
| 2 | +# ConstraintChecker |
| 3 | +# |
| 4 | +# FIXME - Check for constraints (e.g. planning) within varying distances from a polygon of interest. |
| 5 | +# ------------------- |
| 6 | +# begin : 2014-03-19 |
| 7 | +# copyright : (C) 2014 by Lutra Consulting for Dartmoor National Park Authority |
| 8 | +# email : fixme@dnpa.gov.uk |
| 9 | +# ***************************************************************************/ |
| 10 | +# |
| 11 | +#/*************************************************************************** |
| 12 | +# * * |
| 13 | +# * This program is free software; you can redistribute it and/or modify * |
| 14 | +# * it under the terms of the GNU General Public License as published by * |
| 15 | +# * the Free Software Foundation; either version 2 of the License, or * |
| 16 | +# * (at your option) any later version. * |
| 17 | +# * * |
| 18 | +# ***************************************************************************/ |
| 19 | + |
| 20 | +# CONFIGURATION |
| 21 | +PLUGIN_UPLOAD = $(CURDIR)/plugin_upload.py |
| 22 | + |
| 23 | +QGISDIR=.qgis2 |
| 24 | + |
| 25 | +# Makefile for a PyQGIS plugin |
| 26 | + |
| 27 | +# translation |
| 28 | +SOURCES = constraintchecker.py ui_constraintchecker.py __init__.py constraintcheckerdialog.py |
| 29 | +#TRANSLATIONS = i18n/constraintchecker_en.ts |
| 30 | +TRANSLATIONS = |
| 31 | + |
| 32 | +# global |
| 33 | + |
| 34 | +PLUGINNAME = constraintchecker |
| 35 | + |
| 36 | +PY_FILES = constraintchecker.py constraintcheckerdialog.py __init__.py |
| 37 | + |
| 38 | +EXTRAS = icon.png metadata.txt |
| 39 | + |
| 40 | +UI_FILES = ui_constraintchecker.py |
| 41 | + |
| 42 | +RESOURCE_FILES = resources_rc.py |
| 43 | + |
| 44 | +HELP = help/build/html |
| 45 | + |
| 46 | +default: compile |
| 47 | + |
| 48 | +compile: $(UI_FILES) $(RESOURCE_FILES) |
| 49 | + |
| 50 | +%_rc.py : %.qrc |
| 51 | + pyrcc4 -o $*_rc.py $< |
| 52 | + |
| 53 | +%.py : %.ui |
| 54 | + pyuic4 -o $@ $< |
| 55 | + |
| 56 | +%.qm : %.ts |
| 57 | + lrelease $< |
| 58 | + |
| 59 | +# The deploy target only works on unix like operating system where |
| 60 | +# the Python plugin directory is located at: |
| 61 | +# $HOME/$(QGISDIR)/python/plugins |
| 62 | +deploy: compile doc transcompile |
| 63 | + mkdir -p $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME) |
| 64 | + cp -vf $(PY_FILES) $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME) |
| 65 | + cp -vf $(UI_FILES) $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME) |
| 66 | + cp -vf $(RESOURCE_FILES) $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME) |
| 67 | + cp -vf $(EXTRAS) $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME) |
| 68 | + cp -vfr i18n $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME) |
| 69 | + cp -vfr $(HELP) $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME)/help |
| 70 | + |
| 71 | +# The dclean target removes compiled python files from plugin directory |
| 72 | +# also delets any .svn entry |
| 73 | +dclean: |
| 74 | + find $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME) -iname "*.pyc" -delete |
| 75 | + find $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME) -iname ".svn" -prune -exec rm -Rf {} \; |
| 76 | + |
| 77 | +# The derase deletes deployed plugin |
| 78 | +derase: |
| 79 | + rm -Rf $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME) |
| 80 | + |
| 81 | +# The zip target deploys the plugin and creates a zip file with the deployed |
| 82 | +# content. You can then upload the zip file on http://plugins.qgis.org |
| 83 | +zip: deploy dclean |
| 84 | + rm -f $(PLUGINNAME).zip |
| 85 | + cd $(HOME)/$(QGISDIR)/python/plugins; zip -9r $(CURDIR)/$(PLUGINNAME).zip $(PLUGINNAME) |
| 86 | + |
| 87 | +# Create a zip package of the plugin named $(PLUGINNAME).zip. |
| 88 | +# This requires use of git (your plugin development directory must be a |
| 89 | +# git repository). |
| 90 | +# To use, pass a valid commit or tag as follows: |
| 91 | +# make package VERSION=Version_0.3.2 |
| 92 | +package: compile |
| 93 | + rm -f $(PLUGINNAME).zip |
| 94 | + git archive --prefix=$(PLUGINNAME)/ -o $(PLUGINNAME).zip $(VERSION) |
| 95 | + echo "Created package: $(PLUGINNAME).zip" |
| 96 | + |
| 97 | +upload: zip |
| 98 | + $(PLUGIN_UPLOAD) $(PLUGINNAME).zip |
| 99 | + |
| 100 | +# transup |
| 101 | +# update .ts translation files |
| 102 | +transup: |
| 103 | + pylupdate4 Makefile |
| 104 | + |
| 105 | +# transcompile |
| 106 | +# compile translation files into .qm binary format |
| 107 | +transcompile: $(TRANSLATIONS:.ts=.qm) |
| 108 | + |
| 109 | +# transclean |
| 110 | +# deletes all .qm files |
| 111 | +transclean: |
| 112 | + rm -f i18n/*.qm |
| 113 | + |
| 114 | +clean: |
| 115 | + rm $(UI_FILES) $(RESOURCE_FILES) |
| 116 | + |
| 117 | +# build documentation with sphinx |
| 118 | +doc: |
| 119 | + cd help; make html |
0 commit comments