libssh2.spec 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. ##
  2. ## libssh2.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2006 OpenPKG Foundation e.V. <http://openpkg.net/>
  4. ## Copyright (c) 2000-2006 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 version
  25. %define V_libssh2 0.14
  26. %define V_net_ssh2 0.09
  27. # package information
  28. Name: libssh2
  29. Summary: SSH2 Protocol Client Library
  30. URL: http://www.libssh2.org/
  31. Vendor: Sara Golemon
  32. Packager: OpenPKG
  33. Distribution: OpenPKG
  34. Class: EVAL
  35. Group: SSH
  36. License: BSD-style
  37. Version: %{V_libssh2}
  38. Release: 20060926
  39. # package options
  40. %option with_perl no
  41. # list of sources
  42. Source0: http://switch.dl.sourceforge.net/sourceforge/libssh2/libssh2-%{V_libssh2}.tar.gz
  43. Source1: http://www.cpan.org/authors/id/D/DB/DBROBINS/Net-SSH2-%{V_net_ssh2}.tar.gz
  44. Patch0: libssh2.patch
  45. # build information
  46. Prefix: %{l_prefix}
  47. BuildRoot: %{l_buildroot}
  48. BuildPreReq: OpenPKG, openpkg >= 20040130
  49. PreReq: OpenPKG, openpkg >= 20040130
  50. BuildPreReq: openssl, zlib
  51. PreReq: openssl, zlib
  52. %if "%{with_perl}" == "yes"
  53. BuildPreReq: perl, perl-openpkg
  54. PreReq: perl
  55. %endif
  56. AutoReq: no
  57. AutoReqProv: no
  58. %description
  59. libssh2 is the most badly packaged program in the OpenPKG world.
  60. %track
  61. prog libssh2 = {
  62. version = %{V_libssh2}
  63. url = http://prdownloads.sourceforge.net/libssh2/
  64. regex = libssh2-(__VER__)\.tar\.gz
  65. }
  66. prog libssh2:perl = {
  67. version = %{V_net_ssh2}
  68. url = http://www.cpan.org/authors/id/D/DB/DBROBINS/
  69. regex = Net-SSH2-(__VER__)\.tar\.gz
  70. }
  71. %prep
  72. %setup -q
  73. %setup -q -T -D -a 1
  74. %patch -p0
  75. %build
  76. CC="%{l_cc}" \
  77. CFLAGS="%{l_cflags -O}" \
  78. CPPFLAGS="%{l_cppflags}" \
  79. LDFLAGS="%{l_ldflags}" \
  80. ./configure \
  81. --prefix=%{l_prefix} \
  82. --with-openssl=%{l_prefix} \
  83. --with-libz=%{l_prefix}
  84. %{l_make} %{l_mflags -O}
  85. %if "%{with_perl}" == "yes"
  86. %{l_shtool} subst \
  87. -e 's:inc = \(.\)\(.;\):inc = \1../include\2:' \
  88. -e 's:lib = \(.\)\(.;\):lib = \1../src\2:' \
  89. Net-SSH2-%{V_net_ssh2}/Makefile.PL
  90. %{l_prefix}/bin/perl-openpkg prepare
  91. %{l_prefix}/bin/perl-openpkg -d Net-SSH2-%{V_net_ssh2} configure build
  92. %endif
  93. %install
  94. rm -rf $RPM_BUILD_ROOT
  95. %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
  96. %if "%{with_perl}" == "yes"
  97. %{l_prefix}/bin/perl-openpkg -d Net-SSH2-%{V_net_ssh2} install
  98. %{l_prefix}/bin/perl-openpkg -F perl-openpkg-files fixate cleanup
  99. %else
  100. >perl-openpkg-files
  101. %endif
  102. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  103. %{l_files_std} `cat perl-openpkg-files`
  104. %files -f files
  105. %clean
  106. rm -rf $RPM_BUILD_ROOT