Allow libpinyin to build in cross compile mode. 55/26555/5 accepted/tizen_3.0.2014.q3_common accepted/tizen_3.0.m14.3_ivi accepted/tizen_3.0_ivi accepted/tizen_common accepted/tizen_ivi accepted/tizen_mobile accepted/tizen_tv accepted/tizen_wearable tizen tizen_3.0.2014.q3_common tizen_3.0.2014.q4_common tizen_3.0.m14.3_ivi tizen_3.0.m1_mobile tizen_3.0.m1_tv tizen_3.0_ivi accepted/tizen/common/20140930.171011 accepted/tizen/ivi/20141009.080620 accepted/tizen/ivi/20160218.025245 submit/tizen_common/20140929.110645 submit/tizen_ivi/20141007.444444 submit/tizen_ivi/20160217.000000 submit/tizen_ivi/20160217.000006 submit/tizen_mobile/20141120.000000 tizen_3.0.2014.q3_common_release tizen_3.0.m14.3_ivi_release tizen_3.0.m1_mobile_release tizen_3.0.m1_tv_release tizen_3.0.m2.a1_mobile_release tizen_3.0.m2.a1_tv_release tizen_3.0_ivi_release
authorRonan Le Martret <ronan@fridu.net>
Mon, 15 Sep 2014 10:15:47 +0000 (12:15 +0200)
committerKévin THIERRY <kevin.thierry@open.eurogiciel.org>
Fri, 26 Sep 2014 12:42:27 +0000 (14:42 +0200)
 - 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 <ronan@fridu.net>
Signed-off-by: Kévin THIERRY <kevin.thierry@open.eurogiciel.org>
data/Makefile.am
packaging/libpinyin.spec

index 1e80530..90d4e02 100644 (file)
@@ -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
 
index f1e78e3..77e92d1 100644 (file)
@@ -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