---- createrepo_c/doc/python/CMakeLists.txt.orig 2014-05-06 14:58:35.000000000 +0200
-+++ createrepo_c/doc/python/CMakeLists.txt 2016-04-28 18:19:52.853165535 +0200
+--- createrepo_c-0.10.0/doc/python/CMakeLists.txt.orig 2018-05-11 20:05:51.125805641 +0200
++++ createrepo_c-0.10.0/doc/python/CMakeLists.txt 2018-05-11 20:08:41.395803696 +0200
@@ -1,5 +1,5 @@
ADD_CUSTOM_TARGET (doc-python
- PYTHONPATH=${CMAKE_BINARY_DIR}/src/python sphinx-build -E -b html
+ PYTHONPATH=${CMAKE_BINARY_DIR}/src/python sphinx-build-2 -E -b html
- ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/html
COMMENT "Building Python API documentation with Sphinx")
---- createrepo_c/src/python/CMakeLists.txt.orig 2014-05-06 14:58:35.000000000 +0200
-+++ createrepo_c/src/python/CMakeLists.txt 2016-04-28 18:25:18.773151731 +0200
-@@ -1,6 +1,6 @@
--FIND_PACKAGE (PythonLibs 2)
- FIND_PACKAGE (PythonInterp 2 REQUIRED)
+--- createrepo_c-0.10.0/src/python/CMakeLists.txt.orig 2018-05-11 20:05:51.125805641 +0200
++++ createrepo_c-0.10.0/src/python/CMakeLists.txt 2018-05-11 20:09:44.352469646 +0200
+@@ -5,8 +5,8 @@ if (${PYTHON_DESIRED} STREQUAL "2")
+ unset(PYTHON_LIBRARY CACHE)
+ unset(PYTHON_INCLUDE_DIR CACHE)
+ unset(PYTHON_EXECUTABLE CACHE)
+- FIND_PACKAGE(PythonLibs 2)
+ FIND_PACKAGE(PythonInterp 2 REQUIRED)
++ FIND_PACKAGE(PythonLibs 2)
+ else()
+ SET(Python_ADDITIONAL_VERSIONS 3.0)
+ unset(PYTHON_LIBRARY)
+@@ -15,11 +15,11 @@ else()
+ unset(PYTHON_LIBRARY CACHE)
+ unset(PYTHON_INCLUDE_DIR CACHE)
+ unset(PYTHON_EXECUTABLE CACHE)
+- FIND_PACKAGE(PythonLibs 3.0)
+ FIND_PACKAGE(PythonInterp 3.0 REQUIRED)
++ FIND_PACKAGE(PythonLibs 3.0)
+ endif()
+
-EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c "from sys import stdout; from distutils import sysconfig; stdout.write(sysconfig.get_python_lib(True))" OUTPUT_VARIABLE PYTHON_INSTALL_DIR)
-+FIND_PACKAGE (PythonLibs 2)
+EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c "from sys import stdout; from distutils import sysconfig; stdout.write(sysconfig.get_python_lib(True, prefix='/usr'))" OUTPUT_VARIABLE PYTHON_INSTALL_DIR)
INCLUDE_DIRECTORIES (${PYTHON_INCLUDE_PATH})
---- createrepo_c/src/misc.c.orig 2013-12-01 15:00:42.000000000 +0100
-+++ createrepo_c/src/misc.c 2013-12-01 16:18:48.713931227 +0100
-@@ -30,7 +30,7 @@
- #include <ftw.h>
- #include <time.h>
+--- createrepo_c-0.10.0/src/misc.c.orig 2018-05-11 19:45:05.629153195 +0200
++++ createrepo_c-0.10.0/src/misc.c 2018-05-11 20:03:44.592473749 +0200
+@@ -26,7 +26,8 @@
#include <curl/curl.h>
+ #include <errno.h>
+ #include <ftw.h>
-#include <rpm/rpmlib.h>
++#include <rpm/rpmiotypes.h>
+#include <rpm/rpmevr.h>
- #include "error.h"
- #include "misc.h"
-
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
--- createrepo_c/CMakeLists.txt.orig 2013-12-01 15:00:42.000000000 +0100
+++ createrepo_c/CMakeLists.txt 2013-12-01 16:21:27.510591230 +0100
@@ -39,7 +39,7 @@
# rpm:
---- createrepo_c/src/parsehdr.h.orig 2013-12-01 15:00:42.000000000 +0100
-+++ createrepo_c/src/parsehdr.h 2013-12-01 16:55:23.000505810 +0100
-@@ -24,7 +24,7 @@
- extern "C" {
+--- createrepo_c-0.10.0/src/parsehdr.h.orig 2018-05-11 19:45:05.632486529 +0200
++++ createrepo_c-0.10.0/src/parsehdr.h 2018-05-11 20:04:26.635806605 +0200
+@@ -25,7 +25,7 @@ extern "C" {
#endif
+ #include <glib.h>
-#include <rpm/rpmlib.h>
+#include <rpm/rpmtag.h>
- #include <glib.h>
#include "package.h"
- #include "xml_dump.h"
+
+ /** \defgroup parsehdr Header parser API.
--- createrepo_c/src/parsehdr.c.orig 2013-12-01 15:00:42.000000000 +0100
+++ createrepo_c/src/parsehdr.c 2013-12-01 16:33:26.753894379 +0100
@@ -19,6 +19,7 @@
static inline int
cr_compare_dependency(const char *dep1, const char *dep2)
{
---- createrepo_c/src/parsepkg.c~ 2014-05-06 15:58:35.000000000 +0300
-+++ createrepo_c/src/parsepkg.c 2014-06-15 14:59:03.744966692 +0300
-@@ -26,14 +26,17 @@
+--- createrepo_c-0.10.0/src/parsepkg.c.orig 2018-05-11 19:45:05.632486529 +0200
++++ createrepo_c-0.10.0/src/parsepkg.c 2018-05-11 20:05:28.922472561 +0200
+@@ -26,9 +26,9 @@
#include <unistd.h>
#include <rpm/rpmts.h>
#include <rpm/rpmfi.h>
+#include <rpm/pkgio.h>
#include "error.h"
#include "parsehdr.h"
- #include "misc.h"
- #include "checksum.h"
+ #include "parsepkg.h"
+@@ -38,6 +38,9 @@
+ #define ERR_DOMAIN CREATEREPO_C_ERROR
+
+#define _RPMVSF_NOSIGNATURES (RPMVSF_NODSAHEADER | RPMVSF_NORSAHEADER | RPMVSF_NODSA | RPMVSF_NORSA)
+#define _RPMVSF_NODIGESTS (RPMVSF_NOSHA1HEADER | RPMVSF_NOMD5HEADER | RPMVSF_NOSHA1 | RPMVSF_NOMD5)
TARGET_LINK_LIBRARIES(libcreaterepo_c ${SQLITE3_LIBRARIES})
TARGET_LINK_LIBRARIES(libcreaterepo_c ${ZLIB_LIBRARY})
+
+--- createrepo_c-0.10.0/src/deltarpms.h.in.orig 2016-01-05 13:46:28.000000000 +0100
++++ createrepo_c-0.10.0/src/deltarpms.h.in 2018-05-11 20:54:15.319105812 +0200
+@@ -25,7 +25,6 @@ extern "C" {
+ #endif
+
+ #include <glib.h>
+-#include <rpm/rpmlib.h>
+ #include "package.h"
+ #include "parsehdr.h"
+ #include "xml_file.h"
+--- createrepo_c-0.10.0/src/dumper_thread.h.orig 2016-01-05 13:46:28.000000000 +0100
++++ createrepo_c-0.10.0/src/dumper_thread.h 2018-05-11 20:56:44.322437446 +0200
+@@ -25,7 +25,6 @@ extern "C" {
+ #endif
+
+ #include <glib.h>
+-#include <rpm/rpmlib.h>
+ #include "load_metadata.h"
+ #include "locate_metadata.h"
+ #include "misc.h"
# TODO: tests fail (rpm.org vs rpm5 compat problems?)
#
# Conditional build:
+%bcond_without python3 # CPython 3.x module
%bcond_with tests # make tests
-%define gitrev 7ef96a6
Summary: Creates a common metadata repository
Summary(pl.UTF-8): Tworzenie wspólnego repozytorium metadanych
Name: createrepo_c
-Version: 0.4.0
+Version: 0.10.0
Release: 1
License: GPL v2+
Group: Applications/System
-# git clone https://github.com/Tojaj/createrepo_c
-Source0: http://pkgs.fedoraproject.org/repo/pkgs/createrepo_c/%{name}-%{gitrev}.tar.xz/606d117677ab85e5a9ec15896db644c2/createrepo_c-%{gitrev}.tar.xz
-# Source0-md5: 606d117677ab85e5a9ec15896db644c2
+#Source0Download: https://github.com/rpm-software-management/createrepo_c/releases
+Source0: https://github.com/rpm-software-management/createrepo_c/archive/%{version}/%{name}-%{version}.tar.gz
+# Source0-md5: 2e14b3e5d289875b894000ab1e54f1ec
Patch0: %{name}-rpm5.patch
Patch1: %{name}-python.patch
-URL: https://github.com/Tojaj/createrepo_c
+Patch2: %{name}-include.patch
+URL: https://github.com/rpm-software-management/createrepo_c
BuildRequires: bzip2-devel
BuildRequires: check-devel
BuildRequires: cmake >= 2.6
BuildRequires: openssl-devel
BuildRequires: python-devel >= 2
%{?with_tests:BuildRequires: python-nose}
+%if %{with python3}
+BuildRequires: python3-devel >= 1:3.2
+%{?with_tests:BuildRequires: python3-nose}
+%endif
BuildRequires: rpm-devel >= 5
BuildRequires: rpm-pythonprov
BuildRequires: rpmbuild(macros) >= 1.219
BuildRequires: sphinx-pdg-2
BuildRequires: sqlite3-devel >= 3
-BuildRequires: tar >= 1:1.22
-BuildRequires: xz
BuildRequires: xz-devel
BuildRequires: zlib-devel
Requires: %{name}-libs = %{version}-%{release}
Dokumentacja API biblioteki createrepo_c.
%package -n python-createrepo_c
-Summary: Python bindings for the createrepo_c library
-Summary(pl.UTF-8): Wiązania Pythona do biblioteki createrepo_c
+Summary: Python 2 bindings for the createrepo_c library
+Summary(pl.UTF-8): Wiązania Pythona 2 do biblioteki createrepo_c
Group: Development/Languages/Python
Requires: %{name}-libs = %{version}-%{release}
%description -n python-createrepo_c
-Python bindings for the createrepo_c library.
+Python 2 bindings for the createrepo_c library.
%description -n python-createrepo_c -l pl.UTF-8
-Wiązania Pythona do biblioteki createrepo_c.
+Wiązania Pythona 2 do biblioteki createrepo_c.
+
+%package -n python3-createrepo_c
+Summary: Python 3 bindings for the createrepo_c library
+Summary(pl.UTF-8): Wiązania Pythona 3 do biblioteki createrepo_c
+Group: Development/Languages/Python
+Requires: %{name}-libs = %{version}-%{release}
+
+%description -n python3-createrepo_c
+Python 3 bindings for the createrepo_c library.
+
+%description -n python3-createrepo_c -l pl.UTF-8
+Wiązania Pythona 3 do biblioteki createrepo_c.
%package -n bash-completion-createrepo_c
Summary: Bash completion for createrepo_c commands
mergerepo_c, modifyrepo_c).
%prep
-%setup -q -n %{name}
+%setup -q
%patch0 -p1
%patch1 -p1
+%patch2 -p1
%build
-%cmake .
+install -d build %{?with_python3:build-py3}
+
+cd build
+%cmake ..
%{__make}
%{__make} doc
%{__make} test \
ARGS="-V"
%endif
+cd ..
+
+%if %{with python3}
+cd build-py3
+%cmake .. \
+ -DPYTHON_DESIRED=3
+
+%{__make}
+
+%if %{with tests}
+%{__make} tests
+%{__make} test \
+ ARGS="-V"
+%endif
+cd ..
+%endif
%install
rm -rf $RPM_BUILD_ROOT
-%{__make} install \
+%if %{with python3}
+%{__make} -C build-py3 install \
+ DESTDIR=$RPM_BUILD_ROOT
+%py3_comp $RPM_BUILD_ROOT%{py3_sitedir}/createrepo_c
+%py3_ocomp $RPM_BUILD_ROOT%{py3_sitedir}/createrepo_c
+%endif
+
+%{__make} -C build install \
DESTDIR=$RPM_BUILD_ROOT
%py_comp $RPM_BUILD_ROOT%{py_sitedir}/createrepo_c
%attr(755,root,root) %{_bindir}/createrepo_c
%attr(755,root,root) %{_bindir}/mergerepo_c
%attr(755,root,root) %{_bindir}/modifyrepo_c
+%attr(755,root,root) %{_bindir}/sqliterepo_c
%{_mandir}/man8/createrepo_c.8*
%{_mandir}/man8/mergerepo_c.8*
%{_mandir}/man8/modifyrepo_c.8*
+%{_mandir}/man8/sqliterepo_c.8*
%files libs
%defattr(644,root,root,755)
%files apidocs
%defattr(644,root,root,755)
-%doc doc/html
+%doc build/doc/html
%files -n python-createrepo_c
%defattr(644,root,root,755)
%dir %{py_sitedir}/createrepo_c
-%attr(755,root,root) %{py_sitedir}/createrepo_c/_createrepo_cmodule.so
+%attr(755,root,root) %{py_sitedir}/createrepo_c/_createrepo_c.so
%{py_sitedir}/createrepo_c/__init__.py[co]
+%if %{with python3}
+%files -n python3-createrepo_c
+%defattr(644,root,root,755)
+%dir %{py3_sitedir}/createrepo_c
+%attr(755,root,root) %{py3_sitedir}/createrepo_c/_createrepo_c.so
+%{py3_sitedir}/createrepo_c/__init__.py
+%{py3_sitedir}/createrepo_c/__pycache__
+%endif
+
%files -n bash-completion-createrepo_c
%defattr(644,root,root,755)
/etc/bash_completion.d/createrepo_c.bash