]> git.pld-linux.org Git - packages/dnf.git/blob - dnf.spec
up to 4.19.0
[packages/dnf.git] / dnf.spec
1 # TODO
2 # - make -DSYSTEMD_DIR actually to work: https://github.com/rpm-software-management/dnf/pull/213
3 #
4 # Conditional build:
5 %bcond_without  tests           # build without tests
6 %bcond_without  python2         # CPython 2.x version
7 %bcond_with     python3         # CPython 3.x version (dependencies not met currently)
8 #
9 %define gitrev  a7e0aa1
10 %define hawkey_ver      0.5.2
11 %define librepo_ver     1.7.5
12 %define libcomps_ver    0.1.6
13 %define rpm_ver         5.4.0
14
15 Summary:        Package manager forked from Yum, using libsolv as a dependency resolver
16 Summary(pl.UTF-8):      Zarządca pakietów wywodzący się z Yuma, wykorzystujący libsolv do rozwiązywania zależności
17 Name:           dnf
18 Version:        0.6.3
19 Release:        0.5
20 Group:          Base
21 # GPL v2+ with GPL v2 and GPL parts; for a breakdown of the licensing, see PACKAGE-LICENSING
22 License:        GPL v2 (parts on GPL v2+ or GPL)
23 #Source0:       http://rpm-software-management.fedorapeople.org/%{name}-%{gitrev}.tar.xz
24 Source0:        http://pkgs.fedoraproject.org/repo/pkgs/dnf/%{name}-%{gitrev}.tar.xz/82ff495e445ddc56e70dc91750a421ac/dnf-%{gitrev}.tar.xz
25 # Source0-md5:  82ff495e445ddc56e70dc91750a421ac
26 Patch0:         rpm5.patch
27 URL:            https://github.com/rpm-software-management/dnf
28 BuildRequires:  cmake >= 2.4
29 BuildRequires:  gettext-tools
30 BuildRequires:  rpm-pythonprov
31 BuildRequires:  rpmbuild(macros) >= 1.647
32 BuildRequires:  sed >= 4.0
33 BuildRequires:  sphinx-pdg
34 BuildRequires:  systemd-devel
35 %if %{with python2}
36 BuildRequires:  python >= 2
37 %if %{with tests}
38 #BuildRequires: python-bugzilla
39 BuildRequires:  python-hawkey >= %{hawkey_ver}
40 BuildRequires:  python-hawkey-test >= %{hawkey_ver}
41 BuildRequires:  python-iniparse
42 BuildRequires:  python-libcomps >= %{libcomps_ver}
43 BuildRequires:  python-librepo >= %{librepo_ver}
44 BuildRequires:  python-pygpgme
45 BuildRequires:  python-rpm >= %{rpm_ver}
46 BuildRequires:  python-nose
47 BuildRequires:  python-pyliblzma
48 %endif
49 %endif
50 %if %{with python3}
51 BuildRequires:  python3 >= 1:3.3
52 %endif
53 Requires(post,preun,postun):    systemd-units >= 38
54 Requires:       deltarpm
55 Requires:       python-hawkey >= %{hawkey_ver}
56 Requires:       python-iniparse
57 Requires:       python-libcomps >= %{libcomps_ver}
58 Requires:       python-librepo >= %{librepo_ver}
59 Requires:       python-pygpgme
60 Requires:       python-rpm >= %{rpm_ver}
61 #Requires:      rpm-plugin-systemd-inhibit
62 Requires:       systemd-units >= 0.38
63 BuildArch:      noarch
64 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
65
66 %description
67 Package manager forked from Yum, using libsolv as a dependency
68 resolver.
69
70 %description -l pl.UTF-8
71 Zarządca pakietów wywodzący się z Yuma, wykorzystujący libsolv do
72 rozwiązywania zależności.
73
74 %package automatic
75 Summary:        Alternative CLI to "dnf upgrade" suitable for automatic, regular execution
76 Summary(pl.UTF-8):      Alternatywny interfejs do "dnf upgrade" nadający się do automatycznego wywoływania
77 Group:          Base
78 Requires(post): systemd
79 Requires(preun):        systemd
80 Requires(postun):       systemd
81 Requires:       %{name} = %{version}-%{release}
82
83 %description automatic
84 Alternative CLI to "dnf upgrade" suitable for automatic, regular
85 execution.
86
87 %description automatic -l pl.UTF-8
88 Alternatywny interfejs linii poleceń do "dnf upgrade", nadający się do
89 automatycznego, regularnego wywoływania.
90
91 %package -n bash-completion-dnf
92 Summary:        Bash completion for dnf command
93 Summary(pl.UTF-8):      Bashowe uzupełnianie parametrów dla polecenia dnf
94 Group:          Applications/Shells
95 Requires:       %{name} = %{version}-%{release}
96 Requires:       bash-completion
97
98 %description -n bash-completion-dnf
99 Bash completion for dnf command.
100
101 %description -n bash-completion-dnf -l pl.UTF-8
102 Bashowe uzupełnianie parametrów dla polecenia dnf.
103
104 %package -n python3-dnf
105 Summary:        Python 3 version of dnf package manager
106 Summary(pl.UTF-8):      Wersja zarządcy pakietów dnf dla Pythona 3
107 Group:          Libraries/Python
108 # for common files (make -common?)
109 Requires:       %{name} = %{version}-%{release}
110 Requires:       deltarpm
111 Requires:       python3-hawkey >= %{hawkey_ver}
112 # XXX: missing in PLD
113 #Requires:      python3-iniparse
114 Requires:       python3-libcomps >= %{libcomps_ver}
115 # XXX: missing in PLD
116 #Requires:      python3-librepo >= %{librepo_ver}
117 Requires:       python3-pygpgme
118 # XXX: missing in PLD (is it possible with rpm5?)
119 #Requires:      python3-rpm >= %{rpm_ver}
120
121 %description -n python3-dnf
122 Python 3 version of dnf package manager.
123
124 %description -n python3-dnf -l pl.UTF-8
125 Wersja zarządcy pakietów dnf dla Pythona 3.
126
127 %prep
128 %setup -q -n %{name}
129 %patch0 -p1
130
131 # the -D doesn't work
132 %{__sed} -i -e '/SYSTEMD_DIR/ s#/usr/lib/systemd/system#%{systemdunitdir}#' CMakeLists.txt
133
134 %build
135 %if %{with python2}
136 install -d build-py2
137 cd build-py2
138 %cmake .. \
139         -DCMAKE_CXX_COMPILER="%{__cc}" \
140         -DCMAKE_CXX_COMPILER_WORKS=1 \
141         -DPYTHON_DESIRED=2 \
142         -DSYSTEMD_DIR=%{systemdunitdir}
143
144 %{__make}
145 %{__make} doc-man
146
147 %if %{with tests}
148 %{__make} test ARGS="-V"
149 %endif
150
151 cd ..
152 %endif
153
154 %if %{with python3}
155 install -d build-py3
156 cd build-py3
157 %cmake .. \
158         -DCMAKE_CXX_COMPILER="%{__cc}" \
159         -DCMAKE_CXX_COMPILER_WORKS=1 \
160         -DPYTHON_DESIRED=3 \
161         -DPYTHON_EXECUTABLE=%{__python3} \
162         -DSYSTEMD_DIR=%{systemdunitdir}
163
164 %{__make}
165 %{__make} doc-man
166 cd ..
167 %endif
168
169 %install
170 rm -rf $RPM_BUILD_ROOT
171
172 %if %{with python2}
173 %{__make} -C build-py2 install \
174         DESTDIR=$RPM_BUILD_ROOT
175
176 %py_ocomp $RPM_BUILD_ROOT%{py_sitescriptdir}
177 %py_comp $RPM_BUILD_ROOT%{py_sitescriptdir}
178 %py_postclean
179
180 %find_lang %{name}
181
182 install -d $RPM_BUILD_ROOT{%{_sysconfdir}/%{name}/plugins,%{py_sitescriptdir}/dnf-plugins,%{_localstatedir}/log}
183 touch $RPM_BUILD_ROOT%{_localstatedir}/log/%{name}{,-rpm,-plugin}.log
184 %endif
185
186 %if %{with python3}
187 %{__make} -C build-py3 install \
188         DESTDIR=$RPM_BUILD_ROOT
189
190 %py3_ocomp $RPM_BUILD_ROOT%{py3_sitescriptdir}
191 %py3_comp $RPM_BUILD_ROOT%{py3_sitescriptdir}
192 %else
193 %{__rm} $RPM_BUILD_ROOT%{_bindir}/dnf-3
194 %endif
195
196 %clean
197 rm -rf $RPM_BUILD_ROOT
198
199 %post
200 %systemd_post dnf-makecache.timer
201
202 %preun
203 %systemd_preun dnf-makecache.timer
204
205 %postun
206 %systemd_reload
207
208 %post automatic
209 %systemd_post dnf-automatic.timer
210
211 %preun automatic
212 %systemd_preun dnf-automatic.timer
213
214 %postun automatic
215 %systemd_reload
216
217 %if %{with python2}
218 %files -f %{name}.lang
219 %defattr(644,root,root,755)
220 %doc AUTHORS PACKAGE-LICENSING README.rst
221 %attr(755,root,root) %{_bindir}/dnf
222 %dir %{_sysconfdir}/%{name}
223 %dir %{_sysconfdir}/%{name}/plugins
224 %dir %{_sysconfdir}/%{name}/protected.d
225 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/dnf.conf
226 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/protected.d/dnf.conf
227 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/libreport/events.d/collect_dnf.conf
228 %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/%{name}
229 %{_mandir}/man8/dnf.8*
230 %{_mandir}/man8/dnf.conf.8*
231 %{systemdunitdir}/dnf-makecache.service
232 %{systemdunitdir}/dnf-makecache.timer
233 %{py_sitescriptdir}/dnf
234 %exclude %{py_sitescriptdir}/dnf/automatic
235
236 %ghost %{_localstatedir}/log/%{name}.log
237 %ghost %{_localstatedir}/log/%{name}-rpm.log
238 %ghost %{_localstatedir}/log/%{name}-plugin.log
239
240 %files automatic
241 %defattr(644,root,root,755)
242 %attr(755,root,root) %{_bindir}/dnf-automatic
243 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/automatic.conf
244 %{_mandir}/man8/dnf.automatic.8*
245 %{systemdunitdir}/dnf-automatic.service
246 %{systemdunitdir}/dnf-automatic.timer
247 %{py_sitescriptdir}/dnf/automatic
248 %endif
249
250 %files -n bash-completion-dnf
251 %defattr(644,root,root,755)
252 /etc/bash_completion.d/dnf-completion.bash
253
254 %if %{with python3}
255 %files -n python3-dnf
256 %defattr(644,root,root,755)
257 %attr(755,root,root) %{_bindir}/dnf-3
258 %{py3_sitescriptdir}/dnf
259 %endif
This page took 0.10181 seconds and 3 git commands to generate.