From 8a4184e1e2bd333d51ff7a01f34a1eff96521fefeb3037aab8bcb0467b3ce7a8 Mon Sep 17 00:00:00 2001 From: Petr Gajdos Date: Thu, 24 Apr 2014 08:34:32 +0000 Subject: [PATCH 1/3] Accepting request 231198 from home:bjones:branches:devel:libraries:c_c++ - Fixes per Petr and Tomas - Added make check tests - Added python-tre wrapper - Used updated source from https://github.com/laurikari/tre/ OBS-URL: https://build.opensuse.org/request/show/231198 OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/tre?expand=0&rev=13 --- tre-0.8.0.tar.bz2 | 3 -- tre-0.8.0_git201402282055.tar.bz2 | 3 ++ tre-chicken.patch | 21 +++++++++++ tre.changes | 7 ++++ tre.spec | 61 ++++++++++++++++++++++--------- 5 files changed, 75 insertions(+), 20 deletions(-) delete mode 100644 tre-0.8.0.tar.bz2 create mode 100644 tre-0.8.0_git201402282055.tar.bz2 create mode 100644 tre-chicken.patch diff --git a/tre-0.8.0.tar.bz2 b/tre-0.8.0.tar.bz2 deleted file mode 100644 index 9adc6d6..0000000 --- a/tre-0.8.0.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:8dc642c2cde02b2dac6802cdbe2cda201daf79c4ebcbb3ea133915edf1636658 -size 380714 diff --git a/tre-0.8.0_git201402282055.tar.bz2 b/tre-0.8.0_git201402282055.tar.bz2 new file mode 100644 index 0000000..47dd10f --- /dev/null +++ b/tre-0.8.0_git201402282055.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e38db2657eb5570e34850741cee61cae6a083741954251526278a3e2b5cf3c0e +size 122103 diff --git a/tre-chicken.patch b/tre-chicken.patch new file mode 100644 index 0000000..c88f58b --- /dev/null +++ b/tre-chicken.patch @@ -0,0 +1,21 @@ +diff -up tre-0.8.0/python/setup.py.in.chicken tre-0.8.0/python/setup.py.in +--- tre-0.8.0/python/setup.py.in.chicken 2009-09-20 09:51:01.000000000 +0200 ++++ tre-0.8.0/python/setup.py.in 2009-09-20 15:43:45.000000000 +0200 +@@ -10,7 +10,8 @@ import shutil + + version = "@TRE_VERSION@" + data_files = [] +-include_dirs = ["../lib"] ++include_dirs = ["../include"] ++library_dirs = ["../lib/.libs"] + libraries = ["tre"] + + if sys.platform == "win32": +@@ -31,6 +32,7 @@ setup(name = "tre", + sources = ["tre-python.c"], + define_macros = [("HAVE_CONFIG_H", None)], + include_dirs = include_dirs, ++ library_dirs = library_dirs, + libraries = libraries + ), + ], diff --git a/tre.changes b/tre.changes index f257dd2..075febb 100644 --- a/tre.changes +++ b/tre.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Tue Apr 8 10:01:26 CDT 2014 - bjones@ece.msstate.edu + +- Added make check tests +- Added python-tre wrapper +- Used updated source from https://github.com/laurikari/tre/ + ------------------------------------------------------------------- Tue May 8 12:47:43 UTC 2012 - cfarrell@suse.com diff --git a/tre.spec b/tre.spec index 6b816de..71201b3 100644 --- a/tre.spec +++ b/tre.spec @@ -1,7 +1,7 @@ # # spec file for package tre # -# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,16 +17,25 @@ Name: tre -Version: 0.8.0 +Version: 0.8.0_git201402282055 Release: 0 -Source0: http://laurikari.net/tre/tre-%{version}.tar.bz2 -Patch0: %{name}.diff Summary: POSIX compatible regexp library with approximate matching License: BSD-3-Clause Group: System/Libraries Url: http://laurikari.net/tre/ -BuildRoot: %{_tmppath}/%{name}-%{version}-build +# This source comes from https://github.com/laurikari/tre/, revision +# c2f5d130c91b1696385a6ae0b5bcfd5214bcc9ca. The previously released +# version 0.8.0 is old (2009) and no new released have been made by +# the author, so I'm terming this 0.8.0_git201402282055. +Source0: tre-%{version}.tar.bz2 +Patch0: %{name}.diff +# Update the python build to use ../include for tre includes. +Patch1: %{name}-chicken.patch +BuildRequires: gettext-devel +BuildRequires: libtool BuildRequires: pkgconfig +BuildRequires: python-devel +BuildRoot: %{_tmppath}/%{name}-%{version}-build %description TRE is a lightweight, robust, and efficient POSIX compatible regexp @@ -45,15 +54,14 @@ TRE is a lightweight, robust, and efficient POSIX compatible regexp matching library with some exciting features such as approximate matching. - %post -n libtre5 -p /sbin/ldconfig %postun -n libtre5 -p /sbin/ldconfig %package devel -Requires: libtre5 = %{version} Summary: POSIX compatible regexp library with approximate matching Group: Development/Libraries/C and C++ +Requires: libtre5 = %{version} Obsoletes: libtre-devel Provides: libtre-devel @@ -70,27 +78,38 @@ Group: Productivity/Text/Utilities agrep is another powerful grep which has the ability to search for approximate patterns as well as block oriented search. +%package -n python-%{name} +Summary: Python bindings for the tre library +Group: System/Libraries -Authors: --------- - Sun Wu - Udi Manber - Burra Gopal +%description -n python-%{name} +This package contains the python bindings for the TRE library. %prep %setup -q %patch0 -p1 +%patch1 -p1 -b .chicken +./utils/autogen.sh %build -export CXXFLAGS="$RPM_OPT_FLAGS" -export CFLAGS="$RPM_OPT_FLAGS" +# Add compiler option below because of warnings: +# tre-python.c:577:3: warning: dereferencing type-punned pointer will break +# strict-aliasing rules [-Wstrict-aliasing] +export CXXFLAGS="%{optflags}" +export CFLAGS="%{optflags}" %configure --disable-static --enable-shared make %{?_smp_mflags} +pushd python +python setup.py build +popd %install -make install DESTDIR=$RPM_BUILD_ROOT -rm -f $RPM_BUILD_ROOT/%{_libdir}/*.la -rm -rf $RPM_BUILD_ROOT/usr/share/locale/ +make DESTDIR=%{buildroot} install %{?_smp_mflags} +pushd python +python setup.py install --prefix=%{_prefix} --root=%{buildroot} +popd +find %{buildroot} -type f -name "*.la" -delete -print +rm -rf %{buildroot}%{_datadir}/locale/ %files %defattr (-, root, root) @@ -112,4 +131,12 @@ rm -rf $RPM_BUILD_ROOT/usr/share/locale/ %{_bindir}/agrep %{_mandir}/man1/agrep.1.gz +%files -n python-%{name} +%defattr (-, root, root) +%{python_sitearch}/tre.so +%{python_sitearch}/*.egg-info + +%check +make check %{?_smp_mflags} + %changelog From b6a05af9b8d5ca529f8a374ba61fd959317a21c45016b902ee08ab651dd2ab1f Mon Sep 17 00:00:00 2001 From: Petr Gajdos Date: Thu, 24 Apr 2014 09:10:59 +0000 Subject: [PATCH 2/3] - remove redundant setting of C(XX)FLAGS - package translations in tre-lang OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/tre?expand=0&rev=14 --- tre.changes | 6 ++++++ tre.spec | 14 ++++++++------ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/tre.changes b/tre.changes index 075febb..e7ae274 100644 --- a/tre.changes +++ b/tre.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Apr 24 09:06:44 UTC 2014 - pgajdos@suse.com + +- remove redundant setting of C(XX)FLAGS +- package translations in tre-lang + ------------------------------------------------------------------- Tue Apr 8 10:01:26 CDT 2014 - bjones@ece.msstate.edu diff --git a/tre.spec b/tre.spec index 71201b3..471735c 100644 --- a/tre.spec +++ b/tre.spec @@ -48,6 +48,7 @@ Group: System/Libraries Requires: %{name} = %{version} Obsoletes: libtre Provides: libtre +Recommends: %{name}-lang = %{version} %description -n libtre5 TRE is a lightweight, robust, and efficient POSIX compatible regexp @@ -85,6 +86,9 @@ Group: System/Libraries %description -n python-%{name} This package contains the python bindings for the TRE library. +%lang_package + + %prep %setup -q %patch0 -p1 @@ -92,11 +96,6 @@ This package contains the python bindings for the TRE library. ./utils/autogen.sh %build -# Add compiler option below because of warnings: -# tre-python.c:577:3: warning: dereferencing type-punned pointer will break -# strict-aliasing rules [-Wstrict-aliasing] -export CXXFLAGS="%{optflags}" -export CFLAGS="%{optflags}" %configure --disable-static --enable-shared make %{?_smp_mflags} pushd python @@ -109,7 +108,7 @@ pushd python python setup.py install --prefix=%{_prefix} --root=%{buildroot} popd find %{buildroot} -type f -name "*.la" -delete -print -rm -rf %{buildroot}%{_datadir}/locale/ +%find_lang %{name} || echo -n >> %{name}.lang %files %defattr (-, root, root) @@ -136,6 +135,9 @@ rm -rf %{buildroot}%{_datadir}/locale/ %{python_sitearch}/tre.so %{python_sitearch}/*.egg-info +%files lang -f %{name}.lang +%defattr(-,root,root,-) + %check make check %{?_smp_mflags} From 16ce85f70431c228bf832b017e59fc2d347f653994909668e89098db7fe2d8b5 Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Thu, 8 May 2014 11:54:25 +0000 Subject: [PATCH 3/3] Accepting request 232982 from home:bjones:branches:devel:libraries:c_c++ - Added chicken.patch to correct Python build failures - Referenced a git pull request to justify the patch. OBS-URL: https://build.opensuse.org/request/show/232982 OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/tre?expand=0&rev=15 --- tre.changes | 1 + tre.spec | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/tre.changes b/tre.changes index e7ae274..bc45a26 100644 --- a/tre.changes +++ b/tre.changes @@ -10,6 +10,7 @@ Tue Apr 8 10:01:26 CDT 2014 - bjones@ece.msstate.edu - Added make check tests - Added python-tre wrapper - Used updated source from https://github.com/laurikari/tre/ +- Added chicken.patch to correct Python build failures ------------------------------------------------------------------- Tue May 8 12:47:43 UTC 2012 - cfarrell@suse.com diff --git a/tre.spec b/tre.spec index 471735c..e56d41c 100644 --- a/tre.spec +++ b/tre.spec @@ -29,7 +29,8 @@ Url: http://laurikari.net/tre/ # the author, so I'm terming this 0.8.0_git201402282055. Source0: tre-%{version}.tar.bz2 Patch0: %{name}.diff -# Update the python build to use ../include for tre includes. +# Update the python build to fix wrong include and lib paths. +# See https://github.com/laurikari/tre/pull/19. Patch1: %{name}-chicken.patch BuildRequires: gettext-devel BuildRequires: libtool