Package: leafpad
Version: 0.8.9-2
Severity: normal
Tags: patch

Attached is a untested patch.  Hope it works!

Regards,

-- 
roktas
From 3788f25e38b4ffd5d8baf0eefbb6c06d407782fa Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Recai_Okta=C5=9F?= <[EMAIL PROTECTED]>
Date: Mon, 9 Apr 2007 00:37:10 +0300
Subject: [PATCH] Add support for gnome-text-editor alternative.
---
 debian/postinst |   27 +++++++++++++++++++++++++++
 debian/prerm    |   23 +++++++++++++++++++++++
 2 files changed, 50 insertions(+), 0 deletions(-)

diff --git a/debian/postinst b/debian/postinst
new file mode 100644
index 0000000..1037c5c
--- /dev/null
+++ b/debian/postinst
@@ -0,0 +1,27 @@
+#! /bin/sh
+
+set -e
+
+case "$1" in
+configure)
+       # Register leafpad as a gnome-text-editor in the alternatives system.
+       update-alternatives \
+               --install /usr/bin/gnome-text-editor \
+                       gnome-text-editor /usr/bin/leafpad 40 \
+               --slave /usr/share/man/man1/gnome-text-editor.1.gz \
+                       gnome-text-editor.1.gz /usr/share/man/man1/leafpad.1.gz
+       ;;
+
+abort-upgrade|abort-remove|abort-deconfigure)
+       ;;
+
+*)
+       echo "postinst called with unknown argument \`$1'" >&2
+       exit 0
+       ;;
+esac
+
+#DEBHELPER#
+
+exit 0
+
diff --git a/debian/prerm b/debian/prerm
new file mode 100644
index 0000000..a54e0f7
--- /dev/null
+++ b/debian/prerm
@@ -0,0 +1,23 @@
+#! /bin/sh
+
+set -e
+
+case "$1" in
+remove|upgrade|deconfigure)
+       # Unregister leafpad as a gnome-text-editor in the alternatives system.
+       update-alternatives --remove gnome-text-editor /usr/bin/leafpad ||:
+       ;;
+
+failed-upgrade)
+       ;;
+
+*)
+       echo "prerm called with unknown argument \`$1'" >&2
+       exit 0
+       ;;
+esac
+
+#DEBHELPER#
+
+exit 0
+
-- 
1.4.1.1

Attachment: signature.asc
Description: Digital signature

Reply via email to