aboutsummaryrefslogtreecommitdiff
path: root/debian/rules
blob: 5c5305635816fa3b4fc0f1740b36f4a963afb3da (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/usr/bin/make -f
  
DEB_PYTHON_SYSTEM = pysupport
DEB_PYTHON_CLEAN_ARGS = --all

include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/python-distutils.mk

COMMANDS = git-buildpackage  \
           git-import-dsc    \
           git-import-dscs   \
           git-import-orig   \
           git-dch           \
           gbp-pull          \
           gbp-clone

EXAMPLE_SCRIPTS=gbp-cowbuilder-sid gbp-pbuilder gbp-posttag-push

DEB_COMPRESS_EXCLUDE=$(EXAMPLE_SCRIPTS)

MANPAGES=$(patsubst %,docs/%.1,$(COMMANDS) gbp-pq)
MANUAL=docs/manual-html
PYCHECKS=$(patsubst %,%.py,$(COMMANDS))
PYCHECK_LEVEL=Error
GBP_VERSION=gbp/gbp_version.py
VERSION_ENT=docs/version.ent

docs/%.1: docs/man.%.sgml
	docbook2man -o docs/ $<

docs/manual.sgml: docs/version.ent

$(MANUAL): docs/manual.sgml docs/chapters/*.sgml docs/manpages/*.sgml
	docbook-2-html -s local $<
	cp /usr/share/gtk-doc/data/*.png $(MANUAL)

ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
checks: $(PYCHECKS)
	nosetests --with-doctest
endif

%.py: %
	ln -s $< $@
	PYTHONPATH=. pychecker -e $(PYCHECK_LEVEL) -q $<

$(GBP_VERSION): debian/changelog
	echo 'gbp_version="$(DEB_VERSION)"' > $(GBP_VERSION)

$(VERSION_ENT): debian/changelog
	echo '<!ENTITY gbp-version "$(DEB_VERSION)">' >  $(VERSION_ENT)

build/git-buildpackage:: $(MANPAGES) $(MANUAL) $(GBP_VERSION) checks

clean::
	-rm git-*.py
	-rm docs/*.1 docs/manpage.* $(VERSION_ENT)
	-rm -r docs/manual-html/

.PHONY: checks