sudo.spec 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. ##
  2. ## sudo.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2003 Cable & Wireless Deutschland GmbH
  4. ## Copyright (c) 2000-2003 The OpenPKG Project <http://www.openpkg.org/>
  5. ## Copyright (c) 2000-2003 Ralf S. Engelschall <rse@engelschall.com>
  6. ##
  7. ## Permission to use, copy, modify, and distribute this software for
  8. ## any purpose with or without fee is hereby granted, provided that
  9. ## the above copyright notice and this permission notice appear in all
  10. ## copies.
  11. ##
  12. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  13. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  14. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  15. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  16. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  17. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  18. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  19. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  20. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  21. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  22. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  23. ## SUCH DAMAGE.
  24. ##
  25. # package information
  26. Name: sudo
  27. Summary: Flexible Switch User Command
  28. URL: http://www.sudo.ws/
  29. Vendor: Todd Miller
  30. Packager: The OpenPKG Project
  31. Distribution: OpenPKG [BASE]
  32. Group: System
  33. License: BSD
  34. Version: 1.6.6
  35. Release: 20030103
  36. # package options
  37. %option with_pam no
  38. # list of sources
  39. Source0: ftp://ftp.courtesan.com/pub/sudo/sudo-%{version}.tar.gz
  40. # build information
  41. Prefix: %{l_prefix}
  42. BuildRoot: %{l_buildroot}
  43. BuildPreReq: OpenPKG, openpkg >= 20030103, MTA
  44. PreReq: OpenPKG, openpkg >= 20030103, MTA
  45. %if "%{with_pam}" == "yes"
  46. BuildPreReq: PAM
  47. PreReq: PAM
  48. %endif
  49. AutoReq: no
  50. AutoReqProv: no
  51. %description
  52. Sudo (superuser do) allows a system administrator to give certain
  53. users (or groups of users) the ability to run some (or all) commands
  54. as root or another user while logging the commands and arguments.
  55. %prep
  56. %setup -q
  57. %build
  58. CC="%{l_cc}" \
  59. CFLAGS="%{l_cflags -O}" \
  60. %if "%{with_pam}" == "yes"
  61. CPPFLAGS="-I`%{l_prefix}/etc/rc --query pam_incdir`" \
  62. LDFLAGS="-L`%{l_prefix}/etc/rc --query pam_libdir`" \
  63. %endif
  64. ./configure \
  65. --prefix=%{l_prefix} \
  66. --sysconfdir=%{l_prefix}/etc/sudo \
  67. --with-logpath=%{l_prefix}/var/sudo/log/sudo.log \
  68. --with-logging=file \
  69. --with-sudoers-mode=0400 \
  70. --with-sudoers-uid=0 \
  71. --with-sudoers-gid=%{l_muid} \
  72. --with-sendmail=%{l_prefix}/sbin/sendmail \
  73. --with-ignore-dot \
  74. %if "%{with_pam}" == "yes"
  75. --with-pam \
  76. %endif
  77. --enable-shell-sets-home \
  78. --disable-root-sudo \
  79. --with-env-editor \
  80. --disable-path-info \
  81. --disable-nls
  82. %{l_make} %{l_mflags -O}
  83. %install
  84. rm -rf $RPM_BUILD_ROOT
  85. %{l_shtool} mkdir -f -p -m 755 \
  86. $RPM_BUILD_ROOT%{l_prefix}/var/sudo/log/
  87. %{l_shtool} subst \
  88. -e "s;-m 4111;-m 4511;" \
  89. -e "s;-m 0111;-m 0511;" \
  90. Makefile
  91. %{l_make} %{l_mflags} install \
  92. prefix=$RPM_BUILD_ROOT%{l_prefix} \
  93. exec_prefix=$RPM_BUILD_ROOT%{l_prefix} \
  94. sysconfdir=$RPM_BUILD_ROOT%{l_prefix}/etc/sudo \
  95. install_uid=`%{l_shtool} echo -e %u` \
  96. install_gid=`%{l_shtool} echo -e %g` \
  97. sudoers_uid=`%{l_shtool} echo -e %u` \
  98. sudoers_gid=`%{l_shtool} echo -e %g`
  99. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  100. %{l_files_std} \
  101. '%attr(4111,root,%{l_mgrp}) %{l_prefix}/bin/sudo' \
  102. '%attr(0111,root,%{l_mgrp}) %{l_prefix}/sbin/visudo' \
  103. '%config %attr(0400,root,%{l_mgrp}) %{l_prefix}/etc/sudo/sudoers'
  104. %files -f files
  105. %clean
  106. rm -rf $RPM_BUILD_ROOT
  107. %post
  108. %if "%{with_pam}" == "yes"
  109. # add PAM configuration entry
  110. if [ $1 -eq 1 ]; then
  111. $RPM_INSTALL_PREFIX/sbin/pamtool --add --smart --name=sudo
  112. fi
  113. %endif
  114. %preun
  115. %if "%{with_pam}" == "yes"
  116. # remove PAM configuration entry
  117. if [ $1 -eq 0 ]; then
  118. $RPM_INSTALL_PREFIX/sbin/pamtool --remove --smart --name=sudo
  119. fi
  120. %endif