perl-www.spec 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. ##
  2. ## perl-www.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2002 Cable & Wireless Deutschland GmbH
  4. ## Copyright (c) 2000-2002 The OpenPKG Project <http://www.openpkg.org/>
  5. ## Copyright (c) 2000-2002 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. # versions of individual parts
  26. %define V_libwww_perl 5.64
  27. %define V_cgi 2.80
  28. %define V_uri 1.18
  29. # package information
  30. Name: perl-www
  31. Summary: Perl Module for WWW client and server behavior
  32. URL: http://www.cpan.org/
  33. Vendor: Perl Community
  34. Packager: The OpenPKG Project
  35. Distribution: OpenPKG [REL]
  36. Group: Language
  37. License: GPL/Artistic
  38. Version: 20020311
  39. Release: 20020311
  40. # list of sources
  41. Source0: http://www.cpan.org/modules/by-module/WWW/libwww-perl-%{V_libwww_perl}.tar.gz
  42. Source1: http://www.cpan.org/modules/by-module/CGI/CGI.pm-%{V_cgi}.tar.gz
  43. Source2: http://www.cpan.org/modules/by-module/URI/URI-%{V_uri}.tar.gz
  44. # build information
  45. Prefix: %{l_prefix}
  46. BuildRoot: %{l_buildroot}
  47. BuildPreReq: OpenPKG, openpkg >= 20020206, perl
  48. PreReq: OpenPKG, openpkg >= 20020206, perl
  49. AutoReq: no
  50. AutoReqProv: no
  51. %description
  52. Various Perl modules related to World Wide Web (WWW):
  53. - libwww-perl (%{V_libwww_perl})
  54. - CGI (%{V_cgi})
  55. - URI (%{V_uri})
  56. %prep
  57. %setup0 -q -c -n %{name}-%{version}
  58. %setup1 -q -T -D -a 1
  59. %setup2 -q -T -D -a 2
  60. %build
  61. %install
  62. rm -rf $RPM_BUILD_ROOT
  63. %{l_shtool} mkdir -f -p -m 755 \
  64. $RPM_BUILD_ROOT%{l_prefix}/lib/perl5 \
  65. $RPM_BUILD_ROOT%{l_prefix}/man/man3
  66. # create a wrapper script which finds the includes
  67. eval `$perl -V:archname`
  68. perl=$RPM_BUILD_ROOT/perl
  69. echo "#!/bin/sh" >$perl
  70. echo "exec %{l_prefix}/bin/perl \\" >>$perl
  71. echo " -I$RPM_BUILD_ROOT%{l_prefix}/lib/perl5/%{version} \\" >>$perl
  72. echo " -I$RPM_BUILD_ROOT%{l_prefix}/lib/perl5/%{version}/${archname} \\" >>$perl
  73. echo " -I$RPM_BUILD_ROOT%{l_prefix}/lib/perl5/site_perl \\" >>$perl
  74. echo " -I$RPM_BUILD_ROOT%{l_prefix}/lib/perl5/site_perl/%{version} \\" >>$perl
  75. echo " -I$RPM_BUILD_ROOT%{l_prefix}/lib/perl5/site_perl/%{version}/${archname} \\" >>$perl
  76. echo " \"\$@\"" >>$perl
  77. chmod a+x $perl
  78. # determine general tools and arguments
  79. perlargs="PREFIX=$RPM_BUILD_ROOT%{l_prefix} PERL=$perl FULLPERL=$perl"
  80. make="%{l_make} %{l_mflags}"
  81. makeargs="PERL=$perl FULLPERL=$perl"
  82. # make sure our Perl is used
  83. chmod -R u+w .
  84. %{l_shtool} subst \
  85. -e "s:\$^X:'$perl':g" \
  86. `find . -name Makefile.PL -print`
  87. # build libwww-perl
  88. ( cd libwww-perl-%{V_libwww_perl}
  89. $perl Makefile.PL $perlargs </dev/null
  90. $make $makeargs all
  91. $make $makeargs install
  92. )
  93. # build CGI
  94. ( cd CGI.pm-%{V_cgi}
  95. $perl Makefile.PL $perlargs
  96. $make $makeargs all
  97. $make $makeargs install
  98. )
  99. # build URI
  100. ( cd URI-%{V_uri}
  101. $perl Makefile.PL $perlargs
  102. $make $makeargs all
  103. $make $makeargs install
  104. )
  105. # strip down installation tree
  106. find $RPM_BUILD_ROOT%{l_prefix} -name perllocal.pod -print | xargs rm -f
  107. find $RPM_BUILD_ROOT%{l_prefix} -name .packlist -print | xargs rm -f
  108. find $RPM_BUILD_ROOT%{l_prefix} -type d -depth -print | (xargs rmdir >/dev/null 2>&1 || true)
  109. # determine installed files
  110. eval `$perl -V:installarchlib -V:installprivlib -V:installsitearch -V:installsitelib`
  111. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  112. %{l_files_std} \
  113. '%not %dir %{l_prefix}/lib/perl5' \
  114. '%not %dir %{l_prefix}/lib/perl5/*' \
  115. "%not %dir $installarchlib" \
  116. "%not %dir $installprivlib" \
  117. "%not %dir $installsitearch" \
  118. "%not %dir $installsitelib" \
  119. "%not %dir $installarchlib/auto" \
  120. "%not %dir $installprivlib/auto" \
  121. "%not %dir $installsitearch/auto" \
  122. "%not %dir $installsitelib/auto"
  123. %files -f files
  124. %clean
  125. rm -rf $RPM_BUILD_ROOT