]>
Commit | Line | Data |
---|---|---|
f637201a ER |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without tests # build without tests | |
4 | # | |
88a32d38 | 5 | %define hawkey_ver 0.67.0 |
9fd94ada JR |
6 | %define libcomps_ver 0.1.8 |
7 | %define libmodulemd_ver 2.9.3 | |
8 | %define rpm_ver 4.14.0 | |
9 | ||
10 | %define _enable_debug_packages 0 | |
1abae8cd JR |
11 | |
12 | Summary: Package manager | |
13 | Summary(pl.UTF-8): Zarządca pakietów | |
feb41732 | 14 | Name: dnf |
6afe0962 | 15 | Version: 4.12.0 |
5467f6f6 | 16 | Release: 2 |
feb41732 | 17 | Group: Base |
a1a5f7dd JB |
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) | |
1abae8cd | 20 | Source0: https://github.com/rpm-software-management/dnf/archive/%{version}/%{name}-%{version}.tar.gz |
6afe0962 | 21 | # Source0-md5: 0e0242e443f87290efd16226b056f18c |
85a72ee1 JR |
22 | Source1: pld.repo |
23 | Source2: pld-archive.repo | |
24 | Source3: pld-debuginfo.repo | |
25 | Source4: pld-multilib.repo | |
1abae8cd | 26 | Patch0: install.patch |
85a72ee1 | 27 | Patch1: repos.d.patch |
5467f6f6 | 28 | Patch2: uname-cpuinfo-deps.patch |
70e5df64 | 29 | URL: https://github.com/rpm-software-management/dnf |
5aa69e21 | 30 | BuildRequires: bash-completion-devel |
a1a5f7dd | 31 | BuildRequires: cmake >= 2.4 |
cebdb6a6 | 32 | BuildRequires: gettext-tools |
14ed53ae | 33 | BuildRequires: libmodulemd >= %{libmodulemd_ver} |
1abae8cd JR |
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} | |
feb41732 | 42 | BuildRequires: rpmbuild(macros) >= 1.647 |
1abae8cd | 43 | BuildRequires: rpm-pythonprov |
feb41732 ER |
44 | BuildRequires: sed >= 4.0 |
45 | BuildRequires: sphinx-pdg | |
46 | BuildRequires: systemd-devel | |
47 | Requires(post,preun,postun): systemd-units >= 38 | |
14ed53ae | 48 | Requires: libmodulemd >= %{libmodulemd_ver} |
1abae8cd JR |
49 | Requires: python3-gpg |
50 | Requires: python3-hawkey >= %{hawkey_ver} | |
51 | Requires: python3-libcomps >= %{libcomps_ver} | |
52 | Requires: python3-libdnf >= %{hawkey_ver} | |
53 | Requires: python3-rpm | |
feb41732 | 54 | Requires: systemd-units >= 0.38 |
1abae8cd JR |
55 | Recommends: deltarpm |
56 | Recommends: python3-dbus | |
57 | Recommends: python3-unbound | |
58 | Recommends: rpm-plugin-systemd-inhibit | |
feb41732 ER |
59 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
60 | ||
61 | %description | |
1abae8cd JR |
62 | Utility that allows users to manage packages on their systems. It |
63 | supports RPMs, modules and comps groups & environments. | |
feb41732 | 64 | |
d3326039 | 65 | %description -l pl.UTF-8 |
1abae8cd JR |
66 | Marzędzie umożliwiające użytkownikom zarządzanie pakietami w systemie. |
67 | ||
70e5df64 ER |
68 | %package automatic |
69 | Summary: Alternative CLI to "dnf upgrade" suitable for automatic, regular execution | |
d3326039 | 70 | Summary(pl.UTF-8): Alternatywny interfejs do "dnf upgrade" nadający się do automatycznego wywoływania |
70e5df64 | 71 | Group: Base |
70e5df64 ER |
72 | Requires(post): systemd |
73 | Requires(preun): systemd | |
74 | Requires(postun): systemd | |
d3326039 | 75 | Requires: %{name} = %{version}-%{release} |
9fd94ada | 76 | BuildArch: noarch |
70e5df64 ER |
77 | |
78 | %description automatic | |
79 | Alternative CLI to "dnf upgrade" suitable for automatic, regular | |
80 | execution. | |
81 | ||
d3326039 JB |
82 | %description automatic -l pl.UTF-8 |
83 | Alternatywny interfejs linii poleceń do "dnf upgrade", nadający się do | |
84 | automatycznego, regularnego wywoływania. | |
85 | ||
a1a5f7dd JB |
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 | |
9fd94ada | 92 | BuildArch: noarch |
a1a5f7dd JB |
93 | |
94 | %description -n bash-completion-dnf | |
95 | Bash completion for dnf command. | |
96 | ||
97 | %description -n bash-completion-dnf -l pl.UTF-8 | |
98 | Bashowe uzupełnianie parametrów dla polecenia dnf. | |
99 | ||
1abae8cd | 100 | %package -n yum |
3658ab37 JB |
101 | Summary: Yum compatibility layer for DNF |
102 | Summary(pl.UTF-8): Warstwa zgodności z YUM-em dla DNF-a | |
14ed53ae | 103 | Group: Base |
a1a5f7dd | 104 | Requires: %{name} = %{version}-%{release} |
1abae8cd JR |
105 | Recommends: sqlite3 |
106 | Conflicts: yum < 3.4.3-505 | |
9fd94ada | 107 | BuildArch: noarch |
a1a5f7dd | 108 | |
1abae8cd | 109 | %description -n yum |
3658ab37 | 110 | Yum compatibility layer for DNF. |
a1a5f7dd | 111 | |
1abae8cd | 112 | %description -n yum -l pl.UTF-8 |
3658ab37 | 113 | Warstwa zgodności z YUM-em dla DNF-a. |
a1a5f7dd | 114 | |
feb41732 | 115 | %prep |
1abae8cd | 116 | %setup -q |
38fbb761 | 117 | %patch0 -p1 |
85a72ee1 | 118 | %patch1 -p1 |
5467f6f6 | 119 | %patch2 -p1 |
feb41732 | 120 | |
feb41732 | 121 | %build |
1abae8cd JR |
122 | install -d build |
123 | cd build | |
a1a5f7dd | 124 | %cmake .. \ |
1abae8cd JR |
125 | -DPYTHON_DESIRED:FILEPATH=%{__python3} \ |
126 | -DPYTHON_INSTALL_DIR:PATH=%{py3_sitescriptdir} \ | |
127 | -DDNF_VERSION=%{version} \ | |
a1a5f7dd | 128 | -DSYSTEMD_DIR=%{systemdunitdir} |
feb41732 ER |
129 | |
130 | %{__make} | |
131 | %{__make} doc-man | |
132 | ||
feb41732 ER |
133 | %install |
134 | rm -rf $RPM_BUILD_ROOT | |
85a72ee1 | 135 | install -d $RPM_BUILD_ROOT%{_sysconfdir}/{yum,%{name}/{vars,aliases.d,plugins,modules.d,modules.defaults.d,repos.d}} \ |
747eb767 | 136 | -d $RPM_BUILD_ROOT{%{_localstatedir}/log/,%{_var}/cache/dnf} \ |
748413d4 | 137 | -d $RPM_BUILD_ROOT%{py3_sitescriptdir}/dnf-plugins/__pycache__ |
a1a5f7dd | 138 | |
1abae8cd | 139 | %{__make} -C build install \ |
feb41732 ER |
140 | DESTDIR=$RPM_BUILD_ROOT |
141 | ||
1abae8cd | 142 | touch $RPM_BUILD_ROOT%{_localstatedir}/log/%{name}.log |
feb41732 | 143 | |
1abae8cd JR |
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 | |
feb41732 | 146 | |
1abae8cd | 147 | %{__rm} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{%{name}-strict.conf,aliases.d/zypper.conf} |
a1a5f7dd | 148 | |
1abae8cd JR |
149 | # YUM compat layer |
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} | |
85a72ee1 | 153 | ln -sr $RPM_BUILD_ROOT%{_sysconfdir}/{%{name}/repos.d,yum/repos.d} |
1abae8cd | 154 | ln -sr $RPM_BUILD_ROOT%{_sysconfdir}/{%{name}/vars,yum/vars} |
3658ab37 | 155 | ln -s dnf $RPM_BUILD_ROOT%{_bindir}/yum |
a1a5f7dd | 156 | |
85a72ee1 JR |
157 | %ifarch i686 ppc sparc alpha athlon aarch64 %{arm} |
158 | %define ftp_arch %{_target_cpu} | |
159 | %endif | |
160 | %ifarch pentium2 pentium3 pentium4 | |
161 | %define ftp_arch i686 | |
162 | %endif | |
163 | %ifarch %{x8664} | |
164 | %define ftp_arch x86_64 | |
165 | %define ftp_alt_arch i686 | |
166 | %define ftp_alt2_arch x32 | |
167 | %endif | |
168 | %ifarch x32 | |
169 | %define ftp_arch x32 | |
170 | %define ftp_alt_arch x86_64 | |
171 | %define ftp_alt2_arch i686 | |
172 | %endif | |
173 | ||
174 | %define pld_repo %{SOURCE1} | |
175 | %define pld_archive_repo %{SOURCE2} | |
176 | %define pld_debuginfo_repo %{SOURCE3} | |
177 | ||
178 | %ifarch %{x8664} x32 | |
179 | %define pld_multilib_repo %{SOURCE4} | |
180 | %define pld_multilib2_repo %{SOURCE4} | |
181 | %endif | |
182 | ||
183 | %{__sed} -e 's|%%ARCH%%|%{ftp_arch}|g' < %{pld_repo} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld.repo | |
184 | ||
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 | |
187 | %endif | |
188 | ||
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 | |
191 | %endif | |
192 | ||
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 | |
195 | %endif | |
196 | ||
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 | |
199 | %endif | |
200 | ||
748413d4 JR |
201 | %py3_comp $RPM_BUILD_ROOT%{py3_sitescriptdir}/dnf |
202 | %py3_ocomp $RPM_BUILD_ROOT%{py3_sitescriptdir}/dnf | |
203 | ||
1abae8cd | 204 | %find_lang %{name} |
feb41732 ER |
205 | |
206 | %clean | |
207 | rm -rf $RPM_BUILD_ROOT | |
208 | ||
209 | %post | |
210 | %systemd_post dnf-makecache.timer | |
211 | ||
212 | %preun | |
213 | %systemd_preun dnf-makecache.timer | |
214 | ||
215 | %postun | |
216 | %systemd_reload | |
217 | ||
70e5df64 | 218 | %post automatic |
1abae8cd | 219 | %systemd_post dnf-automatic.timer dnf-automatic-download.timer dnf-automatic-install.timer dnf-automatic-notifyonly.timer |
70e5df64 ER |
220 | |
221 | %preun automatic | |
1abae8cd | 222 | %systemd_preun dnf-automatic.timer dnf-automatic-download.timer dnf-automatic-install.timer dnf-automatic-notifyonly.timer |
70e5df64 ER |
223 | |
224 | %postun automatic | |
225 | %systemd_reload | |
226 | ||
feb41732 ER |
227 | %files -f %{name}.lang |
228 | %defattr(644,root,root,755) | |
a1a5f7dd | 229 | %doc AUTHORS PACKAGE-LICENSING README.rst |
feb41732 ER |
230 | %attr(755,root,root) %{_bindir}/dnf |
231 | %dir %{_sysconfdir}/%{name} | |
70e5df64 ER |
232 | %dir %{_sysconfdir}/%{name}/plugins |
233 | %dir %{_sysconfdir}/%{name}/protected.d | |
85a72ee1 | 234 | %dir %{_sysconfdir}/%{name}/repos.d |
feb41732 | 235 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/dnf.conf |
70e5df64 | 236 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/protected.d/dnf.conf |
85a72ee1 | 237 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/repos.d/*.repo |
feb41732 ER |
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} | |
1abae8cd JR |
240 | %{_mandir}/man5/dnf.conf.5* |
241 | %{_mandir}/man5/dnf-transaction-json.5* | |
242 | %{_mandir}/man7/dnf.modularity.7* | |
feb41732 | 243 | %{_mandir}/man8/dnf.8* |
1abae8cd | 244 | %{_mandir}/man8/yum2dnf.8* |
feb41732 ER |
245 | %{systemdunitdir}/dnf-makecache.service |
246 | %{systemdunitdir}/dnf-makecache.timer | |
1abae8cd JR |
247 | %{systemdtmpfilesdir}/dnf.conf |
248 | %{py3_sitescriptdir}/dnf | |
748413d4 | 249 | %{py3_sitescriptdir}/dnf-plugins |
1abae8cd | 250 | %exclude %{py3_sitescriptdir}/dnf/automatic |
747eb767 | 251 | %dir %{_var}/cache/dnf |
feb41732 | 252 | %ghost %{_localstatedir}/log/%{name}.log |
70e5df64 ER |
253 | |
254 | %files automatic | |
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 | |
1abae8cd JR |
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 | |
70e5df64 ER |
265 | %{systemdunitdir}/dnf-automatic.service |
266 | %{systemdunitdir}/dnf-automatic.timer | |
1abae8cd | 267 | %{py3_sitescriptdir}/dnf/automatic |
a1a5f7dd JB |
268 | |
269 | %files -n bash-completion-dnf | |
270 | %defattr(644,root,root,755) | |
5aa69e21 | 271 | %{bash_compdir}/dnf |
a1a5f7dd | 272 | |
1abae8cd | 273 | %files -n yum |
a1a5f7dd | 274 | %defattr(644,root,root,755) |
1abae8cd JR |
275 | %attr(755,root,root) %{_bindir}/yum |
276 | %{_sysconfdir}/yum.conf | |
3524bf68 | 277 | %dir %{_sysconfdir}/yum |
1abae8cd JR |
278 | %{_sysconfdir}/yum/pluginconf.d |
279 | %{_sysconfdir}/yum/protected.d | |
85a72ee1 | 280 | %{_sysconfdir}/yum/repos.d |
1abae8cd | 281 | %{_sysconfdir}/yum/vars |
e2633179 | 282 | %{_mandir}/man1/yum-aliases.1* |
1abae8cd | 283 | %{_mandir}/man5/yum.conf.5.* |
e2633179 | 284 | %{_mandir}/man8/yum.8* |
1abae8cd | 285 | %{_mandir}/man8/yum-shell.8* |
1abae8cd | 286 | %config(noreplace) %{_sysconfdir}/%{name}/protected.d/yum.conf |