: 24 2022 | : 17496 | : 24437013
en ru br
5.1: 1.6.8p12-alt7
4.1: 1.6.8p12-alt5.M41.1
4.0: 1.6.8p12-alt5
3.0: 1.6.7p5-alt5

:: /
: sudo

             Sources      Gear   Bugs and FR  Repocop 

%def_enable python

Name: sudo
Version: 1.9.7p2
Release: alt1
Epoch: 1

Summary: Allows command execution as another user
License: ISC
Group: System/Base


Source: sudo-%version.tar

Patch: sudo-%version-alt.patch

PreReq: control
Requires: vitmp
Provides: %_sysconfdir/sudoers.d

# Automatically added by buildreq on Wed Apr 09 2003

BuildRequires: flex libpam-devel perl-podlators
# Due check of man pages type
BuildRequires: /usr/bin/nroff

BuildRequires: libaudit-devel libcap-devel
BuildRequires: libselinux-devel

BuildRequires: python3-dev

%define _libexecdir %_prefix/libexec/sudo

Summary(ru_RU.UTF-8): Запускает команды в контексте другого пользователя

Sudo is a program designed to allow a sysadmin to give limited root
privileges to users and log root activity.  The basic philosophy is
to give as few privileges as possible but still allow people to get
their work done.

%description -l ru_RU.UTF-8
Sudo - программа, разработанная в помощь системному администратору
делегировать те или иные привилегированные ресурсы пользователям,
с ведением протокола их деятельности.  Основная идея - делегировать
как можно меньше прав, но ровно столько, сколько необходимо для
решения поставленных задач.

%package logsrvd
Summary: High-performance log server for %name
Group: System/Servers
Requires: %name = %epoch:%version-%release

%description logsrvd
%name-logsrvd is a high-performance log server that accepts event and I/O logs from sudo.
It can be used to implement centralized logging of sudo logs.

%package python
Summary: Python plugin for %name
Group: Development/Python
Requires: %name = %epoch:%version-%release

%description python
The %name-python package contains sudo python policy plugin.

%package devel
Summary: Development files for %name
Group: Development/C
Requires: %name = %epoch:%version-%release
BuildArch: noarch

%description devel
The %name-devel package contains header files developing sudo
plugins that use %name.

%description devel -l ru_RU.UTF-8
Пакет %name-devel содержит заголовочные файлы для разработки расширений
для програмы %name.

%patch -p1

export ac_cv_prog_NROFFPROG=nroff
%{subst_enable python}

%configure $configure_options --with-passprompt='[sudo] password for %%u:'

%makeinstall_std INSTALL_OWNER=
install -pD -m600 examples/pam.conf %buildroot%_sysconfdir/pam.d/sudo
mkdir -p %buildroot%_sysconfdir/sudoers.d
chmod u+rwx %buildroot%prefix/*bin/*
install -pD -m755 sudo.control %buildroot/etc/control.d/facilities/sudo
install -pD -m755 sudoers.control %buildroot/etc/control.d/facilities/sudoers
install -pD -m755 sudoreplay.control %buildroot/etc/control.d/facilities/sudoreplay
install -pD -m755 sudowheel.control %buildroot/etc/control.d/facilities/sudowheel
bzip2 -9 %buildroot%_datadir/doc/%name-%version/ChangeLog

%find_lang sudo
%find_lang sudoers

cat sudo.lang sudoers.lang > sudo_all.lang
rm sudo.lang sudoers.lang
rm -f %buildroot%_libdir/sudo/*.la %buildroot%_libdir/*.so

mv %buildroot%_sysconfdir/sudoers.dist %buildroot%_datadir/doc/%name-%version/

%pre_control sudo
%pre_control sudoers
if [ -f "%_controldir/sudoreplay" ]; then
   %pre_control sudoreplay
if [ -f "%_controldir/sudowheel" ]; then
   %pre_control sudowheel

%post_control -s wheelonly sudo
%post_control -s strict sudoers
if [ ! -f "/var/run/control/sudoreplay" ]; then
   if [ "$1" -gt 1 ]; then
       %pre_control sudowheel
       echo wheelonly > "/var/run/control/sudoreplay"
%post_control -s wheelonly sudoreplay
if [ ! -f "/var/run/control/sudowheel" ]; then
   if [ "$1" -gt 1 ]; then
       %pre_control sudowheel
       echo disabled > "/var/run/control/sudowheel"
%post_control -s disabled sudowheel

%triggerpostun -- %name < 1:1.8.0
cp -a %_sysconfdir/sudoers %_sysconfdir/sudoers.rpmsave
if ! grep -q '^#includedir %_sysconfdir/sudoers.d$' %_sysconfdir/sudoers; then
   if [ -d %_sysconfdir/sudoers.d ]; then
       echo "WARNING: %_sysconfdir/sudoers.d directory no longer supported indirectly"
       echo "Update %_sysconfdir/sudoers with next line:"
       echo "#includedir %_sysconfdir/sudoers.d"

       echo >>%_sysconfdir/sudoers
       echo "# Automatically updates by rpm:" >>%_sysconfdir/sudoers
       echo "#includedir %_sysconfdir/sudoers.d" >>%_sysconfdir/sudoers
if ! grep -q '^#includedir %_sysconfdir/sudo.d$' %_sysconfdir/sudoers; then
   if [ -d %_sysconfdir/sudo.d ]; then
       echo "WARNING: %_sysconfdir/sudo.d compat directory no longer supported indirectly"

       if [ "$(ls -A %_sysconfdir/sudo.d)" ]; then
           echo "Update %_sysconfdir/sudoers with next line:"
           echo "#includedir %_sysconfdir/sudo.d"

           echo >>%_sysconfdir/sudoers
           echo "# Automatically updates by rpm:" >>%_sysconfdir/sudoers
           echo "#includedir %_sysconfdir/sudo.d" >>%_sysconfdir/sudoers


%files -f sudo_all.lang
%config %_controldir/sudo*
%attr(600,root,root) %config(noreplace) %_sysconfdir/sudo.conf
%attr(400,root,root) %config(noreplace) %_sysconfdir/sudoers
%attr(600,root,root) %config(noreplace) %_sysconfdir/pam.d/sudo
%dir %_libdir/sudo
%if_enabled python
%exclude %_libdir/sudo/
%attr(700,root,root) %_bindir/sudo
%attr(700,root,root) %_bindir/sudoreplay
%attr(755,root,root) %_sbindir/visudo
%attr(700,root,root) %_sysconfdir/sudoers.d
%exclude %_man8dir/sudo_plugin.8*
%if_enabled python
%exclude %_man8dir/sudo_plugin_python.8*
%exclude %_man5dir/sudo_logsrv.proto.5*
%exclude %_man5dir/sudo_logsrvd.conf.5*
%exclude %_man8dir/sudo_logsrvd.8*
%exclude %_man8dir/sudo_sendlog.8*

%files logsrvd
%attr(600,root,root) %config(noreplace) %_sysconfdir/sudo_logsrvd.conf

%if_enabled python
%files python

%files devel
%doc plugins/sample/sample_plugin.c



: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
: Michael Shigorin