rdist.spec 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. ##
  2. ## rdist.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2003 The OpenPKG Project <http://www.openpkg.org/>
  4. ## Copyright (c) 2000-2003 Ralf S. Engelschall <rse@engelschall.com>
  5. ## Copyright (c) 2000-2003 Cable & Wireless <http://www.cw.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. # FIXME: rse: does not compile under FreeBSD 4!
  26. # package versions
  27. %define V_base 7.0.0
  28. %define V_pl alpha10
  29. %define V_opkg 7.0.0a10
  30. # package information
  31. Name: rdist
  32. Summary: Remote File Distribution
  33. URL: http://www.magnicomp.com/rdist/
  34. Vendor: MagniComp
  35. Packager: The OpenPKG Project
  36. Distribution: OpenPKG [JUNK]
  37. Group: Filesystem
  38. License: BSD
  39. Version: %{V_opkg}
  40. Release: 20031001
  41. # package options
  42. %option with_fsl yes
  43. # list of sources
  44. Source0: ftp://ftp.rge.com/download/rdist/rdist-%{V_base}-%{V_pl}.tar.gz
  45. Source1: rc.rdist
  46. Source2: fsl.rdist
  47. # build information
  48. Prefix: %{l_prefix}
  49. BuildRoot: %{l_buildroot}
  50. BuildPreReq: OpenPKG, openpkg >= 20030718, make, gcc, bison
  51. PreReq: OpenPKG, openpkg >= 20030718
  52. %if "%{with_fsl}" == "yes"
  53. BuildPreReq: fsl >= 1.2.0
  54. PreReq: fsl >= 1.2.0
  55. %endif
  56. AutoReq: no
  57. AutoReqProv: no
  58. %description
  59. RDist maintains identical copies of files over multiple hosts.
  60. It preserves the owner, group, mode, and mtime of files if
  61. possible and can update programs that are executing.
  62. %prep
  63. %setup -q -n rdist-%{V_base}-%{V_pl}
  64. %build
  65. CC="%{l_cc}" \
  66. CFLAGS="%{l_cflags -O}" \
  67. LDFLAGS="%{l_fsl_ldflags}" \
  68. LIBS="%{l_fsl_libs}" \
  69. ./configure \
  70. --prefix=%{l_prefix}
  71. %{l_make} %{l_mflags}
  72. %install
  73. rm -rf $RPM_BUILD_ROOT
  74. %{l_shtool} mkdir -f -p -m 755 \
  75. $RPM_BUILD_ROOT%{l_prefix}/bin \
  76. $RPM_BUILD_ROOT%{l_prefix}/man/man1 \
  77. $RPM_BUILD_ROOT%{l_prefix}/man/man8 \
  78. $RPM_BUILD_ROOT%{l_prefix}/sbin \
  79. $RPM_BUILD_ROOT%{l_prefix}/var/rdist
  80. %{l_shtool} install -c -s -m 755 \
  81. src/rdist \
  82. $RPM_BUILD_ROOT%{l_prefix}/bin/
  83. %{l_shtool} install -c -s -m 755 \
  84. src/rdistd \
  85. $RPM_BUILD_ROOT%{l_prefix}/sbin/
  86. %{l_shtool} install -c -m 644 \
  87. doc/rdist.man \
  88. $RPM_BUILD_ROOT%{l_prefix}/man/man1/rdist.1
  89. %{l_shtool} install -c -m 644 \
  90. doc/rdistd.man \
  91. $RPM_BUILD_ROOT%{l_prefix}/man/man8/rdistd.8
  92. # install run-command script
  93. %{l_shtool} mkdir -f -p -m 755 \
  94. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
  95. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  96. %{SOURCE rc.rdist} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  97. # install OSSP fsl configuration
  98. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/fsl
  99. %{l_shtool} install -c -m 644 %{l_value -s -a} \
  100. %{SOURCE fsl.rdist} \
  101. $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/
  102. # determine installation files
  103. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  104. %{l_files_std} \
  105. '%not %dir %{l_prefix}/etc/fsl' \
  106. '%config %{l_prefix}/etc/fsl/fsl.rdist'
  107. %files -f files
  108. %clean
  109. rm -rf $RPM_BUILD_ROOT
  110. %post
  111. # after upgrade, restart service
  112. [ $1 -eq 2 ] || exit 0
  113. eval `%{l_rc} rdist status 2>/dev/null`
  114. [ ".$rdist_active" = .yes ] && %{l_rc} rdist restart
  115. exit 0
  116. %preun
  117. # before erase, stop service and remove log files
  118. [ $1 -eq 0 ] || exit 0
  119. %{l_rc} rdist stop 2>/dev/null
  120. rm -f $RPM_INSTALL_PREFIX/var/rdist/rdist.log* >/dev/null 2>&1 || true
  121. exit 0