forked from pool/createrepo_c
Accepting request 459098 from home:Pharaoh_Atem:branches:system:packagemanager
- Enable Python bindings for openSUSE Leap. - Enable Python bindings for openSUSE Tumbleweed. - Updated upstream sources - Dropped dep filtering patch (better version merged upstream) - Added missing copyright statements - Fixed license tag and other misc cleanups OBS-URL: https://build.opensuse.org/request/show/459098 OBS-URL: https://build.opensuse.org/package/show/system:packagemanager/createrepo_c?expand=0&rev=15
This commit is contained in:
parent
2ff641ed7c
commit
7566945362
@ -1,53 +0,0 @@
|
||||
diff --git a/src/parsehdr.c b/src/parsehdr.c
|
||||
index ceaf884..61f5a89 100644
|
||||
--- a/src/parsehdr.c
|
||||
+++ b/src/parsehdr.c
|
||||
@@ -319,7 +319,10 @@ cr_package_from_header(Header hdr,
|
||||
};
|
||||
|
||||
// Hastable with filenames from provided
|
||||
- GHashTable *provided_hashtable = g_hash_table_new(g_str_hash, g_str_equal);
|
||||
+ GHashTable *provided_hashtable = g_hash_table_new_full(g_str_hash,
|
||||
+ g_str_equal,
|
||||
+ NULL,
|
||||
+ g_free);
|
||||
|
||||
// Hashtable with already processed files from requires
|
||||
GHashTable *ap_hashtable = g_hash_table_new_full(g_str_hash,
|
||||
@@ -358,15 +361,19 @@ cr_package_from_header(Header hdr,
|
||||
}
|
||||
|
||||
// Skip package primary files
|
||||
- if (g_hash_table_lookup_extended(filenames_hashtable, filename, NULL, NULL)) {
|
||||
+ if (*filename == '/' && g_hash_table_lookup_extended(filenames_hashtable, filename, NULL, NULL)) {
|
||||
if (cr_is_primary(filename)) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// Skip files which are provided
|
||||
- if (g_hash_table_lookup_extended(provided_hashtable, filename, NULL, NULL)) {
|
||||
- continue;
|
||||
+ gpointer pvalue;
|
||||
+ if (g_hash_table_lookup_extended(provided_hashtable, filename, NULL, &pvalue)) {
|
||||
+ struct ap_value_struct *ap_value = pvalue;
|
||||
+ if (!ap_value->flags || !ap_value->flags[0] || !flags || !flags[0] ||
|
||||
+ (!g_strcmp0(ap_value->flags, flags) && !g_strcmp0(ap_value->version, full_version)))
|
||||
+ continue;
|
||||
}
|
||||
|
||||
// Calculate pre value
|
||||
@@ -413,8 +420,12 @@ cr_package_from_header(Header hdr,
|
||||
|
||||
switch (deptype) {
|
||||
case DEP_PROVIDES:
|
||||
- g_hash_table_replace(provided_hashtable, dependency->name, dependency->name);
|
||||
pkg->provides = g_slist_prepend(pkg->provides, dependency);
|
||||
+ struct ap_value_struct *pvalue = g_malloc(sizeof(struct ap_value_struct));
|
||||
+ pvalue->flags = flags;
|
||||
+ pvalue->version = full_version;
|
||||
+ pvalue->pre = dependency->pre;
|
||||
+ g_hash_table_replace(provided_hashtable, dependency->name, pvalue);
|
||||
break;
|
||||
case DEP_CONFLICTS:
|
||||
pkg->conflicts = g_slist_prepend(pkg->conflicts, dependency);
|
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:00a3dbba22ca41503f12aed7f9c5496b477edcdf608c0090847518ade8944092
|
||||
size 357990
|
3
createrepo_c-0.10.0.git20170131.04828e6.tar.gz
Normal file
3
createrepo_c-0.10.0.git20170131.04828e6.tar.gz
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:9ef7852988f75e25bf774bec747067ac202b61fb0d0c331324e1ae7d28cd8cae
|
||||
size 357932
|
@ -1,3 +1,21 @@
|
||||
-------------------------------------------------------------------
|
||||
Sun Feb 19 12:57:21 UTC 2017 - ngompa13@gmail.com
|
||||
|
||||
- Enable Python bindings for openSUSE Leap.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Sun Feb 19 02:27:30 UTC 2017 - ngompa13@gmail.com
|
||||
|
||||
- Enable Python bindings for openSUSE Tumbleweed.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Feb 8 17:42:57 UTC 2017 - ngompa13@gmail.com
|
||||
|
||||
- Updated upstream sources
|
||||
- Dropped dep filtering patch (better version merged upstream)
|
||||
- Added missing copyright statements
|
||||
- Fixed license tag and other misc cleanups
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Oct 31 13:19:23 UTC 2016 - fschreiner@suse.com
|
||||
|
||||
|
@ -1,7 +1,8 @@
|
||||
#
|
||||
# spec file for package createrepo_c
|
||||
#
|
||||
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
|
||||
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
|
||||
# Copyright (c) 2015-2017 Neal Gompa <ngompa13@gmail.com>.
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
@ -15,25 +16,38 @@
|
||||
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
||||
#
|
||||
|
||||
# Enable Python bindings selectively
|
||||
%if (0%{?suse_version} == 1315 && 0%{?is_opensuse}) || 0%{?leap_version} || 0%{?suse_version} >= 1330
|
||||
# Python bindings are enabled for openSUSE Leap and Tumbleweed
|
||||
%bcond_without python
|
||||
%bcond_without python3
|
||||
%else
|
||||
# Python bindings are disabled for older SUSE
|
||||
%bcond_with python
|
||||
%bcond_with python3
|
||||
%endif
|
||||
|
||||
# Enable enhanced DeltaRPM support
|
||||
%bcond_with drpm
|
||||
|
||||
%define major 0
|
||||
%define libname lib%{name}%{major}
|
||||
%define devname lib%{name}-devel
|
||||
|
||||
%define version_unconverted 0.10.0.git20160929.547b5db
|
||||
%define version_unconverted 0.10.0.git20170131.04828e6
|
||||
|
||||
Name: createrepo_c
|
||||
Summary: Creates a common metadata repository
|
||||
License: GPL-2.0
|
||||
License: GPL-2.0+
|
||||
Group: System/Packages
|
||||
Version: 0.10.0.git20160929.547b5db
|
||||
Version: 0.10.0.git20170131.04828e6
|
||||
Release: 0
|
||||
Url: https://github.com/rpm-software-management/createrepo_c
|
||||
Source0: %{name}-%{version}.tar.gz
|
||||
Patch0: 000-Ensure_that_provides-requires_versions_are_factored_into_dep_filtering.diff
|
||||
|
||||
BuildRequires: bash-completion
|
||||
|
||||
%if 0%{?suse_version} >= 1330
|
||||
%if 0%{?suse_version} >= 1330
|
||||
BuildRequires: bash-completion-devel
|
||||
%endif
|
||||
|
||||
@ -51,6 +65,17 @@ BuildRequires: openssl-devel
|
||||
BuildRequires: rpm-devel >= 4.9.0
|
||||
BuildRequires: sqlite3-devel
|
||||
BuildRequires: zlib-devel
|
||||
%if %{with python}
|
||||
BuildRequires: python-devel
|
||||
BuildRequires: python-nose
|
||||
%if %{with python3}
|
||||
BuildRequires: python3-devel
|
||||
BuildRequires: python3-nose
|
||||
%endif
|
||||
%endif
|
||||
%if %{with drpm}
|
||||
BuildRequires: drpm-devel
|
||||
%endif
|
||||
|
||||
Requires: %{libname} = %{version}-%{release}
|
||||
|
||||
@ -65,9 +90,9 @@ rpm packages and maintaining it.
|
||||
|
||||
%package -n %{libname}
|
||||
Summary: Library for repodata manipulation
|
||||
Group: System/Libraries
|
||||
# The function to create DeltaRPMs calls /usr/bin/makedeltarpm,
|
||||
# which is part of the 'deltarpm' package
|
||||
Group: System/Libraries
|
||||
Requires: deltarpm
|
||||
|
||||
%description -n %{libname}
|
||||
@ -85,9 +110,29 @@ Requires: pkg-config
|
||||
This package contains the createrepo_c C library and header files.
|
||||
These development files are for easy manipulation with a repodata.
|
||||
|
||||
%if %{with python}
|
||||
%package -n python2-%{name}
|
||||
Summary: Python 2 bindings for the createrepo_c library
|
||||
Group: Development/Libraries/Python
|
||||
Provides: python-%{name} = %{version}-%{release}
|
||||
Requires: %{libname} = %{version}-%{release}
|
||||
|
||||
%description -n python2-createrepo_c
|
||||
Python 2 bindings for the createrepo_c library.
|
||||
|
||||
%if %{with python3}
|
||||
%package -n python3-%{name}
|
||||
Summary: Python 3 bindings for the createrepo_c library
|
||||
Group: Development/Libraries/Python
|
||||
Requires: %{libname} = %{version}-%{release}
|
||||
|
||||
%description -n python3-createrepo_c
|
||||
Python 3 bindings for the createrepo_c library.
|
||||
%endif
|
||||
%endif
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
%patch0 -p1
|
||||
|
||||
%if %{with python3}
|
||||
rm -rf py3
|
||||
@ -95,21 +140,40 @@ mkdir py3
|
||||
%endif
|
||||
|
||||
%build
|
||||
%cmake -DENABLE_LEGACY_WEAKTAGS=1 -DENABLE_DRPM=OFF -DENABLE_PYTHON=OFF
|
||||
%cmake -DENABLE_LEGACY_WEAKTAGS=1 %{!?with_drpm:-DENABLE_DRPM=OFF} %{!?with_python:-DENABLE_PYTHON=OFF}
|
||||
make %{?_smp_mflags}
|
||||
make doc-c
|
||||
|
||||
%check
|
||||
pushd ./build
|
||||
make tests
|
||||
make ARGS="-V" test
|
||||
%if %{with python}
|
||||
%if %{with python3}
|
||||
pushd ../py3
|
||||
%cmake -DPYTHON_DESIRED:str=3 ../../
|
||||
make %{?_smp_mflags}
|
||||
popd
|
||||
%endif
|
||||
%endif
|
||||
|
||||
%check
|
||||
make tests -C build
|
||||
make ARGS="-V" test -C build
|
||||
|
||||
%if %{with python}
|
||||
%if %{with python3}
|
||||
make tests -C py3/build
|
||||
make ARGS="-V" test -C py3/build
|
||||
%endif
|
||||
%endif
|
||||
|
||||
%install
|
||||
pushd ./build
|
||||
%make_install
|
||||
popd
|
||||
%fdupes %buildroot/%_prefix
|
||||
%make_install -C build
|
||||
|
||||
%if %{with python}
|
||||
%if %{with python3}
|
||||
%make_install -C py3/build
|
||||
%endif
|
||||
%endif
|
||||
|
||||
%fdupes %{buildroot}%{_prefix}
|
||||
|
||||
%post -n %{libname} -p /sbin/ldconfig
|
||||
|
||||
@ -117,10 +181,10 @@ popd
|
||||
|
||||
%files
|
||||
%doc README.md COPYING
|
||||
%_mandir/man8/createrepo_c.8.*
|
||||
%_mandir/man8/mergerepo_c.8.*
|
||||
%_mandir/man8/modifyrepo_c.8.*
|
||||
%_mandir/man8/sqliterepo_c.8.*
|
||||
%{_mandir}/man8/createrepo_c.8*
|
||||
%{_mandir}/man8/mergerepo_c.8*
|
||||
%{_mandir}/man8/modifyrepo_c.8*
|
||||
%{_mandir}/man8/sqliterepo_c.8*
|
||||
%{_datadir}/bash-completion/completions/
|
||||
%{_bindir}/createrepo_c
|
||||
%{_bindir}/mergerepo_c
|
||||
@ -133,9 +197,21 @@ popd
|
||||
%{_libdir}/libcreaterepo_c.so.%{major}.*
|
||||
|
||||
%files -n %{devname}
|
||||
%doc build/doc/html COPYING
|
||||
%{_libdir}/libcreaterepo_c.so
|
||||
%{_libdir}/pkgconfig/createrepo_c.pc
|
||||
%{_includedir}/createrepo_c/
|
||||
%doc build/doc/html COPYING
|
||||
|
||||
%if %{with python}
|
||||
%files -n python2-%{name}
|
||||
%doc COPYING
|
||||
%{python_sitearch}/createrepo_c/
|
||||
|
||||
%if %{with python3}
|
||||
%files -n python3-%{name}
|
||||
%doc COPYING
|
||||
%{python3_sitearch}/createrepo_c/
|
||||
%endif
|
||||
%endif
|
||||
|
||||
%changelog
|
||||
|
Loading…
Reference in New Issue
Block a user