# HG changeset patch # User Michael Schloh von Bennewitz # Date 1344001347 -7200 # Node ID f243ce94972c43784650fd4e35092d096945afcc # Parent eb5f1f7ac5ffb4471328362f6930b78b505cfc6b Import package vendor original specs for necessary manipulations. diff -r eb5f1f7ac5ff -r f243ce94972c sudo/fsl.sudo --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sudo/fsl.sudo Fri Aug 03 15:42:27 2012 +0200 @@ -0,0 +1,16 @@ +## +## fsl.sudo -- OSSP fsl configuration +## + +ident (.*sudo)/.+ q{ + prefix( + prefix="%b %d %H:%M:%S %N <%L> $1[%P]: " + ) + -> { + debug: file( + path="@l_prefix@/var/sudo/sudo.log", + perm=0600 + ) + } +}; + diff -r eb5f1f7ac5ff -r f243ce94972c sudo/rc.sudo --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sudo/rc.sudo Fri Aug 03 15:42:27 2012 +0200 @@ -0,0 +1,22 @@ +#!@l_prefix@/bin/openpkg rc +## +## rc.sudo -- Run-Commands +## + +%config + sudo_enable="$openpkg_rc_def" + sudo_log_prolog="true" + sudo_log_epilog="true" + sudo_log_numfiles="10" + sudo_log_minsize="1M" + sudo_log_complevel="9" + +%daily -u @l_susr@ + rcService sudo enable yes || exit 0 + shtool rotate -f \ + -n ${sudo_log_numfiles} -s ${sudo_log_minsize} -d \ + -z ${sudo_log_complevel} -o @l_rusr@ -g @l_rgrp@ -m 644 \ + -P "${sudo_log_prolog}" \ + -E "${sudo_log_epilog}" \ + @l_prefix@/var/sudo/sudo.log + diff -r eb5f1f7ac5ff -r f243ce94972c sudo/sudo.conf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sudo/sudo.conf Fri Aug 03 15:42:27 2012 +0200 @@ -0,0 +1,9 @@ +## +## sudo.conf -- global sudo(8) configuration +## + +Plugin sudoers_policy sudoers.so +Plugin sudoers_io sudoers.so + +Path noexec @l_prefix@/libexec/sudo/helper/sudo_noexec.so + diff -r eb5f1f7ac5ff -r f243ce94972c sudo/sudo.spec --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sudo/sudo.spec Fri Aug 03 15:42:27 2012 +0200 @@ -0,0 +1,232 @@ +## +## sudo.spec -- OpenPKG RPM Package Specification +## Copyright (c) 2000-2012 OpenPKG Foundation e.V. +## +## Permission to use, copy, modify, and distribute this software for +## any purpose with or without fee is hereby granted, provided that +## the above copyright notice and this permission notice appear in all +## copies. +## +## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED +## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR +## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT +## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +## SUCH DAMAGE. +## + +# package information +Name: sudo +Summary: Flexible Switch User Command +URL: http://www.sudo.ws/ +Vendor: Todd Miller +Packager: OpenPKG Foundation e.V. +Distribution: OpenPKG Community +Class: BASE +Group: ShellUtils +License: BSD +Version: 1.8.5p2 +Release: 20120531 + +# package options +%option with_fsl yes +%option with_pam no +%option with_skey no +%option with_opie no +%option with_ldap no + +# list of sources +Source0: http://www.sudo.ws/sudo/dist/sudo-%{version}.tar.gz +Source1: rc.sudo +Source2: fsl.sudo +Source3: sudo.conf +Source4: sudoers + +# build information +BuildPreReq: OpenPKG, openpkg >= 20100101 +PreReq: OpenPKG, openpkg >= 20100101 +BuildPreReq: zlib +PreReq: zlib +%if "%{with_fsl}" == "yes" +BuildPreReq: fsl +PreReq: fsl +%endif +%if "%{with_pam}" == "yes" +BuildPreReq: PAM +PreReq: PAM +%endif +%if "%{with_skey}" == "yes" +BuildPreReq: skey +PreReq: skey +%endif +%if "%{with_opie}" == "yes" +BuildPreReq: opie +PreReq: opie +%endif +%if "%{with_ldap}" == "yes" +BuildPreReq: openldap +PreReq: openldap +%endif + +%description + Sudo (superuser do) 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. + +%track + prog sudo = { + version = %{version} + url = http://www.sudo.ws/sudo/dist/ + regex = sudo-(__VER__)\.tar\.gz + } + +%prep + %setup -q + %{l_shtool} subst \ + -e '/LINENO: error: C[+]* preprocessor/{N;N;N;N;s/.*/:/;}' \ + configure + case "%{l_platform -t}" in + *-darwin* ) + %{l_shtool} subst \ + -e 's/\(\$(LIBTOOL).*sudo_noexec.lo.*$\)/\1; $(CC) -dynamiclib .libs\/sudo_noexec.o $(LDFLAGS) -o .libs\/sudo_noexec.dylib/' \ + Makefile.in + ;; + *-sunos* ) + %{l_shtool} subst \ + -e 's;^(void)isblank(1);if ((int)isblank(0x20)) exit(0);' \ + configure + ;; + esac + +%build + # configure program + libs="" + case "%{l_platform -t}" in + *-freebsd* ) libs="$libs -lutil" ;; + esac + CC="%{l_cc}" \ + CFLAGS="%{l_cflags -O}" \ + LDFLAGS="%{l_fsl_ldflags}" \ + SUDO_LIBS="$libs %{l_fsl_libs}" \ +%if "%{with_pam}" == "yes" + CPPFLAGS="-I`%{l_rc} --query pam_incdir`" \ + LDFLAGS="-L`%{l_rc} --query pam_libdir` ${LDFLAGS}" \ +%endif + true=`%{l_shtool} path true` \ + ./configure \ + --prefix=%{l_prefix} \ + --mandir=%{l_prefix}/man \ + --sysconfdir=%{l_prefix}/etc/sudo \ + --libexecdir=%{l_prefix}/libexec/sudo \ + --with-plugindir=%{l_prefix}/libexec/sudo/plugin \ + --with-noexec=%{l_prefix}/libexec/sudo/helper/sudo_noexec.so \ + --with-logpath=%{l_prefix}/var/sudo/sudo.log \ + --with-timedir=%{l_prefix}/var/sudo \ + --enable-zlib=%{l_prefix} \ +%if "%{with_fsl}" == "yes" + --with-logging=syslog \ +%else + --with-logging=file \ +%endif + --with-sudoers-mode=0400 \ + --with-sudoers-uid=%{l_suid} \ + --with-sudoers-gid=%{l_sgid} \ + --with-sendmail=$true \ + --with-ignore-dot \ +%if "%{with_pam}" == "yes" + --with-pam \ +%else + --without-pam \ +%endif +%if "%{with_skey}" == "yes" || "%{with_opie}" == "yes" + --with-long-otp-prompt \ +%endif +%if "%{with_skey}" == "yes" + --with-skey=%{l_prefix} \ +%endif +%if "%{with_opie}" == "yes" + --with-opie=%{l_prefix} \ +%endif +%if "%{with_ldap}" == "yes" + --with-ldap=%{l_prefix} \ + --with-ldap-conf-file=%{l_prefix}/etc/sudo/ldap.conf \ +%endif + --enable-shell-sets-home \ + --disable-root-sudo \ + --with-env-editor \ + --disable-path-info \ + --disable-nls + + # build program + %{l_make} %{l_mflags -O} + +%install + # install program + %{l_shtool} mkdir -f -p -m 755 \ + $RPM_BUILD_ROOT%{l_prefix}/var/sudo + %{l_shtool} subst \ + -e "s;-M 4111;-M 4511;" \ + -e "s;-M 0111;-M 0511;" \ + -e "s;-[OG] [^ ]*;;g" \ + Makefile + %{l_make} %{l_mflags} install \ + DESTDIR=$RPM_BUILD_ROOT + rm -rf $RPM_BUILD_ROOT%{l_prefix}/share + + # install run-command script + %{l_shtool} mkdir -f -p -m 755 \ + $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d + %{l_shtool} install -c -m 755 %{l_value -s -a} \ + %{SOURCE rc.sudo} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/ + + # install OSSP fsl configuration + %{l_shtool} mkdir -f -p -m 755 \ + $RPM_BUILD_ROOT%{l_prefix}/etc/fsl + %{l_shtool} install -c -m 644 %{l_value -s -a} \ + %{SOURCE fsl.sudo} \ + $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/ + + # install default configuration file + %{l_shtool} install -c -m 644 %{l_value -s -a} \ + %{SOURCE sudo.conf} %{SOURCE sudoers} \ + $RPM_BUILD_ROOT%{l_prefix}/etc/sudo/ + + # determine installation files + %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \ + %{l_files_std} \ + '%config %{l_prefix}/etc/fsl/fsl.sudo' \ + '%attr(4111,%{l_susr},%{l_mgrp}) %{l_prefix}/bin/sudo' \ + '%attr(4111,%{l_susr},%{l_mgrp}) %{l_prefix}/bin/sudoedit' \ + '%attr(0111,%{l_susr},%{l_mgrp}) %{l_prefix}/sbin/visudo' \ + '%attr(0755,%{l_susr},%{l_mgrp}) %{l_prefix}/libexec/sudo/plugin/sudoers.so' \ + '%attr(0700,%{l_susr},%{l_mgrp}) %dir %{l_prefix}/var/sudo' \ + '%config(noreplace) %attr(0400,%{l_susr},%{l_sgrp}) %{l_prefix}/etc/sudo/sudo.conf' \ + '%config(noreplace) %attr(0400,%{l_susr},%{l_sgrp}) %{l_prefix}/etc/sudo/sudoers' \ + '%attr(0700,%{l_susr},%{l_sgrp}) %{l_prefix}/etc/sudo/sudoers.d' + +%files -f files + +%clean + +%post +%if "%{with_pam}" == "yes" + # add PAM configuration entry + if [ $1 -eq 1 ]; then + $RPM_INSTALL_PREFIX/sbin/pamtool --add --smart --name=sudo + fi +%endif + +%preun +%if "%{with_pam}" == "yes" + # remove PAM configuration entry + if [ $1 -eq 0 ]; then + $RPM_INSTALL_PREFIX/sbin/pamtool --remove --smart --name=sudo + fi +%endif + diff -r eb5f1f7ac5ff -r f243ce94972c sudo/sudoers --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sudo/sudoers Fri Aug 03 15:42:27 2012 +0200 @@ -0,0 +1,17 @@ +## +## sudoers -- global sudoers(5) specification +## Hint: general structure is "who where = (as_whom) what" +## + +#includedir @l_prefix@/etc/sudo/sudoers.d + +# - allow root (first entry) and +# - anybody in group "wheel" (second entry) +# - to run on all hosts +# - under any user +# - without password request +# - with set environment variables +# - any command +root ALL = (ALL) NOPASSWD: SETENV: ALL +%wheel ALL = (ALL) NOPASSWD: SETENV: ALL +