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