Package init
This commit is contained in:
commit
0d6a58198e
15
10-shutdown.rules
Normal file
15
10-shutdown.rules
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
polkit.addRule(function(action, subject) {
|
||||||
|
if (action.id == "org.freedesktop.login1.reboot" ||
|
||||||
|
action.id == "org.freedesktop.login1.reboot-ignore-inhibit" ||
|
||||||
|
action.id == "org.freedesktop.login1.reboot-multiple-sessions" ||
|
||||||
|
action.id == "org.freedesktop.login1.power-off" ||
|
||||||
|
action.id == "org.freedesktop.login1.power-off-ignore-inhibit" ||
|
||||||
|
action.id == "org.freedesktop.login1.power-off-multiple-sessions" ||
|
||||||
|
action.id == "org.freedesktop.login1.hibernate" ||
|
||||||
|
action.id == "org.freedesktop.login1.hibernate-ignore-inhibit" ||
|
||||||
|
action.id == "org.freedesktop.login1.hibernate-multiple-sessions") {
|
||||||
|
if (subject.user != "root") {
|
||||||
|
return polkit.Result.NO;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
10
modify-admin-authorization-from-wheel-group-to-root.patch
Normal file
10
modify-admin-authorization-from-wheel-group-to-root.patch
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
diff -Naru polkit-0.112/src/polkitbackend/50-default.rules polkit-0.112_new/src/polkitbackend/50-default.rules
|
||||||
|
--- polkit-0.112/src/polkitbackend/50-default.rules 2013-04-30 01:28:57.000000000 +0800
|
||||||
|
+++ polkit-0.112_new/src/polkitbackend/50-default.rules 2019-02-14 22:24:21.000000000 +0800
|
||||||
|
@@ -8,5 +8,5 @@
|
||||||
|
// about configuring polkit.
|
||||||
|
|
||||||
|
polkit.addAdminRule(function(action, subject) {
|
||||||
|
- return ["unix-group:wheel"];
|
||||||
|
+ return ["unix-user:0"];
|
||||||
|
});
|
||||||
BIN
polkit-0.116.tar.gz
Normal file
BIN
polkit-0.116.tar.gz
Normal file
Binary file not shown.
10
polkit-0.116.tar.gz.sign
Normal file
10
polkit-0.116.tar.gz.sign
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
-----BEGIN PGP SIGNATURE-----
|
||||||
|
|
||||||
|
iQEcBAABAgAGBQJcwtuMAAoJEIzrMDD/3OJYhGAH/27d2LGj6CaqWgSfJcL7LkKt
|
||||||
|
gXlS/jG16GpgW4K38KRK5d/3z6SXz0rgsT8LBAOSWdtpil1MFQqO2cUcQGAv5IeF
|
||||||
|
5vBVgWzCRTF2KPBDgWHuE0QEw0iRBtZL4cOsibj0IiF8JBZ5zCowrUvVF4V6XS7+
|
||||||
|
4kPYZD24ydY/vz5k6hbwqZfxbqQIOe8vZODzPelfjIDW1E0Zrovp9+KtMCVmSEJz
|
||||||
|
reUiUc1eY0NpP51NhmwykkZ9D4AZ8fB76uqfELtEd9Yec3I0pvwyvI03eLmD7liC
|
||||||
|
yI1VEIezPUgJnrGRf8uaVdaLE5TGn7hSIFCGy3xpBd2ZjTKncoed5JtpVDO1WiY=
|
||||||
|
=1bx+
|
||||||
|
-----END PGP SIGNATURE-----
|
||||||
143
polkit.spec
Normal file
143
polkit.spec
Normal file
@ -0,0 +1,143 @@
|
|||||||
|
Name: polkit
|
||||||
|
Version: 0.116
|
||||||
|
Release: 4
|
||||||
|
Summary: Define and Handle authorizations tool
|
||||||
|
License: LGPLv2+
|
||||||
|
URL: http://www.freedesktop.org/wiki/Software/polkit
|
||||||
|
Source0: http://www.freedesktop.org/software/polkit/releases/%{name}-%{version}.tar.gz
|
||||||
|
Source1: http://www.freedesktop.org/software/polkit/releases/%{name}-%{version}.tar.gz.sign
|
||||||
|
Source2: 10-shutdown.rules
|
||||||
|
|
||||||
|
Patch9000: modify-admin-authorization-from-wheel-group-to-root.patch
|
||||||
|
|
||||||
|
BuildRequires: gcc-c++ glib2-devel >= 2.30.0 expat-devel pam-devel gtk-doc intltool
|
||||||
|
BuildRequires: gobject-introspection-devel systemd systemd-devel pkgconfig(mozjs-60)
|
||||||
|
BuildRequires: libxslt autoconf automake libtool
|
||||||
|
Requires: dbus polkit-pkla-compat
|
||||||
|
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
|
||||||
|
Requires(pre): shadow-utils
|
||||||
|
Requires(post): /sbin/ldconfig, systemd
|
||||||
|
Requires(preun): systemd
|
||||||
|
Requires(postun): /sbin/ldconfig, systemd
|
||||||
|
|
||||||
|
Obsoletes: PolicyKit <= 0.10 polkit-desktop-policy < 0.103 polkit-js-engine < 0.110-4 polkit < 0.113-3
|
||||||
|
Provides: PolicyKit = 0.11 polkit-desktop-policy = 0.103 polkit-js-engine = %{version}-%{release}
|
||||||
|
Conflicts: polkit-gnome < 0.97
|
||||||
|
|
||||||
|
%description
|
||||||
|
polkit is a toolkit for defining and handling authorizations. It is
|
||||||
|
used for allowing unprivileged processes to speak to privileged processes.
|
||||||
|
|
||||||
|
%package libs
|
||||||
|
Summary: Libraries for polkit
|
||||||
|
|
||||||
|
%description libs
|
||||||
|
Libraries files for polkit.
|
||||||
|
|
||||||
|
%package devel
|
||||||
|
Summary: Development files for %{name}
|
||||||
|
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
|
||||||
|
Requires: %{name}-help = %{version}-%{release}
|
||||||
|
Requires: glib2-devel
|
||||||
|
Obsoletes: PolicyKit-devel <= 0.10 PolicyKit-docs <= 0.10 polkit-docs
|
||||||
|
Provides: PolicyKit-devel = 0.11 PolicyKit-docs = 0.11 polkit-docs
|
||||||
|
|
||||||
|
%description devel
|
||||||
|
Development files for polkit.
|
||||||
|
|
||||||
|
%package_help
|
||||||
|
|
||||||
|
%prep
|
||||||
|
%autosetup -n %{name}-%{version} -p1
|
||||||
|
|
||||||
|
%build
|
||||||
|
autoreconf -i
|
||||||
|
export CFLAGS='-fPIC %optflags'
|
||||||
|
export LDFLAGS='-pie -Wl,-z,now -Wl,-z,relro'
|
||||||
|
%configure --enable-gtk-doc \
|
||||||
|
--disable-static \
|
||||||
|
--enable-introspection \
|
||||||
|
--disable-examples \
|
||||||
|
--enable-libsystemd-login=yes --with-mozjs=mozjs-17.0
|
||||||
|
%make_build
|
||||||
|
|
||||||
|
sed -i 's/=\"ientry-idm[0-9]\{5,32\}\"/=\"ientry-idm123456789123456\"/g' docs/polkit/html/polit-index.html
|
||||||
|
|
||||||
|
%install
|
||||||
|
%make_install
|
||||||
|
|
||||||
|
%delete_la
|
||||||
|
|
||||||
|
install -D -p -m 0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/polkit-1/rules.d/10-shutdown.rules
|
||||||
|
%find_lang polkit-1
|
||||||
|
|
||||||
|
%pre
|
||||||
|
getent group polkitd >/dev/null || groupadd -r polkitd
|
||||||
|
getent passwd polkitd >/dev/null || useradd -r -g polkitd -d / -s /sbin/nologin -c "User for polkitd" polkitd
|
||||||
|
exit 0
|
||||||
|
|
||||||
|
%post
|
||||||
|
%systemd_post polkit.service
|
||||||
|
|
||||||
|
%preun
|
||||||
|
%systemd_preun polkit.service
|
||||||
|
|
||||||
|
%postun
|
||||||
|
%systemd_postun_with_restart polkit.service
|
||||||
|
|
||||||
|
%files -f polkit-1.lang
|
||||||
|
%doc COPYING NEWS README
|
||||||
|
%dir %{_sysconfdir}/polkit-1
|
||||||
|
%{_sysconfdir}/polkit-1/rules.d/50-default.rules
|
||||||
|
%{_sysconfdir}/polkit-1/rules.d/10-shutdown.rules
|
||||||
|
%attr(0700,polkitd,root) %dir %{_sysconfdir}/polkit-1/rules.d
|
||||||
|
%{_sysconfdir}/dbus-1/system.d/org.freedesktop.PolicyKit1.conf
|
||||||
|
%{_sysconfdir}/pam.d/polkit-1
|
||||||
|
%{_unitdir}/polkit.service
|
||||||
|
%{_datadir}/dbus-1/system-services/*
|
||||||
|
%dir %{_datadir}/polkit-1/
|
||||||
|
%dir %{_datadir}/polkit-1/actions
|
||||||
|
%attr(0700,polkitd,root) %dir %{_datadir}/polkit-1/rules.d
|
||||||
|
%{_datadir}/polkit-1/actions/org.freedesktop.policykit.policy
|
||||||
|
%{_bindir}/pkaction
|
||||||
|
%{_bindir}/pkcheck
|
||||||
|
%{_bindir}/pkttyagent
|
||||||
|
%dir %{_prefix}/lib/polkit-1
|
||||||
|
%{_prefix}/lib/polkit-1/polkitd
|
||||||
|
%attr(4755,root,root) %{_bindir}/pkexec
|
||||||
|
%attr(4755,root,root) %{_prefix}/lib/polkit-1/polkit-agent-helper-1
|
||||||
|
|
||||||
|
%post libs -p /sbin/ldconfig
|
||||||
|
%postun libs -p /sbin/ldconfig
|
||||||
|
%files libs
|
||||||
|
%{_libdir}/lib*.so.*
|
||||||
|
%{_libdir}/girepository-1.0/*.typelib
|
||||||
|
|
||||||
|
%files devel
|
||||||
|
%{_includedir}/*
|
||||||
|
%{_libdir}/pkgconfig/*.pc
|
||||||
|
%{_libdir}/lib*.so
|
||||||
|
%{_datadir}/gir-1.0/*.gir
|
||||||
|
%{_datadir}/gettext/its/polkit.its
|
||||||
|
%{_datadir}/gettext/its/polkit.loc
|
||||||
|
%{_datadir}/gtk-doc
|
||||||
|
|
||||||
|
%files help
|
||||||
|
%{_datadir}/man/man1/*
|
||||||
|
%{_datadir}/man/man8/*
|
||||||
|
|
||||||
|
%changelog
|
||||||
|
* Sun Sep 29 2019 openEuler Buildteam <buildteam@openeuler.org> - 0.116-4
|
||||||
|
- Add libs
|
||||||
|
|
||||||
|
* Sat Sep 28 2019 openEuler Buildteam <buildteam@openeuler.org> - 0.116-3
|
||||||
|
- Fix requires
|
||||||
|
|
||||||
|
* Tue Sep 24 2019 chengquan <chengquan3@huawei.com> - 0.116-2
|
||||||
|
- Type:bugfix
|
||||||
|
- ID:NA
|
||||||
|
- SUG:NA
|
||||||
|
- DESC:revise requires of polkit
|
||||||
|
|
||||||
|
* Wed Sep 18 2019 openEuler Buildteam <buildteam@openeuler.org> - 0.116-1
|
||||||
|
- Package init
|
||||||
Loading…
x
Reference in New Issue
Block a user