sudosh.spec 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. ##
  2. ## sudosh.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2007 OpenPKG Foundation e.V. <http://openpkg.net/>
  4. ## Copyright (c) 2000-2007 Ralf S. Engelschall <http://engelschall.com/>
  5. ##
  6. ## Permission to use, copy, modify, and distribute this software for
  7. ## any purpose with or without fee is hereby granted, provided that
  8. ## the above copyright notice and this permission notice appear in all
  9. ## copies.
  10. ##
  11. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  12. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  13. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  14. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  15. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  16. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  17. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  18. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  19. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  20. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  21. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  22. ## SUCH DAMAGE.
  23. ##
  24. # package information
  25. Name: sudosh
  26. Summary: SUDO Shell
  27. URL: http://sudosh.sourceforge.net/
  28. Vendor: Douglas Richard Hanks, Jr.
  29. Packager: OpenPKG Foundation e.V.
  30. Distribution: OpenPKG Community
  31. Class: EVAL
  32. Group: ShellUtils
  33. License: Open Software License
  34. Version: 1.8.2
  35. Release: 20071228
  36. # package options
  37. %option with_fsl yes
  38. # list of sources
  39. Source0: http://sudosh.sourceforge.net/sudosh-%{version}.tar.bz2
  40. Source1: sudosh.conf
  41. Source2: fsl.sudosh
  42. Source3: rc.sudosh
  43. Patch0: sudosh.patch
  44. # build information
  45. Prefix: %{l_prefix}
  46. BuildRoot: %{l_buildroot}
  47. BuildPreReq: OpenPKG, openpkg >= 20060823
  48. PreReq: OpenPKG, openpkg >= 20060823
  49. %if "%{with_fsl}" == "yes"
  50. BuildPreReq: fsl
  51. PreReq: fsl
  52. %endif
  53. AutoReq: no
  54. AutoReqProv: no
  55. %description
  56. sudosh(1) is a filter and can be used as a login shell. sudosh(1)
  57. takes advantage of PTY devices in order to sit between the user's
  58. keyboard and a program, in this case a shell. sudosh(1) was designed
  59. specifically to be used in conjunction with sudo(1) or by itself
  60. as a login shell. sudosh(1) allows the execution of a root shell
  61. with logging. Every command the user types within the root shell is
  62. logged as well as the output. The sessions later can be replayed for
  63. reviewing purposes.
  64. %track
  65. prog sudosh = {
  66. version = %{version}
  67. url = http://sudosh.sourceforge.net/
  68. regex = sudosh-(__VER__)\.tar\.bz2
  69. }
  70. %prep
  71. %setup -q
  72. %patch -p0
  73. %build
  74. # configure program
  75. export CC="%{l_cc}"
  76. export CFLAGS="%{l_cflags -O}"
  77. export CPPFLAGS="%{l_cppflags}"
  78. export LDFLAGS="%{l_ldflags} %{l_fsl_ldflags}"
  79. export LIBS="%{l_fsl_libs}"
  80. case "%{l_platform -t}" in
  81. *-freebsd* ) LIBS="$LIBS -lutil" ;;
  82. esac
  83. ./configure \
  84. --prefix=%{l_prefix} \
  85. --sysconfdir=%{l_prefix}/etc/sudosh \
  86. --with-logdir=%{l_prefix}/var/sudosh
  87. # build program
  88. %{l_make} %{l_mflags -O}
  89. %install
  90. # install program
  91. rm -rf $RPM_BUILD_ROOT
  92. %{l_make} %{l_mflags} install \
  93. prefix=$RPM_BUILD_ROOT%{l_prefix} \
  94. exec_prefix=$RPM_BUILD_ROOT%{l_prefix} \
  95. sysconfdir=$RPM_BUILD_ROOT%{l_prefix}/etc/sudosh
  96. # strip down installation files
  97. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
  98. # install default configuration
  99. %{l_shtool} install -c -m 644 %{l_value -s -a} \
  100. %{SOURCE sudosh.conf} $RPM_BUILD_ROOT%{l_prefix}/etc/sudosh/
  101. # create run-time directories
  102. %{l_shtool} mkdir -f -p -m 755 \
  103. $RPM_BUILD_ROOT%{l_prefix}/var/sudosh \
  104. $RPM_BUILD_ROOT%{l_prefix}/var/sudosh/session
  105. # install run-command script
  106. %{l_shtool} mkdir -f -p -m 755 \
  107. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
  108. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  109. %{SOURCE rc.sudosh} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  110. # install OSSP fsl configuration
  111. %{l_shtool} mkdir -f -p -m 755 \
  112. $RPM_BUILD_ROOT%{l_prefix}/etc/fsl
  113. %{l_shtool} install -c -m 644 %{l_value -s -a} \
  114. %{SOURCE fsl.sudosh} $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/
  115. # determine installation files
  116. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  117. %{l_files_std} \
  118. '%config %{l_prefix}/etc/sudosh/*' \
  119. '%attr(-,%{l_musr},%{l_mgrp}) %{l_prefix}/var/sudosh' \
  120. '%attr(1777,%{l_musr},%{l_mgrp}) %{l_prefix}/var/sudosh/session'
  121. %files -f files
  122. %clean
  123. rm -rf $RPM_BUILD_ROOT
  124. %preun
  125. [ $1 -eq 0 ] || exit 0
  126. rm -f $RPM_INSTALL_PREFIX/var/sudosh/session/* >/dev/null 2>&1 || true
  127. rm -f $RPM_INSTALL_PREFIX/var/sudosh/*.log* >/dev/null 2>&1 || true
  128. exit 0