dsh.spec 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. ##
  2. ## dsh.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2007 OpenPKG Foundation e.V. <http://openpkg.net/>
  4. ## Copyright (c) 2000-2007 Ralf S. Engelschall <http://engelschall.com/>
  5. ##
  6. ## Permission to use, copy, modify, and distribute this software for
  7. ## any purpose with or without fee is hereby granted, provided that
  8. ## the above copyright notice and this permission notice appear in all
  9. ## copies.
  10. ##
  11. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  12. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  13. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  14. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  15. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  16. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  17. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  18. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  19. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  20. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  21. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  22. ## SUCH DAMAGE.
  23. ##
  24. # package versions
  25. %define V_dsh 0.25.7
  26. %define V_dshconfig 0.20.12
  27. # package information
  28. Name: dsh
  29. Summary: Dancer's Distributed Shell
  30. URL: http://www.netfort.gr.jp/~dancer/software/dsh.html
  31. Vendor: Junichi Uekawa
  32. Packager: OpenPKG Foundation e.V.
  33. Distribution: OpenPKG Community
  34. Class: PLUS
  35. Group: SSH
  36. License: GPL
  37. Version: %{V_dsh}
  38. Release: 20070328
  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 >= 20040130
  48. PreReq: OpenPKG, openpkg >= 20040130, 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. %track
  55. prog dsh = {
  56. version = %{version}
  57. url = http://www.netfort.gr.jp/~dancer/software/downloads/
  58. regex = dsh-(__VER__)\.tar\.gz
  59. }
  60. prog dsh:libdshconfig = {
  61. version = %{V_dshconfig}
  62. url = http://www.netfort.gr.jp/~dancer/software/downloads/
  63. regex = libdshconfig-(__VER__)\.tar\.gz
  64. }
  65. %prep
  66. %setup -q
  67. %setup -q -T -D -a 1
  68. %patch -p0
  69. %{l_shtool} subst \
  70. -e '/LINENO: error: C[+]* preprocessor/{N;N;N;N;s/.*/:/;}' \
  71. configure libdshconfig*/configure
  72. %build
  73. # build libdshconfig
  74. ( cd libdshconfig-%{V_dshconfig}
  75. CC="%{l_cc}" \
  76. CFLAGS="%{l_cflags -O}" \
  77. CPPFLAGS="%{l_cppflags}" \
  78. LDFLAGS="%{l_ldflags}" \
  79. ./configure \
  80. --prefix=%{l_prefix} \
  81. --mandir=%{l_prefix}/man \
  82. --disable-shared \
  83. --disable-nls
  84. %{l_shtool} subst -e 's;ssize_t;int;g' libdshconfig.c
  85. %{l_make} %{l_mflags -O}
  86. rm -f .libs/*.la*
  87. ) || exit $?
  88. # build dsh
  89. %{l_shtool} subst \
  90. -e 's;/etc\(/dsh/dsh.conf\);%{l_prefix}/etc\1;' \
  91. -e 's;/etc\(/dsh/machines.list\);%{l_prefix}/etc\1;' \
  92. -e 's;/etc\(/dsh/group\);%{l_prefix}/etc\1;' \
  93. dsh.1 dsh.conf.5
  94. CC="%{l_cc}" \
  95. CFLAGS="%{l_cflags -O}" \
  96. CPPFLAGS="%{l_cppflags} -I`pwd`/libdshconfig-%{V_dshconfig}" \
  97. LDFLAGS="%{l_ldflags} -L`pwd`/libdshconfig-%{V_dshconfig}/.libs" \
  98. GREP="grep" \
  99. ./configure \
  100. --prefix=%{l_prefix} \
  101. --sysconfdir=%{l_prefix}/etc/dsh \
  102. --mandir=%{l_prefix}/man \
  103. --disable-shared \
  104. --disable-nls
  105. %{l_make} %{l_mflags -O}
  106. %install
  107. rm -rf $RPM_BUILD_ROOT
  108. # perform standard installation procedure
  109. %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
  110. # strip down installation
  111. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
  112. rm -rf $RPM_BUILD_ROOT%{l_prefix}/man/?? >/dev/null 2>&1 || true
  113. # add reasonable default configuration
  114. %{l_shtool} mkdir -f -p -m 755 \
  115. $RPM_BUILD_ROOT%{l_prefix}/etc/dsh/group
  116. %{l_shtool} install -c -m 644 %{l_value -s -a} \
  117. %{SOURCE dsh.conf} $RPM_BUILD_ROOT%{l_prefix}/etc/dsh/
  118. echo "localhost" >conf
  119. %{l_shtool} install -c -m 644 \
  120. conf $RPM_BUILD_ROOT%{l_prefix}/etc/dsh/machines.list
  121. %{l_shtool} install -c -m 644 \
  122. conf $RPM_BUILD_ROOT%{l_prefix}/etc/dsh/group/localhost
  123. # determine installation files
  124. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  125. %{l_files_std} \
  126. '%config %{l_prefix}/etc/dsh/dsh.conf' \
  127. '%config %{l_prefix}/etc/dsh/machines.list' \
  128. '%config %{l_prefix}/etc/dsh/group/localhost'
  129. %files -f files
  130. %clean
  131. rm -rf $RPM_BUILD_ROOT