SHA256
6
0
forked from pool/tre

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
This commit is contained in:
Petr Gajdos 2014-04-24 08:34:32 +00:00 committed by Git OBS Bridge
parent 09b48748ad
commit 8a4184e1e2
5 changed files with 75 additions and 20 deletions

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:8dc642c2cde02b2dac6802cdbe2cda201daf79c4ebcbb3ea133915edf1636658
size 380714

BIN
tre-0.8.0_git201402282055.tar.bz2 (Stored with Git LFS) Normal file

Binary file not shown.

21
tre-chicken.patch Normal file
View File

@ -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
),
],

View File

@ -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 Tue May 8 12:47:43 UTC 2012 - cfarrell@suse.com

View File

@ -1,7 +1,7 @@
# #
# spec file for package tre # 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 # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # remain the property of their copyright owners, unless otherwise agreed
@ -17,16 +17,25 @@
Name: tre Name: tre
Version: 0.8.0 Version: 0.8.0_git201402282055
Release: 0 Release: 0
Source0: http://laurikari.net/tre/tre-%{version}.tar.bz2
Patch0: %{name}.diff
Summary: POSIX compatible regexp library with approximate matching Summary: POSIX compatible regexp library with approximate matching
License: BSD-3-Clause License: BSD-3-Clause
Group: System/Libraries Group: System/Libraries
Url: http://laurikari.net/tre/ 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: pkgconfig
BuildRequires: python-devel
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description %description
TRE is a lightweight, robust, and efficient POSIX compatible regexp 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 library with some exciting features such as approximate
matching. matching.
%post -n libtre5 -p /sbin/ldconfig %post -n libtre5 -p /sbin/ldconfig
%postun -n libtre5 -p /sbin/ldconfig %postun -n libtre5 -p /sbin/ldconfig
%package devel %package devel
Requires: libtre5 = %{version}
Summary: POSIX compatible regexp library with approximate matching Summary: POSIX compatible regexp library with approximate matching
Group: Development/Libraries/C and C++ Group: Development/Libraries/C and C++
Requires: libtre5 = %{version}
Obsoletes: libtre-devel Obsoletes: libtre-devel
Provides: 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 agrep is another powerful grep which has the ability to search for
approximate patterns as well as block oriented search. approximate patterns as well as block oriented search.
%package -n python-%{name}
Summary: Python bindings for the tre library
Group: System/Libraries
Authors: %description -n python-%{name}
-------- This package contains the python bindings for the TRE library.
Sun Wu
Udi Manber
Burra Gopal
%prep %prep
%setup -q %setup -q
%patch0 -p1 %patch0 -p1
%patch1 -p1 -b .chicken
./utils/autogen.sh
%build %build
export CXXFLAGS="$RPM_OPT_FLAGS" # Add compiler option below because of warnings:
export CFLAGS="$RPM_OPT_FLAGS" # 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 %configure --disable-static --enable-shared
make %{?_smp_mflags} make %{?_smp_mflags}
pushd python
python setup.py build
popd
%install %install
make install DESTDIR=$RPM_BUILD_ROOT make DESTDIR=%{buildroot} install %{?_smp_mflags}
rm -f $RPM_BUILD_ROOT/%{_libdir}/*.la pushd python
rm -rf $RPM_BUILD_ROOT/usr/share/locale/ python setup.py install --prefix=%{_prefix} --root=%{buildroot}
popd
find %{buildroot} -type f -name "*.la" -delete -print
rm -rf %{buildroot}%{_datadir}/locale/
%files %files
%defattr (-, root, root) %defattr (-, root, root)
@ -112,4 +131,12 @@ rm -rf $RPM_BUILD_ROOT/usr/share/locale/
%{_bindir}/agrep %{_bindir}/agrep
%{_mandir}/man1/agrep.1.gz %{_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 %changelog