]>
Commit | Line | Data |
---|---|---|
a91c2820 | 1 | # |
14eed758 | 2 | # Conditional build: |
a313ddd3 | 3 | %bcond_without apidocs # build without apidocs |
c5786473 JB |
4 | %bcond_without consolekit # ConsoleKit fallback |
5 | %bcond_without systemd # use systemd-login for session tracking (fallback to ConsoleKit on runtime) | |
6 | %bcond_with elogind # use elogind instead of systemd-login | |
835d1e5a | 7 | |
c5786473 JB |
8 | %if %{with elogind} |
9 | %undefine with_systemd | |
10 | %endif | |
a5863912 PZ |
11 | Summary: A framework for defining policy for system-wide components |
12 | Summary(pl.UTF-8): Szkielet do definiowania polityki dla komponentów systemowych | |
13 | Name: polkit | |
4e85edc6 | 14 | Version: 0.115 |
78c3d4ee | 15 | Release: 2 |
a5863912 PZ |
16 | License: LGPL v2+ |
17 | Group: Libraries | |
c5786473 | 18 | Source0: https://www.freedesktop.org/software/polkit/releases/%{name}-%{version}.tar.gz |
4e85edc6 | 19 | # Source0-md5: f03b055d6ae5fc8eac76838c7d83d082 |
186114f9 | 20 | Patch0: systemd-fallback.patch |
78c3d4ee | 21 | Patch1: CVE-2018-19788.patch |
c5786473 | 22 | URL: https://www.freedesktop.org/wiki/Software/polkit |
a5863912 PZ |
23 | BuildRequires: autoconf >= 2.60 |
24 | BuildRequires: automake >= 1:1.7 | |
1528e92c | 25 | BuildRequires: docbook-dtd412-xml |
3310eb44 | 26 | BuildRequires: docbook-style-xsl |
c5786473 | 27 | %{?with_elogind:BuildRequires: elogind-devel} |
a5863912 | 28 | BuildRequires: expat-devel >= 1:1.95.8 |
a0f78068 | 29 | BuildRequires: gettext-tools |
835d1e5a | 30 | BuildRequires: glib2-devel >= 1:2.32.0 |
c5786473 JB |
31 | %if %(locale -a | grep -q '^C\.utf8$'; echo $?) |
32 | BuildRequires: glibc-localedb-all | |
33 | %endif | |
e3a98c17 | 34 | BuildRequires: gobject-introspection-devel >= 0.6.2 |
14eed758 | 35 | %{?with_apidocs:BuildRequires: gtk-doc >= 1.3} |
9ff6e803 | 36 | BuildRequires: gtk-doc-automake >= 1.3 |
df23ce59 | 37 | BuildRequires: intltool >= 0.40.0 |
c5786473 JB |
38 | BuildRequires: libstdc++-devel >= 6:4.7 |
39 | BuildRequires: libtool >= 2:1.5 | |
3310eb44 | 40 | BuildRequires: libxslt-progs |
c5786473 | 41 | BuildRequires: mozjs52-devel |
a5863912 PZ |
42 | BuildRequires: pam-devel >= 0.80 |
43 | BuildRequires: pkgconfig | |
1528e92c | 44 | BuildRequires: python-modules |
a7e49982 | 45 | BuildRequires: rpmbuild(macros) >= 1.647 |
a313ddd3 | 46 | %{?with_systemd:BuildRequires: systemd-devel} |
a5863912 | 47 | Requires: %{name}-libs = %{version}-%{release} |
c5786473 | 48 | %if %{without systemd} && %{without elogind} |
186114f9 | 49 | Requires: ConsoleKit >= 0.4.1 |
a7e49982 | 50 | %endif |
a5863912 | 51 | Requires: dbus >= 1.1.2-5 |
c5786473 JB |
52 | %if %{with systemd} |
53 | Requires: systemd-units >= 38 | |
54 | %endif | |
f3084979 | 55 | Obsoletes: PolicyKit |
a5863912 PZ |
56 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
57 | ||
58 | %description | |
59 | PolicyKit is a framework for defining policy for system-wide | |
a313ddd3 | 60 | components and for desktop pieces to configure it. |
a5863912 PZ |
61 | |
62 | %description -l pl.UTF-8 | |
63 | PolicyKit to szkielet do definiowania polityki dla komponentów | |
a313ddd3 | 64 | systemowych oraz składników pulpitu do konfigurowania ich. |
a5863912 PZ |
65 | |
66 | %package apidocs | |
67 | Summary: PolicyKit API documentation | |
68 | Summary(pl.UTF-8): Dokumentacja API PolicyKit | |
69 | Group: Documentation | |
70 | Requires: gtk-doc-common | |
f3084979 | 71 | Obsoletes: PolicyKit-apidocs |
189b240e ER |
72 | %if "%{_rpmversion}" >= "5" |
73 | BuildArch: noarch | |
74 | %endif | |
a5863912 PZ |
75 | |
76 | %description apidocs | |
77 | PolicyKit API documentation. | |
78 | ||
79 | %description apidocs -l pl.UTF-8 | |
80 | Dokumentacja API PolicyKit. | |
81 | ||
82 | %package libs | |
83 | Summary: PolicyKit libraries | |
84 | Summary(pl.UTF-8): Biblioteki PolicyKit | |
85 | Group: Libraries | |
df23ce59 | 86 | Requires: dbus-libs >= 1.1.2-5 |
835d1e5a | 87 | Requires: glib2 >= 1:2.32.0 |
368d6c5e | 88 | Requires: gobject-introspection |
f3084979 | 89 | Obsoletes: PolicyKit-libs |
a5863912 PZ |
90 | |
91 | %description libs | |
92 | PolicyKit libraries. | |
93 | ||
94 | %description libs -l pl.UTF-8 | |
95 | Biblioteki PolicyKit. | |
96 | ||
97 | %package devel | |
98 | Summary: Header files for PolicyKit | |
99 | Summary(pl.UTF-8): Pliki nagłówkowe PolicyKit | |
100 | Group: Development/Libraries | |
101 | Requires: %{name}-libs = %{version}-%{release} | |
102 | Requires: expat-devel >= 1:1.95.8 | |
835d1e5a | 103 | Requires: glib2-devel >= 1:2.32.0 |
f3084979 | 104 | Obsoletes: PolicyKit-devel |
a5863912 PZ |
105 | |
106 | %description devel | |
107 | Header files for PolicyKit. | |
108 | ||
109 | %description devel -l pl.UTF-8 | |
110 | Pliki nagłówkowe PolicyKit. | |
111 | ||
112 | %package static | |
113 | Summary: Static PolicyKit libraries | |
114 | Summary(pl.UTF-8): Statyczne biblioteki PolicyKit | |
115 | Group: Development/Libraries | |
116 | Requires: %{name}-devel = %{version}-%{release} | |
f3084979 | 117 | Obsoletes: PolicyKit-static |
a5863912 PZ |
118 | |
119 | %description static | |
120 | Static PolicyKit libraries. | |
121 | ||
122 | %description static -l pl.UTF-8 | |
123 | Statyczne biblioteki PolicyKit. | |
124 | ||
125 | %prep | |
126 | %setup -q | |
c5786473 JB |
127 | %if %{with consolekit} && (%{with systemd} || %{with elogind}) |
128 | %patch0 -p1 | |
129 | %endif | |
78c3d4ee | 130 | %patch1 -p1 |
a5863912 PZ |
131 | |
132 | %build | |
3310eb44 | 133 | %{?with_apidocs:%{__gtkdocize}} |
df23ce59 | 134 | %{__intltoolize} |
a5863912 PZ |
135 | %{__libtoolize} |
136 | %{__aclocal} | |
137 | %{__autoconf} | |
138 | %{__autoheader} | |
139 | %{__automake} | |
140 | %configure \ | |
3310eb44 | 141 | %{__enable_disable apidocs gtk-doc} \ |
a91c2820 | 142 | --disable-silent-rules \ |
c5786473 | 143 | %{__enable_disable elogind libelogind} \ |
3bdd10dd | 144 | %{__enable_disable systemd libsystemd-login} \ |
a5863912 PZ |
145 | --with-html-dir=%{_gtkdocdir} \ |
146 | --with-pam-include=system-auth \ | |
a7e49982 MB |
147 | --with-pam-module-dir=/%{_lib}/security \ |
148 | --with-polkitd-user=polkitd | |
1b9b199a | 149 | |
c5786473 | 150 | LC_ALL=C.UTF-8 \ |
1b9b199a | 151 | %{__make} -j1 |
a5863912 PZ |
152 | |
153 | %install | |
154 | rm -rf $RPM_BUILD_ROOT | |
155 | ||
156 | %{__make} install \ | |
157 | DESTDIR=$RPM_BUILD_ROOT | |
158 | ||
5498e51a | 159 | %{__rm} $RPM_BUILD_ROOT%{_libdir}/*.la |
a5863912 PZ |
160 | |
161 | %find_lang polkit-1 | |
162 | ||
163 | %clean | |
164 | rm -rf $RPM_BUILD_ROOT | |
165 | ||
a7e49982 MB |
166 | %pre |
167 | %groupadd -g 283 polkitd | |
168 | %useradd -u 283 -s /bin/false -c "polkitd pseudo user" -g polkitd polkitd | |
c88a6447 | 169 | %addusertogroup polkitd proc |
a7e49982 | 170 | |
a7e49982 MB |
171 | %postun |
172 | if [ "$1" = "0" ]; then | |
173 | %userremove polkitd | |
174 | %groupremove polkitd | |
175 | fi | |
176 | ||
177 | %{?with_systemd:%systemd_reload} | |
178 | ||
a5863912 PZ |
179 | %post libs -p /sbin/ldconfig |
180 | %postun libs -p /sbin/ldconfig | |
181 | ||
182 | %files -f polkit-1.lang | |
183 | %defattr(644,root,root,755) | |
9ff6e803 | 184 | %doc AUTHORS NEWS README |
a5863912 PZ |
185 | %attr(755,root,root) %{_bindir}/pkaction |
186 | %attr(755,root,root) %{_bindir}/pkcheck | |
187 | %attr(4755,root,root) %{_bindir}/pkexec | |
a7e49982 | 188 | %attr(755,root,root) %{_bindir}/pkttyagent |
5498e51a | 189 | %attr(755,root,root) %{_bindir}/pk-example-frobnicate |
a7e49982 MB |
190 | %dir %{_prefix}/lib/polkit-1 |
191 | %attr(4755,root,root) %{_prefix}/lib/polkit-1/polkit-agent-helper-1 | |
192 | %attr(755,root,root) %{_prefix}/lib/polkit-1/polkitd | |
a5863912 | 193 | %dir %{_sysconfdir}/polkit-1 |
a7e49982 MB |
194 | %attr(700,polkitd,root) %dir %{_sysconfdir}/polkit-1/rules.d |
195 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/polkit-1/rules.d/50-default.rules | |
a5863912 PZ |
196 | /etc/dbus-1/system.d/org.freedesktop.PolicyKit1.conf |
197 | /etc/pam.d/polkit-1 | |
a7e49982 MB |
198 | %dir %{_datadir}/polkit-1 |
199 | %{_datadir}/polkit-1/actions | |
200 | %attr(700,polkitd,root) %dir %{_datadir}/polkit-1/rules.d | |
a5863912 | 201 | %{_datadir}/dbus-1/system-services/org.freedesktop.PolicyKit1.service |
a7e49982 | 202 | %{?with_systemd:%{systemdunitdir}/polkit.service} |
a5863912 PZ |
203 | %{_mandir}/man1/pkaction.1* |
204 | %{_mandir}/man1/pkcheck.1* | |
205 | %{_mandir}/man1/pkexec.1* | |
a7e49982 | 206 | %{_mandir}/man1/pkttyagent.1* |
0c630415 PZ |
207 | %{_mandir}/man8/polkit.8* |
208 | %{_mandir}/man8/polkitd.8* | |
a5863912 | 209 | |
14eed758 | 210 | %if %{with apidocs} |
a5863912 PZ |
211 | %files apidocs |
212 | %defattr(644,root,root,755) | |
213 | %{_gtkdocdir}/polkit-1 | |
14eed758 | 214 | %endif |
a5863912 PZ |
215 | |
216 | %files libs | |
217 | %defattr(644,root,root,755) | |
218 | # notes which license applies to which package part, AFL text (and GPL text copy) | |
219 | %doc COPYING | |
220 | %attr(755,root,root) %{_libdir}/libpolkit-agent-1.so.*.*.* | |
221 | %attr(755,root,root) %ghost %{_libdir}/libpolkit-agent-1.so.0 | |
a5863912 PZ |
222 | %attr(755,root,root) %{_libdir}/libpolkit-gobject-1.so.*.*.* |
223 | %attr(755,root,root) %ghost %{_libdir}/libpolkit-gobject-1.so.0 | |
a91c2820 | 224 | %{_libdir}/girepository-1.0/Polkit-1.0.typelib |
a36db55f | 225 | %{_libdir}/girepository-1.0/PolkitAgent-1.0.typelib |
a5863912 PZ |
226 | |
227 | %files devel | |
228 | %defattr(644,root,root,755) | |
a5863912 | 229 | %attr(755,root,root) %{_libdir}/libpolkit-agent-1.so |
a5863912 | 230 | %attr(755,root,root) %{_libdir}/libpolkit-gobject-1.so |
a5863912 PZ |
231 | %{_includedir}/polkit-1 |
232 | %{_pkgconfigdir}/polkit-agent-1.pc | |
a5863912 | 233 | %{_pkgconfigdir}/polkit-gobject-1.pc |
a91c2820 | 234 | %{_datadir}/gir-1.0/Polkit-1.0.gir |
a36db55f | 235 | %{_datadir}/gir-1.0/PolkitAgent-1.0.gir |
9dc7cbe6 MB |
236 | %{_datadir}/gettext/its/polkit.its |
237 | %{_datadir}/gettext/its/polkit.loc | |
a5863912 PZ |
238 | |
239 | %files static | |
240 | %defattr(644,root,root,755) | |
241 | %{_libdir}/libpolkit-agent-1.a | |
a5863912 | 242 | %{_libdir}/libpolkit-gobject-1.a |