dsh.spec 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. ##
  2. ## dsh.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2004 The OpenPKG Project <http://www.openpkg.org/>
  4. ## Copyright (c) 2000-2004 Ralf S. Engelschall <rse@engelschall.com>
  5. ## Copyright (c) 2000-2004 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.3
  27. %define V_dshconfig 0.20.11
  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
  35. Class: PLUS
  36. Group: Shell
  37. License: GPL
  38. Version: %{V_dsh}
  39. Release: 20040606
  40. # list of sources
  41. Source0: http://www.netfort.gr.jp/~dancer/software/downloads/dsh-%{V_dsh}.tar.gz
  42. Source1: http://www.netfort.gr.jp/~dancer/software/downloads/libdshconfig-%{V_dshconfig}.tar.gz
  43. Source2: dsh.conf
  44. Patch0: dsh.patch
  45. # build information
  46. Prefix: %{l_prefix}
  47. BuildRoot: %{l_buildroot}
  48. BuildPreReq: OpenPKG, openpkg >= 20040130
  49. PreReq: OpenPKG, openpkg >= 20040130, openssh
  50. AutoReq: no
  51. AutoReqProv: no
  52. %description
  53. Dsh executes commands remotely via SSH on several different machines
  54. at the same time.
  55. %track
  56. prog dsh = {
  57. version = %{version}
  58. url = http://www.netfort.gr.jp/~dancer/software/downloads/
  59. regex = dsh-(__VER__)\.tar\.gz
  60. }
  61. prog dsh:libdshconfig = {
  62. version = %{V_dshconfig}
  63. url = http://www.netfort.gr.jp/~dancer/software/downloads/
  64. regex = libdshconfig-(__VER__)\.tar\.gz
  65. }
  66. %prep
  67. %setup -q
  68. %setup -q -T -D -a 1
  69. %patch -p0
  70. %build
  71. # build libdshconfig
  72. ( cd libdshconfig-%{V_dshconfig}
  73. CC="%{l_cc}" \
  74. CFLAGS="%{l_cflags -O}" \
  75. CPPFLAGS="%{l_cppflags}" \
  76. LDFLAGS="%{l_ldflags}" \
  77. ./configure \
  78. --prefix=%{l_prefix} \
  79. --disable-shared \
  80. --disable-nls
  81. %{l_shtool} subst -e 's;ssize_t;int;g' -- libdshconfig.c
  82. %{l_make} %{l_mflags -O}
  83. rm -f .libs/*.la*
  84. ) || exit $?
  85. # build dsh
  86. %{l_shtool} subst \
  87. -e 's;/etc\(/dsh/dsh.conf\);%{l_prefix}/etc\1;' \
  88. -e 's;/etc\(/dsh/machines.list\);%{l_prefix}/etc\1;' \
  89. -e 's;/etc\(/dsh/group\);%{l_prefix}/etc\1;' \
  90. -- dsh.1
  91. CC="%{l_cc}" \
  92. CFLAGS="%{l_cflags -O}" \
  93. CPPFLAGS="%{l_cppflags} -I`pwd`/libdshconfig-%{V_dshconfig}" \
  94. LDFLAGS="%{l_ldflags} -L`pwd`/libdshconfig-%{V_dshconfig}/.libs" \
  95. ./configure \
  96. --prefix=%{l_prefix} \
  97. --sysconfdir=%{l_prefix}/etc/dsh \
  98. --disable-shared \
  99. --disable-nls
  100. %{l_make} %{l_mflags -O}
  101. %install
  102. rm -rf $RPM_BUILD_ROOT
  103. # perform standard installation procedure
  104. %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
  105. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
  106. # add reasonable default configuration
  107. %{l_shtool} mkdir -f -p -m 755 \
  108. $RPM_BUILD_ROOT%{l_prefix}/etc/dsh/group
  109. %{l_shtool} install -c -m 644 %{l_value -s -a} \
  110. %{SOURCE dsh.conf} $RPM_BUILD_ROOT%{l_prefix}/etc/dsh/
  111. echo "localhost" >conf
  112. %{l_shtool} install -c -m 644 \
  113. conf $RPM_BUILD_ROOT%{l_prefix}/etc/dsh/machines.list
  114. %{l_shtool} install -c -m 644 \
  115. conf $RPM_BUILD_ROOT%{l_prefix}/etc/dsh/group/localhost
  116. # determine installation files
  117. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  118. %{l_files_std} \
  119. '%config %{l_prefix}/etc/dsh/dsh.conf' \
  120. '%config %{l_prefix}/etc/dsh/machines.list' \
  121. '%config %{l_prefix}/etc/dsh/group/localhost'
  122. %files -f files
  123. %clean
  124. rm -rf $RPM_BUILD_ROOT