From 109e3e6635494da972f6368e7f7bc0a1a7bcfa89 Mon Sep 17 00:00:00 2001 From: Yves Arrouye Date: Wed, 22 Nov 2000 00:46:13 +0000 Subject: [PATCH] ICU-678 manage the $(libdir)/icu/current symlink in every package (overkill for the data package, I guess) X-SVN-Rev: 2984 --- .gitignore | 2 ++ icu4c/debian/.cvsignore | 2 ++ icu4c/debian/changelog | 6 ++++ icu4c/debian/icu.postinst.in | 10 +++++++ icu4c/debian/icu.prerm.in | 21 +++++++------- icu4c/debian/postinst.in | 55 ++++++++++++++++++++++++++++++++++++ icu4c/debian/prerm.in | 46 ++++++++++++++++++++++++++++++ icu4c/debian/rules | 27 +++++++++--------- 8 files changed, 144 insertions(+), 25 deletions(-) create mode 100644 icu4c/debian/postinst.in create mode 100644 icu4c/debian/prerm.in diff --git a/.gitignore b/.gitignore index ca9c2017e49..fd9593ad09b 100644 --- a/.gitignore +++ b/.gitignore @@ -27,6 +27,8 @@ icu4c/debian/icu.prerm icu4c/debian/libicu-dev icu4c/debian/libicu[0-9]* icu4c/debian/libicu[0-9]*.p* +icu4c/debian/postinst +icu4c/debian/prerm icu4c/debian/tmp icu4c/source/Makefile icu4c/source/README diff --git a/icu4c/debian/.cvsignore b/icu4c/debian/.cvsignore index e740eb49388..59d3e28207a 100644 --- a/icu4c/debian/.cvsignore +++ b/icu4c/debian/.cvsignore @@ -9,6 +9,8 @@ icu-locales icu-data icu-i18ndata tmp +postinst +prerm icu.postinst icu.prerm libicu[0-9]*.p* diff --git a/icu4c/debian/changelog b/icu4c/debian/changelog index b8bd5071208..b06316ab8e2 100644 --- a/icu4c/debian/changelog +++ b/icu4c/debian/changelog @@ -1,3 +1,9 @@ +icu (1.7-1) unstable; urgency=low + + * Update to ICU version 1.7. + + -- Yves Arrouye Tue, 21 Nov 2000 14:09:37 -0800 + icu (1.6.0.1-20001113-2) unstable; urgency=low * New snapshot with better ISO-2022. diff --git a/icu4c/debian/icu.postinst.in b/icu4c/debian/icu.postinst.in index 90f5c33231a..a8d908fb710 100644 --- a/icu4c/debian/icu.postinst.in +++ b/icu4c/debian/icu.postinst.in @@ -24,6 +24,16 @@ set -e case "$1" in configure) + # Adjust the current ICU link in /usr/lib/icu + + icucurrent=`2>/dev/null ls -dp /usr/lib/icu/* | sed -n 's,.*/\([^/]*\)/$,\1,p'| sort -rn | head -1` + cd /usr/lib/icu + rm -f current + if test x"$icucurrent" != x + then + ln -s "$icucurrent" current + fi + prefix=@prefix@ exec_prefix=@exec_prefix@ diff --git a/icu4c/debian/icu.prerm.in b/icu4c/debian/icu.prerm.in index 737e40d06eb..a52bff1d65a 100644 --- a/icu4c/debian/icu.prerm.in +++ b/icu4c/debian/icu.prerm.in @@ -17,19 +17,18 @@ set -e case "$1" in remove|upgrade|deconfigure) - prefix=@prefix@ - exec_prefix=@exec_prefix@ + # Adjust the current ICU link in /usr/lib/icu - # Set ICU_DATA for ease of testing files. It is not necessary to - # export it as we are guaranteed that the binaries we invoke will - # use the right directory. But we're not taking chances with the - # future :) - - ICU_DATA=@libdir@/@PACKAGE@/@VERSION@ - export ICU_DATA - - rm -f $ICU_DATA/cnvalias.dat + icucurrent=`2>/dev/null ls -dp /usr/lib/icu/* | sed -n -e '/\/@VERSION@\//d' -e 's,.*/\([^/]*\)/$,\1,p' | head -1` + cd /usr/lib/icu + rm -f current + if test x"$icucurrent" != x + then + ln -s "$icucurrent" current + fi +# install-info --quiet --remove /usr/info/foo.info.gz ;; + failed-upgrade) ;; *) diff --git a/icu4c/debian/postinst.in b/icu4c/debian/postinst.in new file mode 100644 index 00000000000..2aa2a3dddb4 --- /dev/null +++ b/icu4c/debian/postinst.in @@ -0,0 +1,55 @@ +#! /bin/sh +# postinst script for foo +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `configure' +# * `abort-upgrade' +# * `abort-remove' `in-favour' +# +# * `abort-deconfigure' `in-favour' +# `removing' +# +# for details, see /usr/share/doc/packaging-manual/ +# +# quoting from the policy: +# Any necessary prompting should almost always be confined to the +# post-installation script, and should be protected with a conditional +# so that unnecessary prompting doesn't happen if a package's +# installation fails and the `postinst' is called with `abort-upgrade', +# `abort-remove' or `abort-deconfigure'. + +case "$1" in + configure) + # Adjust the current ICU link in /usr/lib/icu + + icucurrent=`2>/dev/null ls -dp /usr/lib/icu/* | sed -n 's,.*/\([^/]*\)/$,\1,p'| sort -rn | head -1` + cd /usr/lib/icu + rm -f current + if test x"$icucurrent" != x + then + ln -s "$icucurrent" current + fi + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 0 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 + + diff --git a/icu4c/debian/prerm.in b/icu4c/debian/prerm.in new file mode 100644 index 00000000000..4edd04f4095 --- /dev/null +++ b/icu4c/debian/prerm.in @@ -0,0 +1,46 @@ +#! /bin/sh +# prerm script for foo +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `remove' +# * `upgrade' +# * `failed-upgrade' +# * `remove' `in-favour' +# * `deconfigure' `in-favour' +# `removing' +# +# for details, see /usr/share/doc/packaging-manual/ + +case "$1" in + remove|upgrade|deconfigure) + # Adjust the current ICU link in /usr/lib/icu + + icucurrent=`2>/dev/null ls -dp /usr/lib/icu/* | sed -n -e '/\/@VERSION@\//d' -e 's,.*/\([^/]*\)/$,\1,p' | head -1` + cd /usr/lib/icu + rm -f current + if test x"$icucurrent" != x + then + ln -s "$icucurrent" current + fi +# install-info --quiet --remove /usr/info/foo.info.gz + ;; + failed-upgrade) + ;; + *) + echo "prerm called with unknown argument \`$1'" >&2 + exit 0 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 + + diff --git a/icu4c/debian/rules b/icu4c/debian/rules index d9ef5764d31..a47ea221db2 100755 --- a/icu4c/debian/rules +++ b/icu4c/debian/rules @@ -66,10 +66,19 @@ $(builddir)/configure-stamp: cd $(builddir); CFLAGS='$(CFLAGS)' CXXFLAGS='$(CFLAGS)' INSTALL_PROGRAM='$(INSTALL_PROGRAM)' $(builddir_relative_srcdir)/configure --srcdir=$(builddir_relative_srcdir) --prefix=/usr --mandir=/usr/share/man --sysconfdir=/etc --with-data-packaging=files --disable-rpath --enable-shared --enable-static --disable-samples touch $@ -build: $(builddir)/configure-stamp $(builddir)/build-stamp +build: $(builddir)/configure-stamp debian-files $(builddir)/build-stamp -$(builddir)/build-stamp: - @$(MAKE) -f debian/rules $(addprefix debian/,$(DEBIAN_FILES)) +# Build some Debian files +DEBIAN_FILES=control icu.conffiles postinst prerm icu.postinst icu.prerm libicu$(lib_version_major).postinst + +debian/%: debian/%.in + cd $(builddir) \ + && CONFIG_FILES=$(builddir_relative_topdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status + +debian-files: $(addprefix debian/,$(DEBIAN_FILES)) + +$(builddir)/build-stamp: + @$(MAKE) -f debian/rules dh_testdir @@ -106,16 +115,6 @@ install: build binary-indep: build install # We have nothing to do by default. -# Build some Debian files -DEBIAN_FILES = control icu.conffiles icu.postinst icu.prerm libicu$(lib_version_major).prerm.in libicu$(lib_version_major).prerm libicu$(lib_version_major).postinst - -debian/libicu$(lib_version_major).%: debian/libicu.% - cp $< $@ - -debian/%: debian/%.in - cd $(builddir) \ - && CONFIG_FILES=$(builddir_relative_topdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status - # Build architecture-dependent files here. binary-arch: build install # dh_testversion @@ -220,4 +219,4 @@ update-changelog: fi binary: update-changelog binary-indep binary-arch -.PHONY: build clean binary-indep binary-arch binary install update-changelog +.PHONY: build clean binary-indep binary-arch binary install debian-files update-changelog