2000-09-10 14:53:52 +00:00
|
|
|
# This Makefile is only used by developers.
|
2011-04-22 06:39:45 +00:00
|
|
|
PYVER:=2.7
|
2012-04-23 19:14:13 +00:00
|
|
|
PYTHON?=python$(PYVER)
|
2009-08-19 18:41:26 +00:00
|
|
|
VERSION:=$(shell $(PYTHON) setup.py --version)
|
2011-04-25 12:40:10 +00:00
|
|
|
PLATFORM:=$(shell $(PYTHON) -c "from distutils.util import get_platform; print get_platform()")
|
2013-01-06 17:10:13 +00:00
|
|
|
APPNAME:=$(shell $(PYTHON) setup.py --name)
|
2013-04-15 16:48:08 +00:00
|
|
|
AUTHOR:=$(shell $(PYTHON) setup.py --author)
|
|
|
|
|
MAINTAINER:=$(shell $(PYTHON) setup.py --maintainer)
|
2013-01-06 17:10:13 +00:00
|
|
|
LAPPNAME:=$(shell echo $(APPNAME)|tr "[A-Z]" "[a-z]")
|
|
|
|
|
ARCHIVE_SOURCE:=$(APPNAME)-$(VERSION).tar.xz
|
|
|
|
|
ARCHIVE_WIN32:=$(APPNAME)-$(VERSION).exe
|
|
|
|
|
GITUSER:=wummel
|
|
|
|
|
GITREPO:=$(LAPPNAME)
|
2013-02-20 19:50:22 +00:00
|
|
|
HOMEPAGE:=$(HOME)/public_html/$(LAPPNAME)-webpage.git
|
2013-04-15 16:48:08 +00:00
|
|
|
WEB_META:=doc/web/app.yaml
|
2013-01-06 17:10:13 +00:00
|
|
|
DEBUILDDIR:=$(HOME)/projects/debian/official
|
|
|
|
|
DEBORIGFILE:=$(DEBUILDDIR)/$(LAPPNAME)_$(VERSION).orig.tar.xz
|
2013-01-06 21:55:51 +00:00
|
|
|
DEBPACKAGEDIR:=$(DEBUILDDIR)/$(APPNAME)-$(VERSION)
|
2011-04-06 15:19:31 +00:00
|
|
|
FILESCHECK_URL:=http://localhost/~calvin/
|
2012-12-18 22:05:45 +00:00
|
|
|
SRCDIR:=${HOME}/src
|
2014-03-12 18:22:07 +00:00
|
|
|
PY_FILES_DIRS:=linkcheck tests *.py linkchecker linkchecker-gui cgi-bin config doc/examples scripts
|
2013-01-06 17:17:29 +00:00
|
|
|
MYPY_FILES_DIRS:=linkcheck/HtmlParser linkcheck/checker \
|
|
|
|
|
linkcheck/cache linkcheck/configuration linkcheck/director \
|
|
|
|
|
linkcheck/htmlutil linkcheck/logger linkcheck/network \
|
2014-02-28 23:12:34 +00:00
|
|
|
linkcheck/bookmarks linkcheck/plugins linkcheck/parser \
|
2013-01-06 17:17:29 +00:00
|
|
|
linkcheck/gui/__init__.py \
|
|
|
|
|
linkcheck/gui/checker.py \
|
|
|
|
|
linkcheck/gui/contextmenu.py \
|
|
|
|
|
linkcheck/gui/debug.py \
|
|
|
|
|
linkcheck/gui/editor.py \
|
|
|
|
|
linkcheck/gui/editor_qsci.py \
|
|
|
|
|
linkcheck/gui/editor_qt.py \
|
|
|
|
|
linkcheck/gui/lineedit.py \
|
|
|
|
|
linkcheck/gui/help.py \
|
|
|
|
|
linkcheck/gui/logger.py \
|
|
|
|
|
linkcheck/gui/options.py \
|
|
|
|
|
linkcheck/gui/properties.py \
|
|
|
|
|
linkcheck/gui/settings.py \
|
|
|
|
|
linkcheck/gui/statistics.py \
|
|
|
|
|
linkcheck/gui/syntax.py \
|
|
|
|
|
linkcheck/gui/updater.py \
|
|
|
|
|
linkcheck/gui/urlmodel.py \
|
|
|
|
|
linkcheck/gui/urlsave.py \
|
|
|
|
|
$(filter-out %2.py,$(wildcard linkcheck/*.py)) \
|
|
|
|
|
cgi-bin/lc.wsgi \
|
|
|
|
|
linkchecker \
|
|
|
|
|
linkchecker-gui \
|
|
|
|
|
*.py
|
|
|
|
|
|
2012-09-26 14:54:54 +00:00
|
|
|
TESTS ?= tests
|
|
|
|
|
# set test options, eg. to "--verbose"
|
2009-06-26 05:20:48 +00:00
|
|
|
TESTOPTS=
|
2009-03-04 21:22:43 +00:00
|
|
|
PAGER ?= less
|
2010-03-07 15:40:17 +00:00
|
|
|
# original dnspython repository module
|
2011-05-24 18:18:58 +00:00
|
|
|
DNSPYTHON:=$(HOME)/src/dnspython-git
|
2009-11-13 19:42:53 +00:00
|
|
|
# options to run the pep8 utility
|
2010-03-13 07:47:12 +00:00
|
|
|
PEP8OPTS:=--repeat --ignore=E211,E501,E225,E301,E302,E241 \
|
2011-10-19 11:44:48 +00:00
|
|
|
--exclude="gzip2.py,httplib2.py,robotparser2.py"
|
2011-04-25 13:20:48 +00:00
|
|
|
PY2APPOPTS ?=
|
2011-05-28 06:22:54 +00:00
|
|
|
ifeq ($(shell uname),Darwin)
|
2011-12-16 20:36:01 +00:00
|
|
|
CHMODMINUSMINUS:=
|
2011-05-28 06:22:54 +00:00
|
|
|
else
|
2011-12-16 20:36:01 +00:00
|
|
|
CHMODMINUSMINUS:=--
|
2011-05-28 06:22:54 +00:00
|
|
|
endif
|
2012-09-26 14:54:54 +00:00
|
|
|
# Pytest options:
|
2013-04-15 16:47:54 +00:00
|
|
|
# - use multiple processes
|
2012-09-26 14:54:54 +00:00
|
|
|
# - write test results in file
|
2013-04-15 16:47:54 +00:00
|
|
|
PYTESTOPTS:=-n 4 --resultlog=testresults.txt
|
2012-06-25 18:08:53 +00:00
|
|
|
|
2006-05-18 16:46:58 +00:00
|
|
|
|
2000-03-19 14:24:33 +00:00
|
|
|
all:
|
2011-01-09 15:51:15 +00:00
|
|
|
@echo "Read the file doc/install.txt to see how to build and install this package."
|
2000-02-26 10:24:46 +00:00
|
|
|
|
|
|
|
|
clean:
|
2004-04-04 17:07:40 +00:00
|
|
|
-$(PYTHON) setup.py clean --all
|
2012-12-18 22:05:45 +00:00
|
|
|
rm -f $(LAPPNAME)-out.* *-stamp*
|
2000-11-09 12:02:38 +00:00
|
|
|
$(MAKE) -C po clean
|
2009-07-29 19:53:52 +00:00
|
|
|
$(MAKE) -C doc/html clean
|
2008-03-19 10:22:04 +00:00
|
|
|
$(MAKE) -C linkcheck/HtmlParser clean
|
2011-05-01 07:08:50 +00:00
|
|
|
rm -f linkcheck/network/_network*.so
|
2005-03-15 00:02:37 +00:00
|
|
|
find . -name '*.py[co]' -exec rm -f {} \;
|
2000-02-26 10:24:46 +00:00
|
|
|
|
2013-01-06 17:10:13 +00:00
|
|
|
distclean: clean
|
2012-06-24 11:50:46 +00:00
|
|
|
rm -rf build dist $(APPNAME).egg-info
|
|
|
|
|
rm -f _$(APPNAME)_configdata.py MANIFEST Packages.gz
|
2004-04-04 17:07:40 +00:00
|
|
|
# clean aborted dist builds and -out files
|
2012-12-18 22:05:45 +00:00
|
|
|
rm -f $(LAPPNAME)-out* $(LAPPNAME).prof
|
2012-10-14 09:53:07 +00:00
|
|
|
rm -f alexa*.log testresults.txt
|
2012-06-24 11:50:46 +00:00
|
|
|
rm -rf $(APPNAME)-$(VERSION)
|
2006-07-26 08:09:59 +00:00
|
|
|
rm -rf coverage dist-stamp python-build-stamp*
|
2000-07-14 14:26:41 +00:00
|
|
|
|
2005-03-29 16:33:10 +00:00
|
|
|
MANIFEST: MANIFEST.in setup.py
|
|
|
|
|
$(PYTHON) setup.py sdist --manifest-only
|
|
|
|
|
|
2004-09-01 09:39:39 +00:00
|
|
|
locale:
|
2012-04-11 18:33:09 +00:00
|
|
|
$(MAKE) -C po mofiles
|
2001-03-04 19:42:35 +00:00
|
|
|
|
2004-11-23 23:36:11 +00:00
|
|
|
# to build in the current directory
|
2012-04-22 16:04:06 +00:00
|
|
|
localbuild: MANIFEST locale
|
2011-04-26 12:44:18 +00:00
|
|
|
$(MAKE) -C doc/html
|
2004-08-12 00:03:55 +00:00
|
|
|
$(MAKE) -C linkcheck/HtmlParser
|
2002-11-24 19:53:37 +00:00
|
|
|
$(PYTHON) setup.py build
|
2012-10-26 16:05:00 +00:00
|
|
|
cp -f build/lib.$(PLATFORM)-$(PYVER)*/linkcheck/HtmlParser/htmlsax*.so linkcheck/HtmlParser
|
|
|
|
|
cp -f build/lib.$(PLATFORM)-$(PYVER)*/linkcheck/network/_network*.so linkcheck/network
|
2002-11-24 19:53:37 +00:00
|
|
|
|
2013-01-06 17:10:13 +00:00
|
|
|
release: distclean releasecheck filescheck
|
2013-04-11 16:29:23 +00:00
|
|
|
$(MAKE) dist sign upload homepage tag register changelog deb
|
2013-01-06 17:10:13 +00:00
|
|
|
|
|
|
|
|
tag:
|
|
|
|
|
git tag upstream/$(VERSION)
|
|
|
|
|
git push --tags origin upstream/$(VERSION)
|
2002-02-08 18:49:46 +00:00
|
|
|
|
2013-01-06 17:10:13 +00:00
|
|
|
upload:
|
2013-12-24 06:28:19 +00:00
|
|
|
cp dist/$(ARCHIVE_SOURCE) dist/$(ARCHIVE_WIN32) \
|
|
|
|
|
dist/$(ARCHIVE_SOURCE).asc dist/$(ARCHIVE_WIN32).asc \
|
|
|
|
|
$(HOMEPAGE)/dist
|
2012-09-03 17:50:25 +00:00
|
|
|
|
|
|
|
|
homepage:
|
2013-04-15 16:48:08 +00:00
|
|
|
# update metadata
|
|
|
|
|
@echo "version: \"$(VERSION)\"" > $(WEB_META)
|
|
|
|
|
@echo "name: \"$(APPNAME)\"" >> $(WEB_META)
|
|
|
|
|
@echo "lname: \"$(LAPPNAME)\"" >> $(WEB_META)
|
|
|
|
|
@echo "maintainer: \"$(MAINTAINER)\"" >> $(WEB_META)
|
|
|
|
|
@echo "author: \"$(AUTHOR)\"" >> $(WEB_META)
|
2014-03-04 21:06:04 +00:00
|
|
|
git add $(WEBMETA)
|
|
|
|
|
-git commit -m "Updated webpage meta info"
|
2013-01-06 17:10:13 +00:00
|
|
|
# update documentation and man pages
|
2011-05-30 16:34:43 +00:00
|
|
|
$(MAKE) -C doc man
|
2013-04-15 16:48:08 +00:00
|
|
|
$(MAKE) -C doc/web release
|
2012-09-03 17:50:25 +00:00
|
|
|
|
|
|
|
|
register:
|
2005-01-12 13:29:19 +00:00
|
|
|
@echo "Register at Python Package Index..."
|
|
|
|
|
$(PYTHON) setup.py register
|
2012-09-03 17:50:25 +00:00
|
|
|
@echo "done."
|
|
|
|
|
@echo "Submitting to Freecode..."
|
2012-12-18 22:05:45 +00:00
|
|
|
freecode-submit < $(LAPPNAME).freecode
|
2012-09-03 17:50:25 +00:00
|
|
|
@echo "done."
|
2004-09-03 19:19:10 +00:00
|
|
|
|
2013-01-06 17:10:13 +00:00
|
|
|
deb:
|
|
|
|
|
# build a debian package
|
|
|
|
|
[ -f $(DEBORIGFILE) ] || cp dist/$(ARCHIVE_SOURCE) $(DEBORIGFILE)
|
|
|
|
|
sed -i -e 's/VERSION_$(LAPPNAME):=.*/VERSION_$(LAPPNAME):=$(VERSION)/' $(DEBUILDDIR)/$(LAPPNAME).mak
|
|
|
|
|
[ -d $(DEBPACKAGEDIR) ] || (cd $(DEBUILDDIR); \
|
|
|
|
|
patool extract $(DEBORIGFILE); \
|
|
|
|
|
cd $(CURDIR); \
|
|
|
|
|
git checkout debian; \
|
|
|
|
|
cp -r debian $(DEBPACKAGEDIR); \
|
2013-02-26 20:09:47 +00:00
|
|
|
rm -f $(DEBPACKAGEDIR)/debian/.gitignore; \
|
2013-01-06 17:10:13 +00:00
|
|
|
git checkout master)
|
|
|
|
|
$(MAKE) -C $(DEBUILDDIR) $(LAPPNAME)_clean $(LAPPNAME)
|
|
|
|
|
|
2007-03-21 19:35:05 +00:00
|
|
|
chmod:
|
2011-12-16 20:36:01 +00:00
|
|
|
-chmod -R a+rX,u+w,go-w $(CHMODMINUSMINUS) *
|
2007-03-21 19:35:05 +00:00
|
|
|
find . -type d -exec chmod 755 {} \;
|
|
|
|
|
|
|
|
|
|
dist: locale MANIFEST chmod
|
2012-09-05 22:11:31 +00:00
|
|
|
rm -f dist/$(APPNAME)-$(VERSION).tar.xz
|
|
|
|
|
$(PYTHON) setup.py sdist --formats=tar
|
2012-08-14 15:39:41 +00:00
|
|
|
xz dist/$(APPNAME)-$(VERSION).tar
|
2013-01-06 17:10:13 +00:00
|
|
|
[ ! -f ../$(ARCHIVE_WIN32) ] || cp ../$(ARCHIVE_WIN32) dist
|
2006-05-18 16:46:58 +00:00
|
|
|
|
2012-05-23 20:49:18 +00:00
|
|
|
# Build OSX installer with py2app
|
2011-04-30 11:54:13 +00:00
|
|
|
app: distclean localbuild chmod
|
2011-04-25 13:20:48 +00:00
|
|
|
$(PYTHON) setup.py py2app $(PY2APPOPTS)
|
2011-04-25 13:13:43 +00:00
|
|
|
|
2012-05-23 20:49:18 +00:00
|
|
|
# Build RPM installer with cx_Freeze
|
|
|
|
|
rpm:
|
|
|
|
|
$(MAKE) -C doc/html
|
|
|
|
|
$(MAKE) -C linkcheck/HtmlParser
|
|
|
|
|
$(PYTHON) setup.py bdist_rpm
|
|
|
|
|
|
2013-12-09 16:56:11 +00:00
|
|
|
# Build portable Linux app
|
|
|
|
|
binary: distclean localbuild chmod
|
|
|
|
|
LINKCHECKER_FREEZE=1 $(PYTHON) setup.py bdist
|
|
|
|
|
|
2007-12-14 16:41:19 +00:00
|
|
|
# The check programs used here are mostly local scripts on my private system.
|
|
|
|
|
# So for other developers there is no need to execute this target.
|
2007-11-14 17:56:56 +00:00
|
|
|
check:
|
2008-01-02 14:31:19 +00:00
|
|
|
check-copyright
|
2008-01-16 13:18:00 +00:00
|
|
|
check-pofiles -v
|
2013-01-06 17:17:29 +00:00
|
|
|
py-tabdaddy $(MYPY_FILES_DIRS)
|
2010-03-05 11:50:27 +00:00
|
|
|
py-unittest2-compat tests/
|
2012-10-15 16:19:08 +00:00
|
|
|
$(MAKE) -C doc check
|
2011-02-14 19:28:49 +00:00
|
|
|
$(MAKE) doccheck
|
2008-04-25 16:01:13 +00:00
|
|
|
$(MAKE) pyflakes
|
2006-04-08 10:27:08 +00:00
|
|
|
|
2011-02-14 19:28:49 +00:00
|
|
|
doccheck:
|
2013-01-06 17:17:29 +00:00
|
|
|
py-check-docstrings --force $(MYPY_FILES_DIRS)
|
2011-02-14 19:28:49 +00:00
|
|
|
|
2012-05-12 12:44:18 +00:00
|
|
|
filescheck: localbuild
|
2012-09-18 07:16:34 +00:00
|
|
|
for out in text html gml sql csv xml gxml dot sitemap; do \
|
2012-12-18 22:05:45 +00:00
|
|
|
./$(LAPPNAME) -o$$out -F$$out --complete -r1 -C $(FILESCHECK_URL) || exit 1; \
|
2011-04-06 15:19:31 +00:00
|
|
|
done
|
2009-02-24 14:18:42 +00:00
|
|
|
|
2010-03-07 10:59:18 +00:00
|
|
|
update-copyright:
|
2014-02-28 23:12:34 +00:00
|
|
|
update-copyright --holder="Bastian Kleineidam" $(PY_FILES_DIRS)
|
2010-03-07 10:59:18 +00:00
|
|
|
|
2014-03-11 19:23:41 +00:00
|
|
|
releasecheck: check
|
2010-03-06 20:52:25 +00:00
|
|
|
@if egrep -i "xx\.|xxxx|\.xx" doc/changelog.txt > /dev/null; then \
|
|
|
|
|
echo "Could not release: edit doc/changelog.txt release date"; false; \
|
2004-09-01 09:39:39 +00:00
|
|
|
fi
|
2013-01-06 17:10:13 +00:00
|
|
|
@if [ ! -f ../$(ARCHIVE_WIN32) ]; then \
|
|
|
|
|
echo "Missing WIN32 distribution archive at ../$(ARCHIVE_WIN32)"; \
|
|
|
|
|
false; \
|
|
|
|
|
fi
|
2012-12-18 22:05:45 +00:00
|
|
|
@if ! grep "Version: $(VERSION)" $(LAPPNAME).freecode > /dev/null; then \
|
|
|
|
|
echo "Could not release: edit $(LAPPNAME).freecode version"; false; \
|
2010-10-26 00:02:53 +00:00
|
|
|
fi
|
2012-01-11 20:08:45 +00:00
|
|
|
$(PYTHON) setup.py check --restructuredtext
|
2004-09-01 09:39:39 +00:00
|
|
|
|
2013-01-06 17:10:13 +00:00
|
|
|
sign:
|
2012-09-02 21:44:16 +00:00
|
|
|
for f in $(shell find dist -name *.xz -o -name *.exe -o -name *.zip -o -name *.dmg); do \
|
2011-03-25 18:34:56 +00:00
|
|
|
[ -f $${f}.asc ] || gpg --detach-sign --armor $$f; \
|
2004-09-03 19:19:10 +00:00
|
|
|
done
|
2003-03-16 19:03:32 +00:00
|
|
|
|
2006-02-13 22:11:54 +00:00
|
|
|
test: localbuild
|
2012-11-26 17:49:07 +00:00
|
|
|
env LANG=en_US.utf-8 $(PYTHON) -m pytest $(PYTESTOPTS) $(TESTOPTS) $(TESTS)
|
2004-08-19 21:39:18 +00:00
|
|
|
|
2005-10-10 21:51:47 +00:00
|
|
|
pyflakes:
|
2011-12-13 20:25:09 +00:00
|
|
|
pyflakes $(PY_FILES_DIRS) 2>&1 | \
|
2012-09-19 07:45:47 +00:00
|
|
|
grep -v "local variable 'dummy' is assigned to but never used" | \
|
2014-03-05 18:26:37 +00:00
|
|
|
grep -v -E "'(py2exe|py2app|PyQt4|biplist|setuptools|win32com|find_executable|parse_sitemap|parse_sitemapindex|parse_bookmark_data|parse_bookmark_file|wsgiref|pyftpdlib|linkchecker_rc)' imported but unused" | \
|
2005-10-10 21:51:47 +00:00
|
|
|
grep -v "undefined name '_'" | \
|
2008-04-25 15:59:27 +00:00
|
|
|
grep -v "undefined name '_n'" | cat
|
2005-10-10 21:51:47 +00:00
|
|
|
|
2009-11-13 19:42:53 +00:00
|
|
|
pep8:
|
|
|
|
|
pep8 $(PEP8OPTS) $(PY_FILES_DIRS)
|
|
|
|
|
|
2012-12-18 22:05:45 +00:00
|
|
|
# Compare custom Python files with the originals
|
2006-01-11 22:04:30 +00:00
|
|
|
diff:
|
|
|
|
|
@for f in gzip robotparser httplib; do \
|
|
|
|
|
echo "Comparing $${f}.py"; \
|
2012-12-18 22:05:45 +00:00
|
|
|
diff -u linkcheck/$${f}2.py $(SRCDIR)/cpython.hg/Lib/$${f}.py | $(PAGER); \
|
2006-01-11 22:04:30 +00:00
|
|
|
done
|
2012-12-18 22:05:45 +00:00
|
|
|
@diff -u linkcheck/better_exchook.py $(SRCDIR)/py_better_exchook.git/better_exchook.py
|
2006-01-11 22:04:30 +00:00
|
|
|
|
2011-05-24 18:18:58 +00:00
|
|
|
# Compare dnspython files with the ones from upstream repository
|
2010-03-07 15:40:17 +00:00
|
|
|
dnsdiff:
|
2011-05-24 18:18:58 +00:00
|
|
|
@(for d in dns tests; do \
|
|
|
|
|
diff -BurN --exclude=*.pyc third_party/dnspython/$$d $(DNSPYTHON)/$$d; \
|
|
|
|
|
done) | $(PAGER)
|
2010-03-07 15:40:17 +00:00
|
|
|
|
2007-11-14 22:23:46 +00:00
|
|
|
changelog:
|
2012-12-18 22:05:45 +00:00
|
|
|
github-changelog $(DRYRUN) $(GITUSER) $(GITREPO) doc/changelog.txt
|
2009-02-19 13:35:09 +00:00
|
|
|
|
|
|
|
|
gui:
|
|
|
|
|
$(MAKE) -C linkcheck/gui
|
2011-04-26 14:14:34 +00:00
|
|
|
|
|
|
|
|
count:
|
2014-03-04 20:51:19 +00:00
|
|
|
@sloccount linkchecker linkchecker-gui linkcheck tests
|
2011-05-22 15:39:56 +00:00
|
|
|
|
|
|
|
|
# run eclipse ide
|
|
|
|
|
ide:
|
2011-12-17 18:13:32 +00:00
|
|
|
eclipse -data $(CURDIR)/..
|
2012-09-03 17:53:53 +00:00
|
|
|
|
|
|
|
|
.PHONY: test changelog gui count pyflakes ide login upload all clean distclean
|
2013-01-06 17:10:13 +00:00
|
|
|
.PHONY: pep8 cleandeb locale localbuild deb diff dnsdiff sign
|
2012-09-03 17:53:53 +00:00
|
|
|
.PHONY: filescheck update-copyright releasecheck check register announce
|
2014-03-11 19:23:41 +00:00
|
|
|
.PHONY: chmod dist app rpm release homepage
|