]>
Commit | Line | Data |
---|---|---|
a91c2820 | 1 | # |
14eed758 | 2 | # Conditional build: |
a313ddd3 | 3 | %bcond_without apidocs # build without apidocs |
c5786473 | 4 | %bcond_without consolekit # ConsoleKit fallback |
fbe373fc | 5 | %bcond_with mozjs # build with mozjs as JS backend instead of duktape |
c5786473 JB |
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 | |
835d1e5a | 8 | |
c5786473 JB |
9 | %if %{with elogind} |
10 | %undefine with_systemd | |
11 | %endif | |
a5863912 PZ |
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 | |
fbe373fc JP |
15 | Version: 121 |
16 | Release: 1 | |
a5863912 PZ |
17 | License: LGPL v2+ |
18 | Group: Libraries | |
0b6189b2 | 19 | Source0: https://www.freedesktop.org/software/polkit/releases/%{name}-%{version}.tar.gz |
fbe373fc | 20 | # Source0-md5: 255761abdc616805a6592bb5fffae178 |
186114f9 | 21 | Patch0: systemd-fallback.patch |
c5786473 | 22 | URL: https://www.freedesktop.org/wiki/Software/polkit |
fbe373fc | 23 | BuildRequires: dbus-devel |
1528e92c | 24 | BuildRequires: docbook-dtd412-xml |
3310eb44 | 25 | BuildRequires: docbook-style-xsl |
fbe373fc | 26 | %{!?with_mozjs:BuildRequires: duktape-devel >= 2.2.0} |
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 |
23808af3 | 35 | BuildRequires: gtk-doc >= 1.3 |
9ff6e803 | 36 | BuildRequires: gtk-doc-automake >= 1.3 |
e8eebe78 | 37 | BuildRequires: libstdc++-devel >= 6:7 |
3310eb44 | 38 | BuildRequires: libxslt-progs |
fbe373fc JP |
39 | BuildRequires: meson >= 0.50.0 |
40 | %{?with_mozjs:BuildRequires: mozjs91-devel} | |
41 | BuildRequires: ninja | |
a5863912 PZ |
42 | BuildRequires: pam-devel >= 0.80 |
43 | BuildRequires: pkgconfig | |
e8eebe78 | 44 | BuildRequires: rpm-build >= 4.6 |
fbe373fc | 45 | BuildRequires: rpmbuild(macros) >= 1.736 |
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 |
fbe373fc | 52 | %{!?with_mozjs:Requires: duktape >= 2.2.0} |
c5786473 JB |
53 | %if %{with systemd} |
54 | Requires: systemd-units >= 38 | |
55 | %endif | |
927480f4 | 56 | Obsoletes: PolicyKit < 1 |
a5863912 PZ |
57 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
58 | ||
59 | %description | |
60 | PolicyKit is a framework for defining policy for system-wide | |
a313ddd3 | 61 | components and for desktop pieces to configure it. |
a5863912 PZ |
62 | |
63 | %description -l pl.UTF-8 | |
64 | PolicyKit to szkielet do definiowania polityki dla komponentów | |
a313ddd3 | 65 | systemowych oraz składników pulpitu do konfigurowania ich. |
a5863912 PZ |
66 | |
67 | %package apidocs | |
68 | Summary: PolicyKit API documentation | |
69 | Summary(pl.UTF-8): Dokumentacja API PolicyKit | |
70 | Group: Documentation | |
71 | Requires: gtk-doc-common | |
927480f4 | 72 | Obsoletes: PolicyKit-apidocs < 1 |
189b240e | 73 | BuildArch: noarch |
a5863912 PZ |
74 | |
75 | %description apidocs | |
76 | PolicyKit API documentation. | |
77 | ||
78 | %description apidocs -l pl.UTF-8 | |
79 | Dokumentacja API PolicyKit. | |
80 | ||
81 | %package libs | |
82 | Summary: PolicyKit libraries | |
83 | Summary(pl.UTF-8): Biblioteki PolicyKit | |
84 | Group: Libraries | |
df23ce59 | 85 | Requires: dbus-libs >= 1.1.2-5 |
835d1e5a | 86 | Requires: glib2 >= 1:2.32.0 |
368d6c5e | 87 | Requires: gobject-introspection |
927480f4 | 88 | Obsoletes: PolicyKit-libs < 1 |
a5863912 PZ |
89 | |
90 | %description libs | |
91 | PolicyKit libraries. | |
92 | ||
93 | %description libs -l pl.UTF-8 | |
94 | Biblioteki PolicyKit. | |
95 | ||
96 | %package devel | |
97 | Summary: Header files for PolicyKit | |
98 | Summary(pl.UTF-8): Pliki nagłówkowe PolicyKit | |
99 | Group: Development/Libraries | |
100 | Requires: %{name}-libs = %{version}-%{release} | |
101 | Requires: expat-devel >= 1:1.95.8 | |
835d1e5a | 102 | Requires: glib2-devel >= 1:2.32.0 |
927480f4 | 103 | Obsoletes: PolicyKit-devel < 1 |
35fbcbe0 | 104 | Obsoletes: polkit-static < 121 |
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 | ||
a5863912 | 112 | %prep |
fbe373fc | 113 | %setup -q -n %{name}-v.%{version} |
c5786473 JB |
114 | %if %{with consolekit} && (%{with systemd} || %{with elogind}) |
115 | %patch0 -p1 | |
116 | %endif | |
a5863912 PZ |
117 | |
118 | %build | |
fbe373fc JP |
119 | %meson build \ |
120 | -Dgtk_doc=%{__true_false apidocs} \ | |
121 | -Dtests=false \ | |
122 | -Dsession_tracking=%{?with_systemd:libsystemd-login}%{?with_elogind:libelogind} \ | |
123 | -Dpam_include=system-auth \ | |
124 | -Dpam_module_dir=/%{_lib}/security \ | |
125 | -Dpolkitd_user=polkitd \ | |
126 | -Dexamples=true \ | |
127 | -Djs_engine=%{!?with_mozjs:duktape}%{?with_mozjs:mozjs} \ | |
128 | -Dman=true | |
129 | ||
130 | %ninja_build -C build | |
a5863912 PZ |
131 | |
132 | %install | |
133 | rm -rf $RPM_BUILD_ROOT | |
134 | ||
fbe373fc | 135 | %ninja_install -C build |
a5863912 PZ |
136 | |
137 | %find_lang polkit-1 | |
138 | ||
139 | %clean | |
140 | rm -rf $RPM_BUILD_ROOT | |
141 | ||
a7e49982 MB |
142 | %pre |
143 | %groupadd -g 283 polkitd | |
144 | %useradd -u 283 -s /bin/false -c "polkitd pseudo user" -g polkitd polkitd | |
c88a6447 | 145 | %addusertogroup polkitd proc |
a7e49982 | 146 | |
a7e49982 MB |
147 | %postun |
148 | if [ "$1" = "0" ]; then | |
149 | %userremove polkitd | |
150 | %groupremove polkitd | |
151 | fi | |
152 | ||
153 | %{?with_systemd:%systemd_reload} | |
154 | ||
a5863912 PZ |
155 | %post libs -p /sbin/ldconfig |
156 | %postun libs -p /sbin/ldconfig | |
157 | ||
158 | %files -f polkit-1.lang | |
159 | %defattr(644,root,root,755) | |
fbe373fc | 160 | %doc AUTHORS NEWS.md README.md |
a5863912 PZ |
161 | %attr(755,root,root) %{_bindir}/pkaction |
162 | %attr(755,root,root) %{_bindir}/pkcheck | |
163 | %attr(4755,root,root) %{_bindir}/pkexec | |
a7e49982 | 164 | %attr(755,root,root) %{_bindir}/pkttyagent |
5498e51a | 165 | %attr(755,root,root) %{_bindir}/pk-example-frobnicate |
a7e49982 MB |
166 | %dir %{_prefix}/lib/polkit-1 |
167 | %attr(4755,root,root) %{_prefix}/lib/polkit-1/polkit-agent-helper-1 | |
168 | %attr(755,root,root) %{_prefix}/lib/polkit-1/polkitd | |
a5863912 | 169 | %dir %{_sysconfdir}/polkit-1 |
a7e49982 MB |
170 | %attr(700,polkitd,root) %dir %{_sysconfdir}/polkit-1/rules.d |
171 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/polkit-1/rules.d/50-default.rules | |
a5863912 | 172 | /etc/pam.d/polkit-1 |
a7e49982 | 173 | %dir %{_datadir}/polkit-1 |
fbe373fc | 174 | %{_datadir}/polkit-1/policyconfig-1.dtd |
a7e49982 MB |
175 | %{_datadir}/polkit-1/actions |
176 | %attr(700,polkitd,root) %dir %{_datadir}/polkit-1/rules.d | |
a5863912 | 177 | %{_datadir}/dbus-1/system-services/org.freedesktop.PolicyKit1.service |
15c70c7c | 178 | %{_datadir}/dbus-1/system.d/org.freedesktop.PolicyKit1.conf |
a7e49982 | 179 | %{?with_systemd:%{systemdunitdir}/polkit.service} |
a5863912 PZ |
180 | %{_mandir}/man1/pkaction.1* |
181 | %{_mandir}/man1/pkcheck.1* | |
182 | %{_mandir}/man1/pkexec.1* | |
a7e49982 | 183 | %{_mandir}/man1/pkttyagent.1* |
0c630415 PZ |
184 | %{_mandir}/man8/polkit.8* |
185 | %{_mandir}/man8/polkitd.8* | |
a5863912 | 186 | |
14eed758 | 187 | %if %{with apidocs} |
a5863912 PZ |
188 | %files apidocs |
189 | %defattr(644,root,root,755) | |
190 | %{_gtkdocdir}/polkit-1 | |
14eed758 | 191 | %endif |
a5863912 PZ |
192 | |
193 | %files libs | |
194 | %defattr(644,root,root,755) | |
195 | # notes which license applies to which package part, AFL text (and GPL text copy) | |
196 | %doc COPYING | |
197 | %attr(755,root,root) %{_libdir}/libpolkit-agent-1.so.*.*.* | |
198 | %attr(755,root,root) %ghost %{_libdir}/libpolkit-agent-1.so.0 | |
a5863912 PZ |
199 | %attr(755,root,root) %{_libdir}/libpolkit-gobject-1.so.*.*.* |
200 | %attr(755,root,root) %ghost %{_libdir}/libpolkit-gobject-1.so.0 | |
a91c2820 | 201 | %{_libdir}/girepository-1.0/Polkit-1.0.typelib |
a36db55f | 202 | %{_libdir}/girepository-1.0/PolkitAgent-1.0.typelib |
a5863912 PZ |
203 | |
204 | %files devel | |
205 | %defattr(644,root,root,755) | |
a5863912 | 206 | %attr(755,root,root) %{_libdir}/libpolkit-agent-1.so |
a5863912 | 207 | %attr(755,root,root) %{_libdir}/libpolkit-gobject-1.so |
a5863912 PZ |
208 | %{_includedir}/polkit-1 |
209 | %{_pkgconfigdir}/polkit-agent-1.pc | |
a5863912 | 210 | %{_pkgconfigdir}/polkit-gobject-1.pc |
a91c2820 | 211 | %{_datadir}/gir-1.0/Polkit-1.0.gir |
a36db55f | 212 | %{_datadir}/gir-1.0/PolkitAgent-1.0.gir |
9dc7cbe6 MB |
213 | %{_datadir}/gettext/its/polkit.its |
214 | %{_datadir}/gettext/its/polkit.loc |