From 1bccc71f13bdcf5147c1bbac8bbf64558d75a9cf3d57586c145323fc40903445 Mon Sep 17 00:00:00 2001
From: Jan Engelhardt <jengelh@inai.de>
Date: Tue, 23 Jul 2013 18:00:42 +0000
Subject: [PATCH] Add missing symlinks

OBS-URL: https://build.opensuse.org/package/show/X11:common:Factory/icu?expand=0&rev=32
---
 icu-versioning.diff | 19 +++++++++++++++++++
 icu.changes         |  5 +++++
 icu.spec            | 11 +++++++++--
 3 files changed, 33 insertions(+), 2 deletions(-)

diff --git a/icu-versioning.diff b/icu-versioning.diff
index 4faaaf4..31ad556 100644
--- a/icu-versioning.diff
+++ b/icu-versioning.diff
@@ -9,6 +9,25 @@ SO numbers. They did that before, and they have done it with
 
 Thus, we will use the full version as the SO identifier in openSUSE.
 
+Details:
+
+U_ICU_VERSION_SHORT was (example) "49" before when there was a
+libicui18n.so.49. Now, since there is a libicui18n.so.51.2, we need to
+change U_ICU_VERSION_SHORT. But the define's documentation says
+"without dots", and I do not know how much downstream code depends on
+the non-dot feature, if at all. Anyhow, to bypass this question to
+which we have no definite answer, U_ICU_VERSION_SHORT is instead simply
+defined to "51_2" and we "fix" (read like: hack) it with symlinks.
+
+However, the ICU source also uses U_ICU_VERSION_SHORT to construct the
+path to its data files. However, as there is no "icudt51_2l.dat", but
+only a "icudt51l.dat", U_ICU_VERSION_MAJOR_STR is introduced for
+ICU-internal use, so that I do not have to edit more dirty Makefiles to
+produce a "icudt51_2l.dat" instead. In fact, placing the version number
+in "icudt51l" seems redundant, since that file is in a version-specific
+directory anyway (/usr/share/icu/51.2/) — another point where ICU
+development seems to not pay enough attention.
+
 ---
  source/common/icuplug.c                 |    2 +-
  source/common/umapfile.c                |    6 +++---
diff --git a/icu.changes b/icu.changes
index 6081378..de2eaee 100644
--- a/icu.changes
+++ b/icu.changes
@@ -1,3 +1,8 @@
+-------------------------------------------------------------------
+Tue Jul 23 18:00:11 UTC 2013 - jengelh@inai.de
+
+- Add missing symlinks and update description in icu-versioning.diff
+
 -------------------------------------------------------------------
 Sun Jul 14 13:50:44 UTC 2013 - jengelh@inai.de
 
diff --git a/icu.spec b/icu.spec
index a5c8ac4..f9f7cfd 100644
--- a/icu.spec
+++ b/icu.spec
@@ -149,11 +149,18 @@ make install DESTDIR="$b";
 # does as few as possible, but that means we need some additional
 # cleanup in the spec file now.
 #
-for i in "$b/%_libdir"/*.so.[0-9]*; do
+pushd "$b/%_libdir/"
+for i in *.so.[0-9]*; do
+	echo "Looking at $i"
 	if [ "${i##*.so.}" != "%version" ]; then
-		rm -fv "$i";
+		rm -fv "$i"
+		continue
 	fi
+	# Because U_ICU_VERSION_SHORT is "51_2" and not "51.2",
+	# create some symlinks.
+	ln -s "$i" "${i%%%version}%aversion"
 done
+popd
 
 # /usr/lib/rpm/elfdeps requires +x bit and not all had it at one point
 chmod a+rx "$b/%_libdir"/lib*.so.*