else
AC_MSG_CHECKING([doxygen >= $DOXYGEN_REQ_VER])
DOXYGEN_VER=$($DOXYGEN --version)
- AX_COMPARE_VERSION([$DOXYGEN_VER],[ge],[DOXYGEN_REQ_VER],
- [AC_MSG_RESULT([$DOXYGEN_VER, yes])],
+ AX_COMPARE_VERSION([$DOXYGEN_VER],[ge],[DOXYGEN_REQ_VER],
+ [AC_MSG_RESULT([$DOXYGEN_VER, yes])],
[AC_MSG_RESULT([$DOXYGEN_VER, no, documentation disabled]); enable_doxygen_doc="no"])
fi
fi
--- /dev/null
+diff --git a/tools/Makefile.am b/tools/Makefile.am
+index 992530b..470ac84 100644
+--- a/tools/Makefile.am
++++ b/tools/Makefile.am
+@@ -6,6 +6,8 @@ trietool_SOURCES = trietool.c
+ trietool_LDADD = \
+ $(top_builddir)/datrie/libdatrie.la \
+ $(ICONV_LIBS)
++trietool_CFLAGS = -fPIC
++trietool_LDFLAGS = -pie
+
+ OLD_PROG_NAME=trietool-0.2
+
--- /dev/null
+diff --git a/configure.ac b/configure.ac
+index 3d4a711..aa2b304 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -109,18 +109,18 @@ AC_ARG_ENABLE(doxygen-doc,
+ [disable document generation with doxygen])],
+ , enable_doxygen_doc="yes")
+
+-if test "x$enable_doxygen_doc" = "xyes"; then
+- AC_CHECK_PROG(DOXYGEN,doxygen,doxygen,no)
+- if test "x$DOXYGEN" = "xno"; then
+- enable_doxygen_doc="no"
+- else
+- AC_MSG_CHECKING([doxygen >= $DOXYGEN_REQ_VER])
+- DOXYGEN_VER=$($DOXYGEN --version)
+- AX_COMPARE_VERSION([$DOXYGEN_VER],[ge],[DOXYGEN_REQ_VER],
+- [AC_MSG_RESULT([$DOXYGEN_VER, yes])],
+- [AC_MSG_RESULT([$DOXYGEN_VER, no, documentation disabled]); enable_doxygen_doc="no"])
+- fi
+-fi
++# if test "x$enable_doxygen_doc" = "xyes"; then
++# AC_CHECK_PROG(DOXYGEN,doxygen,doxygen,no)
++# if test "x$DOXYGEN" = "xno"; then
++# enable_doxygen_doc="no"
++# else
++# AC_MSG_CHECKING([doxygen >= $DOXYGEN_REQ_VER])
++# DOXYGEN_VER=$($DOXYGEN --version)
++# AX_COMPARE_VERSION([$DOXYGEN_VER],[ge],[DOXYGEN_REQ_VER],
++# [AC_MSG_RESULT([$DOXYGEN_VER, yes])],
++# [AC_MSG_RESULT([$DOXYGEN_VER, no, documentation disabled]); enable_doxygen_doc="no"])
++# fi
++# fi
+
+ dnl where to install the doxygen-generated HTML doc
+ AC_ARG_WITH(html-docdir,
--- /dev/null
+<manifest>
+ <request>
+ <domain name="_"/>
+ </request>
+</manifest>
--- /dev/null
+Name: libdatrie
+Version: 0.2.13
+Release: 0
+License: LGPL-2.1+
+Summary: Double-Array Trie Library
+Url: http://linux.thai.net/~thep/datrie/datrie.html
+Group: System/Libraries
+Source: %{name}-%{version}.tar.gz
+Source1: Add-pie-compile-option.patch
+Source2: Fix_AC_MSG_RESULT_undefied.patch
+Source99: baselibs.conf
+Source1001: libdatrie.manifest
+
+BuildRequires: pkg-config
+
+%description
+This is an implementation of double-array structure for representing
+trie, as proposed by Junichi Aoe.
+
+Summary: Double-Array Trie Library
+Group: Development/Libraries/C and C++
+
+%package devel
+Summary: Double-Array Trie Library (development)
+Group: Development/Libraries/C and C++
+Requires: libdatrie = %{version}
+
+%description devel
+This is an implementation of double-array structure for representing
+trie, as proposed by Junichi Aoe.
+
+This package contains the development files for libdatrie.
+
+%prep
+%setup -q
+cp %{SOURCE1001} .
+%__patch -p1 < %{SOURCE1}
+%__patch -p1 < %{SOURCE2}
+
+%build
+autoreconf -fi
+
+chmod +x ./configure
+%configure \
+ --disable-static --with-pic \
+ --disable-doxygen-doc
+%__make %{?_smp_mflags}
+
+%check
+# %__make check || exit 0
+
+%install
+%make_install
+%remove_docs
+
+%post -p /sbin/ldconfig
+
+%postun -p /sbin/ldconfig
+
+%files
+%manifest %{name}.manifest
+%license COPYING
+%{_libdir}/libdatrie.so.1*
+
+%files devel
+%manifest %{name}.manifest
+%license COPYING
+%{_bindir}/trietool
+%{_bindir}/trietool-0.2
+%{_includedir}/datrie/
+%{_libdir}/libdatrie.so
+%{_libdir}/pkgconfig/datrie-0.2.pc