From 24e3e379b4173cdab266745a5f67ece41e59e69a Mon Sep 17 00:00:00 2001 From: Yves Arrouye Date: Fri, 27 Oct 2000 22:30:42 +0000 Subject: [PATCH] ICU-208 create the $(prefix)/lib/icu/current symlink that Steven wanted, and then put Makefile.inc in the numbered icu directory with a symlink from current/Makefile.inc to where people expect Makefile.inc to be. (Note: at this time, it is not yet possible to install the development files for many ICU releases in the same root). The current link may be used by Xerces-C which links against libicudata (patch submitted upstream). Debian and RPM packages will actually not archive the current symlink but rather maintain it themselves across libicuXX packages installations so that it always points to the highest-numbered version installed on teh system." X-SVN-Rev: 2822 --- icu4c/debian/changelog | 3 +++ icu4c/debian/control | 2 +- icu4c/debian/libicu16.postinst | 10 ++++++++ icu4c/debian/libicu16.prerm | 46 ++++++++++++++++++++++++++++++++++ icu4c/debian/rules | 36 ++++++++++++++------------ icu4c/packaging/rpm/icu.spec | 22 ++++++++++++++++ icu4c/source/Makefile.in | 7 ++++-- 7 files changed, 107 insertions(+), 19 deletions(-) create mode 100644 icu4c/debian/libicu16.prerm diff --git a/icu4c/debian/changelog b/icu4c/debian/changelog index 0ad971ac5cd..b27afc748ef 100644 --- a/icu4c/debian/changelog +++ b/icu4c/debian/changelog @@ -4,6 +4,9 @@ icu (1.6.0.1-20001027-1) unstable; urgency=low /usr/share. * Move convrtrs.txt into /etc/icu, make it a conffile, and generate /usr/lib/icu/1.6.0.1/cnvalias.dat from it at postinst time. + * Manage a /usr/lib/icu/current symbolic link across installations + of the libicuXX packages. The symlink will always point to the + highest numbered version of ICU. -- Yves Arrouye Tue, 26 Oct 2000 11:14:22 -0700 diff --git a/icu4c/debian/control b/icu4c/debian/control index 1e8411ae063..4ba5558e5a1 100644 --- a/icu4c/debian/control +++ b/icu4c/debian/control @@ -60,7 +60,7 @@ Description: Data for ICU (source files) also all the table-based converters provided in the ICU distribution. . This package contains uncompiled source data. Precompiled data are in the - `libicu1' package. + `libicu16' package. Package: icu-i18ndata Priority: extra diff --git a/icu4c/debian/libicu16.postinst b/icu4c/debian/libicu16.postinst index 2a1cffd94a1..7a7a97d48c9 100644 --- a/icu4c/debian/libicu16.postinst +++ b/icu4c/debian/libicu16.postinst @@ -25,6 +25,16 @@ set -e case "$1" in configure) ldconfig + + # 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) diff --git a/icu4c/debian/libicu16.prerm b/icu4c/debian/libicu16.prerm new file mode 100644 index 00000000000..05796f9cb7e --- /dev/null +++ b/icu4c/debian/libicu16.prerm @@ -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 '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 +# 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 37af9c2a312..9fa35ceb9bc 100755 --- a/icu4c/debian/rules +++ b/icu4c/debian/rules @@ -9,15 +9,18 @@ #export DH_VERBOSE=1 # This is the debhelper compatability version to use. -export DH_COMPAT=1 +export DH_COMPAT=2 +firstdir := $(shell sed -n 's/Package: \(.*\)/\1/p' debian/control | head -1) # Where the source for ICU is, where to build srcdir = source builddir = build # ICU installation directories, w/o the initial slash -icudatadir = usr/share/icu/$(version) -iculibdir = usr/lib/icu/$(version) +pkgdatadir = usr/share/icu +icudatadir = $(pkgdatadir)/$(version) +pkglibdir = usr/lib/icu +iculibdir = $(pkglibdir)/$(version) datasrcdir = usr/share/icu/$(version)/data # shared library versions, option 1 @@ -82,8 +85,8 @@ install: build dh_clean -k dh_installdirs - # Add here commands to install the package into debian/tmp. - $(MAKE) -C $(builddir) install DESTDIR=`pwd`/debian/tmp + # Add here commands to install the package into debian/$(firstdir). + $(MAKE) -C $(builddir) install DESTDIR=`pwd`/debian/$(firstdir) # Build architecture-independent files here. @@ -92,7 +95,7 @@ binary-indep: build install # Build some Debian files debian/%: debian/%.in - cd source \ + cd $(builddir) \ && CONFIG_FILES=../$@ CONFIG_HEADERS= $(SHELL) ./config.status DEBIAN_FILES = icu.conffiles icu.postinst icu.prerm @@ -102,11 +105,11 @@ binary-arch: build install $(addprefix debian/,$(DEBIAN_FILES)) # dh_testversion dh_testdir dh_testroot - rm debian/tmp/usr/sbin/gentest + rm debian/$(firstdir)/usr/sbin/gentest # # build libicu${major} package by moving files from icu-dev # - dh_movefiles -plibicu$(major) \ + dh_movefiles --sourcedir=debian/$(firstdir) -plibicu$(major) \ usr/lib/libicuuc.so.* \ usr/lib/libicui18n.so.* \ usr/lib/libicutoolutil.so.* \ @@ -114,7 +117,7 @@ binary-arch: build install $(addprefix debian/,$(DEBIAN_FILES)) # # build icu package by moving files from icu-dev # - dh_movefiles -picu \ + dh_movefiles --sourcedir=debian/$(firstdir) -picu \ etc \ usr/sbin \ $(icudatadir)/README \ @@ -122,12 +125,14 @@ binary-arch: build install $(addprefix debian/,$(DEBIAN_FILES)) $(iculibdir)/u*.dat \ $(iculibdir)/tz.dat \ usr/share/man - rm debian/tmp/$(iculibdir)/cnvalias.dat + rm debian/$(firstdir)/$(pkglibdir)/current + rm debian/$(firstdir)/$(iculibdir)/cnvalias.dat # # build icu-locales package by moving files from icu-dev # - dh_movefiles -picu-locales \ - $(iculibdir) + dh_movefiles --sourcedir=debian/$(firstdir) -picu-locales \ + $(iculibdir)/*.res \ + $(iculibdir)/*.brk # # build icu-data from the source data # @@ -154,9 +159,8 @@ binary-arch: build install $(addprefix debian/,$(DEBIAN_FILES)) # # do a bit of cleanup # - rm -rf debian/tmp/etc debian/tmp/usr/sbin \ - debian/tmp/$(iculibdir) \ - debian/tmp/usr/share/man + rm -rf debian/$(firstdir)/etc debian/$(firstdir)/usr/sbin \ + debian/$(firstdir)/usr/share/man # # continue to prepare packages # @@ -178,7 +182,7 @@ binary-arch: build install $(addprefix debian/,$(DEBIAN_FILES)) dh_compress dh_fixperms # CVS fixup - if test -d CVS; then find debian/tmp -name CVS -print | xargs rm -r; fi + if test -d CVS; then find debian/$(firstdir) -name CVS -print | xargs rm -r; fi # You may want to make some executables suid here. dh_suidregister dh_makeshlibs diff --git a/icu4c/packaging/rpm/icu.spec b/icu4c/packaging/rpm/icu.spec index 854402d7d62..bdecc26a94b 100644 --- a/icu4c/packaging/rpm/icu.spec +++ b/icu4c/packaging/rpm/icu.spec @@ -64,6 +64,27 @@ fi %post -n libicu16 ldconfig +# 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 + +%preun -n libicu16 +# 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 + %prep %setup -q @@ -584,6 +605,7 @@ make install DESTDIR=$RPM_BUILD_ROOT /usr/include/unicode/utf8.h /usr/include/unicode/utrans.h /usr/include/unicode/utypes.h +/usr/lib/icu/1.6.0.1/Makefile.inc /usr/lib/icu/Makefile.inc /usr/share/icu/1.6.0.1/config diff --git a/icu4c/source/Makefile.in b/icu4c/source/Makefile.in index 1940ba7514f..85fe1faa9b6 100644 --- a/icu4c/source/Makefile.in +++ b/icu4c/source/Makefile.in @@ -86,9 +86,12 @@ all-local: $(srcdir)/configure icudefs.mk install-local: $(top_builddir)/config/Makefile.inc @platform_make_fragment@ README $(EXTRA_DATA:%=$(DESTDIR)$(pkglibdir)/$(VERSION)/%) @$(MKINSTALLDIRS) $(DESTDIR)$(pkgdatadir)/$(VERSION)/config - @$(MKINSTALLDIRS) $(DESTDIR)$(pkglibdir) + @$(MKINSTALLDIRS) $(DESTDIR)$(pkglibdir)/$(VERSION) @$(MKINSTALLDIRS) $(DESTDIR)$(sbindir) - $(INSTALL_DATA) $(top_builddir)/config/Makefile.inc $(DESTDIR)$(pkglibdir)/Makefile.inc + $(INSTALL_DATA) $(top_builddir)/config/Makefile.inc $(DESTDIR)$(pkglibdir)/$(VERSION)/Makefile.inc + cd $(DESTDIR)$(pkglibdir); \ + $(RM) current && ln -s $(VERSION) current; \ + $(RM) Makefile.inc && ln -s current/Makefile.inc . $(INSTALL_DATA) @platform_make_fragment@ $(DESTDIR)$(pkgdatadir)/$(VERSION)/config/@platform_make_fragment_name@ $(INSTALL_SCRIPT) $(top_srcdir)/mkinstalldirs $(DESTDIR)$(pkgdatadir)/mkinstalldirs $(INSTALL_SCRIPT) README $(DESTDIR)$(pkgdatadir)/$(VERSION)/README