a019ee3b074b27fb00fe0742fefe1aaf51230358
[quix0rs-apt-p2p.git] / debian / rules
1 #!/usr/bin/make -f
2
3 # Uncomment this to turn on verbose mode.
4 #export DH_VERBOSE=1
5
6 PYTHON_VERSION=$(shell /usr/bin/python -V 2>&1 | /usr/bin/perl -le 'print "$$1.$$2" if <> =~m/^Python\s+(\d+)\.(\d+)(\.\d+)*/')
7
8
9 build-stamp: apt-p2p.8 apt-p2p.conf.5
10         dh_testdir
11         touch build-stamp
12
13 %.5 %.8: debian/%.sgml
14         /usr/bin/docbook-to-man $< > debian/$@
15
16 clean:
17         dh_testdir
18         dh_testroot
19         rm -rf build/ apt_p2p/*.pyc apt_p2p_Khashmir/*.pyc *.pyc
20         rm -f debian/*.[58]
21         rm -f build-stamp
22         dh_clean
23
24 install: build-stamp
25
26
27         dh_testdir
28         dh_testroot
29         dh_clean -k
30         dh_installdirs
31
32         ./setup.py install --prefix=$(CURDIR)/debian/apt-p2p/usr \
33                 --install-lib=$(CURDIR)/debian/apt-p2p/usr/share/python-support/apt-p2p \
34                 --install-scripts=$(CURDIR)/debian/apt-p2p/usr/sbin
35
36         # Remove the generated .pyc files
37         ( cd debian/apt-p2p/usr/share/python-support/apt-p2p/apt_p2p_Khashmir && \
38           rm -f *.pyc  && \
39           cd ../apt_p2p && \
40           rm -f *.pyc )
41
42 # Build architecture-independent files here.
43 binary-indep: install
44         dh_testdir
45         dh_testroot
46         dh_installdocs
47         dh_installman
48         
49         # Remove the .py from the end of each of these
50         mv debian/apt-p2p/usr/sbin/apt-p2p.py debian/apt-p2p/usr/sbin/apt-p2p
51
52         dh_installchangelogs 
53         dh_install
54         dh_link
55         dh_compress
56         dh_fixperms
57         dh_pysupport
58         dh_installinit
59         dh_installdeb
60         dh_shlibdeps
61         dh_gencontrol
62         dh_md5sums
63         dh_builddeb
64
65 binary: binary-indep binary-arch
66 .PHONY: build clean binary-indep binary-arch binary install