SHA256
1
0
forked from pool/sudo
sudo/sudo.spec
Kristyna Streitova 685fdbfa5f Accepting request 318161 from home:kstreitova:branches:Base:System
- update to 1.8.14p3:
  * changes in 1.8.14p3
    * Fixed a bug introduced in sudo 1.8.14p2 that prevented sudo 
      from working when no tty was present. Bug #706.
    * Fixed tty detection on newer AIX systems where dev_t is 64-bit.
  * changes in 1.8.14p2
    * Fixed a bug introduced in sudo 1.8.14 that prevented the
      lecture file from being created. Bug #704.
  * changes in 1.8.14p1
    * Fixed a bug introduced in sudo 1.8.14 that prevented the sssd
      backend from working. Bug #703.
  * changes in 1.8.14
    * Log messages on Mac OS X now respect sudoers_locale when sudo
      is build with NLS support.
    * The sudo manual pages now pass mandoc -Tlint with no warnings.
    * Fixed a compilation problem on systems with the sig2str()
      function that do not define SIG2STR_MAX in signal.h.
    * Worked around a compiler bug that resulted in unexpected
      behavior when returning an int from a function declared to
      return bool without an explicit cast.
    * Worked around a bug in Mac OS X 10.10 BSD auditing where the
      au_preselect() fails for AUE_sudo events but succeeds for 
      AUE_DARWIN_sudo.
    * Fixed a hang on Linux systems with glibc when sudo is linked
      with jemalloc.
    * When the user runs a command as a user ID that is not present
      in the password database via the -u flag, the command is now
      run with the group ID of the invoking user instead of group ID 0.
    * Fixed a compilation problem on systems that don't pull in
      definitions of uid_t and gid_t without sys/types.h or unistd.h.

OBS-URL: https://build.opensuse.org/request/show/318161
OBS-URL: https://build.opensuse.org/package/show/Base:System/sudo?expand=0&rev=87
2015-07-24 11:38:45 +00:00

187 lines
5.7 KiB
RPMSpec

#
# spec file for package sudo
#
# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: sudo
Version: 1.8.14p3
Release: 0
Summary: Execute some commands as root
License: ISC
Group: System/Base
Url: http://www.sudo.ws/
Source0: http://sudo.ws/sudo/dist/%{name}-%{version}.tar.gz
Source1: sudo.pamd
Source2: README.SUSE
Source3: fate_313276_test.sh
Source4: README_313276.test
Patch0: sudoers2ldif-env.patch
# PATCH-OPENSUSE: the "SUSE" branding of the default sudo config
Patch1: sudo-sudoers.patch
BuildRequires: audit-devel
BuildRequires: groff
BuildRequires: libselinux-devel
BuildRequires: libsss_sudo
BuildRequires: openldap2-devel
BuildRequires: pam-devel
BuildRequires: zlib-devel
Requires(pre): coreutils
Requires(pre): permissions
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
Sudo is a command that allows users to execute some commands as root.
The /etc/sudoers file (edited with 'visudo') specifies which users have
access to sudo and which commands they can run. Sudo logs all its
activities to syslogd, so the system administrator can keep an eye on
things. Sudo asks for the password for initializing a check period of a
given time N (where N is defined at installation and is set to 5
minutes by default).
%package devel
Summary: Header files needed for sudo plugin development
Group: Development/Libraries/C and C++
Requires: %{name} = %{version}
%description devel
These header files are needed for building of sudo plugins.
%package test
Summary: Tests for the package
Group: Development/Tests
Requires: %{name} = %{version}
%description test
Tests for fate#313276
%prep
%setup -q
%patch0 -p1
%patch1 -p1
%build
%ifarch s390 s390x %sparc
F_PIE=-fPIE
%else
F_PIE=-fpie
%endif
export CFLAGS="%{optflags} -Wall $F_PIE -DLDAP_DEPRECATED"
export LDFLAGS="-pie"
%configure \
--libexecdir=%{_libexecdir}/sudo \
--docdir=%{_docdir}/%{name} \
--with-noexec=%{_libexecdir}/sudo/sudo_noexec.so \
--with-pam \
--with-ldap \
--with-selinux \
--with-linux-audit \
--with-logfac=auth \
--with-insults \
--with-all-insults \
--with-ignore-dot \
--with-tty-tickets \
--enable-shell-sets-home \
--enable-warnings \
--with-sendmail=%{_sbindir}/sendmail \
--with-sudoers-mode=0440 \
--with-env-editor \
--without-secure-path \
--with-passprompt='%%p\x27s password:' \
--with-rundir=%{_localstatedir}/lib/sudo \
--with-sssd
make %{?_smp_mflags}
%install
%make_install install_uid=`id -u` install_gid=`id -g`
install -d -m 755 %{buildroot}%{_sysconfdir}/pam.d
install -m 644 %{SOURCE1} %{buildroot}%{_sysconfdir}/pam.d/sudo
mv %{buildroot}%{_docdir}/%{name}/sudoers2ldif %{buildroot}%{_sbindir}
rm -f %{buildroot}%{_bindir}/sudoedit
ln -sf %{_bindir}/sudo %{buildroot}%{_bindir}/sudoedit
install -d -m 755 %{buildroot}%{_sysconfdir}/openldap/schema
install -m 644 doc/schema.OpenLDAP %{buildroot}%{_sysconfdir}/openldap/schema/sudo.schema
install -m 644 %{SOURCE2} %{buildroot}%{_docdir}/%{name}/
rm -f %{buildroot}%{_docdir}/%{name}/sample.pam
rm -f %{buildroot}%{_docdir}/%{name}/sample.syslog.conf
rm -f %{buildroot}%{_docdir}/%{name}/schema.OpenLDAP
%find_lang %{name}
%find_lang sudoers
cat sudoers.lang >> %{name}.lang
# tests
install -d -m 755 %{buildroot}/var/lib/tests/sudo
install -m 755 %{SOURCE3} %{buildroot}/var/lib/tests/sudo
install -m 755 %{SOURCE4} %{buildroot}/var/lib/tests/sudo
install -d %{buildroot}%{_docdir}/%{name}-test
install -m 644 %{buildroot}%{_docdir}/%{name}/LICENSE %{buildroot}%{_docdir}/%{name}-test/LICENSE
%post
chmod 0440 %{_sysconfdir}/sudoers
%if 0%{?suse_version} <= 1130
%run_permissions
%else
%set_permissions /usr/bin/sudo
%endif
%verifyscript
%verify_permissions -e /usr/bin/sudo
%files -f %{name}.lang
%defattr(-,root,root)
%doc %{_docdir}/%{name}
%doc %{_mandir}/man5/sudoers.5*
%doc %{_mandir}/man5/sudo.conf.5*
%doc %{_mandir}/man5/sudoers.ldap.5*
%doc %{_mandir}/man8/sudo.8*
%doc %{_mandir}/man8/sudoedit.8*
%doc %{_mandir}/man8/sudoreplay.8*
%doc %{_mandir}/man8/visudo.8*
%config(noreplace) %attr(0440,root,root) %{_sysconfdir}/sudoers
%dir %{_sysconfdir}/sudoers.d
%config %{_sysconfdir}/pam.d/sudo
%attr(4755,root,root) %{_bindir}/sudo
%dir %{_sysconfdir}/openldap
%dir %{_sysconfdir}/openldap/schema
%attr(0444,root,root) %config %{_sysconfdir}/openldap/schema/sudo.schema
%{_bindir}/sudoedit
%{_bindir}/sudoreplay
%{_sbindir}/visudo
%attr(0755,root,root) %{_sbindir}/sudoers2ldif
%dir %{_libexecdir}/%{name}
%{_libexecdir}/%{name}/sesh
%{_libexecdir}/%{name}/sudo_noexec.so
%{_libexecdir}/%{name}/sudoers.so
%{_libexecdir}/%{name}/group_file.so
%{_libexecdir}/%{name}/system_group.so
%{_libexecdir}/%{name}/libsudo_util.so.*
%attr(0700,root,root) %dir %ghost %{_localstatedir}/lib/%{name}
%files devel
%defattr(-,root,root)
%doc plugins/sample/sample_plugin.c
%{_includedir}/sudo_plugin.h
%{_mandir}/man8/sudo_plugin.8*
%attr(0644,root,root) %{_libexecdir}/%{name}/libsudo_util.so
%{_libexecdir}/%{name}/*.la
%files test
%defattr(-,root, root)
/var/lib/tests
%{_docdir}/%{name}-test/
%changelog