dsh.spec 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. ##
  2. ## dsh.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. # package versions
  26. %define V_dsh 0.25.1
  27. %define V_dshconfig 0.20.10
  28. # package information
  29. Name: dsh
  30. Summary: Dancer's Distributed shell
  31. URL: http://www.netfort.gr.jp/~dancer/software/dsh.html
  32. Vendor: Junichi Uekawa
  33. Packager: The OpenPKG Project
  34. Distribution: OpenPKG [PLUS]
  35. Group: Shell
  36. License: GPL
  37. Version: %{V_dsh}
  38. Release: 20040122
  39. # list of sources
  40. Source0: http://www.netfort.gr.jp/~dancer/software/downloads/dsh-%{V_dsh}.tar.gz
  41. Source1: http://www.netfort.gr.jp/~dancer/software/downloads/libdshconfig-%{V_dshconfig}.tar.gz
  42. Source2: dsh.conf
  43. Patch0: dsh.patch
  44. # build information
  45. Prefix: %{l_prefix}
  46. BuildRoot: %{l_buildroot}
  47. BuildPreReq: OpenPKG, openpkg >= 20030717
  48. PreReq: OpenPKG, openpkg >= 20030717, openssh
  49. AutoReq: no
  50. AutoReqProv: no
  51. %description
  52. Dsh executes commands remotely via SSH on several different machines
  53. at the same time.
  54. %prep
  55. %setup0 -q
  56. %setup1 -q -T -D -a 1
  57. %patch0 -p0
  58. %build
  59. # build libdshconfig
  60. ( cd libdshconfig-%{V_dshconfig}
  61. CC="%{l_cc}" \
  62. CFLAGS="%{l_cflags -O}" \
  63. CPPFLAGS="%{l_cppflags}" \
  64. LDFLAGS="%{l_ldflags}" \
  65. ./configure \
  66. --prefix=%{l_prefix} \
  67. --disable-shared \
  68. --disable-nls
  69. %{l_shtool} subst -e 's;ssize_t;int;g' -- libdshconfig.c
  70. %{l_make} %{l_mflags -O}
  71. rm -f .libs/*.la*
  72. ) || exit $?
  73. # build dsh
  74. %{l_shtool} subst \
  75. -e 's;/etc\(/dsh/dsh.conf\);%{l_prefix}/etc\1;' \
  76. -e 's;/etc\(/dsh/machines.list\);%{l_prefix}/etc\1;' \
  77. -e 's;/etc\(/dsh/group\);%{l_prefix}/etc\1;' \
  78. -- dsh.1
  79. CC="%{l_cc}" \
  80. CFLAGS="%{l_cflags -O}" \
  81. CPPFLAGS="%{l_cppflags} -I`pwd`/libdshconfig-%{V_dshconfig}" \
  82. LDFLAGS="%{l_ldflags} -L`pwd`/libdshconfig-%{V_dshconfig}/.libs" \
  83. ./configure \
  84. --prefix=%{l_prefix} \
  85. --sysconfdir=%{l_prefix}/etc/dsh \
  86. --disable-shared \
  87. --disable-nls
  88. %{l_make} %{l_mflags -O}
  89. %install
  90. rm -rf $RPM_BUILD_ROOT
  91. # perform standard installation procedure
  92. %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
  93. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
  94. # add reasonable default configuration
  95. %{l_shtool} mkdir -f -p -m 755 \
  96. $RPM_BUILD_ROOT%{l_prefix}/etc/dsh/group
  97. %{l_shtool} install -c -m 644 %{l_value -s -a} \
  98. %{SOURCE dsh.conf} $RPM_BUILD_ROOT%{l_prefix}/etc/dsh/
  99. echo "localhost" >conf
  100. %{l_shtool} install -c -m 644 \
  101. conf $RPM_BUILD_ROOT%{l_prefix}/etc/dsh/machines.list
  102. %{l_shtool} install -c -m 644 \
  103. conf $RPM_BUILD_ROOT%{l_prefix}/etc/dsh/group/localhost
  104. # determine installation files
  105. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  106. %{l_files_std} \
  107. '%config %{l_prefix}/etc/dsh/dsh.conf' \
  108. '%config %{l_prefix}/etc/dsh/machines.list' \
  109. '%config %{l_prefix}/etc/dsh/group/localhost'
  110. %files -f files
  111. %clean
  112. rm -rf $RPM_BUILD_ROOT