From 14286edcdd3b2b64c9270c3b93f38013c25a011a Mon Sep 17 00:00:00 2001 From: Ronan Le Martret Date: Mon, 15 Sep 2014 12:15:47 +0200 Subject: [PATCH] Allow libpinyin to build in cross compile mode. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit - 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 --- data/Makefile.am | 9 ++++++--- packaging/libpinyin.spec | 24 ++++++++++-------------- 2 files changed, 16 insertions(+), 17 deletions(-) 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 -- 2.7.4