diff --git a/.cvsignore b/.cvsignore index e69de29..4526255 100644 --- a/.cvsignore +++ b/.cvsignore @@ -0,0 +1,2 @@ +libdatrie-0.1.1.tar.gz +libthai-0.1.7.tar.gz diff --git a/libthai-0.1.7-libdatrie-0.1.1-build-static.patch b/libthai-0.1.7-libdatrie-0.1.1-build-static.patch new file mode 100644 index 0000000..b5ce3e4 --- /dev/null +++ b/libthai-0.1.7-libdatrie-0.1.1-build-static.patch @@ -0,0 +1,33 @@ +--- libthai-0.1.7/src/Makefile.am.orig 2007-01-15 02:28:45.000000000 -0500 ++++ libthai-0.1.7/src/Makefile.am 2007-01-15 02:29:44.000000000 -0500 +@@ -24,7 +24,9 @@ + $(top_builddir)/src/thwchar/libthwchar.la \ + $(top_builddir)/src/thwctype/libthwctype.la \ + $(top_builddir)/src/thwstr/libthwstr.la \ +- $(top_builddir)/src/thwbrk/libthwbrk.la ++ $(top_builddir)/src/thwbrk/libthwbrk.la \ ++ $(DATRIE_LIBS) + libthai_la_LDFLAGS = $(no_undefined) \ +- -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) ++ -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \ ++ -export-symbols-regex '^th_.*' + +--- libthai-0.1.7/src/thbrk/Makefile.am.orig 2007-01-15 02:29:30.000000000 -0500 ++++ libthai-0.1.7/src/thbrk/Makefile.am 2007-01-15 02:29:53.000000000 -0500 +@@ -13,5 +13,4 @@ + brk-maximal.c \ + brk-maximal.h + +-libthbrk_la_LIBADD = $(DATRIE_LIBS) + +--- libthai-0.1.7/libdatrie-0.1.1/datrie/Makefile.am.orig 2007-01-15 02:25:34.000000000 -0500 ++++ libthai-0.1.7/libdatrie-0.1.1/datrie/Makefile.am 2007-01-15 02:25:41.000000000 -0500 +@@ -8,7 +8,7 @@ + + INCLUDES = -I$(top_srcdir) + +-lib_LTLIBRARIES = libdatrie.la ++noinst_LTLIBRARIES = libdatrie.la + + libdatrie_la_SOURCES = \ + typedefs.h \ diff --git a/libthai.spec b/libthai.spec new file mode 100644 index 0000000..dda496f --- /dev/null +++ b/libthai.spec @@ -0,0 +1,124 @@ +%define datrie_version 0.1.1 +%define datrie libdatrie-%{datrie_version} + +Summary: Thai language support routines +Name: libthai +Version: 0.1.7 +Release: 3%{?dist} +License: LGPL +Group: System Environment/Libraries +Source: ftp://linux.thai.net/pub/thailinux/software/libthai/libthai-%{version}.tar.gz +Source1: ftp://linux.thai.net/pub/thailinux/software/libthai/libdatrie-%{datrie_version}.tar.gz +Patch: libthai-0.1.7-libdatrie-0.1.1-build-static.patch +URL: http://linux.thai.net +BuildRoot: %{_tmppath}/%{name}-%{version}-root-%(%{__id_u} -n) + +BuildRequires: pkgconfig +BuildRequires: doxygen +# we edit the Makefile.am's +BuildRequires: automake +BuildRequires: libtool + +%description +LibThai is a set of Thai language support routines aimed to ease +developers' tasks to incorporate Thai language support in their applications. +It includes important Thai-specific functions e.g. word breaking, input and +output methods as well as basic character and string supports. + +%package devel +Summary: Thai language support routines +Group: Development/Libraries +Requires: %{name} = %{version}-%{release} +Requires: pkgconfig + +%description devel +The libthai-devel package includes the header files and developer docs +for the libthai package. + +Install libthai-devel if you want to develop programs which will use +libthai. + +%prep +%setup -q -n %{name}-%{version} -a 1 +%patch -p1 -b .static-build + +%build + +# libthai depends on this library called libdatrie. libdatrie is a +# data-structure implementaiton that the author of libthai ripped out of it. +# However, since libthai is the only user of that code, there's no reason to +# 1) package it separately, 2) use it as a shared library. +# So, we compile it as a libtool convenience library and include in libthai.so, +# and use symbol hiding to hide them (and other internal symbols). +# +# The patch takes care of making datrie into a convenience lib and making sure +# libthai will include it (and hide its symbols), and the exports make sure +# libthai finds the uninstalled libdatrie. We need to call automake, since +# the patch modifies a few Makefile.am's. + +{ + pushd %{datrie} + aclocal + automake + %configure + make + popd +} + +export DATRIE_CFLAGS="-I$PWD/%{datrie}" +export DATRIE_LIBS="$PWD/%{datrie}/datrie/libdatrie.la" +export PATH="$PWD/%{datrie}/tools:$PATH" +aclocal +automake +%configure --disable-static +make + +%install +rm -rf $RPM_BUILD_ROOT + +%makeinstall + +# move installed doc files back to build directory to package themm +# in the right place +mkdir installed-docs +mv $RPM_BUILD_ROOT%{_docdir}/libthai/* installed-docs +rmdir $RPM_BUILD_ROOT%{_docdir}/libthai + +rm $RPM_BUILD_ROOT%{_libdir}/*.la + +%clean +rm -rf $RPM_BUILD_ROOT + +%post -p /sbin/ldconfig + +%postun -p /sbin/ldconfig + +%files +%defattr(-, root, root) +%doc README AUTHORS COPYING ChangeLog TODO +%{_libdir}/lib*.so.* +%{_datadir}/libthai + +%files devel +%defattr(-, root, root) +%doc installed-docs/* +%{_includedir}/thai +%{_libdir}/lib*.so +%{_libdir}/pkgconfig/* +%{_mandir}/man3/* + +%changelog +* Tue Jan 16 2007 Matthias Clasen 0.1.7-3 +- Miscellaneous fixes + +* Tue Jan 16 2007 Behdad Esfahbod 0.1.7-2 +- Apply comments from Matthias Clasen (#222611) +- devel summary improvement +- devel require pkgconfig +- configure --disable-static +- Add comments about the voodoo +- Install docs in the right place + +* Sun Jan 14 2007 Behdad Esfahbod 0.1.7-1 +- Initial package based on package by Supphachoke Suntiwichaya + and Kamthorn Krairaksa for the OLPC. diff --git a/sources b/sources index e69de29..059ddb1 100644 --- a/sources +++ b/sources @@ -0,0 +1,2 @@ +6beadd556169aa58c9210c713d139229 libdatrie-0.1.1.tar.gz +386cc4607ed2e457dd5a1ebdcf4201cb libthai-0.1.7.tar.gz