SPECS/sudo/sudo.spec
f4d17450
 Summary:	Sudo
 Name:		sudo
 Version:	1.8.11p1
1e510285
 Release:	3%{?dist}
f4d17450
 License:	ISC
 URL:		https://www.kernel.org/pub/linux/libs/pam/
 Group:		System Environment/Security
 Vendor:		VMware, Inc.
 Distribution:	Photon
 Source0:	http://www.sudo.ws/sudo/dist/%{name}-%{version}.tar.gz
 BuildRequires:	man-db
2530f4b1
 BuildRequires:	Linux-PAM
 Requires:	Linux-PAM
b3211804
 Requires:	shadow
f4d17450
 %description
 The Sudo package allows a system administrator to give certain users (or groups of users) 
 the ability to run some (or all) commands as root or another user while logging the commands and arguments. 
 
 %prep
 %setup -q
 %build
 
 ./configure \
 	--prefix=%{_prefix} \
 	--bindir=%{_bindir} \
 	--libexecdir=%{_libdir} \
         --docdir=%{_docdir}/%{name}-%{version} \
 	--with-all-insults         \
         --with-env-editor          \
2530f4b1
 	--with-pam                 \
 	--with-pam-login	   \
f4d17450
         --with-passprompt="[sudo] password for %p"
 
 make %{?_smp_mflags}
 %install
 [ %{buildroot} != "/"] && rm -rf %{buildroot}/*
 make install DESTDIR=%{buildroot}
 install -v -dm755 %{buildroot}/%{_docdir}/%{name}-%{version}
 find %{buildroot}/%{_libdir} -name '*.la' -delete
b3211804
 cat >> %{buildroot}/etc/sudoers << EOF
 %wheel ALL=(ALL) ALL
 %sudo   ALL=(ALL) ALL
 EOF
 install -vdm755 %{buildroot}/etc/pam.d
 cat > %{buildroot}/etc/pam.d/sudo << EOF
 #%%PAM-1.0
 auth       include      system-auth
 account    include      system-account
 password   include      system-password
 session    include      system-session
 session    required     pam_env.so
 EOF
 
f4d17450
 %find_lang %{name}
 %{_fixperms} %{buildroot}/*
 %check
 make -k check |& tee %{_specdir}/%{name}-check-log || %{nocheck}
 %post	-p /sbin/ldconfig
b3211804
 groupadd wheel
f4d17450
 %postun	-p /sbin/ldconfig
 %clean
 rm -rf %{buildroot}/*
 %files -f %{name}.lang
 %defattr(-,root,root)
 %{_sysconfdir}/*
 %{_bindir}/*
 %{_includedir}/*
 %{_libdir}/sudo/*.so
 %{_libdir}/sudo/*.so.*
 %{_sbindir}/*
 %{_mandir}/man5/*
 %{_mandir}/man8/*
 %{_docdir}/%{name}-%{version}/*
 %{_datarootdir}/locale/*
 %changelog
b3211804
 *	Fri May 29 2015 Divya Thaluru <dthaluru@vmware.com> 1.8.11p1-3
 -	Adding sudo configuration and PAM config file
2530f4b1
 *	Wed May 27 2015 Divya Thaluru <dthaluru@vmware.com> 1.8.11p1-2
 -	Adding PAM support
f4d17450
 *	Thu Oct 09 2014 Divya Thaluru <dthaluru@vmware.com> 1.8.11p1-1
 -	Initial build.	First version