]> git.decadent.org.uk Git - ion3.git/blob - debian/rules
Moved packages to non-free sections.
[ion3.git] / debian / rules
1 #!/usr/bin/make -f
2
3 # Uncomment this to turn on verbose mode.
4 #export DH_VERBOSE=1
5
6 export SHELL=/bin/bash
7
8 include /usr/share/dpatch/dpatch.make
9
10 PACKAGE := ion3
11 PACKAGE_DEV := $(PACKAGE)-dev
12 PACKAGE_DOC := $(PACKAGE)-doc
13 INSTDIR := debian/$(PACKAGE)
14 INSTDIR_DEV := debian/$(PACKAGE_DEV)
15 INSTDIR_DOC := debian/$(PACKAGE_DOC)
16 UPSTREAM_VERSION := $(shell dpkg-parsechangelog | sed -r 's/^Version: ([0-9]*:)?(.*)-[^-]*$$/\2/; t; d')
17
18 doc-orig:
19         cp -R doc doc-orig
20
21 build-indep: build-indep-stamp
22 build-indep-stamp: doc-orig patch
23         dh_testdir
24
25         cd libextl && $(MAKE) libextl-mkexports
26         #cd doc && $(MAKE) all all-pdf
27
28         touch build-indep-stamp
29
30 build-arch: build-arch-stamp
31 build-arch-stamp: doc-orig patch
32         dh_testdir
33
34         $(MAKE)
35
36         touch build-arch-stamp
37
38 build: build-indep build-arch
39
40 clean: unpatch
41         dh_testdir
42         dh_testroot
43         rm -f build-indep-stamp build-arch-stamp
44
45         $(MAKE) realclean
46
47         if [ -d doc-orig ]; then \
48                 rm -rf doc; \
49                 mv doc-orig doc; \
50         fi
51
52         dh_clean
53
54 install-indep: build-indep
55         dh_testdir
56         dh_testroot
57         dh_clean -i -k
58         dh_installdirs -i
59         dh_install -i
60
61 # install headers
62         find . \( -name debian -o -name config.h -o -name snprintf.h \) \
63                 -prune -o -name '*.h' -exec install -m644 -D {} \
64                 $(INSTDIR_DEV)/usr/include/$(PACKAGE)/{} \;
65
66 install-arch: build-arch
67         dh_testdir
68         dh_testroot
69         dh_clean -a -k
70         dh_installdirs -a
71
72         $(MAKE) install \
73                 PREFIX=$(CURDIR)/$(INSTDIR)/usr \
74                 ETCDIR=$(CURDIR)/$(INSTDIR)/etc/X11/$(PACKAGE)
75
76 # install other things (mainly -dev)
77         dh_install -a
78
79 # fix the installation
80         rm -f $(INSTDIR)/etc/X11/$(PACKAGE)/draw.lua
81
82 binary-indep: build-indep install-indep
83         dh_testdir
84         dh_testroot
85
86 # automatically keep track of api version
87         echo Ion:ApiVersion=$$((cat version.h; echo ION_API_VERSION) \
88                 | cpp -P | tail -1 | sed 's/"//g') >>debian/ion3-dev.substvars
89
90         dh_installchangelogs -i
91         dh_installdocs -i
92 # remove empty images and TeX droppings
93         find $(INSTDIR_DOC)/usr/share/doc/$(PACKAGE_DOC) \
94                 -name '*.png' -size 0 \
95                 -o -name '*.aux' -o -name '*.idx' -o -name '*.log' \
96                 -o -name '*.out' -o -name '*.pl' -o -name WARNINGS \
97                 | xargs rm --
98
99 #       dh_installexamples -i
100 #       dh_install -i
101 #       dh_installmenu -i
102 #       dh_installdebconf -i
103 #       dh_installlogrotate -i
104 #       dh_installemacsen -i
105 #       dh_installpam -i
106 #       dh_installmime -i
107 #       dh_installinit -i
108 #       dh_installcron -i
109 #       dh_installinfo -i
110 #       dh_undocumented -i
111 #       dh_installman -i
112 #       dh_link -i
113 #       dh_strip -i
114         dh_compress -i
115         dh_fixperms -i
116 #       dh_perl -i
117 #       dh_python -i
118 #       dh_makeshlibs -i
119         dh_installdeb -i
120 #       dh_shlibdeps -i
121         dh_gencontrol -i
122         dh_md5sums -i
123         dh_builddeb -i
124
125 binary-arch: build-arch install-arch
126         dh_testdir
127         dh_testroot
128
129 # automatically keep track of api version
130         echo Ion:ApiVersion=$$((cat version.h; echo ION_API_VERSION) \
131                 | cpp -P | tail -1 | sed 's/"//g') >>debian/ion3.substvars
132
133         dh_installchangelogs -a
134         dh_installdocs -a
135         rm -f $(INSTDIR)/usr/share/doc/ion3/LICENSE
136         mv $(INSTDIR)/usr/share/doc/ion3/ChangeLog $(INSTDIR)/usr/share/doc/ion3/changelog
137 #       dh_installexamples -a
138 #       dh_install -a
139         dh_installmenu -a
140         install -m644 debian/ion3.menu-method.i18n \
141                 $(INSTDIR)/etc/menu-methods/ion3-i18n
142
143         cat $(CURDIR)/debian/patches/extra/debian-menu.cfg >> $(INSTDIR)/etc/X11/ion3/cfg_ioncore.lua
144
145         dh_installdebconf -a
146 #       dh_installlogrotate -a
147 #       dh_installemacsen -a
148 #       dh_installpam -a
149 #       dh_installmime -a
150 #       dh_installinit -a
151 #       dh_installcron -a
152 #       dh_installinfo -a
153 #       dh_undocumented -a
154 #       dh_installman -a
155         dh_link -a
156 #       dh_strip -a
157         dh_compress -a -X.lua
158         dh_fixperms -a
159 #       dh_perl -a
160 #       dh_python -a
161 #       dh_makeshlibs -a
162         dh_installdeb -a
163         sed -i 's/^UPSTREAM_VERSION=/UPSTREAM_VERSION=$(UPSTREAM_VERSION)/' \
164                 debian/ion3/DEBIAN/postinst
165         dh_shlibdeps -a
166         dh_gencontrol -a
167         dh_md5sums -a
168         dh_builddeb -a
169
170 binary: binary-indep binary-arch
171 .PHONY: build-indep build-arch build clean binary-indep binary-arch binary \
172         install-indep install-arch unpatch