scponly.spec 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. ##
  2. ## scponly.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: scponly
  27. Summary: Secure Shell (SSH) Wrapper for SCP/SFTP Access Only
  28. URL: http://www.sublimation.org/scponly/
  29. Vendor: Joe Boyle
  30. Packager: The OpenPKG Project
  31. Distribution: OpenPKG [PLUS]
  32. Group: Network
  33. License: MIT-style
  34. Version: 3.8
  35. Release: 20030708
  36. # package options
  37. %option with_fsl yes
  38. # list of sources
  39. Source0: http://www.sublimation.org/scponly/scponly-%{version}.tgz
  40. Source1: rc.scponly
  41. Source2: fsl.scponly
  42. # build information
  43. Prefix: %{l_prefix}
  44. BuildRoot: %{l_buildroot}
  45. BuildPreReq: OpenPKG, openpkg >= 20030415, make, gcc
  46. PreReq: OpenPKG, openpkg >= 20030415, openssh
  47. %if "%{with_fsl}" == "yes"
  48. BuildPreReq: fsl
  49. PreReq: fsl
  50. %endif
  51. AutoReq: no
  52. AutoReqProv: no
  53. %description
  54. scponly is an alternative login shell for providing restricted
  55. access to remote users to both read and write local files via
  56. SCP and SFTP only and without providing any remote execution
  57. privileges.
  58. %prep
  59. %setup -q
  60. %{l_shtool} subst -e 's;${DEFS}\(.*\)$;${DEFS} @LDFLAGS@\1 @LIBS@;' Makefile.in
  61. %build
  62. ( echo "ac_cv_path_scponly_PROG_SFTP_SERVER=%{l_prefix}/libexec/openssh/sftp-server"
  63. echo "ac_cv_path_scponly_PROG_SCP=%{l_prefix}/bin/scp"
  64. echo "ac_cv_path_scponly_PROG_RSYNC=%{l_prefix}/bin/rsync"
  65. ) >config.cache
  66. CC="%{l_cc}" \
  67. CFLAGS="%{l_cflags -O}" \
  68. LDFLAGS="%{l_fsl_ldflags}" \
  69. LIBS="%{l_fsl_libs}" \
  70. ./configure \
  71. --cache-file=./config.cache \
  72. --prefix=%{l_prefix} \
  73. --enable-rsync \
  74. PACKAGE_NAME=scponly
  75. %{l_make} %{l_mflags -O} all debuglevel
  76. %install
  77. rm -rf $RPM_BUILD_ROOT
  78. %{l_shtool} mkdir -f -p -m 755 \
  79. $RPM_BUILD_ROOT%{l_prefix}/var/scponly \
  80. $RPM_BUILD_ROOT%{l_prefix}/etc/scponly \
  81. $RPM_BUILD_ROOT%{l_prefix}/bin \
  82. $RPM_BUILD_ROOT%{l_prefix}/man/man8
  83. %{l_shtool} install -c -s -m 755 \
  84. scponly $RPM_BUILD_ROOT%{l_prefix}/bin/
  85. %{l_shtool} install -c -m 644 \
  86. scponly.8 $RPM_BUILD_ROOT%{l_prefix}/man/man8/
  87. %{l_shtool} install -c -m 644 \
  88. debuglevel $RPM_BUILD_ROOT%{l_prefix}/etc/scponly/
  89. # install run-command script
  90. %{l_shtool} mkdir -f -p -m 755 \
  91. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
  92. %{l_shtool} install -c -m 755 \
  93. -e 's;@l_prefix@;%{l_prefix};g' \
  94. -e 's;@l_susr@;%{l_susr};g' \
  95. -e 's;@l_rusr@;%{l_rusr};g' \
  96. -e 's;@l_rgrp@;%{l_rgrp};g' \
  97. %{SOURCE rc.scponly} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  98. # install OSSP fsl configuration
  99. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/fsl
  100. %{l_shtool} install -c -m 644 \
  101. -e 's;@l_prefix@;%{l_prefix};g' \
  102. %{SOURCE fsl.scponly} \
  103. $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/
  104. # determine installation files
  105. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  106. %{l_files_std} \
  107. '%not %dir %{l_prefix}/etc/fsl' \
  108. '%config %{l_prefix}/etc/fsl/fsl.scponly'
  109. %files -f files
  110. %clean
  111. rm -rf $RPM_BUILD_ROOT