]>
Commit | Line | Data |
---|---|---|
f637201a ER |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without tests # build without tests | |
4 | # | |
feb41732 ER |
5 | # TODO |
6 | # - bash-completion subpackage | |
f637201a | 7 | # - make -DSYSTEMD_DIR actually to work: https://github.com/rpm-software-management/dnf/pull/213 |
70e5df64 ER |
8 | %define gitrev a7e0aa1 |
9 | %define hawkey_version 0.5.2 | |
10 | %define librepo_version 1.7.5 | |
feb41732 | 11 | %define libcomps_version 0.1.6 |
70e5df64 ER |
12 | %define rpm_version 5.4.0 |
13 | ||
feb41732 ER |
14 | Summary: Package manager forked from Yum, using libsolv as a dependency resolver |
15 | Name: dnf | |
70e5df64 | 16 | Version: 0.6.3 |
38fbb761 | 17 | Release: 0.5 |
feb41732 ER |
18 | Group: Base |
19 | # For a breakdown of the licensing, see PACKAGE-LICENSING | |
38fbb761 | 20 | License: GPL v2+ and GPL v2 and GPL |
70e5df64 ER |
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 | |
38fbb761 | 24 | Patch0: rpm5.patch |
70e5df64 | 25 | URL: https://github.com/rpm-software-management/dnf |
feb41732 ER |
26 | BuildRequires: cmake |
27 | BuildRequires: gettext | |
cebdb6a6 | 28 | BuildRequires: gettext-tools |
feb41732 ER |
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 | |
70e5df64 ER |
37 | BuildRequires: python-pygpgme |
38 | BuildRequires: python-rpm >= %{rpm_version} | |
cebdb6a6 | 39 | BuildRequires: rpm-pythonprov |
feb41732 ER |
40 | BuildRequires: rpmbuild(macros) >= 1.647 |
41 | BuildRequires: sed >= 4.0 | |
42 | BuildRequires: sphinx-pdg | |
43 | BuildRequires: systemd-devel | |
f637201a ER |
44 | %if %{with tests} |
45 | BuildRequires: hawkey-devel >= %{hawkey_version} | |
46 | BuildRequires: python-pyliblzma | |
47 | %endif | |
feb41732 ER |
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} | |
70e5df64 ER |
54 | Requires: python-pygpgme |
55 | Requires: python-rpm >= %{rpm_version} | |
56 | #Requires: rpm-plugin-systemd-inhibit | |
feb41732 ER |
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 | ||
70e5df64 ER |
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 | ||
feb41732 ER |
77 | %prep |
78 | %setup -q -n %{name} | |
38fbb761 | 79 | %patch0 -p1 |
feb41732 ER |
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 \ | |
cebdb6a6 | 86 | -DCMAKE_CXX_COMPILER_WORKS=1 -DCMAKE_CXX_COMPILER="%{__cc}" \ |
70e5df64 | 87 | -DPYTHON_DESIRED=2 \ |
feb41732 ER |
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 | ||
feb41732 ER |
107 | %find_lang %{name} |
108 | ||
70e5df64 ER |
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 | |
feb41732 ER |
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 | ||
70e5df64 ER |
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 | ||
feb41732 ER |
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} | |
70e5df64 ER |
138 | %dir %{_sysconfdir}/%{name}/plugins |
139 | %dir %{_sysconfdir}/%{name}/protected.d | |
feb41732 | 140 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/dnf.conf |
70e5df64 | 141 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/protected.d/dnf.conf |
feb41732 ER |
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 | |
70e5df64 | 149 | %exclude %{py_sitescriptdir}/dnf/automatic |
feb41732 ER |
150 | |
151 | %ghost %{_localstatedir}/log/%{name}.log | |
70e5df64 ER |
152 | %ghost %{_localstatedir}/log/%{name}-rpm.log |
153 | %ghost %{_localstatedir}/log/%{name}-plugin.log | |
feb41732 | 154 | /etc/bash_completion.d/dnf-completion.bash |
70e5df64 ER |
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 |