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