]> git.pld-linux.org Git - packages/dnf.git/blob - dnf.spec
- set repos.d dir under /etc/dnf and add PLD Th repos
[packages/dnf.git] / dnf.spec
1 #
2 # Conditional build:
3 %bcond_without  tests           # build without tests
4 #
5 %define hawkey_ver      0.59.0
6 %define libcomps_ver    0.1.8
7 %define libmodulemd_ver 2.9.3
8 %define rpm_ver         4.14.0
9
10 Summary:        Package manager
11 Summary(pl.UTF-8):      Zarządca pakietów
12 Name:           dnf
13 Version:        4.6.1
14 Release:        7
15 Group:          Base
16 # GPL v2+ with GPL v2 and GPL parts; for a breakdown of the licensing, see PACKAGE-LICENSING
17 License:        GPL v2 (parts on GPL v2+ or GPL)
18 Source0:        https://github.com/rpm-software-management/dnf/archive/%{version}/%{name}-%{version}.tar.gz
19 # Source0-md5:  21880d44905d6aa67ab6bee1e86380b3
20 Source1:        pld.repo
21 Source2:        pld-archive.repo
22 Source3:        pld-debuginfo.repo
23 Source4:        pld-multilib.repo
24 Patch0:         install.patch
25 Patch1:         repos.d.patch
26 URL:            https://github.com/rpm-software-management/dnf
27 BuildRequires:  bash-completion-devel
28 BuildRequires:  cmake >= 2.4
29 BuildRequires:  gettext-tools
30 BuildRequires:  libmodulemd >= %{libmodulemd_ver}
31 BuildRequires:  python3
32 BuildRequires:  python3-gpg
33 BuildRequires:  python3-hawkey >= %{hawkey_ver}
34 BuildRequires:  python3-libcomps >= %{libcomps_ver}
35 BuildRequires:  python3-libdnf >= %{hawkey_ver}
36 BuildRequires:  python3-modules
37 BuildRequires:  python3-nose
38 BuildRequires:  python3-rpm >= %{rpm_ver}
39 BuildRequires:  rpmbuild(macros) >= 1.647
40 BuildRequires:  rpm-pythonprov
41 BuildRequires:  sed >= 4.0
42 BuildRequires:  sphinx-pdg
43 BuildRequires:  systemd-devel
44 Requires(post,preun,postun):    systemd-units >= 38
45 Requires:       libmodulemd >= %{libmodulemd_ver}
46 Requires:       python3-gpg
47 Requires:       python3-hawkey >= %{hawkey_ver}
48 Requires:       python3-libcomps >= %{libcomps_ver}
49 Requires:       python3-libdnf >= %{hawkey_ver}
50 Requires:       python3-rpm
51 Requires:       systemd-units >= 0.38
52 Recommends:     deltarpm
53 Recommends:     python3-dbus
54 Recommends:     python3-unbound
55 Recommends:     rpm-plugin-systemd-inhibit
56 BuildArch:      noarch
57 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
58
59 %description
60 Utility that allows users to manage packages on their systems. It
61 supports RPMs, modules and comps groups & environments.
62
63 %description -l pl.UTF-8
64 Marzędzie umożliwiające użytkownikom zarządzanie pakietami w systemie.
65
66 %package common
67 Summary:        Common data and configuration files for DNF
68 Summary(pl.UTF-8):      Wspólne dane i pliki konfiguracyjne dla DNF-a
69 Group:          Base
70 Requires:       libreport-filesystem
71
72 %description common
73 Common data and configuration files for DNF.
74
75 %description common -l pl.UTF-8
76 Wspólne dane i pliki konfiguracyjne dla DNF-a.
77
78 %package automatic
79 Summary:        Alternative CLI to "dnf upgrade" suitable for automatic, regular execution
80 Summary(pl.UTF-8):      Alternatywny interfejs do "dnf upgrade" nadający się do automatycznego wywoływania
81 Group:          Base
82 Requires(post): systemd
83 Requires(preun):        systemd
84 Requires(postun):       systemd
85 Requires:       %{name} = %{version}-%{release}
86
87 %description automatic
88 Alternative CLI to "dnf upgrade" suitable for automatic, regular
89 execution.
90
91 %description automatic -l pl.UTF-8
92 Alternatywny interfejs linii poleceń do "dnf upgrade", nadający się do
93 automatycznego, regularnego wywoływania.
94
95 %package -n bash-completion-dnf
96 Summary:        Bash completion for dnf command
97 Summary(pl.UTF-8):      Bashowe uzupełnianie parametrów dla polecenia dnf
98 Group:          Applications/Shells
99 Requires:       %{name} = %{version}-%{release}
100 Requires:       bash-completion
101
102 %description -n bash-completion-dnf
103 Bash completion for dnf command.
104
105 %description -n bash-completion-dnf -l pl.UTF-8
106 Bashowe uzupełnianie parametrów dla polecenia dnf.
107
108 %package -n yum
109 Summary:        Yum compatibility layer for DNF
110 Summary(pl.UTF-8):      Warstwa zgodności z YUM-em dla DNF-a
111 Group:          Base
112 Requires:       %{name} = %{version}-%{release}
113 Recommends:     sqlite3
114 Conflicts:      yum < 3.4.3-505
115
116 %description -n yum
117 Yum compatibility layer for DNF.
118
119 %description -n yum -l pl.UTF-8
120 Warstwa zgodności z YUM-em dla DNF-a.
121
122 %prep
123 %setup -q
124 %patch0 -p1
125 %patch1 -p1
126
127 %build
128 install -d build
129 cd build
130 %cmake .. \
131         -DPYTHON_DESIRED:FILEPATH=%{__python3} \
132         -DPYTHON_INSTALL_DIR:PATH=%{py3_sitescriptdir} \
133         -DDNF_VERSION=%{version} \
134         -DSYSTEMD_DIR=%{systemdunitdir}
135
136 %{__make}
137 %{__make} doc-man
138
139 %install
140 rm -rf $RPM_BUILD_ROOT
141 install -d $RPM_BUILD_ROOT%{_sysconfdir}/{yum,%{name}/{vars,aliases.d,plugins,modules.d,modules.defaults.d,repos.d}} \
142         -d $RPM_BUILD_ROOT{%{_localstatedir}/log/,%{_var}/cache/dnf} \
143         -d $RPM_BUILD_ROOT%{py3_sitescriptdir}/dnf-plugins/__pycache__
144
145 %{__make} -C build install \
146         DESTDIR=$RPM_BUILD_ROOT
147
148 touch $RPM_BUILD_ROOT%{_localstatedir}/log/%{name}.log
149
150 %{__mv} $RPM_BUILD_ROOT%{_bindir}/dnf-3 $RPM_BUILD_ROOT%{_bindir}/dnf
151 %{__mv} $RPM_BUILD_ROOT%{_bindir}/dnf-automatic-3 $RPM_BUILD_ROOT%{_bindir}/dnf-automatic
152
153 %{__rm} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{%{name}-strict.conf,aliases.d/zypper.conf}
154
155 # YUM compat layer
156 ln -sr $RPM_BUILD_ROOT%{_sysconfdir}/{%{name}/%{name}.conf,yum.conf}
157 ln -sr $RPM_BUILD_ROOT%{_sysconfdir}/{%{name}/plugins,yum/pluginconf.d}
158 ln -sr $RPM_BUILD_ROOT%{_sysconfdir}/{%{name}/protected.d,yum/protected.d}
159 ln -sr $RPM_BUILD_ROOT%{_sysconfdir}/{%{name}/repos.d,yum/repos.d}
160 ln -sr $RPM_BUILD_ROOT%{_sysconfdir}/{%{name}/vars,yum/vars}
161 ln -s dnf $RPM_BUILD_ROOT%{_bindir}/yum
162
163 %ifarch i686 ppc sparc alpha athlon aarch64 %{arm}
164         %define         ftp_arch        %{_target_cpu}
165 %endif
166 %ifarch pentium2 pentium3 pentium4
167         %define         ftp_arch        i686
168 %endif
169 %ifarch %{x8664}
170         %define         ftp_arch        x86_64
171         %define         ftp_alt_arch    i686
172         %define         ftp_alt2_arch   x32
173 %endif
174 %ifarch x32
175         %define         ftp_arch        x32
176         %define         ftp_alt_arch    x86_64
177         %define         ftp_alt2_arch   i686
178 %endif
179
180 %define pld_repo %{SOURCE1}
181 %define pld_archive_repo %{SOURCE2}
182 %define pld_debuginfo_repo %{SOURCE3}
183
184 %ifarch %{x8664} x32
185         %define pld_multilib_repo %{SOURCE4}
186         %define pld_multilib2_repo %{SOURCE4}
187 %endif
188
189 %{__sed} -e 's|%%ARCH%%|%{ftp_arch}|g' < %{pld_repo} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld.repo
190
191 %if 0%{?pld_multilib_repo:1}
192         %{__sed} 's|%%ARCH%%|%{ftp_alt_arch}|g' < %{pld_multilib_repo} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-%{ftp_alt_arch}.repo
193 %endif
194
195 %if 0%{?pld_multilib2_repo:1}
196         %{__sed} 's|%%ARCH%%|%{ftp_alt2_arch}|g' < %{pld_multilib_repo} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-%{ftp_alt2_arch}.repo
197 %endif
198
199 %if 0%{?pld_debuginfo_repo:1}
200 %{__sed} -e 's|%%ARCH%%|%{ftp_arch}|g' < %{pld_debuginfo_repo} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-debuginfo.repo
201 %endif
202
203 %if 0%{?pld_archive_repo:1}
204 %{__sed} -e 's|%%ARCH%%|%{ftp_arch}|g' < %{pld_archive_repo} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-archive.repo
205 %endif
206
207 %py3_comp $RPM_BUILD_ROOT%{py3_sitescriptdir}/dnf
208 %py3_ocomp $RPM_BUILD_ROOT%{py3_sitescriptdir}/dnf
209
210 %find_lang %{name}
211
212 %clean
213 rm -rf $RPM_BUILD_ROOT
214
215 %post
216 %systemd_post dnf-makecache.timer
217
218 %preun
219 %systemd_preun dnf-makecache.timer
220
221 %postun
222 %systemd_reload
223
224 %post automatic
225 %systemd_post dnf-automatic.timer dnf-automatic-download.timer dnf-automatic-install.timer dnf-automatic-notifyonly.timer
226
227 %preun automatic
228 %systemd_preun dnf-automatic.timer dnf-automatic-download.timer dnf-automatic-install.timer dnf-automatic-notifyonly.timer
229
230 %postun automatic
231 %systemd_reload
232
233 %files -f %{name}.lang
234 %defattr(644,root,root,755)
235 %doc AUTHORS PACKAGE-LICENSING README.rst
236 %attr(755,root,root) %{_bindir}/dnf
237 %dir %{_sysconfdir}/%{name}
238 %dir %{_sysconfdir}/%{name}/plugins
239 %dir %{_sysconfdir}/%{name}/protected.d
240 %dir %{_sysconfdir}/%{name}/repos.d
241 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/dnf.conf
242 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/protected.d/dnf.conf
243 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/repos.d/*.repo
244 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/libreport/events.d/collect_dnf.conf
245 %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/%{name}
246 %{_mandir}/man5/dnf.conf.5*
247 %{_mandir}/man5/dnf-transaction-json.5*
248 %{_mandir}/man7/dnf.modularity.7*
249 %{_mandir}/man8/dnf.8*
250 %{_mandir}/man8/yum2dnf.8*
251 %{systemdunitdir}/dnf-makecache.service
252 %{systemdunitdir}/dnf-makecache.timer
253 %{systemdtmpfilesdir}/dnf.conf
254 %{py3_sitescriptdir}/dnf
255 %{py3_sitescriptdir}/dnf-plugins
256 %exclude %{py3_sitescriptdir}/dnf/automatic
257 %dir %{_var}/cache/dnf
258 %ghost %{_localstatedir}/log/%{name}.log
259
260 %files automatic
261 %defattr(644,root,root,755)
262 %attr(755,root,root) %{_bindir}/dnf-automatic
263 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/automatic.conf
264 %{_mandir}/man8/dnf-automatic.8*
265 %{systemdunitdir}/dnf-automatic-download.service
266 %{systemdunitdir}/dnf-automatic-download.timer
267 %{systemdunitdir}/dnf-automatic-install.service
268 %{systemdunitdir}/dnf-automatic-install.timer
269 %{systemdunitdir}/dnf-automatic-notifyonly.service
270 %{systemdunitdir}/dnf-automatic-notifyonly.timer
271 %{systemdunitdir}/dnf-automatic.service
272 %{systemdunitdir}/dnf-automatic.timer
273 %{py3_sitescriptdir}/dnf/automatic
274
275 %files -n bash-completion-dnf
276 %defattr(644,root,root,755)
277 %{bash_compdir}/dnf
278
279 %files -n yum
280 %defattr(644,root,root,755)
281 %attr(755,root,root) %{_bindir}/yum
282 %{_sysconfdir}/yum.conf
283 %dir %{_sysconfdir}/yum
284 %{_sysconfdir}/yum/pluginconf.d
285 %{_sysconfdir}/yum/protected.d
286 %{_sysconfdir}/yum/repos.d
287 %{_sysconfdir}/yum/vars
288 %{_mandir}/man1/yum-aliases.1*
289 %{_mandir}/man5/yum.conf.5.*
290 %{_mandir}/man8/yum.8*
291 %{_mandir}/man8/yum-shell.8*
292 %config(noreplace) %{_sysconfdir}/%{name}/protected.d/yum.conf
This page took 0.077625 seconds and 4 git commands to generate.