3 %bcond_without tests # build without tests
5 %define hawkey_ver 0.67.0
6 %define libcomps_ver 0.1.8
7 %define libmodulemd_ver 2.9.3
10 %define _enable_debug_packages 0
12 Summary: Package manager
13 Summary(pl.UTF-8): Zarządca pakietów
18 # GPL v2+ with GPL v2 and GPL parts; for a breakdown of the licensing, see PACKAGE-LICENSING
19 License: GPL v2 (parts on GPL v2+ or GPL)
20 Source0: https://github.com/rpm-software-management/dnf/archive/%{version}/%{name}-%{version}.tar.gz
21 # Source0-md5: 21a1eaaa8a4ab1b222460983125c141b
23 Source2: pld-archive.repo
24 Source3: pld-debuginfo.repo
25 Source4: pld-multilib.repo
28 Patch2: uname-cpuinfo-deps.patch
29 URL: https://github.com/rpm-software-management/dnf
30 BuildRequires: bash-completion-devel
31 BuildRequires: cmake >= 2.4
32 BuildRequires: gettext-tools
33 BuildRequires: libmodulemd >= %{libmodulemd_ver}
34 BuildRequires: python3
35 BuildRequires: python3-gpg
36 BuildRequires: python3-hawkey >= %{hawkey_ver}
37 BuildRequires: python3-libcomps >= %{libcomps_ver}
38 BuildRequires: python3-libdnf >= %{hawkey_ver}
39 BuildRequires: python3-modules
40 BuildRequires: python3-nose
41 BuildRequires: python3-rpm >= %{rpm_ver}
42 BuildRequires: rpm-build >= 4.6
43 BuildRequires: rpmbuild(macros) >= 1.647
44 BuildRequires: rpm-pythonprov
45 BuildRequires: sed >= 4.0
46 BuildRequires: sphinx-pdg
47 BuildRequires: systemd-devel
48 Requires(post,preun,postun): systemd-units >= 38
49 Requires: libmodulemd >= %{libmodulemd_ver}
51 Requires: python3-hawkey >= %{hawkey_ver}
52 Requires: python3-libcomps >= %{libcomps_ver}
53 Requires: python3-libdnf >= %{hawkey_ver}
54 Requires: python3-modules
56 Requires: systemd-units >= 0.38
58 Recommends: python3-dbus
59 Recommends: python3-unbound
60 Recommends: rpm-plugin-systemd-inhibit
61 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
64 Utility that allows users to manage packages on their systems. It
65 supports RPMs, modules and comps groups & environments.
67 %description -l pl.UTF-8
68 Marzędzie umożliwiające użytkownikom zarządzanie pakietami w systemie.
71 Summary: Alternative CLI to "dnf upgrade" suitable for automatic, regular execution
72 Summary(pl.UTF-8): Alternatywny interfejs do "dnf upgrade" nadający się do automatycznego wywoływania
74 Requires(post): systemd
75 Requires(preun): systemd
76 Requires(postun): systemd
77 Requires: %{name} = %{version}-%{release}
78 Requires: python3-modules
81 %description automatic
82 Alternative CLI to "dnf upgrade" suitable for automatic, regular
85 %description automatic -l pl.UTF-8
86 Alternatywny interfejs linii poleceń do "dnf upgrade", nadający się do
87 automatycznego, regularnego wywoływania.
89 %package -n bash-completion-dnf
90 Summary: Bash completion for dnf command
91 Summary(pl.UTF-8): Bashowe uzupełnianie parametrów dla polecenia dnf
92 Group: Applications/Shells
93 Requires: %{name} = %{version}-%{release}
94 Requires: bash-completion
97 %description -n bash-completion-dnf
98 Bash completion for dnf command.
100 %description -n bash-completion-dnf -l pl.UTF-8
101 Bashowe uzupełnianie parametrów dla polecenia dnf.
104 Summary: Yum compatibility layer for DNF
105 Summary(pl.UTF-8): Warstwa zgodności z YUM-em dla DNF-a
107 Requires: %{name} = %{version}-%{release}
109 Conflicts: yum < 3.4.3-505
113 Yum compatibility layer for DNF.
115 %description -n yum -l pl.UTF-8
116 Warstwa zgodności z YUM-em dla DNF-a.
128 -DPYTHON_DESIRED:FILEPATH=%{__python3} \
129 -DPYTHON_INSTALL_DIR:PATH=%{py3_sitescriptdir} \
130 -DDNF_VERSION=%{version} \
131 -DSYSTEMD_DIR=%{systemdunitdir}
137 rm -rf $RPM_BUILD_ROOT
138 install -d $RPM_BUILD_ROOT%{_sysconfdir}/{yum,%{name}/{vars,aliases.d,plugins,modules.d,modules.defaults.d,repos.d}} \
139 -d $RPM_BUILD_ROOT{%{_localstatedir}/log/,%{_var}/cache/dnf} \
140 -d $RPM_BUILD_ROOT%{py3_sitescriptdir}/dnf-plugins/__pycache__
142 %{__make} -C build install \
143 DESTDIR=$RPM_BUILD_ROOT
145 touch $RPM_BUILD_ROOT%{_localstatedir}/log/%{name}.log
147 %{__mv} $RPM_BUILD_ROOT%{_bindir}/dnf-3 $RPM_BUILD_ROOT%{_bindir}/dnf
148 %{__mv} $RPM_BUILD_ROOT%{_bindir}/dnf-automatic-3 $RPM_BUILD_ROOT%{_bindir}/dnf-automatic
150 %{__rm} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{%{name}-strict.conf,aliases.d/zypper.conf}
152 %{__rm} -r $RPM_BUILD_ROOT%{_localedir}/zh_Hans
155 ln -sr $RPM_BUILD_ROOT%{_sysconfdir}/{%{name}/%{name}.conf,yum.conf}
156 ln -sr $RPM_BUILD_ROOT%{_sysconfdir}/{%{name}/plugins,yum/pluginconf.d}
157 ln -sr $RPM_BUILD_ROOT%{_sysconfdir}/{%{name}/protected.d,yum/protected.d}
158 ln -sr $RPM_BUILD_ROOT%{_sysconfdir}/{%{name}/repos.d,yum/repos.d}
159 ln -sr $RPM_BUILD_ROOT%{_sysconfdir}/{%{name}/vars,yum/vars}
160 ln -s dnf $RPM_BUILD_ROOT%{_bindir}/yum
162 %ifarch i686 ppc sparc alpha athlon aarch64 %{arm}
163 %define ftp_arch %{_target_cpu}
165 %ifarch pentium2 pentium3 pentium4
166 %define ftp_arch i686
169 %define ftp_arch x86_64
170 %define ftp_alt_arch i686
171 %define ftp_alt2_arch x32
175 %define ftp_alt_arch x86_64
176 %define ftp_alt2_arch i686
179 %define pld_repo %{SOURCE1}
180 %define pld_archive_repo %{SOURCE2}
181 %define pld_debuginfo_repo %{SOURCE3}
184 %define pld_multilib_repo %{SOURCE4}
185 %define pld_multilib2_repo %{SOURCE4}
188 %{__sed} -e 's|%%ARCH%%|%{ftp_arch}|g' < %{pld_repo} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld.repo
190 %if 0%{?pld_multilib_repo:1}
191 %{__sed} 's|%%ARCH%%|%{ftp_alt_arch}|g' < %{pld_multilib_repo} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-%{ftp_alt_arch}.repo
194 %if 0%{?pld_multilib2_repo:1}
195 %{__sed} 's|%%ARCH%%|%{ftp_alt2_arch}|g' < %{pld_multilib_repo} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-%{ftp_alt2_arch}.repo
198 %if 0%{?pld_debuginfo_repo:1}
199 %{__sed} -e 's|%%ARCH%%|%{ftp_arch}|g' < %{pld_debuginfo_repo} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-debuginfo.repo
202 %if 0%{?pld_archive_repo:1}
203 %{__sed} -e 's|%%ARCH%%|%{ftp_arch}|g' < %{pld_archive_repo} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-archive.repo
206 %py3_comp $RPM_BUILD_ROOT%{py3_sitescriptdir}/dnf
207 %py3_ocomp $RPM_BUILD_ROOT%{py3_sitescriptdir}/dnf
212 rm -rf $RPM_BUILD_ROOT
215 %systemd_post dnf-makecache.timer
218 %systemd_preun dnf-makecache.timer
224 %systemd_post dnf-automatic.timer dnf-automatic-download.timer dnf-automatic-install.timer dnf-automatic-notifyonly.timer
227 %systemd_preun dnf-automatic.timer dnf-automatic-download.timer dnf-automatic-install.timer dnf-automatic-notifyonly.timer
232 %files -f %{name}.lang
233 %defattr(644,root,root,755)
234 %doc AUTHORS PACKAGE-LICENSING README.rst
235 %attr(755,root,root) %{_bindir}/dnf
236 %dir %{_sysconfdir}/%{name}
237 %dir %{_sysconfdir}/%{name}/plugins
238 %dir %{_sysconfdir}/%{name}/protected.d
239 %dir %{_sysconfdir}/%{name}/repos.d
240 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/dnf.conf
241 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/repos.d/*.repo
242 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/libreport/events.d/collect_dnf.conf
243 %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/%{name}
244 %{_mandir}/man5/dnf.conf.5*
245 %{_mandir}/man5/dnf-transaction-json.5*
246 %{_mandir}/man7/dnf.modularity.7*
247 %{_mandir}/man8/dnf.8*
248 %{_mandir}/man8/yum2dnf.8*
249 %{systemdunitdir}/dnf-makecache.service
250 %{systemdunitdir}/dnf-makecache.timer
251 %{systemdtmpfilesdir}/dnf.conf
252 %{py3_sitescriptdir}/dnf
253 %{py3_sitescriptdir}/dnf-%{version}.dist-info
254 %{py3_sitescriptdir}/dnf-plugins
255 %exclude %{py3_sitescriptdir}/dnf/automatic
256 %dir %{_var}/cache/dnf
257 %ghost %{_localstatedir}/log/%{name}.log
260 %defattr(644,root,root,755)
261 %attr(755,root,root) %{_bindir}/dnf-automatic
262 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/automatic.conf
263 %{_mandir}/man8/dnf-automatic.8*
264 %{systemdunitdir}/dnf-automatic-download.service
265 %{systemdunitdir}/dnf-automatic-download.timer
266 %{systemdunitdir}/dnf-automatic-install.service
267 %{systemdunitdir}/dnf-automatic-install.timer
268 %{systemdunitdir}/dnf-automatic-notifyonly.service
269 %{systemdunitdir}/dnf-automatic-notifyonly.timer
270 %{systemdunitdir}/dnf-automatic.service
271 %{systemdunitdir}/dnf-automatic.timer
272 %{py3_sitescriptdir}/dnf/automatic
274 %files -n bash-completion-dnf
275 %defattr(644,root,root,755)
279 %defattr(644,root,root,755)
280 %attr(755,root,root) %{_bindir}/yum
281 %{_sysconfdir}/yum.conf
282 %dir %{_sysconfdir}/yum
283 %{_sysconfdir}/yum/pluginconf.d
284 %{_sysconfdir}/yum/protected.d
285 %{_sysconfdir}/yum/repos.d
286 %{_sysconfdir}/yum/vars
287 %{_mandir}/man1/yum-aliases.1*
288 %{_mandir}/man5/yum.conf.5.*
289 %{_mandir}/man8/yum.8*
290 %{_mandir}/man8/yum-shell.8*
291 %config(noreplace) %{_sysconfdir}/%{name}/protected.d/yum.conf