From: Ronan Le Martret Date: Mon, 15 Sep 2014 10:15:47 +0000 (+0200) Subject: Allow libpinyin to build in cross compile mode. X-Git-Tag: accepted/tizen/common/20140930.171011^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=HEAD;p=platform%2Fupstream%2Flibpinyin.git Allow libpinyin to build in cross compile mode. - Yocto needs cross compile support. - Clean specfile. - Regenerate the configure file. - Remove generate files. - use rpm macro (allow yocto to add var to make command). - Improve rpmlint score. [kevin.thierry: Add missing dependency on pkgconfig.] Change-Id: If73d1592b15a6296c6eb2110811c98cc54f44e84 Signed-off-by: Ronan Le Martret Signed-off-by: Kévin THIERRY --- diff --git a/data/Makefile.am b/data/Makefile.am index 1e80530..90d4e02 100644 --- a/data/Makefile.am +++ b/data/Makefile.am @@ -47,6 +47,9 @@ libpinyin_dbdir = $(libdir)/libpinyin/data CLEANFILES = $(binary_model_data) +utils_storage = ../utils/storage +utils_training = ../utils/training + interpolation2.text: wget http://downloads.sourceforge.net/libpinyin/models/model7.text.tar.gz tar xvf model7.text.tar.gz -C $(top_srcdir)/data @@ -56,9 +59,9 @@ $(tablefiles): interpolation2.text bigram.db: $(textual_model_data) $(RM) $(binary_model_data) - ../utils/storage/gen_binary_files --table-dir $(top_srcdir)/data - ../utils/storage/import_interpolation --table-dir $(top_srcdir)/data < $(top_srcdir)/data/interpolation2.text - ../utils/training/gen_unigram --table-dir $(top_srcdir)/data + $(utils_storage)/gen_binary_files --table-dir $(top_srcdir)/data + $(utils_storage)/import_interpolation --table-dir $(top_srcdir)/data < $(top_srcdir)/data/interpolation2.text + $(utils_training)/gen_unigram --table-dir $(top_srcdir)/data phrase_index.bin pinyin_index.bin $(binfiles): bigram.db diff --git a/packaging/libpinyin.spec b/packaging/libpinyin.spec index f1e78e3..77e92d1 100644 --- a/packaging/libpinyin.spec +++ b/packaging/libpinyin.spec @@ -1,6 +1,6 @@ Name: libpinyin Version: 1.0.0 -Release: 1 +Release: 0 Summary: Library to deal with pinyin License: GPL-2.0+ Group: System/Libraries @@ -8,13 +8,14 @@ URL: https://github.com/libpinyin/libpinyin Source0: http://downloads.sourceforge.net/libpinyin/libpinyin/%{name}-%{version}.tar.gz Source1001: libpinyin.manifest -BuildRequires: db4-devel, glib2-devel +BuildRequires: db4-devel +BuildRequires: glib2-devel +BuildRequires: pkgconfig %description The libpinyin project aims to provide the algorithms core for intelligent sentence-based Chinese pinyin input methods. - %package devel Summary: Development files for %{name} Requires: %{name} = %{version}-%{release} @@ -23,7 +24,6 @@ Requires: %{name} = %{version}-%{release} The %{name}-devel package contains libraries and header files for developing applications that use %{name}. - %package tools Summary: Tools for %{name} Requires: %{name} = %{version}-%{release} @@ -31,36 +31,32 @@ Requires: %{name} = %{version}-%{release} %description tools The %{name}-tools package contains tools. - %prep %setup -q cp %{SOURCE1001} . - %build -%configure --disable-static -make %{?_smp_mflags} +%reconfigure --disable-static +%__make %{?_smp_mflags} %install -make install DESTDIR=$RPM_BUILD_ROOT -find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';' - +%make_install DESTDIR=%{buildroot} +find %{buildroot} -name '*.la' -exec rm -f {} ';' %post -p /sbin/ldconfig %postun -p /sbin/ldconfig - %files %manifest %{name}.manifest -%doc AUTHORS COPYING README +%license COPYING +%doc AUTHORS README %{_libdir}/*.so.* %dir %{_libdir}/libpinyin %{_libdir}/libpinyin/data %files devel %manifest %{name}.manifest -%doc %dir %{_includedir}/libpinyin-1.0.0 %{_includedir}/libpinyin-1.0.0/* %{_libdir}/*.so