diff --git a/.gitignore b/.gitignore index 01136d1..bd7a36c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1 @@ -/Botan-*.stripped.tbz -/Botan-1.10.12.stripped.tar.gz -/Botan-1.10.13.stripped.tar.gz +/Botan-*.stripped.tar.gz diff --git a/botan-1.10.13-python-init.patch b/botan-1.10.13-python-init.patch new file mode 100644 index 0000000..040a9a7 --- /dev/null +++ b/botan-1.10.13-python-init.patch @@ -0,0 +1,9 @@ +diff -up Botan-1.10.13/src/wrap/python/__init__.py.orig Botan-1.10.13/src/wrap/python/__init__.py +--- Botan-1.10.13/src/wrap/python/__init__.py.orig 2016-04-28 15:27:08.000000000 +0200 ++++ Botan-1.10.13/src/wrap/python/__init__.py 2016-06-30 18:02:11.724997966 +0200 +@@ -1,4 +1,4 @@ +-from _botan import * ++from botan._botan import * + + # Initialize the library when the module is imported + init = LibraryInitializer() diff --git a/botan-boost_python.patch b/botan-boost_python.patch new file mode 100644 index 0000000..ccc016b --- /dev/null +++ b/botan-boost_python.patch @@ -0,0 +1,20 @@ +diff -up Botan-1.10.13/src/build-data/makefile/python.in.orig Botan-1.10.13/src/build-data/makefile/python.in +--- Botan-1.10.13/src/build-data/makefile/python.in.orig 2016-04-28 15:27:08.000000000 +0200 ++++ Botan-1.10.13/src/build-data/makefile/python.in 2016-06-30 16:12:04.001859858 +0200 +@@ -15,13 +15,15 @@ BOTAN_PYTHON_MODDIR = %{python_obj_dir} + + PYTHON_OBJS = %{python_objs} + ++BOOST_PYTHON = boost_python ++ + all: $(BOTAN_PYTHON_MODDIR)/_botan.so + + %{python_build_cmds} + + $(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)/* diff --git a/botan.spec b/botan.spec index 64caa23..2df2f50 100644 --- a/botan.spec +++ b/botan.spec @@ -1,8 +1,12 @@ %global major_version 1.10 +%if 0%{?fedora} +%global with_python3 1 +%endif + Name: botan -Version: %{major_version}.13 -Release: 1%{?dist} +Version: %{major_version}.14 +Release: 3%{?dist} Summary: Crypto library written in C++ Group: System Environment/Libraries @@ -16,19 +20,35 @@ Patch0: botan-aarch64.patch Patch1: botan-1.10-add-ppc64le.patch # Enable only cleared ECC algorithms Patch2: botan-1.10.5-ecc-fix.patch +# Make boost_python selectable +Patch3: botan-boost_python.patch +# Fix wrong path +Patch4: botan-1.10.13-python-init.patch BuildRequires: gcc-c++ -BuildRequires: python -BuildRequires: python-sphinx -BuildRequires: python-devel +BuildRequires: python2 +BuildRequires: python2-devel BuildRequires: boost-python-devel +%if 0%{?with_python3} +BuildRequires: python3 +BuildRequires: python3-devel +BuildRequires: boost-python3-devel +%endif # with_python3 +BuildRequires: python-sphinx BuildRequires: bzip2-devel BuildRequires: zlib-devel +%if 0%{?fedora} >=26 +BuildRequires: compat-openssl10-devel +%else BuildRequires: openssl-devel +%endif -# do not check .so files in the python_sitelib directory -%global __provides_exclude_from ^(%{python_sitearch}/.*\\.so)$ +# do not check .so files in the python_sitelib directories +%global __provides_exclude_from ^(%{python2_sitearch}/.*\\.so)$ +%if 0%{?with_python3} +%global __provides_exclude_from ^(%{python3_sitearch}/.*\\.so)$ +%endif # with_python3 %{!?_pkgdocdir: %global _pkgdocdir %{_docdir}/%{name}-%{version}} @@ -48,7 +68,11 @@ Requires: %{name}%{?_isa} = %{version}-%{release} Requires: pkgconfig Requires: bzip2-devel Requires: zlib-devel +%if 0%{?fedora} >=26 +Requires: compat-openssl10-devel +%else Requires: openssl-devel +%endif %description devel The %{name}-devel package contains libraries and header files for @@ -66,24 +90,45 @@ BuildArch: noarch This package contains HTML documentation for %{name}. -%package python -Summary: Python bindings for %{name} +%package -n python2-%{name} +Summary: Python2 bindings for %{name} Group: System Environment/Libraries +%{?python_provide:%python_provide python2-%{name}} +# the python2 package was named botan-python up to 1.10.13-1 +Provides: %{name}-python = %{version}-%{release} +Obsoletes: %{name}-python < 1.10.13-2 -%description python +%description -n python2-%{name} %{summary} -This package contains the Python binding for %{name}. +This package contains the Python2 binding for %{name}. Note: The Python binding should be considered alpha software, and the interfaces may change in the future. +%if 0%{?with_python3} +%package -n python3-%{name} +Summary: Python3 bindings for %{name} +Group: System Environment/Libraries +%{?python_provide:%python_provide python3-%{name}} + +%description -n python3-%{name} +%{summary} + +This package contains the Python3 binding for %{name}. + +Note: The Python binding should be considered alpha software, and the +interfaces may change in the future. +%endif # with_python3 + %prep %setup -q -n Botan-%{version} %patch0 -p1 %patch1 -p1 %patch2 -p1 -b .eccfix +%patch3 -p1 +%patch4 -p1 # These tests will fail. rm -rf checks/ec_tests.cpp @@ -105,14 +150,30 @@ rm -rf checks/ec_tests.cpp --enable-modules=%{enable_modules} \ --disable-modules=%{disable_modules} \ --with-boost-python \ - --with-python-version=%{python_version} \ + --with-python-version=dummy.dummy \ --with-sphinx -# (ab)using CXX as an easy way to inject our CXXFLAGS -make CXX="g++ ${CXXFLAGS:-%{optflags}}" %{?_smp_mflags} -make -f Makefile.python \ - CXX="g++ ${CXXFLAGS:-%{optflags}}" %{?_smp_mflags} +%if 0%{?with_python3} +cp -a build/python{,3} +%endif # with_python3 +# (ab)using CXX as an easy way to inject our CXXFLAGS +make CXX="g++ -std=c++11 ${CXXFLAGS:-%{optflags}}" %{?_smp_mflags} + +make -f Makefile.python \ + CXX="g++ -std=c++11 ${CXXFLAGS:-%{optflags}}" %{?_smp_mflags} \ + PYTHON_INC="$(python2-config --includes)" \ + PYTHON_ROOT=. + +%if 0%{?with_python3} +mv build/python{,2} ; mv build/python{3,} +make -f Makefile.python \ + CXX="g++ -std=c++11 ${CXXFLAGS:-%{optflags}}" %{?_smp_mflags} \ + PYTHON_INC="$(python3-config --includes)" \ + PYTHON_ROOT=. \ + BOOST_PYTHON=boost_python3 +mv build/python{,3} ; mv build/python{2,} +%endif # with_python3 %install make install \ @@ -122,12 +183,19 @@ make install \ INSTALL_CMD_DATA="install -p -m 644" make -f Makefile.python install \ - PYTHON_SITE_PACKAGE_DIR=%{buildroot}%{python_sitearch} + PYTHON_SITE_PACKAGE_DIR=%{buildroot}%{python2_sitearch} + +%if 0%{?with_python3} +mv build/python{,2} ; mv build/python{3,} +make -f Makefile.python install \ + PYTHON_SITE_PACKAGE_DIR=%{buildroot}%{python3_sitearch} +mv build/python{,3} ; mv build/python{2,} +%endif # with_python3 # fixups find doc/examples -type f -exec chmod -x {} \; -mv doc/examples/python doc/python-examples -cp -a doc/{examples,python-examples,license.txt} \ +mv doc/examples/python doc/python2-examples +cp -a doc/{examples,python2-examples,license.txt} \ %{buildroot}%{_pkgdocdir} cp -a %{SOURCE1} %{buildroot}%{_pkgdocdir} rm -r %{buildroot}%{_pkgdocdir}/manual/{.doctrees,.buildinfo} @@ -174,17 +242,21 @@ rm -r %{buildroot}%{_pkgdocdir}/manual/{.doctrees,.buildinfo} %else %{_pkgdocdir}/license.txt %endif # licensedir +%{_pkgdocdir}/python2-examples -%files python -%{_pkgdocdir}/python-examples -%exclude %{_pkgdocdir}/python-examples/*.pyc -%exclude %{_pkgdocdir}/python-examples/*.pyo -%{python_sitearch}/%{name} +%files -n python2-%{name} +%{python2_sitearch}/%{name} + + +%if 0%{?with_python3} +%files -n python3-%{name} +%{python3_sitearch}/%{name} +%endif # with_python3 %check -make CXX="g++ ${CXXFLAGS:-%{optflags}}" %{?_smp_mflags} check +make CXX="g++ -std=c++11 ${CXXFLAGS:-%{optflags}}" %{?_smp_mflags} check # these checks would fail mv checks/validate.dat{,.orig} @@ -194,6 +266,23 @@ LD_LIBRARY_PATH=%{buildroot}%{_libdir} ./check --validate %changelog +* Sat Dec 10 2016 Thomas Moschny - 1.10.14-3 +- Add -std=c++11 to the compilerflags (needed on EPEL7). + +* Fri Dec 9 2016 Thomas Moschny - 1.10.14-2 +- Update to 1.10.14. +- Depend on OpenSSL 1.0 compat package for F26+. + +* Tue Jul 19 2016 Fedora Release Engineering - 1.10.13-4 +- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages + +* Sun Jul 3 2016 Thomas Moschny - 1.10.13-3 +- Fix typo. + +* Sun Jul 3 2016 Thomas Moschny - 1.10.13-2 +- Provide python2- and python3- subpackages (rhbz#1313786). +- Move python examples to -doc subpackage. + * Fri Apr 29 2016 Thomas Moschny - 1.10.13-1 - Update to 1.10.13. diff --git a/repack.sh b/repack.sh index a55199a..af5cd56 100755 --- a/repack.sh +++ b/repack.sh @@ -1,6 +1,6 @@ #! /bin/bash -name=Botan-1.10.13 +name=Botan-1.10.14 src=${name}.tgz dst=${name}.stripped.tar.gz diff --git a/sources b/sources index 34e6824..bbe1e99 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -d7cc44ba99c8b989913a11a5a8acf927 Botan-1.10.13.stripped.tar.gz +55fb6734ce039c79ddac939af9a176dc Botan-1.10.14.stripped.tar.gz