]>
Commit | Line | Data |
---|---|---|
1 | # | |
2 | # Conditional build: | |
3 | %bcond_without apidocs # build without apidocs | |
4 | %bcond_without consolekit # ConsoleKit fallback | |
5 | %bcond_with mozjs # build with mozjs as JS backend instead of duktape | |
6 | %bcond_without systemd # use systemd-login for session tracking (fallback to ConsoleKit on runtime) | |
7 | %bcond_with elogind # use elogind instead of systemd-login | |
8 | ||
9 | %if %{with elogind} | |
10 | %undefine with_systemd | |
11 | %endif | |
12 | Summary: A framework for defining policy for system-wide components | |
13 | Summary(pl.UTF-8): Szkielet do definiowania polityki dla komponentów systemowych | |
14 | Name: polkit | |
15 | Version: 122 | |
16 | Release: 1 | |
17 | License: LGPL v2+ | |
18 | Group: Libraries | |
19 | Source0: https://gitlab.freedesktop.org/polkit/polkit/-/archive/%{version}/%{name}-%{version}.tar.bz2 | |
20 | # Source0-md5: 7eb1f0070c66e5e8646d23ad38773253 | |
21 | Patch0: systemd-fallback.patch | |
22 | Patch1: elogind.patch | |
23 | URL: https://www.freedesktop.org/wiki/Software/polkit | |
24 | BuildRequires: dbus-devel | |
25 | BuildRequires: docbook-dtd412-xml | |
26 | BuildRequires: docbook-style-xsl | |
27 | %{!?with_mozjs:BuildRequires: duktape-devel >= 2.2.0} | |
28 | %{?with_elogind:BuildRequires: elogind-devel} | |
29 | BuildRequires: expat-devel >= 1:1.95.8 | |
30 | BuildRequires: gettext-tools | |
31 | BuildRequires: glib2-devel >= 1:2.32.0 | |
32 | %if %(locale -a | grep -q '^C\.utf8$'; echo $?) | |
33 | BuildRequires: glibc-localedb-all | |
34 | %endif | |
35 | BuildRequires: gobject-introspection-devel >= 0.6.2 | |
36 | BuildRequires: gtk-doc >= 1.3 | |
37 | BuildRequires: gtk-doc-automake >= 1.3 | |
38 | BuildRequires: libstdc++-devel >= 6:7 | |
39 | BuildRequires: libxslt-progs | |
40 | BuildRequires: meson >= 0.50.0 | |
41 | %{?with_mozjs:BuildRequires: mozjs102-devel} | |
42 | BuildRequires: ninja | |
43 | BuildRequires: pam-devel >= 0.80 | |
44 | BuildRequires: pkgconfig | |
45 | BuildRequires: rpm-build >= 4.6 | |
46 | BuildRequires: rpmbuild(macros) >= 1.736 | |
47 | %{?with_systemd:BuildRequires: systemd-devel} | |
48 | Requires: %{name}-libs = %{version}-%{release} | |
49 | %if %{without systemd} && %{without elogind} | |
50 | Requires: ConsoleKit >= 0.4.1 | |
51 | %endif | |
52 | Requires: dbus >= 1.1.2-5 | |
53 | %{!?with_mozjs:Requires: duktape >= 2.2.0} | |
54 | %if %{with systemd} | |
55 | Requires: systemd-units >= 38 | |
56 | %endif | |
57 | Obsoletes: PolicyKit < 1 | |
58 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
59 | ||
60 | %description | |
61 | PolicyKit is a framework for defining policy for system-wide | |
62 | components and for desktop pieces to configure it. | |
63 | ||
64 | %description -l pl.UTF-8 | |
65 | PolicyKit to szkielet do definiowania polityki dla komponentów | |
66 | systemowych oraz składników pulpitu do konfigurowania ich. | |
67 | ||
68 | %package apidocs | |
69 | Summary: PolicyKit API documentation | |
70 | Summary(pl.UTF-8): Dokumentacja API PolicyKit | |
71 | Group: Documentation | |
72 | Requires: gtk-doc-common | |
73 | Obsoletes: PolicyKit-apidocs < 1 | |
74 | BuildArch: noarch | |
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 | |
86 | Requires: dbus-libs >= 1.1.2-5 | |
87 | Requires: glib2 >= 1:2.32.0 | |
88 | Requires: gobject-introspection | |
89 | Obsoletes: PolicyKit-libs < 1 | |
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 | |
103 | Requires: glib2-devel >= 1:2.32.0 | |
104 | Obsoletes: PolicyKit-devel < 1 | |
105 | Obsoletes: polkit-static < 121 | |
106 | ||
107 | %description devel | |
108 | Header files for PolicyKit. | |
109 | ||
110 | %description devel -l pl.UTF-8 | |
111 | Pliki nagłówkowe PolicyKit. | |
112 | ||
113 | %prep | |
114 | %setup -q | |
115 | %if %{with consolekit} && (%{with systemd} || %{with elogind}) | |
116 | %patch0 -p1 | |
117 | %endif | |
118 | %if %{with elogind} | |
119 | %patch1 -p1 | |
120 | %endif | |
121 | ||
122 | %build | |
123 | %meson build \ | |
124 | -Dgtk_doc=%{__true_false apidocs} \ | |
125 | -Dtests=false \ | |
126 | -Dsession_tracking=%{?with_systemd:libsystemd-login}%{?with_elogind:libelogind} \ | |
127 | -Dpam_include=system-auth \ | |
128 | -Dpam_module_dir=/%{_lib}/security \ | |
129 | -Dpolkitd_user=polkitd \ | |
130 | -Dexamples=true \ | |
131 | -Djs_engine=%{!?with_mozjs:duktape}%{?with_mozjs:mozjs} \ | |
132 | -Dman=true | |
133 | ||
134 | %ninja_build -C build | |
135 | ||
136 | %install | |
137 | rm -rf $RPM_BUILD_ROOT | |
138 | ||
139 | %ninja_install -C build | |
140 | ||
141 | %find_lang polkit-1 | |
142 | ||
143 | %clean | |
144 | rm -rf $RPM_BUILD_ROOT | |
145 | ||
146 | %pre | |
147 | %groupadd -g 283 polkitd | |
148 | %useradd -u 283 -s /bin/false -c "polkitd pseudo user" -g polkitd polkitd | |
149 | %addusertogroup polkitd proc | |
150 | ||
151 | %postun | |
152 | if [ "$1" = "0" ]; then | |
153 | %userremove polkitd | |
154 | %groupremove polkitd | |
155 | fi | |
156 | ||
157 | %{?with_systemd:%systemd_reload} | |
158 | ||
159 | %post libs -p /sbin/ldconfig | |
160 | %postun libs -p /sbin/ldconfig | |
161 | ||
162 | %files -f polkit-1.lang | |
163 | %defattr(644,root,root,755) | |
164 | %doc AUTHORS NEWS.md README.md | |
165 | %attr(755,root,root) %{_bindir}/pkaction | |
166 | %attr(755,root,root) %{_bindir}/pkcheck | |
167 | %attr(4755,root,root) %{_bindir}/pkexec | |
168 | %attr(755,root,root) %{_bindir}/pkttyagent | |
169 | %attr(755,root,root) %{_bindir}/pk-example-frobnicate | |
170 | %dir %{_prefix}/lib/polkit-1 | |
171 | %attr(4755,root,root) %{_prefix}/lib/polkit-1/polkit-agent-helper-1 | |
172 | %attr(755,root,root) %{_prefix}/lib/polkit-1/polkitd | |
173 | %dir %{_sysconfdir}/polkit-1 | |
174 | %attr(700,polkitd,root) %dir %{_sysconfdir}/polkit-1/rules.d | |
175 | /etc/pam.d/polkit-1 | |
176 | %dir %{_datadir}/polkit-1 | |
177 | %{_datadir}/polkit-1/policyconfig-1.dtd | |
178 | %{_datadir}/polkit-1/actions | |
179 | %attr(700,polkitd,root) %dir %{_datadir}/polkit-1/rules.d | |
180 | %{_datadir}/polkit-1/rules.d/50-default.rules | |
181 | %{_datadir}/dbus-1/system-services/org.freedesktop.PolicyKit1.service | |
182 | %{_datadir}/dbus-1/system.d/org.freedesktop.PolicyKit1.conf | |
183 | %{?with_systemd:%{systemdunitdir}/polkit.service} | |
184 | %{_mandir}/man1/pkaction.1* | |
185 | %{_mandir}/man1/pkcheck.1* | |
186 | %{_mandir}/man1/pkexec.1* | |
187 | %{_mandir}/man1/pkttyagent.1* | |
188 | %{_mandir}/man8/polkit.8* | |
189 | %{_mandir}/man8/polkitd.8* | |
190 | ||
191 | %if %{with apidocs} | |
192 | %files apidocs | |
193 | %defattr(644,root,root,755) | |
194 | %{_gtkdocdir}/polkit-1 | |
195 | %endif | |
196 | ||
197 | %files libs | |
198 | %defattr(644,root,root,755) | |
199 | # notes which license applies to which package part, AFL text (and GPL text copy) | |
200 | %doc COPYING | |
201 | %attr(755,root,root) %{_libdir}/libpolkit-agent-1.so.*.*.* | |
202 | %attr(755,root,root) %ghost %{_libdir}/libpolkit-agent-1.so.0 | |
203 | %attr(755,root,root) %{_libdir}/libpolkit-gobject-1.so.*.*.* | |
204 | %attr(755,root,root) %ghost %{_libdir}/libpolkit-gobject-1.so.0 | |
205 | %{_libdir}/girepository-1.0/Polkit-1.0.typelib | |
206 | %{_libdir}/girepository-1.0/PolkitAgent-1.0.typelib | |
207 | ||
208 | %files devel | |
209 | %defattr(644,root,root,755) | |
210 | %attr(755,root,root) %{_libdir}/libpolkit-agent-1.so | |
211 | %attr(755,root,root) %{_libdir}/libpolkit-gobject-1.so | |
212 | %{_includedir}/polkit-1 | |
213 | %{_pkgconfigdir}/polkit-agent-1.pc | |
214 | %{_pkgconfigdir}/polkit-gobject-1.pc | |
215 | %{_datadir}/gir-1.0/Polkit-1.0.gir | |
216 | %{_datadir}/gir-1.0/PolkitAgent-1.0.gir | |
217 | %{_datadir}/gettext/its/polkit.its | |
218 | %{_datadir}/gettext/its/polkit.loc |