[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Install hooks - pretty please...



Hi,

I need the install hook support in debian-files to be able to package a 
Finnish spellchecking & hyphenator package and would really appreciate if 
someone with write privileges to CVS could take the time.

It's basically just a matter of implementing the currently non-existing shell 
script /usr/lib/openoffice.org-debian-files/install-hook; here's what Chris 
wrote earlier in response to my proposed patch (attached):

> I think it would be better to pass the package name as a parameter (the
> first?) to all the scripts in a single directory.  A hook can then operate
> only on the package types it needs;
>
>   case $1 in
>     openoffice.org)
>        [...]
>        ;;
>     openoffice.org-l10n-*)
>        [Operations for any langpack...]
>        ;;
>   etc.
>
> I do, however, agree that having separate directories for the operation is
> useful, since hooks may need to run in the opposite order for install and
> remove operations.
>
> So how about:
>
> HOOKDIR="/usr/lib/openoffice.org-debian-files/hooks/$SCRIPT.d"
>
> Also, the format of the hook scripts needs to be documented a little, e.g.
> at the top of the master script itself.

- Jarno
diff -Naur openoffice.org-debian-files-1.0.1/debian/dirs new/debian/dirs
--- openoffice.org-debian-files-1.0.1/debian/dirs	2002-12-01 19:30:23.000000000 +0000
+++ new/debian/dirs	2002-12-17 12:43:12.000000000 +0000
@@ -2,4 +2,4 @@
 usr/share/doc/openoffice.org
 etc/openoffice
 usr/share/lintian/overrides
-
+usr/lib/openoffice.org-debian-files
diff -Naur openoffice.org-debian-files-1.0.1/debian/rules new/debian/rules
--- openoffice.org-debian-files-1.0.1/debian/rules	2002-12-01 19:59:44.000000000 +0000
+++ new/debian/rules	2002-12-17 14:03:53.000000000 +0000
@@ -35,7 +35,11 @@
 		$(CURDIR)/debian/openoffice.org-debian-files/usr/bin
 	install -m755 bin/spadmin \
 		$(CURDIR)/debian/openoffice.org-debian-files/usr/bin/oopadmin
-	
+
+	# install hook file
+	install -m755 lib/install-hook \
+            $(CURDIR)/debian/openoffice.org-debian-files/usr/lib/openoffice.org-debian-files
+
 	# install response file
 	install -m644 etc/autoresponse.conf \
             $(CURDIR)/debian/openoffice.org-debian-files/etc/openoffice
diff -Naur openoffice.org-debian-files-1.0.1/lib/install-hook new/lib/install-hook
--- openoffice.org-debian-files-1.0.1/lib/install-hook	1970-01-01 00:00:00.000000000 +0000
+++ new/lib/install-hook	2002-12-17 13:01:43.000000000 +0000
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+PACKAGE=$1
+SCRIPT=$2
+ALLARGS=$3
+
+HOOKDIR="/usr/lib/openoffice.org-debian-files/hooks/$PACKAGE/$SCRIPT"
+
+if [ -d $HOOKDIR ]; then
+  RUNPARTSCMD="/bin/run-parts "
+  for x in $@; do
+    RUNPARTSCMD="$RUNPARTSCMD --arg $x"
+  done
+  RUNPARTSCMD="$RUNPARTSCMD \"$HOOKDIR\""
+  eval $RUNPARTSCMD
+fi

Reply to: