diff options
| author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2011-03-11 00:38:39 +0100 |
|---|---|---|
| committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2011-03-11 00:38:39 +0100 |
| commit | d53698505300f254bb08fafb0cca5338796c8ef5 (patch) | |
| tree | d8bc5575b04d622180006a50a84fe6c84851b380 /debian | |
| parent | 8610f18e932bce3c97ff8c7a4980a63be49240cb (diff) | |
Add script to get e.g. update-grub called.
Diffstat (limited to 'debian')
| -rw-r--r-- | debian/changelog | 2 | ||||
| -rw-r--r-- | debian/gnumach-image.postinst.in | 66 | ||||
| -rw-r--r-- | debian/gnumach-image.postrm.in | 66 | ||||
| -rw-r--r-- | debian/gnumach-image.preinst.in | 61 | ||||
| -rw-r--r-- | debian/gnumach-image.prerm.in | 64 | ||||
| -rwxr-xr-x | debian/rules | 29 |
6 files changed, 286 insertions, 2 deletions
diff --git a/debian/changelog b/debian/changelog index aec768b..2961147 100644 --- a/debian/changelog +++ b/debian/changelog @@ -30,6 +30,8 @@ gnumach (2:1.3.99.dfsg.git20110305-1) unreleased; urgency=low * debian/rules: Apply package renames in $(pkg{,_xen,_udeb,_dbg,_xen_dbg). * debian/gnumach*.{install,docs}: Rename accordingly. * debian/patches/11_ignore_CSIn.patch: Ignore \E[6n emited by busybox. + * debian/gnumach-image.{preinst,postinst,prerm,postrm}: Add script to get + e.g. update-grub called. -- Samuel Thibault <sthibault@debian.org> Sat, 31 Jul 2010 17:35:20 +0200 diff --git a/debian/gnumach-image.postinst.in b/debian/gnumach-image.postinst.in new file mode 100644 index 0000000..c44672b --- /dev/null +++ b/debian/gnumach-image.postinst.in @@ -0,0 +1,66 @@ +#! /bin/sh +# postinst script +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * <postinst> `configure' <most-recently-configured-version> +# * <old-postinst> `abort-upgrade' <new version> +# * <conflictor's-postinst> `abort-remove' `in-favour' <package> +# <new-version> +# * <deconfigured's-postinst> `abort-deconfigure' `in-favour' +# <failed-install-package> <version> `removing' +# <conflicting-package> <version> +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package +# + +PATH="/sbin:/bin:/usr/sbin:/usr/bin" +KERNEL_IMG_CONF="/etc/kernel-img.conf" +RELEASE="@RELEASE@" +VERSION="@VERSION@" + +case "$1" in + configure) + # Sanitize and quote maintainer script parameters + for p in "$@"; do + q="$(echo "$p" | sed -e "s/'/'\\''/g")" + DEB_MAINT_PARAMS="$DEB_MAINT_PARAMS '$q'" + done + export DEB_MAINT_PARAMS + + # Run /etc/kernel-img.conf postinst hook if defined + postinst_hook=$(sed '/^\s*postinst_hook/!d;s/.*=\s*//' $KERNEL_IMG_CONF 2>/dev/null || true) + if [ -n "$postinst_hook" ] ; then + echo "Running postinst hook script $postinst_hook." 1>&2 + $postinst_hook "$RELEASE" "/boot/gnumach-$RELEASE.gz" + fi + + # Run /etc/kernel/postinst.d/ hooks if they exist + if [ -d "/etc/kernel/postinst.d" ] ; then + run-parts --verbose --exit-on-error \ + --arg=$RELEASE \ + --arg=/boot/gnumach-$RELEASE.gz \ + /etc/kernel/postinst.d + fi + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 + + diff --git a/debian/gnumach-image.postrm.in b/debian/gnumach-image.postrm.in new file mode 100644 index 0000000..1513cad --- /dev/null +++ b/debian/gnumach-image.postrm.in @@ -0,0 +1,66 @@ +#!/bin/sh +# postrm script +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * <postrm> `remove' +# * <postrm> `purge' +# * <old-postrm> `upgrade' <new-version> +# * <new-postrm> `failed-upgrade' <old-version> +# * <new-postrm> `abort-install' +# * <new-postrm> `abort-install' <old-version> +# * <new-postrm> `abort-upgrade' <old-version> +# * <disappearer's-postrm> `disappear' <overwriter> +# <overwriter-version> +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + +PATH="/sbin:/bin:/usr/sbin:/usr/bin" +KERNEL_IMG_CONF="/etc/kernel-img.conf" +RELEASE="@RELEASE@" +VERSION="@VERSION@" + +case "$1" in + remove) + # Sanitize and quote maintainer script parameters + for p in "$@"; do + q="$(echo "$p" | sed -e "s/'/'\\''/g")" + DEB_MAINT_PARAMS="$DEB_MAINT_PARAMS '$q'" + done + export DEB_MAINT_PARAMS + + # Run /etc/kernel-img.conf postrm hook if defined + postrm_hook=$(sed '/^\s*postrm_hook/!d;s/.*=\s*//' $KERNEL_IMG_CONF 2>/dev/null || true) + if [ -n "$postrm_hook" ] ; then + echo "Running postrm hook script $postrm_hook." 1>&2 + $postrm_hook "$RELEASE" "/boot/gnumach-$RELEASE.gz" + fi + + # Run /etc/kernel/postrm.d/ hooks if they exist + if [ -d "/etc/kernel/postrm.d" ]; then + echo "Running /etc/kernel/postrm.d hooks..." 1>&2 + run-parts --verbose --exit-on-error \ + --arg=$RELEASE \ + --arg=/boot/gnumach-$RELEASE.gz \ + /etc/kernel/postrm.d + fi + ;; + + purge|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) + ;; + + *) + echo "postrm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff --git a/debian/gnumach-image.preinst.in b/debian/gnumach-image.preinst.in new file mode 100644 index 0000000..eab4f73 --- /dev/null +++ b/debian/gnumach-image.preinst.in @@ -0,0 +1,61 @@ +#!/bin/sh +# preinst script +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * <new-preinst> `install' +# * <new-preinst> `install' <old-version> +# * <new-preinst> `upgrade' <old-version> +# * <old-preinst> `abort-upgrade' <new-version> +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + +PATH="/sbin:/bin:/usr/sbin:/usr/bin" +KERNEL_IMG_CONF="/etc/kernel-img.conf" +RELEASE="@RELEASE@" +VERSION="@VERSION@" + +case "$1" in + install|upgrade) + # Sanitize and quote maintainer script parameters + for p in "$@"; do + q="$(echo "$p" | sed -e "s/'/'\\''/g")" + DEB_MAINT_PARAMS="$DEB_MAINT_PARAMS '$q'" + done + export DEB_MAINT_PARAMS + + # Run preinst hook if defined + preinst_hook=$(sed '/^\s*preinst_hook/!d;s/.*=\s*//' $KERNEL_IMG_CONF 2>/dev/null || true) + if [ -n "$preinst_hook" ] ; then + echo "Running preinst hook script $preinst_hook." 1>&2 + $preinst_hook "$RELEASE" "/boot/gnumach-$RELEASE.gz" + fi + + # Run /etc/kernel/preinst.d/ hooks if they exist + if [ -d "/etc/kernel/preinst.d" ]; then + echo "Running /etc/kernel/preinst.d hooks..." 1>&2 + run-parts --verbose --exit-on-error \ + --arg=$RELEASE \ + --arg=/boot/gnumach-$RELEASE.gz \ + /etc/kernel/preinst.d + fi + ;; + + abort-upgrade) + ;; + + *) + echo "preinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff --git a/debian/gnumach-image.prerm.in b/debian/gnumach-image.prerm.in new file mode 100644 index 0000000..c82616c --- /dev/null +++ b/debian/gnumach-image.prerm.in @@ -0,0 +1,64 @@ +#!/bin/sh +# prerm script +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * <prerm> `remove' +# * <old-prerm> `upgrade' <new-version> +# * <new-prerm> `failed-upgrade' <old-version> +# * <conflictor's-prerm> `remove' `in-favour' <package> <new-version> +# * <deconfigured's-prerm> `deconfigure' `in-favour' +# <package-being-installed> <version> `removing' +# <conflicting-package> <version> +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + +PATH="/sbin:/bin:/usr/sbin:/usr/bin" +KERNEL_IMG_CONF="/etc/kernel-img.conf" +RELEASE="@RELEASE@" +VERSION="@VERSION@" + +case "$1" in + remove) + # Sanitize and quote maintainer script parameters + for p in "$@"; do + q="$(echo "$p" | sed -e "s/'/'\\''/g")" + DEB_MAINT_PARAMS="$DEB_MAINT_PARAMS '$q'" + done + export DEB_MAINT_PARAMS + + # Run prerm hook if defined + prerm_hook=$(sed '/^\s*prerm_hook/!d;s/.*=\s*//g' $KERNEL_IMG_CONF 2>/dev/null || true) + if [ -n "$prerm_hook" ] ; then + echo "Running prerm hook script $prerm_hook." 1>&2 + $prerm_hook "$RELEASE" "/boot/gnumach-$RELEASE.gz" + fi + + # Run /etc/kernel/prerm.d/ hooks if they exist + if [ -d "/etc/kernel/prerm.d" ]; then + echo "Running /etc/kernel/prerm.d hooks..." 1>&2 + run-parts --verbose --exit-on-error \ + --arg=$RELEASE \ + --arg=/boot/gnumach-$RELEASE.gz \ + /etc/kernel/prerm.d + fi + ;; + + failed-upgrade|upgrade|deconfigure) + ;; + + *) + echo "prerm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff --git a/debian/rules b/debian/rules index 831a7b7..8d31fa4 100755 --- a/debian/rules +++ b/debian/rules @@ -4,8 +4,15 @@ # Rewritten by Guillem Jover <guillem@debian.org> # -VERSION=1.3.99 -MACHINE=486 +FULL_VERSION := $(shell dpkg-parsechangelog | grep ^Version: | sed -e 's/^.*: //g') +NOEPOCH_VERSION := $(shell echo $(FULL_VERSION) | sed -e 's/.*://g') +TAR_VERSION := $(shell echo $(NOEPOCH_VERSION) | sed -e 's/-.*//g') +VERSION := $(shell echo $(TAR_VERSION) | sed -e 's/\.dfsg.*//g') +MAJOR := $(shell echo $(VERSION) | sed -e 's/\..*//g') +DEB_HOST_ARCH_OS := $(shell dpkg-architecture -qDEB_HOST_ARCH_OS) + + +MACHINE := 486 pkg := gnumach-image-$(VERSION)-$(MACHINE) pkg_xen := gnumach-image-$(VERSION)-xen-$(MACHINE) @@ -123,6 +130,11 @@ clean: rm -rf autom4te.cache build-aux rm -f aclocal.m4 config.h.in configure INSTALL Makefile.in find -name '*~' -o -name '*.rej' -o -name '*.orig' | xargs rm -f + + rm -f debian/gnumach-image-*.preinst + rm -f debian/gnumach-image-*.prerm + rm -f debian/gnumach-image-*.postinst + rm -f debian/gnumach-image-*.postrm dh_clean @@ -154,6 +166,19 @@ install: build mv $(D_DBG)/boot/gnumach $(D_DBG)/boot/gnumach-$(VERSION)-$(MACHINE)-dbg mv $(D_XEN_DBG)/boot/gnumach $(D_XEN_DBG)/boot/gnumach-$(VERSION)-xen-$(MACHINE)-dbg +ifeq ($(DEB_HOST_ARCH_OS),hurd) + for script in preinst prerm postinst postrm ; do \ + sed -e "s/@VERSION@/$(VERSION)/g" \ + -e "s/@RELEASE@/$(VERSION)-$(MACHINE)/g" \ + debian/gnumach-image.$$script.in \ + > debian/gnumach-image-$(VERSION)-$(MACHINE).$$script ; \ + sed -e "s/@VERSION@/$(VERSION)/g" \ + -e "s/@RELEASE@/$(VERSION)-xen-$(MACHINE)/g" \ + debian/gnumach-image.$$script.in \ + > debian/gnumach-image-$(VERSION)-xen-$(MACHINE).$$script ; \ + done +endif + binary: binary-indep binary-arch binary-indep: install |
