[packages/treedec] - new
qboosh
qboosh at pld-linux.org
Fri May 17 05:38:00 CEST 2019
commit bee46b661f919699ba080310ac485047e6ddee65
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date: Fri May 17 05:38:34 2019 +0200
- new
treedec-python.patch | 48 ++++++++++++++++
treedec.spec | 153 +++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 201 insertions(+)
---
diff --git a/treedec.spec b/treedec.spec
new file mode 100644
index 0000000..e3cfd8e
--- /dev/null
+++ b/treedec.spec
@@ -0,0 +1,153 @@
+#
+# Conditional build:
+%bcond_with gala # use gala graph functions (broken build when using gala snapshot 20181110 + boost 1.70)
+%bcond_without python2 # CPython 2.x module
+%bcond_without python3 # CPython 3.x module
+#
+Summary: Tree decomposition algorithms
+Summary(pl.UTF-8): Algorytmy do rozkładu drzewiastego
+Name: treedec
+# configure.ac /AC_INIT
+Version: 0.9.0
+%define gitref aceed466aebd2e9f898172f3a5c3d9f481dfdb63
+%define snap 20181209
+Release: 1
+License: GPL v2, GPL v3
+Group: Libraries
+#Source0Download: https://github.com/freetdi/tdlib/releases
+Source0: https://github.com/freetdi/tdlib/archive/%{gitref}/%{name}-%{snap}.tar.gz
+# Source0-md5: dedb02819869f08c1035d23f47883d69
+Patch0: %{name}-python.patch
+URL: https://github.com/freetdi/tdlib
+BuildRequires: autoconf >= 2.69
+BuildRequires: automake
+BuildRequires: boost-devel >= 1.55
+%{?with_gala:BuildRequires: freetdi-gala-devel}
+BuildRequires: libstdc++-devel >= 6:4.7
+BuildRequires: libtool >= 2:2
+BuildRequires: stx-btree-devel
+%if %{with python2}
+BuildRequires: python-Cython >= 0.20.0
+BuildRequires: python-devel >= 1:2.7
+%endif
+%if %{with python3}
+BuildRequires: python3-Cython >= 0.20.0
+BuildRequires: python3-devel >= 1:3.2
+%endif
+BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+treedec provides tree decomposition algorithms.
+
+%description -l pl.UTF-8
+Biblioteka treedec udostępnia algorytmy rozkładu drzewiastego.
+
+%package devel
+Summary: Tree decomposition algorithms
+Summary(pl.UTF-8): Algorytmy do rozkładu drzewiastego
+License: Boost v1.0
+Group: Development/Libraries
+Requires: libstdc++-devel >= 6:4.7
+
+%description devel
+treedec provides tree decomposition algorithms.
+
+%description devel -l pl.UTF-8
+Biblioteka treedec udostępnia algorytmy rozkładu drzewiastego.
+
+%package -n python-tdlib
+Summary: Python 2 tree decomposition module
+Summary(pl.UTF-8): Moduł do rozkładu drzewiastego dla Pythona 2
+Group: Libraries/Python
+
+%description -n python-tdlib
+Python 2 tree decomposition module.
+
+%description -n python-tdlib -l pl.UTF-8
+Moduł do rozkładu drzewiastego dla Pythona 2.
+
+%package -n python3-tdlib
+Summary: Python 3 tree decomposition module
+Summary(pl.UTF-8): Moduł do rozkładu drzewiastego dla Pythona 3
+Group: Libraries/Python
+
+%description -n python3-tdlib
+Python 3 tree decomposition module.
+
+%description -n python3-tdlib -l pl.UTF-8
+Moduł do rozkładu drzewiastego dla Pythona 3.
+
+%prep
+%setup -q -n tdlib-%{gitref}
+%patch0 -p1
+
+%build
+%{__libtoolize}
+%{__aclocal} -I m4
+%{__autoconf}
+%{__autoheader}
+%{__automake}
+install -d build-py2
+cd build-py2
+../%configure \
+ --disable-static \
+ %{!?with_gala:--without-gala} \
+ --with-python-include-dir=%{py_incdir} \
+ %{!?with_python2:--without-python}
+
+%{__make}
+cd ..
+
+%if %{with python3}
+install -d build-py3
+cd build-py3
+../%configure \
+ PYTHON=%{__python3} \
+ --disable-static \
+ %{!?with_gala:--without-gala} \
+ --with-python-include-dir=%{py3_incdir} \
+ %{!?with_python3:--without-python}
+
+%{__make}
+%endif
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+%if %{with python3}
+%{__make} -C build-py3 install \
+ DESTDIR=$RPM_BUILD_ROOT
+
+%{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/tdlib/cytdlib.la
+%endif
+
+%{__make} -C build-py2 install \
+ DESTDIR=$RPM_BUILD_ROOT
+
+%{__rm} $RPM_BUILD_ROOT%{py_sitedir}/tdlib/cytdlib.la
+%py_postclean
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files devel
+%defattr(644,root,root,755)
+%doc AUTHORS BUGS COPYING NEWS README THANKS TODO
+%{_includedir}/treedec
+
+%if %{with python2}
+%files -n python-tdlib
+%defattr(644,root,root,755)
+%dir %{py_sitedir}/tdlib
+%attr(755,root,root) %{py_sitedir}/tdlib/cytdlib.so
+%{py_sitedir}/tdlib/*.py[co]
+%endif
+
+%if %{with python3}
+%files -n python3-tdlib
+%defattr(644,root,root,755)
+%dir %{py_sitedir}/tdlib
+%attr(755,root,root) %{py3_sitedir}/tdlib/cytdlib.so
+%{py3_sitedir}/tdlib/*.py
+%{py3_sitedir}/tdlib/__pycache__
+%endif
diff --git a/treedec-python.patch b/treedec-python.patch
new file mode 100644
index 0000000..4a71fc3
--- /dev/null
+++ b/treedec-python.patch
@@ -0,0 +1,48 @@
+--- tdlib-aceed466aebd2e9f898172f3a5c3d9f481dfdb63/tdlib/Makefile.am.orig 2018-12-08 15:21:03.000000000 +0100
++++ tdlib-aceed466aebd2e9f898172f3a5c3d9f481dfdb63/tdlib/Makefile.am 2019-05-16 21:23:54.840906287 +0200
+@@ -2,7 +2,7 @@
+
+ SUBDIRS = . tests
+
+-instdir = $(pythondir)/tdlib
++instdir = $(pyexecdir)/tdlib
+ inst_PYTHON = \
+ __init__.py \
+ graphs.py \
+@@ -22,7 +22,7 @@
+ .PHONY: clean-extra symlinks
+
+ AM_CXXFLAGS = -pthread -Wl,-O1 -Wl,-Bsymbolic-functions \
+- -fno-strict-aliasing -g -fwrapv -O2 -Wall \
++ -fno-strict-aliasing -fwrapv -Wall \
+ -Wformat -Werror=format-security
+
+ longcheck: all-am
+@@ -41,7 +41,7 @@
+ ln -sf $(srcdir)/__init__.py
+
+ AM_CPPFLAGS = @PYTHON_INCLUDES@ -I$(top_srcdir)/src
+-AM_LDFLAGS = -module -omit-version
++AM_LDFLAGS = -module -avoid-version
+
+ EXTRA_DIST = \
+ graphs.py \
+--- tdlib-aceed466aebd2e9f898172f3a5c3d9f481dfdb63/m4/am_check_python_headers.m4.orig 2018-12-08 15:21:03.000000000 +0100
++++ tdlib-aceed466aebd2e9f898172f3a5c3d9f481dfdb63/m4/am_check_python_headers.m4 2019-05-16 22:03:42.884635811 +0200
+@@ -5,12 +5,16 @@
+ [AC_REQUIRE([AM_PATH_PYTHON])
+ AC_MSG_CHECKING(for headers required to compile python extensions)
+ dnl deduce PYTHON_INCLUDES
++ if test -n "$PYTHON_INCLUDE_DIR"; then
++ PYTHON_INCLUDES="-I$PYTHON_INCLUDE_DIR"
++ else
+ py_prefix=`$PYTHON -c "import sys; print(sys.prefix)"`
+ py_exec_prefix=`$PYTHON -c "import sys; print(sys.exec_prefix)"`
+ PYTHON_INCLUDES="-I${py_prefix}/include/python${PYTHON_VERSION}"
+ if test "$py_prefix" != "$py_exec_prefix"; then
+ PYTHON_INCLUDES="$PYTHON_INCLUDES -I${py_exec_prefix}/include/python${PYTHON_VERSION}"
+ fi
++ fi
+ AC_SUBST(PYTHON_INCLUDES)
+ dnl check if the headers exist:
+ save_CPPFLAGS="$CPPFLAGS"
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/treedec.git/commitdiff/bee46b661f919699ba080310ac485047e6ddee65
More information about the pld-cvs-commit
mailing list