]>
Commit | Line | Data |
---|---|---|
1 | # | |
2 | # Conditional build: | |
3 | %bcond_without tests # build without tests | |
4 | # | |
5 | # TODO | |
6 | # - bash-completion subpackage | |
7 | # - make -DSYSTEMD_DIR actually to work: https://github.com/rpm-software-management/dnf/pull/213 | |
8 | %define gitrev a7e0aa1 | |
9 | %define hawkey_version 0.5.2 | |
10 | %define librepo_version 1.7.5 | |
11 | %define libcomps_version 0.1.6 | |
12 | %define rpm_version 5.4.0 | |
13 | ||
14 | Summary: Package manager forked from Yum, using libsolv as a dependency resolver | |
15 | Name: dnf | |
16 | Version: 0.6.3 | |
17 | Release: 0.5 | |
18 | Group: Base | |
19 | # For a breakdown of the licensing, see PACKAGE-LICENSING | |
20 | License: GPL v2+ and GPL v2 and GPL | |
21 | #Source0: http://rpm-software-management.fedorapeople.org/%{name}-%{gitrev}.tar.xz | |
22 | Source0: http://pkgs.fedoraproject.org/repo/pkgs/dnf/%{name}-%{gitrev}.tar.xz/82ff495e445ddc56e70dc91750a421ac/dnf-%{gitrev}.tar.xz | |
23 | # Source0-md5: 82ff495e445ddc56e70dc91750a421ac | |
24 | Patch0: rpm5.patch | |
25 | URL: https://github.com/rpm-software-management/dnf | |
26 | BuildRequires: cmake | |
27 | BuildRequires: gettext | |
28 | BuildRequires: gettext-tools | |
29 | BuildRequires: python | |
30 | BuildRequires: python-Sphinx | |
31 | #BuildRequires: python-bugzilla | |
32 | BuildRequires: python-hawkey >= %{hawkey_version} | |
33 | BuildRequires: python-iniparse | |
34 | BuildRequires: python-libcomps >= %{libcomps_version} | |
35 | BuildRequires: python-librepo >= %{librepo_version} | |
36 | BuildRequires: python-nose | |
37 | BuildRequires: python-pygpgme | |
38 | BuildRequires: python-rpm >= %{rpm_version} | |
39 | BuildRequires: rpm-pythonprov | |
40 | BuildRequires: rpmbuild(macros) >= 1.647 | |
41 | BuildRequires: sed >= 4.0 | |
42 | BuildRequires: sphinx-pdg | |
43 | BuildRequires: systemd-devel | |
44 | %if %{with tests} | |
45 | BuildRequires: hawkey-devel >= %{hawkey_version} | |
46 | BuildRequires: python-pyliblzma | |
47 | %endif | |
48 | Requires(post,preun,postun): systemd-units >= 38 | |
49 | Requires: deltarpm | |
50 | Requires: python-hawkey >= %{hawkey_version} | |
51 | Requires: python-iniparse | |
52 | Requires: python-libcomps >= %{libcomps_version} | |
53 | Requires: python-librepo >= %{librepo_version} | |
54 | Requires: python-pygpgme | |
55 | Requires: python-rpm >= %{rpm_version} | |
56 | #Requires: rpm-plugin-systemd-inhibit | |
57 | Requires: systemd-units >= 0.38 | |
58 | BuildArch: noarch | |
59 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
60 | ||
61 | %description | |
62 | Package manager forked from Yum, using libsolv as a dependency | |
63 | resolver. | |
64 | ||
65 | %package automatic | |
66 | Summary: Alternative CLI to "dnf upgrade" suitable for automatic, regular execution | |
67 | Group: Base | |
68 | Requires: %{name} = %{version}-%{release} | |
69 | Requires(post): systemd | |
70 | Requires(preun): systemd | |
71 | Requires(postun): systemd | |
72 | ||
73 | %description automatic | |
74 | Alternative CLI to "dnf upgrade" suitable for automatic, regular | |
75 | execution. | |
76 | ||
77 | %prep | |
78 | %setup -q -n %{name} | |
79 | %patch0 -p1 | |
80 | ||
81 | # the -D doesn't work | |
82 | %{__sed} -i -e '/SYSTEMD_DIR/ s#/usr/lib/systemd/system#%{systemdunitdir}#' CMakeLists.txt | |
83 | ||
84 | %build | |
85 | %cmake \ | |
86 | -DCMAKE_CXX_COMPILER_WORKS=1 -DCMAKE_CXX_COMPILER="%{__cc}" \ | |
87 | -DPYTHON_DESIRED=2 \ | |
88 | -DSYSTEMD_DIR=%{systemdunitdir} \ | |
89 | . | |
90 | ||
91 | %{__make} | |
92 | %{__make} doc-man | |
93 | ||
94 | %if %{with tests} | |
95 | %{__make} ARGS="-V" test | |
96 | %endif | |
97 | ||
98 | %install | |
99 | rm -rf $RPM_BUILD_ROOT | |
100 | %{__make} install \ | |
101 | DESTDIR=$RPM_BUILD_ROOT | |
102 | ||
103 | %py_ocomp $RPM_BUILD_ROOT%{py_sitescriptdir} | |
104 | %py_comp $RPM_BUILD_ROOT%{py_sitescriptdir} | |
105 | %py_postclean | |
106 | ||
107 | %find_lang %{name} | |
108 | ||
109 | install -d $RPM_BUILD_ROOT{%{_sysconfdir}/%{name}/plugins,%{py_sitescriptdir}/dnf-plugins,%{_localstatedir}/log} | |
110 | touch $RPM_BUILD_ROOT%{_localstatedir}/log/%{name}{,-rpm,-plugin}.log | |
111 | ||
112 | %clean | |
113 | rm -rf $RPM_BUILD_ROOT | |
114 | ||
115 | %post | |
116 | %systemd_post dnf-makecache.timer | |
117 | ||
118 | %preun | |
119 | %systemd_preun dnf-makecache.timer | |
120 | ||
121 | %postun | |
122 | %systemd_reload | |
123 | ||
124 | %post automatic | |
125 | %systemd_post dnf-automatic.timer | |
126 | ||
127 | %preun automatic | |
128 | %systemd_preun dnf-automatic.timer | |
129 | ||
130 | %postun automatic | |
131 | %systemd_reload | |
132 | ||
133 | %files -f %{name}.lang | |
134 | %defattr(644,root,root,755) | |
135 | %doc AUTHORS README.rst COPYING PACKAGE-LICENSING | |
136 | %attr(755,root,root) %{_bindir}/dnf | |
137 | %dir %{_sysconfdir}/%{name} | |
138 | %dir %{_sysconfdir}/%{name}/plugins | |
139 | %dir %{_sysconfdir}/%{name}/protected.d | |
140 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/dnf.conf | |
141 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/protected.d/dnf.conf | |
142 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/libreport/events.d/collect_dnf.conf | |
143 | %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/%{name} | |
144 | %{_mandir}/man8/dnf.8* | |
145 | %{_mandir}/man8/dnf.conf.8* | |
146 | %{systemdunitdir}/dnf-makecache.service | |
147 | %{systemdunitdir}/dnf-makecache.timer | |
148 | %{py_sitescriptdir}/dnf | |
149 | %exclude %{py_sitescriptdir}/dnf/automatic | |
150 | ||
151 | %ghost %{_localstatedir}/log/%{name}.log | |
152 | %ghost %{_localstatedir}/log/%{name}-rpm.log | |
153 | %ghost %{_localstatedir}/log/%{name}-plugin.log | |
154 | /etc/bash_completion.d/dnf-completion.bash | |
155 | ||
156 | %files automatic | |
157 | %defattr(644,root,root,755) | |
158 | %attr(755,root,root) %{_bindir}/dnf-automatic | |
159 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/automatic.conf | |
160 | %{_mandir}/man8/dnf.automatic.8* | |
161 | %{systemdunitdir}/dnf-automatic.service | |
162 | %{systemdunitdir}/dnf-automatic.timer | |
163 | %{py_sitescriptdir}/dnf/automatic |