Skip to content

Commit cb80f4d

Browse files
committed
Finalize spec for 0.3.17 release
1 parent 97e172f commit cb80f4d

File tree

1 file changed

+101
-43
lines changed

1 file changed

+101
-43
lines changed

dnfdaemon.spec

Lines changed: 101 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,85 +1,115 @@
11
%global dnf_org org.baseurl.Dnf
22
%global dnf_version 2.2.0
3+
%global dnf_nocompat 3.0
34

45
Name: dnfdaemon
5-
Version: 0.3.16
6+
Version: 0.3.17
67
Release: 1%{?dist}
78
Summary: DBus daemon for dnf package actions
9+
810
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
1113

1214
BuildArch: noarch
1315
BuildRequires: python3-devel
16+
BuildRequires: make
17+
18+
# Ensure systemd macros are available
19+
%if 0%{?mageia}
20+
BuildRequires: systemd-devel
21+
%else
1422
BuildRequires: systemd
23+
%endif
24+
25+
# Ensure that correct pygobject module is available
26+
%if 0%{?mageia}
27+
Requires: python3-gobject3
28+
%else
1529
Requires: python3-gobject
30+
%endif
1631
Requires: python3-dbus
1732
Requires: python3-dnf >= %{dnf_version}
33+
Conflicts: python3-dnf >= %{dnf_nocompat}
34+
1835
Requires: polkit
1936

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
2151
Requires(post): policycoreutils-python-utils
2252
Requires(postun): policycoreutils-python-utils
2353
%else
2454
Requires(post): policycoreutils-python
2555
Requires(postun): policycoreutils-python
2656
%endif
2757

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)
3162

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.
3466

35-
%prep
36-
%setup -q
3767

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}.
4082

41-
%install
42-
make install DESTDIR=$RPM_BUILD_ROOT DATADIR=%{_datadir} SYSCONFDIR=%{_sysconfdir}
4383

4484
%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+
4787
BuildRequires: python3-devel
4888
Requires: %{name} = %{version}-%{release}
89+
%if 0%{?mageia}
90+
Requires: python3-gobject3
91+
%else
4992
Requires: python3-gobject
93+
%endif
94+
%{?python_provide:%python_provide python3-%{name}}
5095

5196
%description -n python3-%{name}
52-
Python 3 api for communicating with the dnf-daemon DBus service
97+
Python 3 API for communicating with %{name}.
5398

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}
6199

62-
%description -n python-%{name}
63-
Python 2 api for communicating with the dnf-daemon DBus service
100+
%prep
101+
%autosetup
64102

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
71105

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}
77108

78-
%preun
79-
%systemd_preun %{name}.service
80109

81110
%files
82-
%doc README.md ChangeLog COPYING
111+
%doc README.md ChangeLog
112+
%license COPYING
83113
%{_datadir}/dbus-1/system-services/%{dnf_org}*
84114
%{_datadir}/dbus-1/services/%{dnf_org}*
85115
%{_datadir}/%{name}/
@@ -92,13 +122,41 @@ fi
92122
%{python3_sitelib}/%{name}/server
93123

94124

95-
%files -n python-%{name}
96-
%{python_sitelib}/%{name}
125+
%files -n python2-%{name}
126+
%{python2_sitelib}/%{name}/
97127

98128
%files -n python3-%{name}
99129
%{python3_sitelib}/%{name}/client
100130

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+
101153
%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+
102160
* Wed May 25 2016 Tim Lauridsen <timlau@fedoraproject.org> 0.3.16-1
103161
- bumped release
104162

0 commit comments

Comments
 (0)