[packages/botan2] - updated to 2.6.0 (as botan2)

qboosh qboosh at pld-linux.org
Sat Jun 30 09:43:43 CEST 2018


commit 189a518b7fff24728d0703aa8ef831fa3d1d7b52
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Sat Jun 30 09:45:05 2018 +0200

    - updated to 2.6.0 (as botan2)

 botan-includes.patch      |  10 -----
 botan-python.patch        |  48 --------------------
 botan.spec => botan2.spec | 109 ++++++++++++++++------------------------------
 3 files changed, 37 insertions(+), 130 deletions(-)
---
diff --git a/botan.spec b/botan2.spec
similarity index 70%
rename from botan.spec
rename to botan2.spec
index 2496244..f1cc458 100644
--- a/botan.spec
+++ b/botan2.spec
@@ -1,7 +1,8 @@
+# TODO: fix sphinx docs build (sphinx-build hangs?)
 #
 # Conditional build:
 %bcond_without	tests		# unit tests
-%bcond_without	apidocs		# Sphinx based HTML documentation
+%bcond_with	apidocs		# Sphinx based HTML documentation [hangs, FIXME]
 %bcond_without	static_libs	# static library
 %bcond_without	python		# Python bindings
 %bcond_without	python2		# CPython 2.x binding
@@ -13,32 +14,27 @@
 %endif
 Summary:	Crypto library written in C++
 Summary(pl.UTF-8):	Biblioteka kryptograficzna napisana w C++
-Name:		botan
-Version:	1.10.17
+Name:		botan2
+Version:	2.6.0
 Release:	1
 License:	BSD
 Group:		Libraries
 Source0:	https://botan.randombit.net/releases/Botan-%{version}.tgz
-# Source0-md5:	e5ed5dc70edd238c5a2116670b2cb3f3
-Patch0:		%{name}-includes.patch
-Patch1:		%{name}-python.patch
+# Source0-md5:	8967f4951310e3548e3875d3c1501a16
 URL:		https://botan.randombit.net/
 BuildRequires:	bzip2-devel
-BuildRequires:	gmp-devel
 BuildRequires:	libstdc++-devel
 BuildRequires:	openssl-devel
-BuildRequires:	python >= 1:2.6
+BuildRequires:	python >= 1:2.7
 BuildRequires:	rpm-pythonprov
 BuildRequires:	rpmbuild(macros) >= 1.714
 %{?with_apidocs:BuildRequires:	sphinx-pdg}
 BuildRequires:	zlib-devel
 %if %{with python2}
-BuildRequires:	boost-python-devel
-BuildRequires:	python-devel >= 1:2.6
+BuildRequires:	python-devel >= 1:2.7
 %endif
 %if %{with python3}
-BuildRequires:	boost-python3-devel
-BuildRequires:	python3-devel >= 1:3.2
+BuildRequires:	python3-devel >= 1:3.4
 %endif
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
@@ -128,12 +124,13 @@ Wiązanie Pythona 3.x do biblioteki Botan.
 
 %prep
 %setup -q -n Botan-%{version}
-%patch0 -p1
-%patch1 -p1
+
+# kill shebang, nothing to execute directly
+%{__sed} -i -e '1d' src/python/botan2.py
 
 %build
 # we have the necessary prerequisites, so enable optional modules
-%define enable_modules gnump,bzip2,zlib,openssl
+%define enable_modules bzip2,lzma,zlib,openssl,sqlite3,tpm,pkcs11
 
 # fixme: maybe disable unix_procs, very slow.
 %define disable_modules %{nil}
@@ -146,48 +143,22 @@ Wiązanie Pythona 3.x do biblioteki Botan.
 	--cpu=%{_arch} \
 	--enable-modules=%{enable_modules} \
 	--disable-modules=%{disable_modules} \
-%if %{with python}
-	--with-boost-python \
-	--with-python-version=x.y \
+%if %{with python2}
+	--with-python-version=%{py_ver} \
 %endif
-	%{?with_apidocs:--with-sphinx}
+	%{!?with_apidocs:--without-sphinx}
 
 # (ab)using CXX as an easy way to inject our CXXFLAGS
 %{__make} \
-	CXX="%{__cxx} %{rpmcxxflags}"
+	CXX="%{__cxx} -pthread" \
+	CXXFLAGS="%{rpmcxxflags}"
 
 %if %{with apidocs}
 %{__make} docs
 %endif
 
 %if %{with tests}
-%{__make} check \
-	CXX="%{__cxx} %{rpmcxxflags}"
-
-LD_LIBRARY_PATH=. ./check --validate
-%endif
-
-%if %{with python2}
-install -d build/python%{py_ver}
-%{__make} -f Makefile.python \
-	CXX="%{__cxx}" \
-	CFLAGS="%{rpmcxxflags}" \
-	LDFLAGS="%{rpmldflags}" \
-	PY_VER=%{py_ver} \
-	PYTHON_ROOT=%{py_libdir}/config \
-	PYTHON_INC=-I%{py_incdir}
-%endif
-
-%if %{with python3}
-install -d build/python%{py3_ver}
-%{__make} -f Makefile.python \
-	CXX="%{__cxx}" \
-	CFLAGS="%{rpmcxxflags}" \
-	LDFLAGS="%{rpmldflags}" \
-	BOOST_PYTHON=boost_python3 \
-	PY_VER=%{py3_ver} \
-	PYTHON_ROOT=%{py3_libdir}/config \
-	PYTHON_INC=-I%{py3_incdir}
+LD_LIBRARY_PATH=. ./botan-test
 %endif
 
 %install
@@ -196,28 +167,24 @@ rm -rf $RPM_BUILD_ROOT
 %{__make} install \
 	INSTALL_CMD_EXEC="install -p -m 755" \
 	INSTALL_CMD_DATA="install -p -m 644" \
-	DOCDIR=_doc \
-	DESTDIR=$RPM_BUILD_ROOT%{_prefix}
+	DESTDIR=$RPM_BUILD_ROOT
 
 %if %{with python2}
-%{__make} -f Makefile.python install \
-	PY_VER=%{py_ver} \
-	PYTHON_SITE_PACKAGE_DIR=$RPM_BUILD_ROOT%{py_sitedir}
-
 %py_comp $RPM_BUILD_ROOT%{py_sitedir}
 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
 %py_postclean
 %endif
 
 %if %{with python3}
-%{__make} -f Makefile.python install \
-	PY_VER=%{py3_ver} \
-	PYTHON_SITE_PACKAGE_DIR=$RPM_BUILD_ROOT%{py3_sitedir}
-
+install -d $RPM_BUILD_ROOT%{py3_sitedir}
+cp -p src/python/botan2.py $RPM_BUILD_ROOT%{py3_sitedir}
 %py3_comp $RPM_BUILD_ROOT%{py3_sitedir}
 %py3_ocomp $RPM_BUILD_ROOT%{py3_sitedir}
 %endif
 
+# packaged as %doc
+%{__rm} -r $RPM_BUILD_ROOT%{_docdir}/botan-%{version}
+
 %if %{with apidocs}
 install -d $RPM_BUILD_ROOT%{_examplesdir}
 cp -pr doc/examples $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
@@ -231,26 +198,28 @@ rm -rf $RPM_BUILD_ROOT
 
 %files
 %defattr(644,root,root,755)
-%doc readme.txt doc/{algos,credits,faq,index,license,log,support,users}.txt
-%attr(755,root,root) %{_libdir}/libbotan-1.10.so.*.*
-%attr(755,root,root) %ghost %{_libdir}/libbotan-1.10.so.1
+%doc license.txt news.rst readme.rst doc/{authors.txt,credits.rst,reading_list.txt,roadmap.rst,security.rst,todo.rst}
+%attr(755,root,root) %{_bindir}/botan
+%attr(755,root,root) %{_libdir}/libbotan-2.so.*.*
+%attr(755,root,root) %ghost %{_libdir}/libbotan-2.so.5
+%{_mandir}/man1/botan.1*
 
 %files devel
 %defattr(644,root,root,755)
-%attr(755,root,root) %{_bindir}/botan-config-1.10
-%attr(755,root,root) %{_libdir}/libbotan-1.10.so
-%{_includedir}/botan-1.10
-%{_pkgconfigdir}/botan-1.10.pc
+%attr(755,root,root) %{_libdir}/libbotan-2.so
+%{_includedir}/botan-2
+%{_pkgconfigdir}/botan-2.pc
 
 %if %{with static_libs}
 %files static
 %defattr(644,root,root,755)
-%{_libdir}/libbotan-1.10.a
+%{_libdir}/libbotan-2.a
 %endif
 
 %if %{with apidocs}
 %files apidocs
 %defattr(644,root,root,755)
+# FIXME: update path after fixing sphinx build
 %doc _doc/manual/{_static,*.html,*.js}
 %{_examplesdir}/%{name}-%{version}
 %endif
@@ -258,16 +227,12 @@ rm -rf $RPM_BUILD_ROOT
 %if %{with python2}
 %files -n python-botan
 %defattr(644,root,root,755)
-%dir %{py_sitedir}/botan
-%attr(755,root,root) %{py_sitedir}/botan/_botan.so
-%{py_sitedir}/botan/__init__.py[co]
+%{py_sitedir}/botan2.py[co]
 %endif
 
 %if %{with python3}
 %files -n python3-botan
 %defattr(644,root,root,755)
-%dir %{py3_sitedir}/botan
-%attr(755,root,root) %{py3_sitedir}/botan/_botan.so
-%{py3_sitedir}/botan/__init__.py
-%{py3_sitedir}/botan/__pycache__
+%{py3_sitedir}/botan2.py
+%{py3_sitedir}/__pycache__/botan2.cpython-*.py[co]
 %endif
diff --git a/botan-includes.patch b/botan-includes.patch
deleted file mode 100644
index 06b848e..0000000
--- a/botan-includes.patch
+++ /dev/null
@@ -1,10 +0,0 @@
---- Botan-1.10.17/src/hash/gost_3411/gost_3411.cpp.orig	2017-10-02 08:00:00.000000000 +0200
-+++ Botan-1.10.17/src/hash/gost_3411/gost_3411.cpp	2018-06-29 17:29:33.583934040 +0200
-@@ -5,6 +5,7 @@
- * Distributed under the terms of the Botan license
- */
- 
-+#include <stdint.h>
- #include <botan/gost_3411.h>
- #include <botan/loadstor.h>
- #include <botan/rotate.h>
diff --git a/botan-python.patch b/botan-python.patch
deleted file mode 100644
index 321146c..0000000
--- a/botan-python.patch
+++ /dev/null
@@ -1,48 +0,0 @@
---- Botan-1.10.17/src/build-data/makefile/python.in.orig	2018-06-29 20:09:39.647157687 +0200
-+++ Botan-1.10.17/src/build-data/makefile/python.in	2018-06-29 20:09:44.253824302 +0200
-@@ -3,11 +3,14 @@
- LDFLAGS       =
- WARN_FLAGS    = %{warn_flags}
- 
-+BOOST_PYTHON  = boost_python
-+PY_VER        = %{python_version}
-+
- SERIES        = %{version_major}.%{version_minor}
- 
--PYTHON_ROOT = /usr/lib/python%{python_version}/config
--PYTHON_INC = -I/usr/include/python%{python_version}
--PYTHON_SITE_PACKAGE_DIR = /usr/lib/python%{python_version}/site-packages/
-+PYTHON_ROOT = /usr/lib/python$(PY_VER)/config
-+PYTHON_INC = -I/usr/include/python$(PY_VER)
-+PYTHON_SITE_PACKAGE_DIR = /usr/lib/python$(PY_VER)/site-packages/
- 
- PYTHON_FLAGS = -I%{python_dir} -fPIC -ftemplate-depth-255 $(WARN_FLAGS) $(PYTHON_INC) $(CFLAGS)
- 
-@@ -21,7 +24,7 @@
- 
- $(BOTAN_PYTHON_MODDIR)/_botan.so: $(PYTHON_OBJS)
- 	cp %{python_dir}/*.py $(BOTAN_PYTHON_MODDIR)
--	$(CXX) -shared -Wl,-soname,$@ $(PYTHON_OBJS) -L. -L$(PYTHON_ROOT) $(LDFLAGS) -lbotan-$(SERIES) -lboost_python -o $@
-+	$(CXX) -shared -Wl,-soname,$@ $(PYTHON_OBJS) -L. -L$(PYTHON_ROOT) $(LDFLAGS) -lbotan-$(SERIES) -l$(BOOST_PYTHON) -o $@
- 
- clean:
- 	rm -rf $(BOTAN_PYTHON_MODDIR)/*
---- Botan-1.10.17/configure.py.orig	2017-10-02 08:00:00.000000000 +0200
-+++ Botan-1.10.17/configure.py	2018-06-29 20:11:39.013822990 +0200
-@@ -98,7 +98,7 @@
- 
-         self.doc_output_dir = os.path.join(self.build_dir, 'docs')
- 
--        self.pyobject_dir = os.path.join(self.build_dir, 'python')
-+        self.pyobject_dir = os.path.join(self.build_dir, 'python$(PY_VER)')
- 
-         self.include_dir = os.path.join(self.build_dir, 'include')
-         self.botan_include_dir = os.path.join(self.include_dir, 'botan')
---- Botan-1.10.17/src/wrap/python/__init__.py.orig	2017-10-02 08:00:00.000000000 +0200
-+++ Botan-1.10.17/src/wrap/python/__init__.py	2018-06-29 21:31:52.813768028 +0200
-@@ -1,4 +1,4 @@
--from _botan import *
-+from botan._botan import *
- 
- # Initialize the library when the module is imported
- init = LibraryInitializer()
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/botan2.git/commitdiff/189a518b7fff24728d0703aa8ef831fa3d1d7b52



More information about the pld-cvs-commit mailing list