#!/usr/bin/make -f # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 export DH_OPTIONS VERSION := $(shell dpkg-parsechangelog | awk '/^Version:/ { print $$2 }') EXPECTED_AC_VERSION := $(shell echo "$(VERSION)" | cut -d. -f1,2) AC_VERSION := $(shell grep -w '^AC_INIT' configure.ac | cut -d' ' -f2 | \ sed 's/[][,]//g') MANGLED_VERSION := $(subst ~,-,$(VERSION)) ifneq ($(EXPECTED_AC_VERSION),$(AC_VERSION)) $(warning Version $(VERSION) in debian/changelog does not match $(AC_VERSION) in configure.ac!) endif DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH) PYTHON := $(shell pyversions -r) console-setup-depends := console-setup (>= $(shell cd d-i/source/console-setup && dpkg-parsechangelog | awk '/Version:/ {print $$2}')) update: $(MAKE) -C d-i update update-local: $(MAKE) -C d-i update UPDATE_LOCAL=1 build: build-stamp build-stamp: dh_testdir $(MAKE) -f /usr/share/quilt/quilt.make patch PYTHON=$(PYTHON) dh_auto_configure dh_auto_build $(MAKE) -C d-i build touch build-stamp check: # Sanity-check before upload. find -name debian -prune -o -name \*.py -print | xargs py_compilefiles find -type f \( -name \*.pyc -o -name \*.pyo \) -print0 | xargs -0r rm -f # Check the syntax of any shell scripts. set -e; for x in $$(find -type f -print0 | xargs -0 file -i | grep "text/x-shellscript" | cut -d':' -f1); do \ sh -n $$x; \ done pychecker: ./run-pychecker clean: check dh_testdir dh_testroot $(MAKE) -f /usr/share/quilt/quilt.make unpatch $(MAKE) -C d-i clean dh_auto_clean dh_clean rm -f debian/kbdnames.gz $(MAKE) -C d-i check d-i/source/console-setup/Keyboard/MyKeyboardNames.pl: $(MAKE) -C d-i/source/console-setup/Keyboard MyKeyboardNames.pl \ pc105.tree xkbdir=/usr/share/X11/xkb debian/kbdnames.gz: d-i/source/console-setup/Keyboard/MyKeyboardNames.pl ( cd d-i/source/console-setup/Keyboard \ && ./kbdnames-maker MyKeyboardNames.pl \ | grep -v '^C[*]' | grep -v '[*]model[*]' | sort | gzip -9 ) >$@ ubiquity/keyboard_names.py: d-i/source/console-setup/Keyboard/MyKeyboardNames.pl d-i/make-keyboard-names $< > $@ install: DH_OPTIONS= install: build ubiquity/keyboard_names.py debian/kbdnames.gz dh_testdir dh_testroot dh_prep cp debian/ubiquity.dirs-any debian/ubiquity.dirs ifneq (,$(wildcard debian/ubiquity.dirs-$(DEB_HOST_ARCH))) cat debian/ubiquity.dirs-$(DEB_HOST_ARCH) >> debian/ubiquity.dirs endif dh_installdirs # For the meantime, nearly everything automake wants to install is # part of the GTK frontend. ifndef UBIQUITY_NO_GTK $(MAKE) install DESTDIR=$(CURDIR)/debian/ubiquity-frontend-gtk \ pythondir=\$${prefix}/lib/ubiquity \ pyexecdir=\$${prefix}/lib/ubiquity rm -rf debian/ubiquity-frontend-gtk/usr/share/applications \ debian/ubiquity-frontend-gtk/usr/share/ubiquity/pixmaps mv -n debian/ubiquity-frontend-gtk/usr/lib/ubiquity/ubiquity \ debian/ubiquity/usr/lib/ubiquity/ rm -f debian/ubiquity/usr/lib/ubiquity/ubiquity/_osextras.a \ debian/ubiquity/usr/lib/ubiquity/ubiquity/_osextras.la endif $(MAKE) -C d-i install cp debian/ubiquity.install-any debian/ubiquity.install ifneq (,$(wildcard debian/ubiquity.install-$(DEB_HOST_ARCH))) cat debian/ubiquity.install-$(DEB_HOST_ARCH) >> debian/ubiquity.install endif ifdef UBIQUITY_NO_GTK dh_install -Nubiquity-frontend-gtk -Noem-config-gtk else ifdef UBIQUITY_NO_KDE dh_install -Nubiquity-frontend-kde -Noem-config-kde else dh_install endif endif dh_di_numbers # Bits of manual installation that can't be done by dh_install install bin/ubiquity-wrapper debian/ubiquity/usr/bin/ubiquity sed 's/@VERSION@/$(VERSION)/g' bin/ubiquity \ > debian/ubiquity/usr/lib/ubiquity/bin/ubiquity chmod +x debian/ubiquity/usr/lib/ubiquity/bin/ubiquity # sed 's,/usr/lib/apt-setup,/usr/lib/ubiquity/apt-setup,g' \ # d-i/source/apt-setup/apt-setup \ # > debian/ubiquity/usr/lib/ubiquity/apt-setup/apt-setup # chmod +x debian/ubiquity/usr/lib/ubiquity/apt-setup/apt-setup install d-i/source/apt-setup/finish-install.apt-cdrom-setup \ debian/ubiquity/usr/lib/ubiquity/apt-setup/finish-install if [ -e "d-i/source/base-installer/kernel/$(DEB_HOST_ARCH).sh" ]; then \ install -m644 d-i/source/base-installer/kernel/$(DEB_HOST_ARCH).sh \ debian/ubiquity/usr/lib/ubiquity/base-installer/kernel.sh; \ fi install d-i/source/clock-setup/debian/clock-setup.postinst \ debian/ubiquity/usr/lib/ubiquity/clock-setup/clock-setup sed -e '/^rcsfile=/ { s/.*/exit 0/; q }' \ d-i/source/clock-setup/finish-install.d/10clock-setup \ > debian/ubiquity/usr/lib/ubiquity/clock-setup/finish-install chmod +x debian/ubiquity/usr/lib/ubiquity/clock-setup/finish-install sed -e 's,/usr/share/console-setup-mini/console-setup.config,/var/lib/dpkg/info/console-setup.config,g' \ -e 's,^\([[:space:]]*\)update-initramfs,\1: update-initramfs,' \ d-i/source/console-setup/debian/console-setup.postinst \ > debian/ubiquity/usr/lib/ubiquity/console-setup/console-setup.postinst chmod +x debian/ubiquity/usr/lib/ubiquity/console-setup/console-setup.postinst sed 's,\(finish-install=\).*,\1/dev/null,' \ d-i/source/hw-detect/debian/hw-detect/bin/hw-detect \ > debian/ubiquity/bin/hw-detect chmod +x debian/ubiquity/bin/hw-detect ifeq ($(DEB_HOST_ARCH),sparc) sed 's,/usr/share/hw-detect,/usr/lib/ubiquity/hw-detect,g' \ d-i/source/hw-detect/discover-sbus.sh \ > debian/ubiquity/bin/discover-sbus chmod +x debian/ubiquity/bin/discover-sbus endif set -e; for x in languagemap localechooser post-base-installer; do \ sed 's,/usr/share/localechooser,/usr/lib/ubiquity/localechooser,g' \ d-i/source/localechooser/$$x \ > debian/ubiquity/usr/lib/ubiquity/localechooser/$$x; \ chmod +x debian/ubiquity/usr/lib/ubiquity/localechooser/$$x; \ done sed 's/\\\$${!TAB}/ /g' \ debian/ubiquity/usr/lib/ubiquity/localechooser/localechooser \ > debian/ubiquity/usr/lib/ubiquity/localechooser/localechooser-debconf chmod +x debian/ubiquity/usr/lib/ubiquity/localechooser/localechooser-debconf install d-i/source/localechooser/finish-install \ debian/ubiquity/usr/lib/ubiquity/localechooser/ install d-i/source/tzsetup/post-base-installer.d/*tzsetup \ debian/ubiquity/usr/lib/ubiquity/tzsetup/post-base-installer sed -e 's,/target/,/,g;s,/target,/,g' \ debian/ubiquity/usr/lib/ubiquity/tzsetup/post-base-installer \ > debian/oem-config/usr/lib/ubiquity/tzsetup/post-base-installer-oem chmod +x debian/oem-config/usr/lib/ubiquity/tzsetup/post-base-installer-oem sed -i -e 's,db_input medium tzsetup/selected,db_input high tzsetup/selected,' \ -e 's,/usr/share/tzsetup/tzmap,/usr/lib/ubiquity/tzsetup/tzmap,g' \ debian/ubiquity/usr/lib/ubiquity/tzsetup/tzsetup cp debian/ubiquity/usr/lib/ubiquity/user-setup/reserved-usernames \ debian/ubiquity/usr/lib/ubiquity/user-setup/reserved-usernames-oem echo oem >> debian/ubiquity/usr/lib/ubiquity/user-setup/reserved-usernames-oem set -e; for x in user-setup user-setup-ask user-setup-apply; do \ sed -e 's,/usr/lib/user-setup,/usr/lib/ubiquity/user-setup,g' \ -e 's,/bin/sh,/bin/bash,g' \ d-i/source/user-setup/$$x \ > debian/ubiquity/usr/lib/ubiquity/user-setup/$$x; \ chmod +x debian/ubiquity/usr/lib/ubiquity/user-setup/$$x; \ done sed -i -e 's,db_input high user-setup/encrypt-home,db_input medium user-setup/encrypt-home,' \ debian/ubiquity/usr/lib/ubiquity/user-setup/user-setup-ask sed -e 's,reserved-usernames,reserved-usernames-oem,g' \ debian/ubiquity/usr/lib/ubiquity/user-setup/user-setup-ask \ > debian/ubiquity/usr/lib/ubiquity/user-setup/user-setup-ask-oem chmod +x debian/ubiquity/usr/lib/ubiquity/user-setup/user-setup-ask-oem install d-i/source/debian-installer-utils/post-base-installer.d/10register-module \ debian/ubiquity/usr/lib/ubiquity/debian-installer-utils/register-module.post-base-installer sed -e 's,/target/,/,g;s,/target,/,g' \ d-i/source/debian-installer-utils/post-base-installer.d/10register-module \ > debian/oem-config/usr/lib/ubiquity/debian-installer-utils/register-module.post-base-installer-oem chmod +x debian/oem-config/usr/lib/ubiquity/debian-installer-utils/register-module.post-base-installer-oem ifeq ($(DEB_HOST_ARCH),armel) install d-i/source/flash-kernel/debian/flash-kernel-installer.postinst \ debian/ubiquity/usr/lib/ubiquity/flash-kernel/flash-kernel-installer endif ifeq ($(DEB_HOST_ARCH),powerpc) install d-i/source/kboot-installer/debian/postinst \ debian/ubiquity/usr/lib/ubiquity/kboot-installer/kboot-installer install d-i/source/yaboot-installer/debian/postinst \ debian/ubiquity/usr/lib/ubiquity/yaboot-installer/yaboot-installer endif ifeq ($(DEB_HOST_ARCH),sparc) install d-i/source/silo-installer/debian/silo-installer.postinst \ debian/ubiquity/usr/lib/ubiquity/silo-installer/silo-installer endif set -e; for size in 16 22 32 48 64 128; do \ mkdir -p debian/ubiquity-frontend-kde/usr/share/icons/hicolor/$${size}x$${size}/apps; \ cp desktop/hi$${size}-app-ubiquity.png debian/ubiquity-frontend-kde/usr/share/icons/hicolor/$${size}x$${size}/apps/ubiquity.png; \ done BINARY_INDEP_OPTIONS := -i ifdef UBIQUITY_NO_GTK BINARY_INDEP_OPTIONS += -Nubiquity-frontend-gtk -Noem-config-gtk endif ifdef UBIQUITY_NO_KDE BINARY_INDEP_OPTIONS += -Nubiquity-frontend-kde -Noem-config-kde endif # Build architecture-independent files here. binary-indep: DH_OPTIONS=$(BINARY_INDEP_OPTIONS) binary-indep: install dh_testdir dh_testroot dh_installchangelogs dh_installdocs dh_installdebconf # oem-config dh_installinit -n --name=oem-config dh_installinit -n --name=oem-config-debconf dh_installman dh_lintian dh_link dh_strip dh_compress dh_fixperms DH_OPTIONS= dh_pycentral -pubiquity-frontend-gtk \ -pubiquity-frontend-kde dh_installdeb dh_shlibdeps dh_gencontrol -- -Vmangled-version='$(MANGLED_VERSION)' dh_md5sums dh_builddeb # Build architecture-dependent files here. binary-arch: DH_OPTIONS=-a binary-arch: install dh_testdir dh_testroot dh_installchangelogs dh_installdocs dh_installdebconf echo >> debian/ubiquity/DEBIAN/templates po2debconf --podir=debian/imported-po \ debian/ubiquity.templates-imported \ >> debian/ubiquity/DEBIAN/templates echo >> debian/ubiquity/DEBIAN/templates grep-dctrl -XFTemplate base-installer/kernel/linux/link_in_boot \ d-i/templates \ >> debian/ubiquity/DEBIAN/templates if [ "$$(tail -n1 debian/ubiquity/DEBIAN/templates)" ]; then \ echo >> debian/ubiquity/DEBIAN/templates; \ fi grep-dctrl -v -FTemplate base-installer/ d-i/templates \ >> debian/ubiquity/DEBIAN/templates # ubiquity dh_installinit --no-start --name=ubiquity dh_installman dh_link dh_strip dh_compress dh_fixperms dh_pycentral dh_installdeb dh_shlibdeps dh_gencontrol -- -V'console-setup-depends=$(console-setup-depends)' -Vmangled-version='$(MANGLED_VERSION)' dh_md5sums dh_builddeb binary: binary-indep binary-arch .PHONY: build clean binary-indep binary-arch binary install