Merge branch 'jbrill-gh4320-fix' of github.com:jcbrill/scons into jbrill-gh4320-fix
[scons.git] / packaging / debian / rules
blob9d83723a9e0d6a85bc816e73ac1f84b182a1ac34
1 #!/usr/bin/make -f
2 # Sample debian/rules that uses debhelper.
3 # GNU copyright 1997 to 1999 by Joey Hess.
5 ########
6 # Overridable variables added to support building test .deb files
7 # as part of routine SCons builds. --SK
8 BUILDDEB_OPTIONS=
9 PYTHON_VERSION=`python -V 2>&1| cut -d" " -f2 | cut -d"." -f1-2`
10 PYTHON_PATH=/usr/bin/python
11 PYTHON=$(PYTHON_PATH)$(PYTHON_VERSION)
12 #######
14 # Uncomment this to turn on verbose mode.
15 #export DH_VERBOSE=1
17 # This is the debhelper compatability version to use.
18 configure: configure-stamp
19 configure-stamp:
20 dh_testdir
21 # Add here commands to configure the package.
24 touch configure-stamp
26 build: configure-stamp build-stamp
27 build-stamp:
28 dh_testdir
29 $(PYTHON) setup.py build
30 touch build-stamp
32 clean:
33 dh_testdir
34 dh_testroot
35 rm -f build-stamp configure-stamp
36 rm -rf build/
37 dh_clean
39 install: build
40 dh_testdir
41 dh_testroot
42 dh_prep
43 dh_installdirs
45 # Add here commands to install the package into debian/scons.
46 @########
47 @# The SCons project uses Aegis for development, which requires
48 @# that targets be removed explicitly before they're created.
49 @# (They could be symlinks to checked-in read-only copies in the
50 @# repository.) We also can't assume that the proper directories
51 @# already exist on our non-Debian test build systems. Hence,
52 @# we do a lot of mkdir -p and rm -f here... --SK
53 @########
54 mkdir -p debian/scons/usr/lib/python$(PYTHON_VERSION)/site-packages/
55 rm -rf debian/scons/usr/lib/python$(PYTHON_VERSION)/site-packages/SCons
56 cp -r build/lib*/SCons debian/scons/usr/lib/python$(PYTHON_VERSION)/site-packages/
58 mkdir -p debian/scons/usr/bin/
59 rm -f debian/scons/usr/bin/scons
60 rm -f debian/scons/usr/bin/sconsign
61 ifeq ($(PYTHON),python)
62 cp build/scripts/scons debian/scons/usr/bin/scons
63 cp build/scripts/sconsign debian/scons/usr/bin/sconsign
64 else
65 sed '1s|.*|#!/usr/bin/python2.2|' build/scripts/scons > debian/scons/usr/bin/scons
66 sed '1s|.*|#!/usr/bin/python2.2|' build/scripts/sconsign > debian/scons/usr/bin/sconsign
67 endif
68 chmod +x debian/scons/usr/bin/scons
69 chmod +x debian/scons/usr/bin/sconsign
71 mkdir -p debian/scons/usr/share/man/man1/
72 rm -f debian/scons/usr/share/man/man1/scons.1
73 rm -f debian/scons/usr/share/man/man1/sconsign.1
74 cp scons.1 debian/scons/usr/share/man/man1/
75 cp sconsign.1 debian/scons/usr/share/man/man1/
77 mkdir -p debian/scons/usr/share/doc/scons
78 rm -f debian/scons/usr/share/doc/scons/changelog
79 rm -f debian/scons/usr/share/doc/scons/README.txt
80 rm -f debian/scons/usr/share/doc/scons/CHANGES.txt
81 rm -f debian/scons/usr/share/doc/scons/*.gz
82 rm -f debian/scons/usr/share/doc/scons/copyright
84 cp README.txt debian/scons/usr/share/doc/scons/
85 cp CHANGES.txt debian/scons/usr/share/doc/scons/
87 gzip -9 debian/scons/usr/share/doc/scons/*
89 cp debian/changelog debian/scons/usr/share/doc/scons/changelog
91 cp debian/copyright debian/scons/usr/share/doc/scons/
93 # Build architecture-independent files here.
94 binary-indep: build install
95 dh_testdir
96 dh_testroot
97 #dh_installdocs
98 dh_installchangelogs
99 dh_link
100 dh_strip
101 dh_compress
102 dh_fixperms
103 dh_installdeb
104 dh_shlibdeps
105 dh_gencontrol
106 dh_md5sums
107 dh_builddeb $(BUILDDEB_OPTIONS)
109 # Build architecture-dependent files here.
110 binary-arch: build install
112 binary: binary-indep binary-arch
113 .PHONY: build clean binary-indep binary-arch binary install configure