]> git.pld-linux.org Git - packages/sudo.git/blobdiff - sudo.spec
- added linux audit support
[packages/sudo.git] / sudo.spec
index 8dab4dcb4224c6bea6aa421e6d754f6514b7a6bd..8f8c83703d419be22d51d3d5c2b2cc9ecd70aabe 100644 (file)
--- a/sudo.spec
+++ b/sudo.spec
@@ -1,5 +1,6 @@
 #
 # Conditional build:
+%bcond_without audit           # Linux audit support
 %bcond_with    kerberos5       # enable Kerberos V support (conflicts with PAM)
 %bcond_without ldap            # disable LDAP support
 %bcond_without pam             # disable PAM support
@@ -20,29 +21,35 @@ Summary(pt_BR.UTF-8):       Permite que usuários específicos executem comandos como
 Summary(ru.UTF-8):     Позволяет определенным пользователям исполнять команды от имени root
 Summary(uk.UTF-8):     Дозволяє вказаним користувачам виконувати команди від імені root
 Name:          sudo
-Version:       1.7.4p3
-Release:       2
+Version:       1.7.10p7
+Release:       1
 Epoch:         1
 License:       BSD
 Group:         Applications/System
 Source0:       ftp://ftp.sudo.ws/pub/sudo/%{name}-%{version}.tar.gz
-# Source0-md5: 950994a454a3eb7a74df5f4bc863bd2b
+# Source0-md5: 9faa5ceaf23cca0468d0f5d211bac6e4
 Source1:       %{name}.pamd
 Source2:       %{name}-i.pamd
 Source3:       %{name}.logrotate
 Patch0:                %{name}-libtool.patch
 Patch1:                %{name}-env.patch
+Patch2:                config.patch
 URL:           http://www.sudo.ws/sudo/
+%{?with_audit:BuildRequires:   audit-libs-devel}
 BuildRequires: autoconf >= 2.53
 BuildRequires: automake
+BuildRequires: bison
+BuildRequires: flex
+BuildRequires: gettext-devel
 %{?with_kerberos5:BuildRequires:       heimdal-devel}
 %{?with_selinux:BuildRequires: libselinux-devel}
-BuildRequires: libtool >= 2:2.2.6
+BuildRequires: libtool >= 2:2.2.6b
 %{?with_ldap:BuildRequires:    openldap-devel >= 2.3.0}
 %{?with_pam:BuildRequires:     pam-devel}
 BuildRequires: rpm >= 4.4.9-56
-BuildRequires: rpmbuild(macros) >= 1.402
+BuildRequires: rpmbuild(macros) >= 1.595
 %{?with_skey:BuildRequires:    skey-devel >= 2.2-11}
+BuildRequires: zlib-devel
 Requires:      pam >= %{pam_ver}
 Obsoletes:     cu-sudo
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
@@ -135,49 +142,48 @@ Ten pakiet zawiera sudo.schema dla pakietu openldap.
 %prep
 %setup -q
 # only local macros
-mv -f aclocal.m4 acinclude.m4
-# kill libtool.m4 copy
-rm -f acsite.m4
+mv aclocal.m4 acinclude.m4
 # do not load libtool macros from acinclude
+cp -p acinclude.m4 acinclude.m4.orig
 %{__sed} -i -e '/Pull in libtool macros/,$d' acinclude.m4
 
 %patch0 -p1
 %patch1 -p1
+%patch2 -p1
 
 %build
 %{__mv} install-sh install-custom-sh
 %{__libtoolize}
 %{__mv} install-custom-sh install-sh
 cp -f /usr/share/automake/config.sub .
-%{__aclocal}
+%{__aclocal} -I m4
 %{__autoconf}
 %configure \
        NROFFPROG=nroff \
+       --enable-zlib=system \
+       --with-env-editor \
+       --with-ignore-dot \
        --with-incpath=/usr/include/security \
-       --with-timedir=/var/run/sudo \
-       --with-pam \
-       --with-pam-login \
-       --with-logging=both \
+       %{?with_kerberos5:--with-kerb5} \
+       %{?with_ldap:--with-ldap} \
+       %{?with_audit:--with-linux-audit} \
        --with-logfac=auth \
+       --with-logging=both \
+       --with-loglen=320 \
        --with-logpath=/var/log/sudo \
-       --with-ignore-dot \
-       --with-env-editor \
+       --with-long-otp-prompt \
+       --with-pam \
+       --with-pam-login \
+       --with-passprompt="[sudo] password for %%p: " \
        --with-secure-path="/bin:/sbin:/usr/bin:/usr/sbin" \
-       --with-loglen=320 \
-       --with%{!?with_kerberos5:out}-kerb5 \
-       --with%{!?with_ldap:out}-ldap \
-       --with%{!?with_skey:out}-skey \
-       --with%{!?with_selinux:out}-selinux \
-       --with-long-otp-prompt
+       %{?with_selinux:--with-selinux} \
+       %{?with_skey:--with-skey}
 
 %{__make}
 
 %install
 rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{%{_sysconfdir}/{sudoers.d,pam.d,logrotate.d},/var/{log,run/sudo},%{_mandir}/man8}
-
-# makefile broken?
-touch .libs/sudo_noexec.so
+install -d $RPM_BUILD_ROOT{%{_sysconfdir}/{sudoers.d,pam.d,logrotate.d},/var/log/sudo-io,%{_mandir}/man8}
 
 %{__make} -j1 install \
        DESTDIR=$RPM_BUILD_ROOT \
@@ -186,19 +192,17 @@ touch .libs/sudo_noexec.so
        sudoers_uid=$(id -u) \
        sudoers_gid=$(id -g)
 
-cp -a %{SOURCE1} $RPM_BUILD_ROOT/etc/pam.d/sudo
-cp -a %{SOURCE2} $RPM_BUILD_ROOT/etc/pam.d/sudo-i
-touch $RPM_BUILD_ROOT/var/log/sudo
-cp -a %{SOURCE3} $RPM_BUILD_ROOT/etc/logrotate.d/sudo
+cp -p %{SOURCE1} $RPM_BUILD_ROOT/etc/pam.d/sudo
+cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/pam.d/sudo-i
+cp -p %{SOURCE3} $RPM_BUILD_ROOT/etc/logrotate.d/sudo
 
-chmod -R +r $RPM_BUILD_ROOT%{_prefix}
+touch $RPM_BUILD_ROOT/var/log/sudo
 
-rm -f $RPM_BUILD_ROOT%{_libdir}/sudo_noexec.la
-rm -rf $RPM_BUILD_ROOT%{_docdir}/%{name}
+%{__rm} -r $RPM_BUILD_ROOT%{_docdir}/%{name}
 
 %if %{with ldap}
 install -d $RPM_BUILD_ROOT%{schemadir}
-cp -a schema.OpenLDAP $RPM_BUILD_ROOT%{schemadir}/sudo.schema
+cp -p schema.OpenLDAP $RPM_BUILD_ROOT%{schemadir}/sudo.schema
 %endif
 
 %clean
@@ -207,10 +211,7 @@ rm -rf $RPM_BUILD_ROOT
 %post -n openldap-schema-sudo
 %openldap_schema_register %{schemadir}/sudo.schema -d core
 %service -q ldap restart
-
-# banner on first install
-if [ "$1" = "1" ]; then
-%banner -e openldap-schema-sudo <<'EOF'
+%banner -o -e openldap-schema-sudo <<'EOF'
 NOTE:
 In order for sudoRole LDAP queries to be efficient, the server must index
 the attribute 'sudoUser', e.g.
@@ -218,7 +219,6 @@ the attribute 'sudoUser', e.g.
     # Indices to maintain
     index   sudoUser    eq
 EOF
-fi
 
 %postun -n openldap-schema-sudo
 if [ "$1" = "0" ]; then
@@ -226,6 +226,10 @@ if [ "$1" = "0" ]; then
        %service -q ldap restart
 fi
 
+%triggerpostun -- %{name} < 1:1.7.8p2-5
+mv -f /var/run/sudo/* /var/db/sudo 2>/dev/null
+rmdir /var/run/sudo 2>/dev/null || :
+
 %files
 %defattr(644,root,root,755)
 %doc ChangeLog HISTORY NEWS README TROUBLESHOOTING UPGRADE sample.*
@@ -247,9 +251,12 @@ fi
 %{_mandir}/man8/sudoreplay.8*
 %{_mandir}/man8/visudo.8*
 %attr(600,root,root) %ghost /var/log/sudo
+%attr(700,root,root) /var/log/sudo-io
 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/sudo
-%attr(700,root,root) %dir /var/run/sudo
+%attr(700,root,root) %dir /var/db/sudo
 
+%if %{with ldap}
 %files -n openldap-schema-sudo
 %defattr(644,root,root,755)
 %{schemadir}/sudo.schema
+%endif
This page took 0.076184 seconds and 4 git commands to generate.