|
1 | 1 | %global dnf_org org.baseurl.Dnf |
2 | 2 | %global dnf_version 2.2.0 |
| 3 | +%global dnf_nocompat 3.0 |
3 | 4 |
|
4 | 5 | Name: dnfdaemon |
5 | | -Version: 0.3.16 |
| 6 | +Version: 0.3.17 |
6 | 7 | Release: 1%{?dist} |
7 | 8 | Summary: DBus daemon for dnf package actions |
| 9 | + |
8 | 10 | License: GPLv2+ |
9 | | -URL: https://github.com/timlau/dnf-daemon |
10 | | -Source0: https://github.com/timlau/dnf-daemon/releases/download/%{name}-%{version}/%{name}-%{version}.tar.xz |
| 11 | +URL: https://github.com/manatools/dnfdaemon |
| 12 | +Source0: %{url}/releases/download/%{name}-%{version}/%{name}-%{version}.tar.xz |
11 | 13 |
|
12 | 14 | BuildArch: noarch |
13 | 15 | BuildRequires: python3-devel |
| 16 | +BuildRequires: make |
| 17 | + |
| 18 | +# Ensure systemd macros are available |
| 19 | +%if 0%{?mageia} |
| 20 | +BuildRequires: systemd-devel |
| 21 | +%else |
14 | 22 | BuildRequires: systemd |
| 23 | +%endif |
| 24 | + |
| 25 | +# Ensure that correct pygobject module is available |
| 26 | +%if 0%{?mageia} |
| 27 | +Requires: python3-gobject3 |
| 28 | +%else |
15 | 29 | Requires: python3-gobject |
| 30 | +%endif |
16 | 31 | Requires: python3-dbus |
17 | 32 | Requires: python3-dnf >= %{dnf_version} |
| 33 | +Conflicts: python3-dnf >= %{dnf_nocompat} |
| 34 | + |
18 | 35 | Requires: polkit |
19 | 36 |
|
20 | | -%if 0%{?fedora} >= 23 |
| 37 | +Requires(post): systemd |
| 38 | +Requires(preun): systemd |
| 39 | +Requires(postun): systemd |
| 40 | + |
| 41 | +%description |
| 42 | +Dbus daemon for performing package actions with the dnf package manager |
| 43 | + |
| 44 | + |
| 45 | +%package selinux |
| 46 | +Summary: SELinux integration for dnfdaemon |
| 47 | + |
| 48 | +Requires: %{name} = %{version}-%{release} |
| 49 | + |
| 50 | +%if 0%{?fedora} >= 23 || 0%{?mageia} >= 6 |
21 | 51 | Requires(post): policycoreutils-python-utils |
22 | 52 | Requires(postun): policycoreutils-python-utils |
23 | 53 | %else |
24 | 54 | Requires(post): policycoreutils-python |
25 | 55 | Requires(postun): policycoreutils-python |
26 | 56 | %endif |
27 | 57 |
|
28 | | -Requires(post): systemd |
29 | | -Requires(preun): systemd |
30 | | -Requires(postun): systemd |
| 58 | +# Use boolean weak reverse dependencies |
| 59 | +# http://rpm.org/user_doc/dependencies.html#weak-dependencies |
| 60 | +# http://rpm.org/user_doc/boolean_dependencies.html |
| 61 | +Supplements: (dnfdaemon and selinux-policy) |
31 | 62 |
|
32 | | -%description |
33 | | -Dbus daemon for performing package actions with the dnf package manager |
| 63 | +%description selinux |
| 64 | +Metapackage customizing the SELinux policy to ensure dnfdaemon works with |
| 65 | +SELinux enabled in enforcing mode. |
34 | 66 |
|
35 | | -%prep |
36 | | -%setup -q |
37 | 67 |
|
38 | | -%build |
39 | | -# Nothing to build |
| 68 | +%package -n python2-%{name} |
| 69 | +Summary: Python 2 API for communicating with %{name} |
| 70 | + |
| 71 | +BuildRequires: python2-devel |
| 72 | +Requires: %{name} = %{version}-%{release} |
| 73 | +%if 0%{?mageia} |
| 74 | +Requires: python-gobject3 |
| 75 | +%else |
| 76 | +Requires: python-gobject |
| 77 | +%endif |
| 78 | +%{?python_provide:%python_provide python2-%{name}} |
| 79 | + |
| 80 | +%description -n python2-%{name} |
| 81 | +Python 2 API for communicating with %{name}. |
40 | 82 |
|
41 | | -%install |
42 | | -make install DESTDIR=$RPM_BUILD_ROOT DATADIR=%{_datadir} SYSCONFDIR=%{_sysconfdir} |
43 | 83 |
|
44 | 84 | %package -n python3-%{name} |
45 | | -Summary: Python 3 api for communicating with the dnf-daemon DBus service |
46 | | -Group: Applications/System |
| 85 | +Summary: Python 3 API for communicating with %{name} |
| 86 | + |
47 | 87 | BuildRequires: python3-devel |
48 | 88 | Requires: %{name} = %{version}-%{release} |
| 89 | +%if 0%{?mageia} |
| 90 | +Requires: python3-gobject3 |
| 91 | +%else |
49 | 92 | Requires: python3-gobject |
| 93 | +%endif |
| 94 | +%{?python_provide:%python_provide python3-%{name}} |
50 | 95 |
|
51 | 96 | %description -n python3-%{name} |
52 | | -Python 3 api for communicating with the dnf-daemon DBus service |
| 97 | +Python 3 API for communicating with %{name}. |
53 | 98 |
|
54 | | -%package -n python2-%{name} |
55 | | -Summary: Python 2 api for communicating with the dnf-daemon DBus service |
56 | | -Group: Applications/System |
57 | | -BuildRequires: python2-devel |
58 | | -Requires: %{name} = %{version}-%{release} |
59 | | -Requires: pygobject3 |
60 | | -Provides: python-%{name} = %{version}-%{release} |
61 | 99 |
|
62 | | -%description -n python-%{name} |
63 | | -Python 2 api for communicating with the dnf-daemon DBus service |
| 100 | +%prep |
| 101 | +%autosetup |
64 | 102 |
|
65 | | -%post |
66 | | -# apply the right selinux file context |
67 | | -# http://fedoraproject.org/wiki/PackagingDrafts/SELinux#File_contexts |
68 | | -semanage fcontext -a -t rpm_exec_t '%{_datadir}/%{name}/%{name}-system' 2>/dev/null || : |
69 | | -restorecon -R %{_datadir}/%{name}/%{name}-system || : |
70 | | -%systemd_post %{name}.service |
| 103 | +%build |
| 104 | +# Nothing to build |
71 | 105 |
|
72 | | -%postun |
73 | | -if [ $1 -eq 0 ] ; then # final removal |
74 | | -semanage fcontext -d -t rpm_exec_t '%{_datadir}/%{name}/%{name}-system' 2>/dev/null || : |
75 | | -fi |
76 | | -%systemd_postun %{name}.service |
| 106 | +%install |
| 107 | +make install DESTDIR=%{buildroot} DATADIR=%{_datadir} SYSCONFDIR=%{_sysconfdir} |
77 | 108 |
|
78 | | -%preun |
79 | | -%systemd_preun %{name}.service |
80 | 109 |
|
81 | 110 | %files |
82 | | -%doc README.md ChangeLog COPYING |
| 111 | +%doc README.md ChangeLog |
| 112 | +%license COPYING |
83 | 113 | %{_datadir}/dbus-1/system-services/%{dnf_org}* |
84 | 114 | %{_datadir}/dbus-1/services/%{dnf_org}* |
85 | 115 | %{_datadir}/%{name}/ |
|
92 | 122 | %{python3_sitelib}/%{name}/server |
93 | 123 |
|
94 | 124 |
|
95 | | -%files -n python-%{name} |
96 | | -%{python_sitelib}/%{name} |
| 125 | +%files -n python2-%{name} |
| 126 | +%{python2_sitelib}/%{name}/ |
97 | 127 |
|
98 | 128 | %files -n python3-%{name} |
99 | 129 | %{python3_sitelib}/%{name}/client |
100 | 130 |
|
| 131 | + |
| 132 | +%post |
| 133 | +%systemd_post %{name}.service |
| 134 | + |
| 135 | +%postun |
| 136 | +%systemd_postun %{name}.service |
| 137 | + |
| 138 | +%preun |
| 139 | +%systemd_preun %{name}.service |
| 140 | + |
| 141 | +%post selinux |
| 142 | +# apply the right selinux file context |
| 143 | +# http://fedoraproject.org/wiki/PackagingDrafts/SELinux#File_contexts |
| 144 | +semanage fcontext -a -t rpm_exec_t '%{_datadir}/%{name}/%{name}-system' 2>/dev/null || : |
| 145 | +restorecon -R %{_datadir}/%{name}/%{name}-system || : |
| 146 | + |
| 147 | +%postun selinux |
| 148 | +if [ $1 -eq 0 ] ; then # final removal |
| 149 | +semanage fcontext -d -t rpm_exec_t '%{_datadir}/%{name}/%{name}-system' 2>/dev/null || : |
| 150 | +fi |
| 151 | + |
| 152 | + |
101 | 153 | %changelog |
| 154 | +* Fri Apr 14 2017 Neal Gompa <ngompa13@gmail.com> 0.3.17-1 |
| 155 | +- Require dnf-2.2.0 due to usage and expectation of new APIs |
| 156 | +- Change to have SELinux subpackage weak installed |
| 157 | + based on solution by Kevin Kofler (rhbz#1395531) |
| 158 | +- Rework spec file to support Fedora and Mageia |
| 159 | + |
102 | 160 | * Wed May 25 2016 Tim Lauridsen <timlau@fedoraproject.org> 0.3.16-1 |
103 | 161 | - bumped release |
104 | 162 |
|
|
0 commit comments