debian/rules
author Faheem Mitha <faheem@faheem.info>
Sat, 11 Oct 2014 02:27:21 +0530
changeset 1127 87625964c333
parent 1126 aef5e42a4fde
child 1165 f0978cb993a0
permissions -rwxr-xr-x
debian: remove .PHONY line completely This does not work in the case of implicit pattern matching rules as used by dh. Consider this example from Geoffrey Thomas: $ ls -l total 16 -rw-r--r-- 1 faheem faheem 17 Aug 16 20:27 blue.c -rw-r--r-- 1 faheem faheem 17 Aug 16 20:27 green.c -rw-r--r-- 1 faheem faheem 35 Aug 16 20:26 Makefile -rw-r--r-- 1 faheem faheem 17 Aug 16 20:27 red.c $ cat Makefile %: %.c gcc -o $@ $< .PHONY: blue $ make red gcc -o red red.c $ make green gcc -o green green.c $ make blue make: Nothing to be done for blue'. The Make manual (http://www.gnu.org/software/make/manual/make.html#Phony-Targets) says Since it knows that phony targets do not name actual files that could be remade from other files, make skips the implicit rule search for phony targets (see Implicit Rules). Thanks to the good folks on #debian-mentors on OFTC for instruction and explanation in these matters.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
531
b18b00036355 pkg/debian: Debian packaging
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
     1
#!/usr/bin/make -f
1123
d6c065a7a6b1 debian: Add DH_VERBOSE, commented out, for debugging convenience
Faheem Mitha <faheem@faheem.info>
parents: 999
diff changeset
     2
#export DH_VERBOSE=1
531
b18b00036355 pkg/debian: Debian packaging
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
     3
1124
25e8f9c43f8a debian: remove clean target before implicit match rule
Faheem Mitha <faheem@faheem.info>
parents: 1123
diff changeset
     4
%:
531
b18b00036355 pkg/debian: Debian packaging
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
     5
	dh $@ --with python2 --buildsystem=python_distutils
b18b00036355 pkg/debian: Debian packaging
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
     6
1125
f14163c7275a debian: replace build line with a override_dh_auto_build line
Faheem Mitha <faheem@faheem.info>
parents: 1124
diff changeset
     7
override_dh_auto_build:
f14163c7275a debian: replace build line with a override_dh_auto_build line
Faheem Mitha <faheem@faheem.info>
parents: 1124
diff changeset
     8
	dh_auto_build
531
b18b00036355 pkg/debian: Debian packaging
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
     9
	$(MAKE) -C docs
b18b00036355 pkg/debian: Debian packaging
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    10
725
235a942eba3f debian: honor nocheck in DEB_BUILD_OPTIONS
Julien Cristau <julien.cristau@logilab.fr>
parents: 535
diff changeset
    11
ifeq (,$(filter nocheck, $(DEB_BUILD_OPTIONS)))
531
b18b00036355 pkg/debian: Debian packaging
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    12
override_dh_auto_test:
b18b00036355 pkg/debian: Debian packaging
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    13
	cd tests &&  python run-tests.py --with-hg=`which hg`
725
235a942eba3f debian: honor nocheck in DEB_BUILD_OPTIONS
Julien Cristau <julien.cristau@logilab.fr>
parents: 535
diff changeset
    14
endif
535
47246c32e0fb pkg-debian: remove conflicting __init__.py files
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 531
diff changeset
    15
47246c32e0fb pkg-debian: remove conflicting __init__.py files
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 531
diff changeset
    16
override_dh_python2:
47246c32e0fb pkg-debian: remove conflicting __init__.py files
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 531
diff changeset
    17
	# avoid conflict with mercurial's own hgext/__init__.py
47246c32e0fb pkg-debian: remove conflicting __init__.py files
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 531
diff changeset
    18
	find debian -name __init__.py -delete
47246c32e0fb pkg-debian: remove conflicting __init__.py files
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 531
diff changeset
    19
	dh_python2
735
d3bfd03cb26e debian: properly clean the docs build
Julien Cristau <julien.cristau@logilab.fr>
parents: 725
diff changeset
    20
1126
aef5e42a4fde debian: replace clean with override_dh_auto_clean
Faheem Mitha <faheem@faheem.info>
parents: 1125
diff changeset
    21
override_dh_auto_clean: clean-docs
aef5e42a4fde debian: replace clean with override_dh_auto_clean
Faheem Mitha <faheem@faheem.info>
parents: 1125
diff changeset
    22
	dh_auto_clean
999
38099dfdcbbe debian: add line to clean target to delete error files caused by failing tests
Faheem Mitha <faheem@faheem.info>
parents: 735
diff changeset
    23
	rm -f tests/*.err
735
d3bfd03cb26e debian: properly clean the docs build
Julien Cristau <julien.cristau@logilab.fr>
parents: 725
diff changeset
    24
d3bfd03cb26e debian: properly clean the docs build
Julien Cristau <julien.cristau@logilab.fr>
parents: 725
diff changeset
    25
clean-docs:
d3bfd03cb26e debian: properly clean the docs build
Julien Cristau <julien.cristau@logilab.fr>
parents: 725
diff changeset
    26
	rm -rf html
d3bfd03cb26e debian: properly clean the docs build
Julien Cristau <julien.cristau@logilab.fr>
parents: 725
diff changeset
    27
	rm -f docs/static/logo-evolve.ico
d3bfd03cb26e debian: properly clean the docs build
Julien Cristau <julien.cristau@logilab.fr>
parents: 725
diff changeset
    28
	rm -f docs/tutorials/tutorial.rst