]> git.pld-linux.org Git - packages/dnf.git/blob - dnf.spec
yum depends directly on python3-modules too
[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.12.0
16 Release:        2
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:  0e0242e443f87290efd16226b056f18c
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:  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}
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-modules
54 Requires:       python3-rpm
55 Requires:       systemd-units >= 0.38
56 Recommends:     deltarpm
57 Recommends:     python3-dbus
58 Recommends:     python3-unbound
59 Recommends:     rpm-plugin-systemd-inhibit
60 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
61
62 %description
63 Utility that allows users to manage packages on their systems. It
64 supports RPMs, modules and comps groups & environments.
65
66 %description -l pl.UTF-8
67 Marzędzie umożliwiające użytkownikom zarządzanie pakietami w systemie.
68
69 %package automatic
70 Summary:        Alternative CLI to "dnf upgrade" suitable for automatic, regular execution
71 Summary(pl.UTF-8):      Alternatywny interfejs do "dnf upgrade" nadający się do automatycznego wywoływania
72 Group:          Base
73 Requires(post): systemd
74 Requires(preun):        systemd
75 Requires(postun):       systemd
76 Requires:       %{name} = %{version}-%{release}
77 Requires:       python3-modules
78 BuildArch:      noarch
79
80 %description automatic
81 Alternative CLI to "dnf upgrade" suitable for automatic, regular
82 execution.
83
84 %description automatic -l pl.UTF-8
85 Alternatywny interfejs linii poleceń do "dnf upgrade", nadający się do
86 automatycznego, regularnego wywoływania.
87
88 %package -n bash-completion-dnf
89 Summary:        Bash completion for dnf command
90 Summary(pl.UTF-8):      Bashowe uzupełnianie parametrów dla polecenia dnf
91 Group:          Applications/Shells
92 Requires:       %{name} = %{version}-%{release}
93 Requires:       bash-completion
94 BuildArch:      noarch
95
96 %description -n bash-completion-dnf
97 Bash completion for dnf command.
98
99 %description -n bash-completion-dnf -l pl.UTF-8
100 Bashowe uzupełnianie parametrów dla polecenia dnf.
101
102 %package -n yum
103 Summary:        Yum compatibility layer for DNF
104 Summary(pl.UTF-8):      Warstwa zgodności z YUM-em dla DNF-a
105 Group:          Base
106 Requires:       %{name} = %{version}-%{release}
107 Recommends:     sqlite3
108 Conflicts:      yum < 3.4.3-505
109 BuildArch:      noarch
110
111 %description -n yum
112 Yum compatibility layer for DNF.
113
114 %description -n yum -l pl.UTF-8
115 Warstwa zgodności z YUM-em dla DNF-a.
116
117 %prep
118 %setup -q
119 %patch0 -p1
120 %patch1 -p1
121 %patch2 -p1
122
123 %build
124 install -d build
125 cd build
126 %cmake .. \
127         -DPYTHON_DESIRED:FILEPATH=%{__python3} \
128         -DPYTHON_INSTALL_DIR:PATH=%{py3_sitescriptdir} \
129         -DDNF_VERSION=%{version} \
130         -DSYSTEMD_DIR=%{systemdunitdir}
131
132 %{__make}
133 %{__make} doc-man
134
135 %install
136 rm -rf $RPM_BUILD_ROOT
137 install -d $RPM_BUILD_ROOT%{_sysconfdir}/{yum,%{name}/{vars,aliases.d,plugins,modules.d,modules.defaults.d,repos.d}} \
138         -d $RPM_BUILD_ROOT{%{_localstatedir}/log/,%{_var}/cache/dnf} \
139         -d $RPM_BUILD_ROOT%{py3_sitescriptdir}/dnf-plugins/__pycache__
140
141 %{__make} -C build install \
142         DESTDIR=$RPM_BUILD_ROOT
143
144 touch $RPM_BUILD_ROOT%{_localstatedir}/log/%{name}.log
145
146 %{__mv} $RPM_BUILD_ROOT%{_bindir}/dnf-3 $RPM_BUILD_ROOT%{_bindir}/dnf
147 %{__mv} $RPM_BUILD_ROOT%{_bindir}/dnf-automatic-3 $RPM_BUILD_ROOT%{_bindir}/dnf-automatic
148
149 %{__rm} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{%{name}-strict.conf,aliases.d/zypper.conf}
150
151 # YUM compat layer
152 ln -sr $RPM_BUILD_ROOT%{_sysconfdir}/{%{name}/%{name}.conf,yum.conf}
153 ln -sr $RPM_BUILD_ROOT%{_sysconfdir}/{%{name}/plugins,yum/pluginconf.d}
154 ln -sr $RPM_BUILD_ROOT%{_sysconfdir}/{%{name}/protected.d,yum/protected.d}
155 ln -sr $RPM_BUILD_ROOT%{_sysconfdir}/{%{name}/repos.d,yum/repos.d}
156 ln -sr $RPM_BUILD_ROOT%{_sysconfdir}/{%{name}/vars,yum/vars}
157 ln -s dnf $RPM_BUILD_ROOT%{_bindir}/yum
158
159 %ifarch i686 ppc sparc alpha athlon aarch64 %{arm}
160         %define         ftp_arch        %{_target_cpu}
161 %endif
162 %ifarch pentium2 pentium3 pentium4
163         %define         ftp_arch        i686
164 %endif
165 %ifarch %{x8664}
166         %define         ftp_arch        x86_64
167         %define         ftp_alt_arch    i686
168         %define         ftp_alt2_arch   x32
169 %endif
170 %ifarch x32
171         %define         ftp_arch        x32
172         %define         ftp_alt_arch    x86_64
173         %define         ftp_alt2_arch   i686
174 %endif
175
176 %define pld_repo %{SOURCE1}
177 %define pld_archive_repo %{SOURCE2}
178 %define pld_debuginfo_repo %{SOURCE3}
179
180 %ifarch %{x8664} x32
181         %define pld_multilib_repo %{SOURCE4}
182         %define pld_multilib2_repo %{SOURCE4}
183 %endif
184
185 %{__sed} -e 's|%%ARCH%%|%{ftp_arch}|g' < %{pld_repo} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld.repo
186
187 %if 0%{?pld_multilib_repo:1}
188         %{__sed} 's|%%ARCH%%|%{ftp_alt_arch}|g' < %{pld_multilib_repo} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-%{ftp_alt_arch}.repo
189 %endif
190
191 %if 0%{?pld_multilib2_repo:1}
192         %{__sed} 's|%%ARCH%%|%{ftp_alt2_arch}|g' < %{pld_multilib_repo} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-%{ftp_alt2_arch}.repo
193 %endif
194
195 %if 0%{?pld_debuginfo_repo:1}
196 %{__sed} -e 's|%%ARCH%%|%{ftp_arch}|g' < %{pld_debuginfo_repo} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-debuginfo.repo
197 %endif
198
199 %if 0%{?pld_archive_repo:1}
200 %{__sed} -e 's|%%ARCH%%|%{ftp_arch}|g' < %{pld_archive_repo} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-archive.repo
201 %endif
202
203 %py3_comp $RPM_BUILD_ROOT%{py3_sitescriptdir}/dnf
204 %py3_ocomp $RPM_BUILD_ROOT%{py3_sitescriptdir}/dnf
205
206 %find_lang %{name}
207
208 %clean
209 rm -rf $RPM_BUILD_ROOT
210
211 %post
212 %systemd_post dnf-makecache.timer
213
214 %preun
215 %systemd_preun dnf-makecache.timer
216
217 %postun
218 %systemd_reload
219
220 %post automatic
221 %systemd_post dnf-automatic.timer dnf-automatic-download.timer dnf-automatic-install.timer dnf-automatic-notifyonly.timer
222
223 %preun automatic
224 %systemd_preun dnf-automatic.timer dnf-automatic-download.timer dnf-automatic-install.timer dnf-automatic-notifyonly.timer
225
226 %postun automatic
227 %systemd_reload
228
229 %files -f %{name}.lang
230 %defattr(644,root,root,755)
231 %doc AUTHORS PACKAGE-LICENSING README.rst
232 %attr(755,root,root) %{_bindir}/dnf
233 %dir %{_sysconfdir}/%{name}
234 %dir %{_sysconfdir}/%{name}/plugins
235 %dir %{_sysconfdir}/%{name}/protected.d
236 %dir %{_sysconfdir}/%{name}/repos.d
237 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/dnf.conf
238 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/protected.d/dnf.conf
239 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/repos.d/*.repo
240 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/libreport/events.d/collect_dnf.conf
241 %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/%{name}
242 %{_mandir}/man5/dnf.conf.5*
243 %{_mandir}/man5/dnf-transaction-json.5*
244 %{_mandir}/man7/dnf.modularity.7*
245 %{_mandir}/man8/dnf.8*
246 %{_mandir}/man8/yum2dnf.8*
247 %{systemdunitdir}/dnf-makecache.service
248 %{systemdunitdir}/dnf-makecache.timer
249 %{systemdtmpfilesdir}/dnf.conf
250 %{py3_sitescriptdir}/dnf
251 %{py3_sitescriptdir}/dnf-plugins
252 %exclude %{py3_sitescriptdir}/dnf/automatic
253 %dir %{_var}/cache/dnf
254 %ghost %{_localstatedir}/log/%{name}.log
255
256 %files automatic
257 %defattr(644,root,root,755)
258 %attr(755,root,root) %{_bindir}/dnf-automatic
259 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/automatic.conf
260 %{_mandir}/man8/dnf-automatic.8*
261 %{systemdunitdir}/dnf-automatic-download.service
262 %{systemdunitdir}/dnf-automatic-download.timer
263 %{systemdunitdir}/dnf-automatic-install.service
264 %{systemdunitdir}/dnf-automatic-install.timer
265 %{systemdunitdir}/dnf-automatic-notifyonly.service
266 %{systemdunitdir}/dnf-automatic-notifyonly.timer
267 %{systemdunitdir}/dnf-automatic.service
268 %{systemdunitdir}/dnf-automatic.timer
269 %{py3_sitescriptdir}/dnf/automatic
270
271 %files -n bash-completion-dnf
272 %defattr(644,root,root,755)
273 %{bash_compdir}/dnf
274
275 %files -n yum
276 %defattr(644,root,root,755)
277 %attr(755,root,root) %{_bindir}/yum
278 %{_sysconfdir}/yum.conf
279 %dir %{_sysconfdir}/yum
280 %{_sysconfdir}/yum/pluginconf.d
281 %{_sysconfdir}/yum/protected.d
282 %{_sysconfdir}/yum/repos.d
283 %{_sysconfdir}/yum/vars
284 %{_mandir}/man1/yum-aliases.1*
285 %{_mandir}/man5/yum.conf.5.*
286 %{_mandir}/man8/yum.8*
287 %{_mandir}/man8/yum-shell.8*
288 %config(noreplace) %{_sysconfdir}/%{name}/protected.d/yum.conf
This page took 0.093407 seconds and 4 git commands to generate.