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: 0e0242e443f87290efd16226b056f18c
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: rpmbuild(macros) >= 1.647
43 BuildRequires: rpm-pythonprov
44 BuildRequires: sed >= 4.0
45 BuildRequires: sphinx-pdg
46 BuildRequires: systemd-devel
47 Requires(post,preun,postun): systemd-units >= 38
48 Requires: libmodulemd >= %{libmodulemd_ver}
50 Requires: python3-hawkey >= %{hawkey_ver}
51 Requires: python3-libcomps >= %{libcomps_ver}
52 Requires: python3-libdnf >= %{hawkey_ver}
54 Requires: systemd-units >= 0.38
56 Recommends: python3-dbus
57 Recommends: python3-unbound
58 Recommends: rpm-plugin-systemd-inhibit
59 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
62 Utility that allows users to manage packages on their systems. It
63 supports RPMs, modules and comps groups & environments.
65 %description -l pl.UTF-8
66 Marzędzie umożliwiające użytkownikom zarządzanie pakietami w systemie.
69 Summary: Alternative CLI to "dnf upgrade" suitable for automatic, regular execution
70 Summary(pl.UTF-8): Alternatywny interfejs do "dnf upgrade" nadający się do automatycznego wywoływania
72 Requires(post): systemd
73 Requires(preun): systemd
74 Requires(postun): systemd
75 Requires: %{name} = %{version}-%{release}
78 %description automatic
79 Alternative CLI to "dnf upgrade" suitable for automatic, regular
82 %description automatic -l pl.UTF-8
83 Alternatywny interfejs linii poleceń do "dnf upgrade", nadający się do
84 automatycznego, regularnego wywoływania.
86 %package -n bash-completion-dnf
87 Summary: Bash completion for dnf command
88 Summary(pl.UTF-8): Bashowe uzupełnianie parametrów dla polecenia dnf
89 Group: Applications/Shells
90 Requires: %{name} = %{version}-%{release}
91 Requires: bash-completion
94 %description -n bash-completion-dnf
95 Bash completion for dnf command.
97 %description -n bash-completion-dnf -l pl.UTF-8
98 Bashowe uzupełnianie parametrów dla polecenia dnf.
101 Summary: Yum compatibility layer for DNF
102 Summary(pl.UTF-8): Warstwa zgodności z YUM-em dla DNF-a
104 Requires: %{name} = %{version}-%{release}
106 Conflicts: yum < 3.4.3-505
110 Yum compatibility layer for DNF.
112 %description -n yum -l pl.UTF-8
113 Warstwa zgodności z YUM-em dla DNF-a.
125 -DPYTHON_DESIRED:FILEPATH=%{__python3} \
126 -DPYTHON_INSTALL_DIR:PATH=%{py3_sitescriptdir} \
127 -DDNF_VERSION=%{version} \
128 -DSYSTEMD_DIR=%{systemdunitdir}
134 rm -rf $RPM_BUILD_ROOT
135 install -d $RPM_BUILD_ROOT%{_sysconfdir}/{yum,%{name}/{vars,aliases.d,plugins,modules.d,modules.defaults.d,repos.d}} \
136 -d $RPM_BUILD_ROOT{%{_localstatedir}/log/,%{_var}/cache/dnf} \
137 -d $RPM_BUILD_ROOT%{py3_sitescriptdir}/dnf-plugins/__pycache__
139 %{__make} -C build install \
140 DESTDIR=$RPM_BUILD_ROOT
142 touch $RPM_BUILD_ROOT%{_localstatedir}/log/%{name}.log
144 %{__mv} $RPM_BUILD_ROOT%{_bindir}/dnf-3 $RPM_BUILD_ROOT%{_bindir}/dnf
145 %{__mv} $RPM_BUILD_ROOT%{_bindir}/dnf-automatic-3 $RPM_BUILD_ROOT%{_bindir}/dnf-automatic
147 %{__rm} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{%{name}-strict.conf,aliases.d/zypper.conf}
150 ln -sr $RPM_BUILD_ROOT%{_sysconfdir}/{%{name}/%{name}.conf,yum.conf}
151 ln -sr $RPM_BUILD_ROOT%{_sysconfdir}/{%{name}/plugins,yum/pluginconf.d}
152 ln -sr $RPM_BUILD_ROOT%{_sysconfdir}/{%{name}/protected.d,yum/protected.d}
153 ln -sr $RPM_BUILD_ROOT%{_sysconfdir}/{%{name}/repos.d,yum/repos.d}
154 ln -sr $RPM_BUILD_ROOT%{_sysconfdir}/{%{name}/vars,yum/vars}
155 ln -s dnf $RPM_BUILD_ROOT%{_bindir}/yum
157 %ifarch i686 ppc sparc alpha athlon aarch64 %{arm}
158 %define ftp_arch %{_target_cpu}
160 %ifarch pentium2 pentium3 pentium4
161 %define ftp_arch i686
164 %define ftp_arch x86_64
165 %define ftp_alt_arch i686
166 %define ftp_alt2_arch x32
170 %define ftp_alt_arch x86_64
171 %define ftp_alt2_arch i686
174 %define pld_repo %{SOURCE1}
175 %define pld_archive_repo %{SOURCE2}
176 %define pld_debuginfo_repo %{SOURCE3}
179 %define pld_multilib_repo %{SOURCE4}
180 %define pld_multilib2_repo %{SOURCE4}
183 %{__sed} -e 's|%%ARCH%%|%{ftp_arch}|g' < %{pld_repo} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld.repo
185 %if 0%{?pld_multilib_repo:1}
186 %{__sed} 's|%%ARCH%%|%{ftp_alt_arch}|g' < %{pld_multilib_repo} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-%{ftp_alt_arch}.repo
189 %if 0%{?pld_multilib2_repo:1}
190 %{__sed} 's|%%ARCH%%|%{ftp_alt2_arch}|g' < %{pld_multilib_repo} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-%{ftp_alt2_arch}.repo
193 %if 0%{?pld_debuginfo_repo:1}
194 %{__sed} -e 's|%%ARCH%%|%{ftp_arch}|g' < %{pld_debuginfo_repo} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-debuginfo.repo
197 %if 0%{?pld_archive_repo:1}
198 %{__sed} -e 's|%%ARCH%%|%{ftp_arch}|g' < %{pld_archive_repo} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-archive.repo
201 %py3_comp $RPM_BUILD_ROOT%{py3_sitescriptdir}/dnf
202 %py3_ocomp $RPM_BUILD_ROOT%{py3_sitescriptdir}/dnf
207 rm -rf $RPM_BUILD_ROOT
210 %systemd_post dnf-makecache.timer
213 %systemd_preun dnf-makecache.timer
219 %systemd_post dnf-automatic.timer dnf-automatic-download.timer dnf-automatic-install.timer dnf-automatic-notifyonly.timer
222 %systemd_preun dnf-automatic.timer dnf-automatic-download.timer dnf-automatic-install.timer dnf-automatic-notifyonly.timer
227 %files -f %{name}.lang
228 %defattr(644,root,root,755)
229 %doc AUTHORS PACKAGE-LICENSING README.rst
230 %attr(755,root,root) %{_bindir}/dnf
231 %dir %{_sysconfdir}/%{name}
232 %dir %{_sysconfdir}/%{name}/plugins
233 %dir %{_sysconfdir}/%{name}/protected.d
234 %dir %{_sysconfdir}/%{name}/repos.d
235 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/dnf.conf
236 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/protected.d/dnf.conf
237 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/repos.d/*.repo
238 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/libreport/events.d/collect_dnf.conf
239 %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/%{name}
240 %{_mandir}/man5/dnf.conf.5*
241 %{_mandir}/man5/dnf-transaction-json.5*
242 %{_mandir}/man7/dnf.modularity.7*
243 %{_mandir}/man8/dnf.8*
244 %{_mandir}/man8/yum2dnf.8*
245 %{systemdunitdir}/dnf-makecache.service
246 %{systemdunitdir}/dnf-makecache.timer
247 %{systemdtmpfilesdir}/dnf.conf
248 %{py3_sitescriptdir}/dnf
249 %{py3_sitescriptdir}/dnf-plugins
250 %exclude %{py3_sitescriptdir}/dnf/automatic
251 %dir %{_var}/cache/dnf
252 %ghost %{_localstatedir}/log/%{name}.log
255 %defattr(644,root,root,755)
256 %attr(755,root,root) %{_bindir}/dnf-automatic
257 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/automatic.conf
258 %{_mandir}/man8/dnf-automatic.8*
259 %{systemdunitdir}/dnf-automatic-download.service
260 %{systemdunitdir}/dnf-automatic-download.timer
261 %{systemdunitdir}/dnf-automatic-install.service
262 %{systemdunitdir}/dnf-automatic-install.timer
263 %{systemdunitdir}/dnf-automatic-notifyonly.service
264 %{systemdunitdir}/dnf-automatic-notifyonly.timer
265 %{systemdunitdir}/dnf-automatic.service
266 %{systemdunitdir}/dnf-automatic.timer
267 %{py3_sitescriptdir}/dnf/automatic
269 %files -n bash-completion-dnf
270 %defattr(644,root,root,755)
274 %defattr(644,root,root,755)
275 %attr(755,root,root) %{_bindir}/yum
276 %{_sysconfdir}/yum.conf
277 %dir %{_sysconfdir}/yum
278 %{_sysconfdir}/yum/pluginconf.d
279 %{_sysconfdir}/yum/protected.d
280 %{_sysconfdir}/yum/repos.d
281 %{_sysconfdir}/yum/vars
282 %{_mandir}/man1/yum-aliases.1*
283 %{_mandir}/man5/yum.conf.5.*
284 %{_mandir}/man8/yum.8*
285 %{_mandir}/man8/yum-shell.8*
286 %config(noreplace) %{_sysconfdir}/%{name}/protected.d/yum.conf