dsh.spec 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  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.0
  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: 20040106
  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. # build information
  44. Prefix: %{l_prefix}
  45. BuildRoot: %{l_buildroot}
  46. BuildPreReq: OpenPKG, openpkg >= 20030717
  47. PreReq: OpenPKG, openpkg >= 20030717, openssh
  48. AutoReq: no
  49. AutoReqProv: no
  50. %description
  51. Dsh executes commands remotely via SSH on several different machines
  52. at the same time.
  53. %prep
  54. %setup0 -q
  55. %setup1 -q -T -D -a 1
  56. %build
  57. # build libdshconfig
  58. ( cd libdshconfig-%{V_dshconfig}
  59. CC="%{l_cc}" \
  60. CFLAGS="%{l_cflags -O}" \
  61. CPPFLAGS="%{l_cppflags}" \
  62. LDFLAGS="%{l_ldflags}" \
  63. ./configure \
  64. --prefix=%{l_prefix} \
  65. --disable-shared \
  66. --disable-nls
  67. %{l_shtool} subst -e 's;ssize_t;int;g' -- libdshconfig.c
  68. %{l_make} %{l_mflags -O}
  69. rm -f .libs/*.la*
  70. ) || exit $?
  71. # build dsh
  72. %{l_shtool} subst \
  73. -e 's;/etc\(/dsh/dsh.conf\);%{l_prefix}/etc\1;' \
  74. -e 's;/etc\(/dsh/machines.list\);%{l_prefix}/etc\1;' \
  75. -e 's;/etc\(/dsh/group\);%{l_prefix}/etc\1;' \
  76. -- dsh.1
  77. CC="%{l_cc}" \
  78. CFLAGS="%{l_cflags -O}" \
  79. CPPFLAGS="%{l_cppflags} -I`pwd`/libdshconfig-%{V_dshconfig}" \
  80. LDFLAGS="%{l_ldflags} -L`pwd`/libdshconfig-%{V_dshconfig}/.libs" \
  81. ./configure \
  82. --prefix=%{l_prefix} \
  83. --sysconfdir=%{l_prefix}/etc/dsh \
  84. --disable-shared \
  85. --disable-nls
  86. %{l_make} %{l_mflags -O}
  87. %install
  88. rm -rf $RPM_BUILD_ROOT
  89. # perform standard installation procedure
  90. %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
  91. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
  92. # add reasonable default configuration
  93. %{l_shtool} mkdir -f -p -m 755 \
  94. $RPM_BUILD_ROOT%{l_prefix}/etc/dsh/group
  95. %{l_shtool} install -c -m 644 %{l_value -s -a} \
  96. %{SOURCE dsh.conf} $RPM_BUILD_ROOT%{l_prefix}/etc/dsh/
  97. echo "localhost" >conf
  98. %{l_shtool} install -c -m 644 \
  99. conf $RPM_BUILD_ROOT%{l_prefix}/etc/dsh/machines.list
  100. %{l_shtool} install -c -m 644 \
  101. conf $RPM_BUILD_ROOT%{l_prefix}/etc/dsh/group/localhost
  102. # determine installation files
  103. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  104. %{l_files_std} \
  105. '%config %{l_prefix}/etc/dsh/dsh.conf' \
  106. '%config %{l_prefix}/etc/dsh/machines.list' \
  107. '%config %{l_prefix}/etc/dsh/group/localhost'
  108. %files -f files
  109. %clean
  110. rm -rf $RPM_BUILD_ROOT