sudo/sudo.spec

125 lines
3.6 KiB
RPMSpec

#
# spec file for package sudo (Version 1.7.2)
#
# Copyright (c) 2009 SUSE LINUX Products 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/
#
# norootforbuild
Name: sudo
BuildRequires: openldap2-devel pam-devel postfix
BuildRequires: libselinux-devel
PreReq: coreutils
Version: 1.7.2
Release: 1
Group: System/Base
License: BSD 3-clause (or similar)
Url: http://www.sudo.ws/
Summary: Execute some commands as root
Source0: %{name}-%{version}.tar.bz2
Source1: %{name}.pamd
Source2: README.SUSE
Patch1: %{name}-1.7.1-defaults.diff
Patch2: %{name}-1.7.1-sudoers.diff
Patch3: %{name}-1.7.1-__P.diff
Patch4: %{name}-1.7.1-strip.diff
Patch5: %{name}-1.7.1-secure_path.diff
Patch6: %{name}-1.7.1-env.diff
Patch7: %{name}-1.7.1-pam_rhost.diff
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).
Authors:
--------
Jeff Nieusma <nieusma@rootgroup.com>
David Hieb <davehieb@rootgroup.com>
Ian McCloghrie <ian@ucsd.edu>
%prep
%setup -q
%patch1
%patch2
%patch3
%patch4
%patch5
%patch6
%patch7
cp %{SOURCE2} .
%build
%ifarch s390 s390x
F_PIE=-fPIE
%else
F_PIE=-fpie
%endif
export CFLAGS="$RPM_OPT_FLAGS -Wall $F_PIE -DLDAP_DEPRECATED"
export LDFLAGS="-pie"
%configure \
--libexecdir=%{_libexecdir}/sudo \
--with-noexec=%{_libexecdir}/sudo/sudo_noexec.so \
--with-selinux \
--with-logfac=auth \
--with-insults \
--with-all-insults \
--with-ignore-dot \
--with-tty-tickets \
--enable-shell-sets-home \
--with-sudoers-mode=0440 \
--with-pam \
--with-ldap \
--with-env-editor \
--without-secure-path \
--with-passprompt='%%p\x27s password:'
make %{?jobs:-j%jobs}
%install
make DESTDIR=$RPM_BUILD_ROOT install
install -d -m 700 $RPM_BUILD_ROOT/var/run/sudo
install -d -m 755 $RPM_BUILD_ROOT%{_sysconfdir}/pam.d
install -m 644 %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/pam.d/sudo
install -m 755 sudoers2ldif $RPM_BUILD_ROOT%{_sbindir}/sudoers2ldif
rm -f $RPM_BUILD_ROOT%{_bindir}/sudoedit
ln -sf %{_bindir}/sudo $RPM_BUILD_ROOT%{_bindir}/sudoedit
%post
chmod 0440 %{_sysconfdir}/sudoers
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root)
%doc HISTORY LICENSE PORTING README README.LDAP README.SUSE TROUBLESHOOTING UPGRADE WHATSNEW *.pod
%doc %{_mandir}/man?/*
%config(noreplace) %attr(0440,root,root) %{_sysconfdir}/sudoers
%config %{_sysconfdir}/pam.d/sudo
%attr(4755,root,root) %{_bindir}/sudo
%{_bindir}/sudoedit
%{_sbindir}/*
%{_libexecdir}/sudo
/var/run/sudo
%changelog