]> git.pld-linux.org Git - packages/dnf.git/blob - dnf.spec
up to 4.17.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.17.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:  3ba77f1f0288155d9004e3778f9b7ac8
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 # YUM compat layer
153 ln -sr $RPM_BUILD_ROOT%{_sysconfdir}/{%{name}/%{name}.conf,yum.conf}
154 ln -sr $RPM_BUILD_ROOT%{_sysconfdir}/{%{name}/plugins,yum/pluginconf.d}
155 ln -sr $RPM_BUILD_ROOT%{_sysconfdir}/{%{name}/protected.d,yum/protected.d}
156 ln -sr $RPM_BUILD_ROOT%{_sysconfdir}/{%{name}/repos.d,yum/repos.d}
157 ln -sr $RPM_BUILD_ROOT%{_sysconfdir}/{%{name}/vars,yum/vars}
158 ln -s dnf $RPM_BUILD_ROOT%{_bindir}/yum
159
160 %ifarch i686 ppc sparc alpha athlon aarch64 %{arm}
161         %define         ftp_arch        %{_target_cpu}
162 %endif
163 %ifarch pentium2 pentium3 pentium4
164         %define         ftp_arch        i686
165 %endif
166 %ifarch %{x8664}
167         %define         ftp_arch        x86_64
168         %define         ftp_alt_arch    i686
169         %define         ftp_alt2_arch   x32
170 %endif
171 %ifarch x32
172         %define         ftp_arch        x32
173         %define         ftp_alt_arch    x86_64
174         %define         ftp_alt2_arch   i686
175 %endif
176
177 %define pld_repo %{SOURCE1}
178 %define pld_archive_repo %{SOURCE2}
179 %define pld_debuginfo_repo %{SOURCE3}
180
181 %ifarch %{x8664} x32
182         %define pld_multilib_repo %{SOURCE4}
183         %define pld_multilib2_repo %{SOURCE4}
184 %endif
185
186 %{__sed} -e 's|%%ARCH%%|%{ftp_arch}|g' < %{pld_repo} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld.repo
187
188 %if 0%{?pld_multilib_repo:1}
189         %{__sed} 's|%%ARCH%%|%{ftp_alt_arch}|g' < %{pld_multilib_repo} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-%{ftp_alt_arch}.repo
190 %endif
191
192 %if 0%{?pld_multilib2_repo:1}
193         %{__sed} 's|%%ARCH%%|%{ftp_alt2_arch}|g' < %{pld_multilib_repo} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-%{ftp_alt2_arch}.repo
194 %endif
195
196 %if 0%{?pld_debuginfo_repo:1}
197 %{__sed} -e 's|%%ARCH%%|%{ftp_arch}|g' < %{pld_debuginfo_repo} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-debuginfo.repo
198 %endif
199
200 %if 0%{?pld_archive_repo:1}
201 %{__sed} -e 's|%%ARCH%%|%{ftp_arch}|g' < %{pld_archive_repo} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-archive.repo
202 %endif
203
204 %py3_comp $RPM_BUILD_ROOT%{py3_sitescriptdir}/dnf
205 %py3_ocomp $RPM_BUILD_ROOT%{py3_sitescriptdir}/dnf
206
207 %find_lang %{name}
208
209 %clean
210 rm -rf $RPM_BUILD_ROOT
211
212 %post
213 %systemd_post dnf-makecache.timer
214
215 %preun
216 %systemd_preun dnf-makecache.timer
217
218 %postun
219 %systemd_reload
220
221 %post automatic
222 %systemd_post dnf-automatic.timer dnf-automatic-download.timer dnf-automatic-install.timer dnf-automatic-notifyonly.timer
223
224 %preun automatic
225 %systemd_preun dnf-automatic.timer dnf-automatic-download.timer dnf-automatic-install.timer dnf-automatic-notifyonly.timer
226
227 %postun automatic
228 %systemd_reload
229
230 %files -f %{name}.lang
231 %defattr(644,root,root,755)
232 %doc AUTHORS PACKAGE-LICENSING README.rst
233 %attr(755,root,root) %{_bindir}/dnf
234 %dir %{_sysconfdir}/%{name}
235 %dir %{_sysconfdir}/%{name}/plugins
236 %dir %{_sysconfdir}/%{name}/protected.d
237 %dir %{_sysconfdir}/%{name}/repos.d
238 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/dnf.conf
239 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/protected.d/dnf.conf
240 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/repos.d/*.repo
241 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/libreport/events.d/collect_dnf.conf
242 %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/%{name}
243 %{_mandir}/man5/dnf.conf.5*
244 %{_mandir}/man5/dnf-transaction-json.5*
245 %{_mandir}/man7/dnf.modularity.7*
246 %{_mandir}/man8/dnf.8*
247 %{_mandir}/man8/yum2dnf.8*
248 %{systemdunitdir}/dnf-makecache.service
249 %{systemdunitdir}/dnf-makecache.timer
250 %{systemdtmpfilesdir}/dnf.conf
251 %{py3_sitescriptdir}/dnf
252 %{py3_sitescriptdir}/dnf-plugins
253 %exclude %{py3_sitescriptdir}/dnf/automatic
254 %dir %{_var}/cache/dnf
255 %ghost %{_localstatedir}/log/%{name}.log
256
257 %files automatic
258 %defattr(644,root,root,755)
259 %attr(755,root,root) %{_bindir}/dnf-automatic
260 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/automatic.conf
261 %{_mandir}/man8/dnf-automatic.8*
262 %{systemdunitdir}/dnf-automatic-download.service
263 %{systemdunitdir}/dnf-automatic-download.timer
264 %{systemdunitdir}/dnf-automatic-install.service
265 %{systemdunitdir}/dnf-automatic-install.timer
266 %{systemdunitdir}/dnf-automatic-notifyonly.service
267 %{systemdunitdir}/dnf-automatic-notifyonly.timer
268 %{systemdunitdir}/dnf-automatic.service
269 %{systemdunitdir}/dnf-automatic.timer
270 %{py3_sitescriptdir}/dnf/automatic
271
272 %files -n bash-completion-dnf
273 %defattr(644,root,root,755)
274 %{bash_compdir}/dnf
275
276 %files -n yum
277 %defattr(644,root,root,755)
278 %attr(755,root,root) %{_bindir}/yum
279 %{_sysconfdir}/yum.conf
280 %dir %{_sysconfdir}/yum
281 %{_sysconfdir}/yum/pluginconf.d
282 %{_sysconfdir}/yum/protected.d
283 %{_sysconfdir}/yum/repos.d
284 %{_sysconfdir}/yum/vars
285 %{_mandir}/man1/yum-aliases.1*
286 %{_mandir}/man5/yum.conf.5.*
287 %{_mandir}/man8/yum.8*
288 %{_mandir}/man8/yum-shell.8*
289 %config(noreplace) %{_sysconfdir}/%{name}/protected.d/yum.conf
This page took 0.519863 seconds and 4 git commands to generate.