]> git.pld-linux.org Git - packages/botan.git/commitdiff
- updated to 1.10.17 (latests 1.x version; new soname) auto/th/botan-1.10.17-1
authorJakub Bogusz <qboosh@pld-linux.org>
Fri, 29 Jun 2018 20:36:55 +0000 (22:36 +0200)
committerJakub Bogusz <qboosh@pld-linux.org>
Fri, 29 Jun 2018 20:36:55 +0000 (22:36 +0200)
- removed obsolete soname patch
- added includes patch (fix missing stdint include)
- added python patch (allow multiple pythons build)

README.fedora [deleted file]
botan-includes.patch [new file with mode: 0644]
botan-python.patch [new file with mode: 0644]
botan.spec
soname.patch [deleted file]

diff --git a/README.fedora b/README.fedora
deleted file mode 100644 (file)
index f3b8795..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-For legal reasons, the following modules have been completely removed
-from the Botan package in Fedora:
-
- * Block Ciphers
-   * IDEA [src/block/idea]
-   * RC6 [src/block/rc6]
-   * RC5 [src/block/rc5]
- * Public Key Base
-   * ECC Public Key [src/pubkey/ecc_key]
-   * ECC Domain Parameters [src/pubkey/ec_dompar]
-   * ECDSA [src/pubkey/ecdsa]
-   * ECKAEG [src/pubkey/eckaeg]
- * Math
-   * GF(p) Math [src/math/gfpmath]
diff --git a/botan-includes.patch b/botan-includes.patch
new file mode 100644 (file)
index 0000000..06b848e
--- /dev/null
@@ -0,0 +1,10 @@
+--- 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
new file mode 100644 (file)
index 0000000..321146c
--- /dev/null
@@ -0,0 +1,48 @@
+--- 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()
index af1a64b42c4b3987d0909862e87295fad6dd80f0..2496244d838954e494d6aee3091b6813094f89ab 100644 (file)
@@ -1,30 +1,45 @@
 #
 # Conditional build:
-%bcond_without tests           # build without tests
-%bcond_without apidocs         # do not build and package API docs
-%bcond_without static_libs     # don't build static libraries
+%bcond_without tests           # unit tests
+%bcond_without apidocs         # Sphinx based HTML documentation
+%bcond_without static_libs     # static library
+%bcond_without python          # Python bindings
+%bcond_without python2         # CPython 2.x binding
+%bcond_without python3         # CPython 3.x binding
 
+%if %{without python}
+%undefine      with_python2
+%undefine      with_python3
+%endif
 Summary:       Crypto library written in C++
 Summary(pl.UTF-8):     Biblioteka kryptograficzna napisana w C++
 Name:          botan
-Version:       1.8.14
-Release:       3
+Version:       1.10.17
+Release:       1
 License:       BSD
 Group:         Libraries
-# tarfile is stripped using repack.sh. original tarfile to be found
-# here: http://files.randombit.net/botan/Botan-%%{version}.tbz
-Source0:       http://pkgs.fedoraproject.org/repo/pkgs/botan/Botan-%{version}.stripped.tbz/4b5ce78b1cfc0735eb7ec4f6903068ca/Botan-%{version}.stripped.tbz
-# Source0-md5: 4b5ce78b1cfc0735eb7ec4f6903068ca
-Source1:       README.fedora
-# soname was changed unintentionally upstream, revert it.
-Patch0:                soname.patch
-URL:           http://botan.randombit.net/
+Source0:       https://botan.randombit.net/releases/Botan-%{version}.tgz
+# Source0-md5: e5ed5dc70edd238c5a2116670b2cb3f3
+Patch0:                %{name}-includes.patch
+Patch1:                %{name}-python.patch
+URL:           https://botan.randombit.net/
 BuildRequires: bzip2-devel
 BuildRequires: gmp-devel
 BuildRequires: libstdc++-devel
 BuildRequires: openssl-devel
-BuildRequires: python
+BuildRequires: python >= 1:2.6
+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
+%endif
+%if %{with python3}
+BuildRequires: boost-python3-devel
+BuildRequires: python3-devel >= 1:3.2
+%endif
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %description
@@ -44,8 +59,8 @@ napisane w przenośnym C++. Dodatkowe udogodnienia to dokumentacja API,
 wprowadzenie oraz przykłady.
 
 %package devel
-Summary:       Header files for botan library
-Summary(pl.UTF-8):     Pliki nagłówkowe biblioteki botan
+Summary:       Header files for Botan library
+Summary(pl.UTF-8):     Pliki nagłówkowe biblioteki Botan
 Group:         Development/Libraries
 Requires:      %{name} = %{version}-%{release}
 Requires:      bzip2-devel
@@ -55,42 +70,66 @@ Requires:   zlib-devel
 
 %description devel
 This package contains the header files for developing applications
-that use botan.
+that use Botan.
 
 %description devel
 Ten pakiet zawiera pliki nagłówkowe do tworzenia aplikacji
-wykorzystujących bibliotekę botan.
+wykorzystujących bibliotekę Botan.
 
 %package static
-Summary:       Static botan library
-Summary(pl.UTF-8):     Statyczna biblioteka botan
+Summary:       Static Botan library
+Summary(pl.UTF-8):     Statyczna biblioteka Botan
 Group:         Development/Libraries
 Requires:      %{name}-devel = %{version}-%{release}
 
 %description static
-Static botan library.
+Static Botan library.
 
 %description static -l pl.UTF-8
-Statyczna biblioteka botan.
+Statyczna biblioteka Botan.
 
 %package apidocs
-Summary:       botan API documentation
-Summary(pl.UTF-8):     Dokumentacja API biblioteki botan
+Summary:       Botan API documentation
+Summary(pl.UTF-8):     Dokumentacja API biblioteki Botan
 Group:         Documentation
 %if "%{_rpmversion}" >= "5"
 BuildArch:     noarch
 %endif
 
 %description apidocs
-API and internal documentation for botan library.
+API and internal documentation for Botan library.
 
 %description apidocs -l pl.UTF-8
-Dokumentacja API biblioteki botan.
+Dokumentacja API biblioteki Botan.
+
+%package -n python-botan
+Summary:       Python 2.x binding for Botan library
+Summary(pl.UTF-8):     Wiązanie Pythona 2.x do biblioteki Botan
+Group:         Libraries/Python
+Requires:      %{name} = %{version}-%{release}
+
+%description -n python-botan
+Python 2.x binding for Botan library.
+
+%description -n python-botan -l pl.UTF-8
+Wiązanie Pythona 2.x do biblioteki Botan.
+
+%package -n python3-botan
+Summary:       Python 3.x binding for Botan library
+Summary(pl.UTF-8):     Wiązanie Pythona 3.x do biblioteki Botan
+Group:         Libraries/Python
+Requires:      %{name} = %{version}-%{release}
+
+%description -n python3-botan
+Python 3.x binding for Botan library.
+
+%description -n python3-botan -l pl.UTF-8
+Wiązanie Pythona 3.x do biblioteki Botan.
 
 %prep
 %setup -q -n Botan-%{version}
-%patch0 -p0
-cp -p %{SOURCE1} .
+%patch0 -p1
+%patch1 -p1
 
 %build
 # we have the necessary prerequisites, so enable optional modules
@@ -106,61 +145,129 @@ cp -p %{SOURCE1} .
        --os=linux \
        --cpu=%{_arch} \
        --enable-modules=%{enable_modules} \
-       --disable-modules=%{disable_modules}
+       --disable-modules=%{disable_modules} \
+%if %{with python}
+       --with-boost-python \
+       --with-python-version=x.y \
+%endif
+       %{?with_apidocs:--with-sphinx}
 
 # (ab)using CXX as an easy way to inject our CXXFLAGS
 %{__make} \
        CXX="%{__cxx} %{rpmcxxflags}"
 
+%if %{with apidocs}
+%{__make} docs
+%endif
+
 %if %{with tests}
-%{__make} \
-       CXX="%{__cxx} %{rpmcxxflags}" check
+%{__make} check \
+       CXX="%{__cxx} %{rpmcxxflags}"
 
-# these checks would fail
-%{__mv} checks/validate.dat{,.orig}
-awk '/\[.*\]/{f=0} /\[(RC5.*|RC6|IDEA)\]/{f=1} (f && !/^#/){sub(/^/,"#")} {print}' \
-       checks/validate.dat.orig > checks/validate.dat
 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}
+%endif
+
 %install
 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}
 
-rm $RPM_BUILD_ROOT%{_bindir}/botan-config
+%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}
+
+%py3_comp $RPM_BUILD_ROOT%{py3_sitedir}
+%py3_ocomp $RPM_BUILD_ROOT%{py3_sitedir}
+%endif
+
+%if %{with apidocs}
+install -d $RPM_BUILD_ROOT%{_examplesdir}
+cp -pr doc/examples $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
+%endif
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
-# NOTE: only update ld.so cache, there are no symlinks
-%post  -p /sbin/postshell
-/sbin/ldconfig -X
-%postun        -p /sbin/postshell
-/sbin/ldconfig -X
+%post  -p /sbin/ldconfig
+%postun        -p /sbin/ldconfig
 
 %files
 %defattr(644,root,root,755)
-%doc _doc/{credits,license,log,readme,thanks}.txt _doc/{fips140.tex,pgpkeys.asc} README.fedora
-%attr(755,root,root) %{_libdir}/libbotan-1.8.*.so
+%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
 
 %files devel
 %defattr(644,root,root,755)
-%attr(755,root,root) %{_libdir}/libbotan.so
-%{_includedir}/botan
-%{_pkgconfigdir}/botan-1.8.pc
+%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
 
 %if %{with static_libs}
 %files static
 %defattr(644,root,root,755)
-%{_libdir}/libbotan.a
+%{_libdir}/libbotan-1.10.a
 %endif
 
 %if %{with apidocs}
 %files apidocs
 %defattr(644,root,root,755)
-%doc doc/examples _doc/{api*,tutorial*}
+%doc _doc/manual/{_static,*.html,*.js}
+%{_examplesdir}/%{name}-%{version}
+%endif
+
+%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]
+%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__
 %endif
diff --git a/soname.patch b/soname.patch
deleted file mode 100644 (file)
index 6976728..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# old_revision [adcf24b7e258c125f78aaff4ef2d3557f1183c3e]
-#
-# patch "configure.py"
-#  from [b43917e0e74e7ef1ff0024542da0dabe104a1582]
-#    to [ba82e657a585f31e9ba20056a57c5f597c0f0297]
-#
-============================================================
---- configure.py       b43917e0e74e7ef1ff0024542da0dabe104a1582
-+++ configure.py       ba82e657a585f31e9ba20056a57c5f597c0f0297
-@@ -38,7 +38,7 @@ class BuildConfigurationInformation(obje
-     version_major = 1
-     version_minor = 8
-     version_patch = 14
--    version_so_patch = 13
-+    version_so_patch = 2
-     version_suffix = ''
-     version_string = '%d.%d.%d%s' % (
This page took 0.089849 seconds and 4 git commands to generate.