dsh.spec 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. ##
  2. ## dsh.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2003 Cable & Wireless Deutschland GmbH
  4. ## Copyright (c) 2000-2003 The OpenPKG Project <http://www.openpkg.org/>
  5. ## Copyright (c) 2000-2003 Ralf S. Engelschall <rse@engelschall.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.23.5
  27. %define V_dshconfig 0.20.8
  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 [EVAL]
  35. Group: Shell
  36. License: GPL
  37. Version: %{V_dsh}
  38. Release: 20030101
  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 >= 20021230
  47. PreReq: OpenPKG, openpkg >= 20021230, 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. %options
  54. %prep
  55. %setup0 -q
  56. %setup1 -q -T -D -a 1
  57. %build
  58. # build libdshconfig
  59. ( cd libdshconfig-%{V_dshconfig}
  60. CC="%{l_cc}" \
  61. CFLAGS="%{l_cflags -O}" \
  62. CPPFLAGS="%{l_cppflags}" \
  63. LDFLAGS="%{l_ldflags}" \
  64. ./configure \
  65. --prefix=%{l_prefix} \
  66. --disable-shared \
  67. --disable-nls
  68. %{l_shtool} subst -e 's;ssize_t;int;g' -- libdshconfig.c
  69. %{l_make} %{l_mflags -O}
  70. rm -f .libs/*.la*
  71. )
  72. # build dsh
  73. %{l_shtool} subst \
  74. -e 's;/etc\(/dsh/dsh.conf\);%{l_prefix}/etc\1;' \
  75. -e 's;/etc\(/dsh/machines.list\);%{l_prefix}/etc\1;' \
  76. -e 's;/etc\(/dsh/group\);%{l_prefix}/etc\1;' \
  77. -- dsh.1
  78. CC="%{l_cc}" \
  79. CFLAGS="%{l_cflags -O}" \
  80. CPPFLAGS="%{l_cppflags} -I`pwd`/libdshconfig-%{V_dshconfig}" \
  81. LDFLAGS="%{l_ldflags} -L`pwd`/libdshconfig-%{V_dshconfig}/.libs" \
  82. ./configure \
  83. --prefix=%{l_prefix} \
  84. --sysconfdir=%{l_prefix}/etc/dsh \
  85. --disable-shared \
  86. --disable-nls
  87. %{l_make} %{l_mflags -O}
  88. %install
  89. rm -rf $RPM_BUILD_ROOT
  90. # perform standard installation procedure
  91. %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
  92. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
  93. # add reasonable default configuration
  94. %{l_shtool} mkdir -f -p -m 755 \
  95. $RPM_BUILD_ROOT%{l_prefix}/etc/dsh/group
  96. %{l_shtool} install -c -m 644 \
  97. -e 's;@l_prefix@;%{l_prefix};g' \
  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