source: ubiquity/trunk/fuentes/debian/rules @ 1091

Last change on this file since 1091 was 1091, checked in by mabarracus, 3 years ago

Try to improve compile time

  • Property svn:executable set to *
File size: 11.1 KB
Line 
1#!/usr/bin/make -f
2
3# Uncomment this to turn on verbose mode.
4#export DH_VERBOSE=1
5
6export DH_OPTIONS
7export LC_ALL=C.UTF-8
8
9VERSION := $(shell dpkg-parsechangelog | awk '/^Version:/ { print $$2 }')
10EXPECTED_AC_VERSION := $(shell echo "$(VERSION)" | cut -d. -f1,2)
11AC_VERSION := $(shell grep -w '^AC_INIT' configure.ac | cut -d' ' -f2 | \
12                        sed 's/[][,]//g')
13MANGLED_VERSION := $(subst ~,-,$(VERSION))
14
15ifneq ($(EXPECTED_AC_VERSION),$(AC_VERSION))
16$(warning Version $(VERSION) in debian/changelog does not match $(AC_VERSION) in configure.ac!)
17endif
18
19DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
20DEB_HOST_ARCH_OS ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)
21DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
22
23console-setup-depends := console-setup (>= $(shell cd d-i/source/console-setup && dpkg-parsechangelog | awk '/Version:/ {print $$2}'))
24
25update:
26        $(MAKE) -C d-i update
27
28update-local:
29        $(MAKE) -C d-i update UPDATE_LOCAL=1
30
31build: build-arch build-indep
32build-arch: build-stamp
33build-indep: build-stamp
34
35build-stamp:
36        dh_testdir
37        $(MAKE) -f /usr/share/quilt/quilt.make patch
38        cp debian/real-po/ca_ES@valencia.po po/
39        dh_autoreconf -- ./autogen.sh
40        dh_auto_configure -- --libexecdir=\$${prefix}/lib
41        dh_auto_build --parallel
42        $(MAKE) -j4 -C d-i build
43        convert -resize 32x32 data/ubiquity.svg pixmaps/ubiquity.xpm
44
45        touch build-stamp
46
47check:
48        # Sanity-check before upload.
49        find -name debian -prune -o -name \*.py -print | xargs py3compile
50        find -type f \( -name \*.pyc -o -name \*.pyo \) -print0 | xargs -0r rm -f
51        find -name __pycache__ -print0 | xargs -0r rm -rf
52        # Check the syntax of any shell scripts.
53        set -e; for x in $$(find -type f \! -name \*.po \! -name \*.pot -print0 | xargs -0 file -i | grep "text/x-shellscript" | cut -d':' -f1); do \
54                sh -n $$x; \
55        done
56        # Check the syntax of any Python scripts.
57        ./tests/run-pyflakes
58        ./tests/run-pep8
59
60pychecker:
61        ./run-pychecker
62
63clean: check
64        dh_testdir
65        dh_testroot
66
67        $(MAKE) -C d-i clean
68        dh_auto_clean
69        dh_autoreconf_clean
70        dh_clean
71        rm -rf build-locale tests/partman-tree pixmaps/ubiquity.xpm
72
73        $(MAKE) -C d-i check
74
75d-i/source/console-setup/Keyboard/KeyboardNames.pl:
76        $(MAKE) -C d-i/source/console-setup/Keyboard KeyboardNames.pl \
77                xkbdir=/usr/share/X11/xkb
78
79debian/kbdnames.gz: d-i/source/console-setup/Keyboard/KeyboardNames.pl
80        d-i/source/console-setup/Keyboard/kbdnames-maker $< | gzip -9c > $@
81
82install: install-stamp
83
84install-stamp: DH_OPTIONS=
85install-stamp: build-stamp debian/kbdnames.gz
86        dh_testdir
87        dh_testroot
88        dh_prep
89        cp debian/ubiquity.dirs-any debian/ubiquity.dirs
90ifneq (,$(wildcard debian/ubiquity.dirs-$(DEB_HOST_ARCH)))
91        cat debian/ubiquity.dirs-$(DEB_HOST_ARCH) >> debian/ubiquity.dirs
92endif
93        dh_installdirs
94        dh_installmenu
95
96        $(MAKE) install DESTDIR=`pwd`/debian/tmp
97
98        $(MAKE) -C d-i install
99
100        cp debian/ubiquity.install-any debian/ubiquity.install
101ifneq (,$(wildcard debian/ubiquity.install-$(DEB_HOST_ARCH)))
102        cat debian/ubiquity.install-$(DEB_HOST_ARCH) >> debian/ubiquity.install
103endif
104ifdef UBIQUITY_NO_GTK
105        dh_install -Nubiquity-frontend-gtk -Noem-config-gtk
106else
107ifdef UBIQUITY_NO_KDE
108        dh_install -Nubiquity-frontend-kde -Noem-config-kde
109else
110        dh_install
111endif
112endif
113        # We don't need the source files installed
114        rm -rf debian/ubiquity-frontend-kde/usr/share/ubiquity/qt/images/source/
115
116        dh_di_numbers
117
118        # Bits of manual installation that can't be done by dh_install
119
120        install bin/ubiquity-wrapper debian/ubiquity/usr/bin/ubiquity
121        sed 's/@VERSION@/$(VERSION)/g' bin/ubiquity \
122                > debian/ubiquity/usr/lib/ubiquity/bin/ubiquity
123        chmod +x debian/ubiquity/usr/lib/ubiquity/bin/ubiquity
124        sed 's,/usr/lib/apt-setup,/usr/lib/ubiquity/apt-setup,g' \
125                d-i/source/apt-setup/apt-setup \
126                > debian/ubiquity/usr/lib/ubiquity/apt-setup/apt-setup
127        chmod +x debian/ubiquity/usr/lib/ubiquity/apt-setup/apt-setup
128
129        install d-i/source/apt-setup/finish-install.d/10apt-cdrom-setup \
130                debian/ubiquity/usr/lib/ubiquity/apt-setup/finish-install
131        if [ -e "d-i/source/base-installer/kernel/$(DEB_HOST_ARCH).sh" ]; then \
132                install -m644 d-i/source/base-installer/kernel/$(DEB_HOST_ARCH).sh \
133                        debian/ubiquity/usr/lib/ubiquity/base-installer/kernel.sh; \
134        fi
135        install d-i/source/clock-setup/debian/clock-setup.postinst \
136                debian/ubiquity/usr/lib/ubiquity/clock-setup/clock-setup
137        sed -e '/^# Update target system configuration/ { s/.*/exit 0/; q }' \
138                d-i/source/clock-setup/finish-install.d/10clock-setup \
139                > debian/ubiquity/usr/lib/ubiquity/clock-setup/finish-install
140        chmod +x debian/ubiquity/usr/lib/ubiquity/clock-setup/finish-install
141        sed -e 's,/usr/share/console-setup/keyboard-configuration.config,/var/lib/dpkg/info/keyboard-configuration.config,g' \
142            -e 's,^\([[:space:]]*\)update-initramfs,\1: update-initramfs,' \
143                d-i/source/console-setup/debian/keyboard-configuration.postinst \
144                > debian/ubiquity/usr/lib/ubiquity/console-setup/keyboard-configuration.postinst
145        (cd d-i/source/console-setup && \
146         debian/preprocessor $(CURDIR)/debian/ubiquity/usr/lib/ubiquity/console-setup/keyboard-configuration.postinst && \
147         debian/preprocessor $(CURDIR)/debian/ubiquity/usr/share/ubiquity/console-setup-apply)
148        chmod +x debian/ubiquity/usr/lib/ubiquity/console-setup/keyboard-configuration.postinst
149        sed 's,\(finish_install=\).*,\1/dev/null,' \
150                d-i/source/hw-detect/debian/hw-detect/bin/hw-detect \
151                > debian/ubiquity/bin/hw-detect
152        chmod +x debian/ubiquity/bin/hw-detect
153        set -e; for x in languagemap localechooser; do \
154                sed 's,/usr/share/localechooser,/usr/lib/ubiquity/localechooser,g' \
155                        d-i/source/localechooser/$$x \
156                        > debian/ubiquity/usr/lib/ubiquity/localechooser/$$x; \
157                chmod +x debian/ubiquity/usr/lib/ubiquity/localechooser/$$x; \
158        done
159        cp -a d-i/source/localechooser/post-base-installer.d/05localechooser \
160                debian/ubiquity/usr/lib/ubiquity/localechooser/post-base-installer
161        patch debian/ubiquity/usr/lib/ubiquity/localechooser/post-base-installer \
162                < d-i/patches/localechooser-post-base-installer.patch
163        chmod +x debian/ubiquity/usr/lib/ubiquity/localechooser/post-base-installer
164        sed 's/\\\$${!TAB}/ /g' \
165                debian/ubiquity/usr/lib/ubiquity/localechooser/localechooser \
166                > debian/ubiquity/usr/lib/ubiquity/localechooser/localechooser-debconf
167        chmod +x debian/ubiquity/usr/lib/ubiquity/localechooser/localechooser-debconf
168        install d-i/source/localechooser/finish-install.d/05localechooser \
169                debian/ubiquity/usr/lib/ubiquity/localechooser/finish-install
170        install d-i/source/tzsetup/post-base-installer.d/*tzsetup \
171                debian/ubiquity/usr/lib/ubiquity/tzsetup/post-base-installer
172        sed -e 's,/target/,/,g;s,/target,/,g' \
173                debian/ubiquity/usr/lib/ubiquity/tzsetup/post-base-installer \
174                > debian/oem-config/usr/lib/ubiquity/tzsetup/post-base-installer-oem
175        chmod +x debian/oem-config/usr/lib/ubiquity/tzsetup/post-base-installer-oem
176        sed -i -e 's,db_input medium tzsetup/selected,db_input high tzsetup/selected,' \
177               -e 's,/usr/share/tzsetup/tzmap,/usr/lib/ubiquity/tzsetup/tzmap,g' \
178                debian/ubiquity/usr/lib/ubiquity/tzsetup/tzsetup
179        cp debian/ubiquity/usr/lib/ubiquity/user-setup/reserved-usernames \
180                debian/ubiquity/usr/lib/ubiquity/user-setup/reserved-usernames-oem
181        echo oem >> debian/ubiquity/usr/lib/ubiquity/user-setup/reserved-usernames-oem
182        set -e; for x in user-setup user-setup-ask user-setup-apply; do \
183                sed -e 's,/usr/lib/user-setup,/usr/lib/ubiquity/user-setup,g' \
184                    -e 's,/bin/sh,/bin/bash,g' \
185                        d-i/source/user-setup/$$x \
186                        > debian/ubiquity/usr/lib/ubiquity/user-setup/$$x; \
187                chmod +x debian/ubiquity/usr/lib/ubiquity/user-setup/$$x; \
188        done
189        sed -i -e 's,db_input high user-setup/encrypt-home,db_input medium user-setup/encrypt-home,' \
190                debian/ubiquity/usr/lib/ubiquity/user-setup/user-setup-ask
191        sed -e 's,reserved-usernames,reserved-usernames-oem,g' \
192                debian/ubiquity/usr/lib/ubiquity/user-setup/user-setup-ask \
193                > debian/ubiquity/usr/lib/ubiquity/user-setup/user-setup-ask-oem
194        chmod +x debian/ubiquity/usr/lib/ubiquity/user-setup/user-setup-ask-oem
195        install d-i/source/debian-installer-utils/list-devices-$(DEB_HOST_ARCH_OS) \
196                debian/ubiquity/bin/list-devices
197        install d-i/source/debian-installer-utils/post-base-installer.d/10register-module \
198                debian/ubiquity/usr/lib/ubiquity/debian-installer-utils/register-module.post-base-installer
199        sed -e 's,/target/,/,g;s,/target,/,g' \
200                d-i/source/debian-installer-utils/post-base-installer.d/10register-module \
201                > debian/oem-config/usr/lib/ubiquity/debian-installer-utils/register-module.post-base-installer-oem
202        chmod +x debian/oem-config/usr/lib/ubiquity/debian-installer-utils/register-module.post-base-installer-oem
203ifneq (,$(filter armel armhf,$(DEB_HOST_ARCH)))
204        install d-i/source/flash-kernel/debian/flash-kernel-installer.postinst \
205                debian/ubiquity/usr/lib/ubiquity/flash-kernel/flash-kernel-installer
206endif
207ifeq ($(DEB_HOST_ARCH),powerpc)
208        install d-i/source/yaboot-installer/debian/postinst \
209                debian/ubiquity/usr/lib/ubiquity/yaboot-installer/yaboot-installer
210endif
211
212        touch install-stamp
213
214tests: install-stamp
215ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
216        CODE=0; env -i LANG=C.UTF-8 ./tests/run --xvfb-log debian/xvfb.log || CODE=$$?; \
217        echo "xauth/Xrdb output:"; \
218        cat debian/xvfb.log; \
219        rm -f debian/xvfb.log; \
220        exit $$CODE
221endif
222
223BINARY_INDEP_OPTIONS := -i
224ifdef UBIQUITY_NO_GTK
225BINARY_INDEP_OPTIONS += -Noem-config-gtk
226endif
227ifdef UBIQUITY_NO_KDE
228BINARY_INDEP_OPTIONS += -Nubiquity-frontend-kde -Noem-config-kde
229endif
230
231# Build architecture-independent files here.
232binary-indep: DH_OPTIONS=$(BINARY_INDEP_OPTIONS)
233binary-indep: install-stamp
234        dh_testdir
235        dh_testroot
236        dh_installchangelogs
237        dh_installdocs
238        dh_installdebconf
239        # oem-config
240        dh_systemd_enable --name=oem-config
241        dh_installinit -n --name=oem-config
242        dh_installinit -n --name=oem-config-debconf
243        dh_installman
244        dh_lintian
245        dh_link
246        dh_scour
247        dh_strip
248        dh_compress
249        dh_fixperms
250        dh_python3 /usr/lib/ubiquity
251        dh_installdeb
252        dh_shlibdeps
253        dh_gencontrol -- -Vmangled-version='$(MANGLED_VERSION)'
254        dh_md5sums
255        NO_PNG_PKG_MANGLE=1 dh_builddeb -- -Zxz
256
257BINARY_ARCH_OPTIONS := -a
258ifdef UBIQUITY_NO_GTK
259BINARY_ARCH_OPTIONS += -Nubiquity-frontend-gtk
260endif
261
262# Build architecture-dependent files here.
263binary-arch: DH_OPTIONS=$(BINARY_ARCH_OPTIONS)
264binary-arch: tests install-stamp
265        dh_testdir
266        dh_testroot
267        dh_installchangelogs
268        dh_installdocs
269        dh_installdebconf
270        echo >> debian/ubiquity/DEBIAN/templates
271        po2debconf --podir=debian/imported-po \
272                debian/ubiquity.templates-imported \
273                >> debian/ubiquity/DEBIAN/templates
274        echo >> debian/ubiquity/DEBIAN/templates
275        grep-dctrl -XFTemplate base-installer/kernel/linux/link_in_boot \
276                d-i/templates \
277                >> debian/ubiquity/DEBIAN/templates
278        if [ "$$(tail -n1 debian/ubiquity/DEBIAN/templates)" ]; then \
279                echo >> debian/ubiquity/DEBIAN/templates; \
280        fi
281        grep-dctrl -v -FTemplate base-installer/ d-i/templates \
282                >> debian/ubiquity/DEBIAN/templates
283        # ubiquity
284        dh_systemd_enable --name=ubiquity
285        dh_installinit --no-start --name=ubiquity
286        dh_installman
287        dh_lintian
288        dh_link
289        dh_scour
290        dh_strip
291        dh_compress
292        dh_fixperms
293        dh_python3 /usr/lib/ubiquity
294        dh_installdeb
295        dh_shlibdeps
296        dh_gencontrol -- -V'console-setup-depends=$(console-setup-depends)' -Vmangled-version='$(MANGLED_VERSION)'
297        dh_md5sums
298        NO_PNG_PKG_MANGLE=1 dh_builddeb -- -Zxz
299
300binary: binary-indep binary-arch
301.PHONY: build clean binary-indep binary-arch binary install tests
Note: See TracBrowser for help on using the repository browser.