# TODO
+# - finish, update dependencies, add missing modules to PLD
# - make -DSYSTEMD_DIR actually to work: https://github.com/rpm-software-management/dnf/pull/213
#
# Conditional build:
%bcond_without python2 # CPython 2.x version
%bcond_with python3 # CPython 3.x version (dependencies not met currently)
#
-%define gitrev a7e0aa1
-%define hawkey_ver 0.5.2
-%define librepo_ver 1.7.5
-%define libcomps_ver 0.1.6
+%define hawkey_ver 0.11.1
+%define librepo_ver 1.8.1
+%define libcomps_ver 0.1.8
+#define libmodulemd_ver 1.4.0
+#define smartcols_ver 0.3.0
%define rpm_ver 5.4.0
Summary: Package manager forked from Yum, using libsolv as a dependency resolver
Summary(pl.UTF-8): Zarządca pakietów wywodzący się z Yuma, wykorzystujący libsolv do rozwiązywania zależności
Name: dnf
-Version: 0.6.3
-Release: 0.5
+Version: 2.7.5
+%define subver modularity-6
+Release: 0.1
Group: Base
# GPL v2+ with GPL v2 and GPL parts; for a breakdown of the licensing, see PACKAGE-LICENSING
License: GPL v2 (parts on GPL v2+ or GPL)
-#Source0: http://rpm-software-management.fedorapeople.org/%{name}-%{gitrev}.tar.xz
-Source0: http://pkgs.fedoraproject.org/repo/pkgs/dnf/%{name}-%{gitrev}.tar.xz/82ff495e445ddc56e70dc91750a421ac/dnf-%{gitrev}.tar.xz
-# Source0-md5: 82ff495e445ddc56e70dc91750a421ac
+#Source0Download: https://github.com/rpm-software-management/dnf/releases
+Source0: https://github.com/rpm-software-management/dnf/archive/%{version}-%{subver}/%{name}-%{version}-%{subver}.tar.gz
+# Source0-md5: 9f29c69ba7826c9cdacc7d3b811dc163
Patch0: rpm5.patch
+Patch1: %{name}-python.patch
URL: https://github.com/rpm-software-management/dnf
BuildRequires: cmake >= 2.4
BuildRequires: gettext-tools
BuildRequires: rpm-pythonprov
-BuildRequires: rpmbuild(macros) >= 1.647
+BuildRequires: rpmbuild(macros) >= 1.714
BuildRequires: sed >= 4.0
BuildRequires: sphinx-pdg
BuildRequires: systemd-devel
BuildRequires: python >= 2
%if %{with tests}
#BuildRequires: python-bugzilla
+BuildRequires: python-gpg
BuildRequires: python-hawkey >= %{hawkey_ver}
BuildRequires: python-hawkey-test >= %{hawkey_ver}
BuildRequires: python-iniparse
BuildRequires: python-libcomps >= %{libcomps_ver}
BuildRequires: python-librepo >= %{librepo_ver}
-BuildRequires: python-pygpgme
-BuildRequires: python-rpm >= %{rpm_ver}
BuildRequires: python-nose
BuildRequires: python-pyliblzma
+BuildRequires: python-rpm >= %{rpm_ver}
%endif
%endif
%if %{with python3}
Requires: python-iniparse
Requires: python-libcomps >= %{libcomps_ver}
Requires: python-librepo >= %{librepo_ver}
-Requires: python-pygpgme
+Requires: python-gpg
+Requires: python-pyliblzma
Requires: python-rpm >= %{rpm_ver}
#Requires: rpm-plugin-systemd-inhibit
Requires: systemd-units >= 0.38
Summary: Alternative CLI to "dnf upgrade" suitable for automatic, regular execution
Summary(pl.UTF-8): Alternatywny interfejs do "dnf upgrade" nadający się do automatycznego wywoływania
Group: Base
-Requires(post): systemd
-Requires(preun): systemd
-Requires(postun): systemd
+Requires(post,preun,postun): systemd
Requires: %{name} = %{version}-%{release}
%description automatic
Summary(pl.UTF-8): Bashowe uzupełnianie parametrów dla polecenia dnf
Group: Applications/Shells
Requires: %{name} = %{version}-%{release}
-Requires: bash-completion
+Requires: bash-completion >= 2.0
%description -n bash-completion-dnf
Bash completion for dnf command.
# for common files (make -common?)
Requires: %{name} = %{version}-%{release}
Requires: deltarpm
+Requires: python3-gpg
Requires: python3-hawkey >= %{hawkey_ver}
# XXX: missing in PLD
#Requires: python3-iniparse
Requires: python3-libcomps >= %{libcomps_ver}
-# XXX: missing in PLD
-#Requires: python3-librepo >= %{librepo_ver}
-Requires: python3-pygpgme
+Requires: python3-librepo >= %{librepo_ver}
+#Requires: python3-pyliblzma
# XXX: missing in PLD (is it possible with rpm5?)
#Requires: python3-rpm >= %{rpm_ver}
Wersja zarządcy pakietów dnf dla Pythona 3.
%prep
-%setup -q -n %{name}
+%setup -q -n %{name}-%{version}-%{subver}
%patch0 -p1
+%patch1 -p1
# the -D doesn't work
%{__sed} -i -e '/SYSTEMD_DIR/ s#/usr/lib/systemd/system#%{systemdunitdir}#' CMakeLists.txt
install -d build-py2
cd build-py2
%cmake .. \
+ -DBASH_COMPLETION_COMPLETIONSDIR=%{bash_compdir} \
-DCMAKE_CXX_COMPILER="%{__cc}" \
-DCMAKE_CXX_COMPILER_WORKS=1 \
-DPYTHON_DESIRED=2 \
install -d build-py3
cd build-py3
%cmake .. \
+ -DBASH_COMPLETION_COMPLETIONSDIR=%{bash_compdir} \
-DCMAKE_CXX_COMPILER="%{__cc}" \
-DCMAKE_CXX_COMPILER_WORKS=1 \
-DPYTHON_DESIRED=3 \
%py3_ocomp $RPM_BUILD_ROOT%{py3_sitescriptdir}
%py3_comp $RPM_BUILD_ROOT%{py3_sitescriptdir}
-%else
-%{__rm} $RPM_BUILD_ROOT%{_bindir}/dnf-3
%endif
%clean
%files -f %{name}.lang
%defattr(644,root,root,755)
%doc AUTHORS PACKAGE-LICENSING README.rst
-%attr(755,root,root) %{_bindir}/dnf
+%attr(755,root,root) %{_bindir}/dnf-2
%dir %{_sysconfdir}/%{name}
%dir %{_sysconfdir}/%{name}/plugins
%dir %{_sysconfdir}/%{name}/protected.d
%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/protected.d/dnf.conf
%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/libreport/events.d/collect_dnf.conf
%config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/%{name}
+%{_mandir}/man5/dnf.conf.5*
+%{_mandir}/man5/yum.conf.5*
%{_mandir}/man8/dnf.8*
-%{_mandir}/man8/dnf.conf.8*
+%{_mandir}/man8/yum.8*
+%{_mandir}/man8/yum2dnf.8*
%{systemdunitdir}/dnf-makecache.service
%{systemdunitdir}/dnf-makecache.timer
+%{systemdtmpfilesdir}/dnf.conf
%{py_sitescriptdir}/dnf
%exclude %{py_sitescriptdir}/dnf/automatic
%files automatic
%defattr(644,root,root,755)
-%attr(755,root,root) %{_bindir}/dnf-automatic
+%attr(755,root,root) %{_bindir}/dnf-automatic-2
%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/automatic.conf
%{_mandir}/man8/dnf.automatic.8*
%{systemdunitdir}/dnf-automatic.service
%{systemdunitdir}/dnf-automatic.timer
+%{systemdunitdir}/dnf-automatic-download.service
+%{systemdunitdir}/dnf-automatic-download.timer
+%{systemdunitdir}/dnf-automatic-install.service
+%{systemdunitdir}/dnf-automatic-install.timer
+%{systemdunitdir}/dnf-automatic-notifyonly.service
+%{systemdunitdir}/dnf-automatic-notifyonly.timer
%{py_sitescriptdir}/dnf/automatic
%endif
%files -n bash-completion-dnf
%defattr(644,root,root,755)
-/etc/bash_completion.d/dnf-completion.bash
+%{bash_compdir}/dnf
%if %{with python3}
%files -n python3-dnf
---- dnf/dnf/base.py~ 2014-12-09 13:36:18.000000000 +0200
-+++ dnf/dnf/base.py 2015-01-31 19:34:11.698771194 +0200
-@@ -284,10 +284,9 @@
- 'nodocs': rpm.RPMTRANS_FLAG_NODOCS,
+--- dnf-2.7.5-modularity-6/dnf/base.py.orig 2018-05-27 21:14:15.773307563 +0200
++++ dnf-2.7.5-modularity-6/dnf/base.py 2018-05-27 21:22:47.703301715 +0200
+@@ -601,7 +601,7 @@
'test': rpm.RPMTRANS_FLAG_TEST,
'justdb': rpm.RPMTRANS_FLAG_JUSTDB,
-- 'nocontexts': rpm.RPMTRANS_FLAG_NOCONTEXTS,
-- 'nocrypto' : rpm.RPMTRANS_FLAG_NOFILEDIGEST}
-- _TS_VSFLAGS_TO_RPM = {'nocrypto' : rpm._RPMVSF_NOSIGNATURES |
-- rpm._RPMVSF_NODIGESTS}
-+ 'nocontexts': 0,
-+ 'nocrypto' : 0}
-+ _TS_VSFLAGS_TO_RPM = {'nocrypto' : rpm.RPMVSF_NODSAHEADER }
+ 'nocontexts': rpm.RPMTRANS_FLAG_NOCONTEXTS,
+- 'nocrypto': rpm.RPMTRANS_FLAG_NOFILEDIGEST}
++ 'nocrypto': rpm.RPMTRANS_FLAG_NOFDIGEST}
+ _TS_VSFLAGS_TO_RPM = {'nocrypto': rpm._RPMVSF_NOSIGNATURES |
+ rpm._RPMVSF_NODIGESTS}
- @property
- def ts(self):
-@@ -1254,7 +1253,7 @@
-
- installroot = self.conf.installroot
- myts = dnf.rpm.transaction.initReadOnlyTransaction(root=installroot)
-- myts.pushVSFlags(~(rpm._RPMVSF_NOSIGNATURES|rpm._RPMVSF_NODIGESTS))
-+ myts.pushVSFlags(~rpm.RPMVSF_NODSAHEADER)
- idx = myts.dbMatch('name', 'gpg-pubkey')
- keys = len(idx)
- del idx
---- dnf/dnf/rpm/transaction.py~ 2014-12-09 13:36:18.000000000 +0200
-+++ dnf/dnf/rpm/transaction.py 2015-01-31 19:37:26.945547832 +0200
-@@ -119,5 +119,5 @@
-
- def initReadOnlyTransaction(root='/'):
- read_ts = TransactionWrapper(root=root)
-- read_ts.pushVSFlags((rpm._RPMVSF_NOSIGNATURES|rpm._RPMVSF_NODIGESTS))
-+ read_ts.pushVSFlags(rpm.RPMVSF_NODSAHEADER)
- return read_ts
---- dnf/dnf/rpm/__init__.py~ 2014-12-09 13:36:18.000000000 +0200
-+++ dnf/dnf/rpm/__init__.py 2015-01-31 19:36:50.920349099 +0200
-@@ -29,7 +29,7 @@
- """Calculate the release version for the system. :api"""
-
- ts = transaction.initReadOnlyTransaction(root=installroot)
-- ts.pushVSFlags(~(rpm._RPMVSF_NOSIGNATURES|rpm._RPMVSF_NODIGESTS))
-+ ts.pushVSFlags(~rpm.RPMVSF_NODSAHEADER)
- for distroverpkg in dnf.const.DISTROVERPKG:
- try:
- idx = ts.dbMatch('provides', distroverpkg)