]> git.pld-linux.org Git - packages/dnf.git/blob - dnf.spec
up to 4.19.0
[packages/dnf.git] / dnf.spec
1 #
2 # Conditional build:
3 %bcond_without  tests           # build without tests
4 #
5 %define         hawkey_ver              0.67.0
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
11
12 Summary:        Package manager
13 Summary(pl.UTF-8):      Zarządca pakietów
14 Name:           dnf
15 Version:        4.19.0
16 Release:        1
17 Group:          Base
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
22 Source1:        pld.repo
23 Source2:        pld-archive.repo
24 Source3:        pld-debuginfo.repo
25 Source4:        pld-multilib.repo
26 Patch0:         install.patch
27 Patch1:         repos.d.patch
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}
50 Requires:       python3-gpg
51 Requires:       python3-hawkey >= %{hawkey_ver}
52 Requires:       python3-libcomps >= %{libcomps_ver}
53 Requires:       python3-libdnf >= %{hawkey_ver}
54 Requires:       python3-modules
55 Requires:       python3-rpm
56 Requires:       systemd-units >= 0.38
57 Recommends:     deltarpm
58 Recommends:     python3-dbus
59 Recommends:     python3-unbound
60 Recommends:     rpm-plugin-systemd-inhibit
61 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
62
63 %description
64 Utility that allows users to manage packages on their systems. It
65 supports RPMs, modules and comps groups & environments.
66
67 %description -l pl.UTF-8
68 Marzędzie umożliwiające użytkownikom zarządzanie pakietami w systemie.
69
70 %package automatic
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
73 Group:          Base
74 Requires(post): systemd
75 Requires(preun):        systemd
76 Requires(postun):       systemd
77 Requires:       %{name} = %{version}-%{release}
78 Requires:       python3-modules
79 BuildArch:      noarch
80
81 %description automatic
82 Alternative CLI to "dnf upgrade" suitable for automatic, regular
83 execution.
84
85 %description automatic -l pl.UTF-8
86 Alternatywny interfejs linii poleceń do "dnf upgrade", nadający się do
87 automatycznego, regularnego wywoływania.
88
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
95 BuildArch:      noarch
96
97 %description -n bash-completion-dnf
98 Bash completion for dnf command.
99
100 %description -n bash-completion-dnf -l pl.UTF-8
101 Bashowe uzupełnianie parametrów dla polecenia dnf.
102
103 %package -n yum
104 Summary:        Yum compatibility layer for DNF
105 Summary(pl.UTF-8):      Warstwa zgodności z YUM-em dla DNF-a
106 Group:          Base
107 Requires:       %{name} = %{version}-%{release}
108 Recommends:     sqlite3
109 Conflicts:      yum < 3.4.3-505
110 BuildArch:      noarch
111
112 %description -n yum
113 Yum compatibility layer for DNF.
114
115 %description -n yum -l pl.UTF-8
116 Warstwa zgodności z YUM-em dla DNF-a.
117
118 %prep
119 %setup -q
120 %patch0 -p1
121 %patch1 -p1
122 %patch2 -p1
123
124 %build
125 install -d build
126 cd build
127 %cmake .. \
128         -DPYTHON_DESIRED:FILEPATH=%{__python3} \
129         -DPYTHON_INSTALL_DIR:PATH=%{py3_sitescriptdir} \
130         -DDNF_VERSION=%{version} \
131         -DSYSTEMD_DIR=%{systemdunitdir}
132
133 %{__make}
134 %{__make} doc-man
135
136 %install
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__
141
142 %{__make} -C build install \
143         DESTDIR=$RPM_BUILD_ROOT
144
145 touch $RPM_BUILD_ROOT%{_localstatedir}/log/%{name}.log
146
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
149
150 %{__rm} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{%{name}-strict.conf,aliases.d/zypper.conf}
151
152 %{__rm} -r $RPM_BUILD_ROOT%{_localedir}/zh_Hans
153
154 # YUM compat layer
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
161
162 %ifarch i686 ppc sparc alpha athlon aarch64 %{arm}
163         %define         ftp_arch        %{_target_cpu}
164 %endif
165 %ifarch pentium2 pentium3 pentium4
166         %define         ftp_arch        i686
167 %endif
168 %ifarch %{x8664}
169         %define         ftp_arch        x86_64
170         %define         ftp_alt_arch    i686
171         %define         ftp_alt2_arch   x32
172 %endif
173 %ifarch x32
174         %define         ftp_arch        x32
175         %define         ftp_alt_arch    x86_64
176         %define         ftp_alt2_arch   i686
177 %endif
178
179 %define pld_repo %{SOURCE1}
180 %define pld_archive_repo %{SOURCE2}
181 %define pld_debuginfo_repo %{SOURCE3}
182
183 %ifarch %{x8664} x32
184         %define pld_multilib_repo %{SOURCE4}
185         %define pld_multilib2_repo %{SOURCE4}
186 %endif
187
188 %{__sed} -e 's|%%ARCH%%|%{ftp_arch}|g' < %{pld_repo} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld.repo
189
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
192 %endif
193
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
196 %endif
197
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
200 %endif
201
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
204 %endif
205
206 %py3_comp $RPM_BUILD_ROOT%{py3_sitescriptdir}/dnf
207 %py3_ocomp $RPM_BUILD_ROOT%{py3_sitescriptdir}/dnf
208
209 %find_lang %{name}
210
211 %clean
212 rm -rf $RPM_BUILD_ROOT
213
214 %post
215 %systemd_post dnf-makecache.timer
216
217 %preun
218 %systemd_preun dnf-makecache.timer
219
220 %postun
221 %systemd_reload
222
223 %post automatic
224 %systemd_post dnf-automatic.timer dnf-automatic-download.timer dnf-automatic-install.timer dnf-automatic-notifyonly.timer
225
226 %preun automatic
227 %systemd_preun dnf-automatic.timer dnf-automatic-download.timer dnf-automatic-install.timer dnf-automatic-notifyonly.timer
228
229 %postun automatic
230 %systemd_reload
231
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
258
259 %files automatic
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
273
274 %files -n bash-completion-dnf
275 %defattr(644,root,root,755)
276 %{bash_compdir}/dnf
277
278 %files -n yum
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
This page took 0.118471 seconds and 4 git commands to generate.