cvsd.spec 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. ##
  2. ## cvsd.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: cvsd
  26. Summary: CVS PServer Daemon
  27. URL: http://ch.tudelft.nl/~arthur/cvsd/
  28. Vendor: Arthur de Jong
  29. Packager: OpenPKG Foundation e.V.
  30. Distribution: OpenPKG Community
  31. Class: PLUS
  32. Group: SCM
  33. License: GPL
  34. Version: 1.0.14
  35. Release: 20071208
  36. # package options
  37. %option with_fsl yes
  38. # list of sources
  39. Source0: http://ch.tudelft.nl/~arthur/cvsd/cvsd-%{version}.tar.gz
  40. Source1: cvsd.conf
  41. Source2: rc.cvsd
  42. Source3: fsl.cvsd
  43. Patch0: cvsd.patch
  44. # build information
  45. Prefix: %{l_prefix}
  46. BuildRoot: %{l_buildroot}
  47. BuildPreReq: OpenPKG, openpkg >= 20060823, cvs, gcc
  48. PreReq: OpenPKG, openpkg >= 20060823, cvs
  49. %if "%{with_fsl}" == "yes"
  50. BuildPreReq: fsl
  51. PreReq: fsl
  52. %endif
  53. AutoReq: no
  54. AutoReqProv: no
  55. %description
  56. cvsd is a wrapper program for cvs in pserver mode. It will run
  57. 'cvs pserver' under a special uid/gid in a chroot jail. cvsd is
  58. run as a daemon and is controlled through a configuration file. It
  59. is relatively easy to configure and tools are provided for setting
  60. up a rootjail. This server can be useful if you want to run a
  61. public cvs pserver. You should however be aware of the security
  62. limitations of running a cvs pserver. If you want any kind of
  63. authentication you should really consider using secure shell as a
  64. secure authentication mechanism and transport. Passwords used in cvs
  65. pserver are transmitted in plaintext and this wrapper won't change
  66. that. This server adds a layer of security to cvs. cvs is a very
  67. powerful tool and is capable of running scripts and other things.
  68. By running cvs in a rootjail it is possible to limit the amount of
  69. "damage" cvs can do if it is exploited. It is generally a good idea
  70. to run cvsd without any write permissions to any directory on the
  71. system.
  72. %track
  73. prog cvsd = {
  74. version = %{version}
  75. url = http://ch.tudelft.nl/~arthur/cvsd/downloads.html
  76. regex = cvsd-(__VER__)\.tar\.gz
  77. }
  78. %prep
  79. %setup -q
  80. %patch -p0
  81. %build
  82. # configure program
  83. CC="%{l_cc}" \
  84. CFLAGS="%{l_cflags -O}" \
  85. LDFLAGS="%{l_fsl_ldflags}" \
  86. LIBS="%{l_fsl_libs}" \
  87. GREP="grep" \
  88. ./configure \
  89. --prefix=%{l_prefix}
  90. # build program
  91. %{l_make} %{l_mflags -O}
  92. %install
  93. rm -rf $RPM_BUILD_ROOT
  94. %{l_shtool} mkdir -f -p -m 755 \
  95. $RPM_BUILD_ROOT%{l_prefix}/var/cvsd \
  96. $RPM_BUILD_ROOT%{l_prefix}/etc/cvsd
  97. # perform standard installation procedure
  98. %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
  99. rm -rf $RPM_BUILD_ROOT%{l_prefix}/etc/init.d
  100. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
  101. # creating configuration
  102. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  103. %{SOURCE cvsd.conf} $RPM_BUILD_ROOT%{l_prefix}/etc/cvsd/cvsd.conf
  104. # install run-command script
  105. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
  106. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  107. %{SOURCE rc.cvsd} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  108. # install OSSP fsl configuration
  109. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/fsl
  110. %{l_shtool} install -c -m 644 %{l_value -s -a} \
  111. %{SOURCE fsl.cvsd} \
  112. $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/
  113. # determine installation files
  114. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  115. %{l_files_std} \
  116. '%config %{l_prefix}/etc/fsl/fsl.cvsd'
  117. %files -f files
  118. %clean
  119. rm -rf $RPM_BUILD_ROOT
  120. %pre
  121. # before upgrade, save status and stop service
  122. [ $1 -eq 2 ] || exit 0
  123. eval `%{l_rc} cvsd status 2>/dev/null | tee %{l_tmpfile}`
  124. %{l_rc} cvsd stop 2>/dev/null
  125. exit 0
  126. %post
  127. [ $1 -eq 2 ] || exit 0
  128. # after upgrade, restore status
  129. eval `cat %{l_tmpfile}`; rm -f %{l_tmpfile}
  130. [ ".$cvsd_active" = .yes ] && %{l_rc} cvsd start
  131. exit 0
  132. %preun
  133. # before erase, stop service and remove log files
  134. [ $1 -eq 0 ] || exit 0
  135. %{l_rc} cvsd stop 2>/dev/null
  136. rm -f $RPM_INSTALL_PREFIX/var/cvsd/*.log* >/dev/null 2>&1 || true
  137. exit 0