From 0a702a0bef9e1b86c62a1b0072c02526e945308b Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Mon, 14 Aug 2006 13:37:12 +0000 Subject: [PATCH] zebra{srv,idx}-1.3 installed with symlinks (alternatives). This allows Zebra 1.3 to co-exist with Zebra 2.0. --- Makefile.am | 5 +++-- configure.in | 4 +++- debian/changelog | 6 ++++++ debian/idzebra.postinst | 16 ++++++++++++++++ debian/idzebra.prerm | 11 +++++++++++ debian/postinst | 2 -- debian/rules | 5 +---- doc/Makefile.am | 14 +++++++++----- index/Makefile.am | 17 ++++++++++++++--- 9 files changed, 63 insertions(+), 17 deletions(-) create mode 100644 debian/idzebra.postinst create mode 100644 debian/idzebra.prerm delete mode 100644 debian/postinst diff --git a/Makefile.am b/Makefile.am index ba7d72e..d80498f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,4 +1,4 @@ -## $Id: Makefile.am,v 1.14.2.2 2006-06-07 07:43:47 adam Exp $ +## $Id: Makefile.am,v 1.14.2.3 2006-08-14 13:37:12 adam Exp $ AUTOMAKE_OPTIONS=foreign @@ -22,7 +22,8 @@ dist-hook: cp $(srcdir)/debian/control $(distdir)/debian cp $(srcdir)/debian/changelog $(distdir)/debian cp $(srcdir)/debian/rules $(distdir)/debian - cp $(srcdir)/debian/postinst $(distdir)/debian + cp $(srcdir)/debian/*.postinst $(distdir)/debian + cp $(srcdir)/debian/*.prerm $(distdir)/debian cp $(srcdir)/debian/copyright $(distdir)/debian mkdir -p $(distdir)/perl cd $(srcdir)/perl && ./doswig diff --git a/configure.in b/configure.in index 43b72cc..e560ef7 100644 --- a/configure.in +++ b/configure.in @@ -1,8 +1,10 @@ dnl Zebra, Index Data Aps, 1995-2006 -dnl $Id: configure.in,v 1.91.2.24 2006-08-14 08:37:47 adam Exp $ +dnl $Id: configure.in,v 1.91.2.25 2006-08-14 13:37:12 adam Exp $ dnl AC_INIT(include/zebraver.h) AM_INIT_AUTOMAKE(idzebra,1.3.37) +PACKAGE_SUFFIX="-1.3" +AC_SUBST(PACKAGE_SUFFIX) dnl ------ Substitutions AC_SUBST(TCL_INCLUDE) AC_SUBST(TCL_LIB) diff --git a/debian/changelog b/debian/changelog index 2053d96..5493d90 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +idzebra (1.3.37-2) unstable; urgency=low + + * zebra{srv,idx}-1.3 installed with symlinks (alternatives). + + -- Adam Dickmeiss Mon, 14 Aug 2006 15:34:40 +0200 + idzebra (1.3.37-1) unstable; urgency=low * Internal. Upstream. diff --git a/debian/idzebra.postinst b/debian/idzebra.postinst new file mode 100644 index 0000000..fab1e6c --- /dev/null +++ b/debian/idzebra.postinst @@ -0,0 +1,16 @@ +#!/bin/sh + +set -e + +if [ "$1" != configure ]; then exit 0; fi + +update-alternatives --quiet --install /usr/bin/zebraidx zebraidx \ + /usr/bin/zebraidx-1.3 50 \ + --slave /usr/share/man/man1/zebraidx.1.gz zebraidx.1.gz \ + /usr/share/man/man1/zebraidx-1.3.1.gz + +update-alternatives --quiet --install /usr/bin/zebrasrv zebrasrv \ + /usr/bin/zebrasrv-1.3 50 \ + --slave /usr/share/man/man8/zebrasrv.8.gz zebrasrv.8.gz \ + /usr/share/man/man8/zebrasrv-1.3.8.gz + diff --git a/debian/idzebra.prerm b/debian/idzebra.prerm new file mode 100644 index 0000000..75b2cb3 --- /dev/null +++ b/debian/idzebra.prerm @@ -0,0 +1,11 @@ +#!/bin/sh + +set -e + +case "$1" in + remove|deconfigure) + update-alternatives --quiet --remove zebraidx /usr/bin/zebraidx-1.3 + update-alternatives --quiet --remove zebrasrv /usr/bin/zebrasrv-1.3 + ;; + *) +esac diff --git a/debian/postinst b/debian/postinst deleted file mode 100644 index bfa9a1d..0000000 --- a/debian/postinst +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -# Postinst script for Zebra diff --git a/debian/rules b/debian/rules index 51c465a..fdcc478 100755 --- a/debian/rules +++ b/debian/rules @@ -97,7 +97,7 @@ binary-arch: build install dh_installdeb -p idzebra #dh_installman -p idzebra doc/zebraidx.1 doc/zebrasrv.8 - dh_installman -p idzebra debian/tmp/usr/share/man/man1/zebraidx.1 debian/tmp/usr/share/man/man8/zebrasrv.8 + dh_installman -p idzebra debian/tmp/usr/share/man/man1/zebraidx-1.3.1 debian/tmp/usr/share/man/man8/zebrasrv-1.3.8 dh_strip dh_compress -a @@ -105,9 +105,6 @@ binary-arch: build install dh_shlibdeps -p idzebra $(LOCAL_LINK) - cat debian/postinst >> debian/idzebra/DEBIAN/postinst - chmod +x debian/idzebra/DEBIAN/postinst - dh_gencontrol -p idzebra dh_md5sums -p idzebra diff --git a/doc/Makefile.am b/doc/Makefile.am index c010adf..704cdaf 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -1,4 +1,4 @@ -## $Id: Makefile.am,v 1.23.2.1 2004-08-19 13:10:23 adam Exp $ +## $Id: Makefile.am,v 1.23.2.2 2006-08-14 13:37:18 adam Exp $ docdir=$(datadir)/doc/@PACKAGE@ SUPPORTFILES = \ @@ -34,7 +34,7 @@ HTMLFILES = \ PNGFILES=zebra.png EPSFILES=zebra.eps -MANFILES=zebraidx.1 zebrasrv.8 +MANFILES=zebraidx$(PACKAGE_SUFFIX).1 zebrasrv$(PACKAGE_SUFFIX).8 REFFILES=zebraidx-man.sgml zebrasrv-man.sgml @@ -45,13 +45,15 @@ EXTRA_DIST = $(XMLFILES) $(SUPPORTFILES) $(REFFILES) \ $(doc_DATA) $(EPSFILES) $(man_MANS) $(REFFILES) \ zvrank.txt marc_indexing.xml -zebraidx.1: zebraidx-man.sgml zebraidx-options.xml zebraidx-commands.xml +zebraidx$(PACKAGE_SUFFIX).1: zebraidx-man.sgml zebraidx-options.xml zebraidx-commands.xml if test ! -f zebraidx-options.xml ; then ln -s $(srcdir)/zebraidx-options.xml .; fi if test ! -f zebraidx-commands.xml ; then ln -s $(srcdir)/zebraidx-commands.xml .; fi docbook2man $(srcdir)/zebraidx-man.sgml + mv zebraidx.1 zebraidx$(PACKAGE_SUFFIX).1 -zebrasrv.8: zebrasrv-man.sgml +zebrasrv$(PACKAGE_SUFFIX).8: zebrasrv-man.sgml docbook2man $(srcdir)/zebrasrv-man.sgml + mv zebrasrv.8 zebrasrv$(PACKAGE_SUFFIX).8 $(HTMLFILES): $(XMLFILES) jade -E14 -D $(srcdir) -d zebrahtml.dsl -t sgml $(srcdir)/xml.dcl zebra.xml @@ -98,4 +100,6 @@ dist-hook: fi \ done - +install-data-hook: + cd $(DESTDIR)$(man1dir) && ln -sf zebraidx$(PACKAGE_SUFFIX).1 zebraidx.1 + cd $(DESTDIR)$(man8dir) && ln -sf zebrasrv$(PACKAGE_SUFFIX).8 zebrasrv.8 diff --git a/index/Makefile.am b/index/Makefile.am index 867246a..8f7bdcf 100644 --- a/index/Makefile.am +++ b/index/Makefile.am @@ -1,6 +1,6 @@ -## $Id: Makefile.am,v 1.23.2.1 2006-03-24 13:47:29 adam Exp $ +## $Id: Makefile.am,v 1.23.2.2 2006-08-14 13:37:20 adam Exp $ -noinst_PROGRAMS = apitest kdump +noinst_PROGRAMS = apitest kdump zebrash noinst_LIBRARIES = libzebra.a @@ -17,7 +17,7 @@ libzebra_a_LIBADD = \ ../recctrl/librecctrl.a ../data1/libdata1.a ../bfile/libbfile.a \ ../dfa/libdfa.a ../util/libutil.a -bin_PROGRAMS = zebraidx zebrasrv zebrash +bin_PROGRAMS = zebraidx zebrasrv zebraidx_SOURCES = main.c zebrasrv_SOURCES = zserver.c @@ -39,3 +39,14 @@ libzebra.a: $(libzebra_a_OBJECTS) $(libzebra_a_DEPENDENCIES) ar cru libzebra.a $(libzebra_a_OBJECTS) atmp/*.o -rm -fr atmp $(RANLIB) libzebra.a + +install-exec-hook: + cd $(DESTDIR)$(bindir); for p in $(bin_PROGRAMS); do \ + mv -f $$p $$p$(PACKAGE_SUFFIX); \ + ln -sf $$p$(PACKAGE_SUFFIX) $$p; \ + done + +uninstall-hook: + cd $(DESTDIR)$(bindir) && for p in $(bin_PROGRAMS); do \ + rm -f $$p$(PACKAGE_SUFFIX); \ + done -- 1.7.10.4