From 90842f34dca698e0b5d3a681a40da9440f3cc425 Mon Sep 17 00:00:00 2001 From: Ryan Niebur Date: Fri, 29 May 2009 00:43:52 -0700 Subject: [PATCH] also set a priority number for the alternative in the distro config file. This sets it to 50 for debian, and 39 for ubuntu (just under firefox). This addresses the other half of the ubuntu diff. --- debian/changelog | 5 ++++- debian/clean | 1 + debian/config/Debian.h | 2 ++ debian/config/Ubuntu.h | 2 ++ debian/midori.postinst.base | 2 +- debian/rules | 18 +++++++++++++++--- 6 files changed, 25 insertions(+), 5 deletions(-) diff --git a/debian/changelog b/debian/changelog index 380e8ac3..bad5d1a0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -15,8 +15,11 @@ midori (0.1.7-1) UNRELEASED; urgency=low * change the default-homepage patch to use the files in debian/config/ to set the default homepage based on whether it's debian, ubuntu, etc (second half of ubuntu diff) + * also set a priority number for the alternative in the distro config + file. This sets it to 50 for debian, and 39 for ubuntu (just under + firefox). This addresses the other half of the ubuntu diff. - -- Ryan Niebur Thu, 28 May 2009 23:28:24 -0700 + -- Ryan Niebur Fri, 29 May 2009 00:43:08 -0700 midori (0.1.6-1) experimental; urgency=low diff --git a/debian/clean b/debian/clean index d2a36720..d95aab58 100644 --- a/debian/clean +++ b/debian/clean @@ -1 +1,2 @@ midori/midori-debian.h +debian/midori.postinst diff --git a/debian/config/Debian.h b/debian/config/Debian.h index 318a23d1..beb0223a 100644 --- a/debian/config/Debian.h +++ b/debian/config/Debian.h @@ -1 +1,3 @@ #define DEBIAN_DISTRO_DEFAULT_HOMEPAGE "file:///usr/share/doc/midori/user/midori.html" +#define DEBIAN_WWW_ALTERNATIVES_PRIORITY 50 + diff --git a/debian/config/Ubuntu.h b/debian/config/Ubuntu.h index d3466f2c..5f07884e 100644 --- a/debian/config/Ubuntu.h +++ b/debian/config/Ubuntu.h @@ -1 +1,3 @@ #define DEBIAN_DISTRO_DEFAULT_HOMEPAGE "file:///usr/share/ubuntu-artwork/home/index.html" +#define DEBIAN_WWW_ALTERNATIVES_PRIORITY 39 + diff --git a/debian/midori.postinst.base b/debian/midori.postinst.base index 5c1f3cc1..32f4b76c 100644 --- a/debian/midori.postinst.base +++ b/debian/midori.postinst.base @@ -4,7 +4,7 @@ case "$1" in configure) update-alternatives \ --install /usr/bin/x-www-browser \ - x-www-browser /usr/bin/midori 50 \ + x-www-browser /usr/bin/midori DEBIAN_WWW_ALTERNATIVES_PRIORITY \ --slave /usr/share/man/man1/x-www-browser.1.gz \ x-www-browser.1.gz /usr/share/man/man1/midori.1.gz ;; diff --git a/debian/rules b/debian/rules index eb6c4d37..1f9544f4 100755 --- a/debian/rules +++ b/debian/rules @@ -1,12 +1,16 @@ #!/usr/bin/make -f +CMD=$(shell echo $@ | sed 's/override_//') + +CONFIG_FILE=debian/config/$(shell lsb_release -is).h + %: dh --with quilt $@ override_dh_quilt_patch: - ln -sf ../debian/config/$(shell lsb_release -is).h midori/midori-debian.h + ln -sf ../$(CONFIG_FILE) midori/midori-debian.h test -e midori/midori-debian.h - dh_quilt_patch + $(CMD) override_dh_auto_clean: ./waf --nocache distclean @@ -26,5 +30,13 @@ override_dh_auto_install: ./waf --nocache install --destdir debian/tmp rm -f debian/tmp/usr/share/doc/midori/COPYING debian/tmp/usr/share/doc/midori/TRANSLATE +PRIORITY=$(shell sed -r -e '/DEBIAN_WWW_ALTERNATIVES_PRIORITY/ !d' -e 's/.* ([^ ]*)$$/\1/' $(CONFIG_FILE)) + +debian/midori.postinst: debian/midori.postinst.base + sed "s/DEBIAN_WWW_ALTERNATIVES_PRIORITY/$(PRIORITY)/g" debian/midori.postinst.base > debian/midori.postinst + +override_dh_installdeb: debian/midori.postinst + $(CMD) + override_dh_strip: - dh_strip --dbg-package=midori-dbg + $(CMD) --dbg-package=midori-dbg -- 2.39.5