perl-www.spec 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  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_uri 1.19
  28. %define V_cgi 2.81
  29. %define V_cgi_application 2.4
  30. %define V_cgi_formbuilder 2.06
  31. %define V_cgi_formmagick 0.82
  32. %define V_cgi_minimal 1.09
  33. %define V_cgi_safe 1.24
  34. %define V_cgi_session 2.7
  35. # package information
  36. Name: perl-www
  37. Summary: Perl Module for WWW client and server behavior
  38. URL: http://www.cpan.org/
  39. Vendor: Perl Community
  40. Packager: The OpenPKG Project
  41. Distribution: OpenPKG [REL]
  42. Group: Language
  43. License: GPL/Artistic
  44. Version: 20020527
  45. Release: 20020527
  46. # list of sources
  47. Source0: http://www.cpan.org/modules/by-module/URI/URI-%{V_uri}.tar.gz
  48. Source1: http://www.cpan.org/modules/by-module/WWW/libwww-perl-%{V_libwww_perl}.tar.gz
  49. Source2: http://www.cpan.org/modules/by-module/CGI/CGI.pm-%{V_cgi}.tar.gz
  50. Source3: http://www.cpan.org/modules/by-module/CGI/CGI-Application-%{V_cgi_application}.tar.gz
  51. Source4: http://www.cpan.org/modules/by-module/CGI/CGI-FormBuilder-%{V_cgi_formbuilder}.tar.gz
  52. Source5: http://www.cpan.org/modules/by-module/CGI/CGI-FormMagick-%{V_cgi_formmagick}.tar.gz
  53. Source6: http://www.cpan.org/modules/by-module/CGI/CGI-Minimal-%{V_cgi_minimal}.tar.gz
  54. Source7: http://www.cpan.org/modules/by-module/CGI/CGI-Safe-%{V_cgi_safe}.tar.gz
  55. Source8: http://www.cpan.org/modules/by-module/CGI/CGI-Session-%{V_cgi_session}.tar.gz
  56. # build information
  57. Prefix: %{l_prefix}
  58. BuildRoot: %{l_buildroot}
  59. BuildPreReq: OpenPKG, openpkg >= 20020206, perl, perl-crypto, perl-mail, perl-xml, perl-net
  60. PreReq: OpenPKG, openpkg >= 20020206, perl, perl-crypto, perl-mail, perl-xml, perl-net
  61. AutoReq: no
  62. AutoReqProv: no
  63. %description
  64. Various Perl modules related to World Wide Web (WWW):
  65. - libwww-perl (%{V_libwww_perl})
  66. - URI (%{V_uri})
  67. - CGI (%{V_cgi})
  68. - CGI::Application (%{V_cgi_application})
  69. - CGI::FormBuilder (%{V_cgi_formbuilder})
  70. - CGI::FormMagick (%{V_cgi_formmagick})
  71. - CGI::Minimal (%{V_cgi_minimal})
  72. - CGI::Safe (%{V_cgi_safe})
  73. - CGI::Session (%{V_cgi_session})
  74. %prep
  75. %setup0 -q -c -n %{name}-%{version}
  76. %setup1 -q -T -D -a 1
  77. %setup2 -q -T -D -a 2
  78. %setup3 -q -T -D -a 3
  79. %setup4 -q -T -D -a 4
  80. %setup5 -q -T -D -a 5
  81. %setup6 -q -T -D -a 6
  82. %setup7 -q -T -D -a 7
  83. %setup8 -q -T -D -a 8
  84. %build
  85. %install
  86. rm -rf $RPM_BUILD_ROOT
  87. %{l_shtool} mkdir -f -p -m 755 \
  88. $RPM_BUILD_ROOT%{l_prefix}/lib/perl5 \
  89. $RPM_BUILD_ROOT%{l_prefix}/man/man3
  90. # create a wrapper script which finds the includes
  91. eval `%{l_prefix}/bin/perl -V:version -V:archname`
  92. perl=$RPM_BUILD_ROOT/perl
  93. echo "#!/bin/sh" >$perl
  94. echo "exec %{l_prefix}/bin/perl \\" >>$perl
  95. echo " -I$RPM_BUILD_ROOT%{l_prefix}/lib/perl5/${version} \\" >>$perl
  96. echo " -I$RPM_BUILD_ROOT%{l_prefix}/lib/perl5/${version}/${archname} \\" >>$perl
  97. echo " -I$RPM_BUILD_ROOT%{l_prefix}/lib/perl5/site_perl \\" >>$perl
  98. echo " -I$RPM_BUILD_ROOT%{l_prefix}/lib/perl5/site_perl/${version} \\" >>$perl
  99. echo " -I$RPM_BUILD_ROOT%{l_prefix}/lib/perl5/site_perl/${version}/${archname} \\" >>$perl
  100. echo " \"\$@\"" >>$perl
  101. chmod a+x $perl
  102. # determine general tools and arguments
  103. perlargs="PREFIX=$RPM_BUILD_ROOT%{l_prefix} PERL=$perl FULLPERL=$perl"
  104. make="%{l_make} %{l_mflags}"
  105. makeargs="PERL=$perl FULLPERL=$perl"
  106. # make sure our Perl is used
  107. chmod -R u+w .
  108. %{l_shtool} subst \
  109. -e "s:\$^X:'$perl':g" \
  110. `find . -name Makefile.PL -print`
  111. # build URI
  112. ( cd URI-%{V_uri}
  113. $perl Makefile.PL $perlargs
  114. $make $makeargs all
  115. $make $makeargs install
  116. )
  117. # build libwww-perl
  118. ( cd libwww-perl-%{V_libwww_perl}
  119. $perl Makefile.PL $perlargs </dev/null
  120. $make $makeargs all
  121. $make $makeargs install
  122. )
  123. # build CGI
  124. ( cd CGI.pm-%{V_cgi}
  125. $perl Makefile.PL $perlargs INSTALLDIRS=site
  126. $make $makeargs all
  127. $make $makeargs install
  128. # resolve conflict with shipped CGI module of Perl
  129. rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man3/CGI*
  130. )
  131. # build remaining modules
  132. for mod in \
  133. %{SOURCE3} %{SOURCE4} %{SOURCE5} %{SOURCE6} %{SOURCE7} \
  134. %{SOURCE8}
  135. do
  136. dir=`echo "$mod" | sed -e 's;^.*/\([^/]*\)\.tar\.gz$;\1;'`
  137. cd $dir
  138. chmod -R u+rw .
  139. cp Makefile.PL Makefile.PL.orig
  140. sed -e "s:\$^X:'$perl':g" <Makefile.PL.orig >Makefile.PL
  141. $perl Makefile.PL $perlargs
  142. %{l_make} %{l_mflags} $makeargs all
  143. %{l_make} %{l_mflags} $makeargs install
  144. cd ..
  145. done
  146. # strip down installation tree
  147. find $RPM_BUILD_ROOT%{l_prefix} -name perllocal.pod -print | xargs rm -f
  148. find $RPM_BUILD_ROOT%{l_prefix} -name .packlist -print | xargs rm -f
  149. find $RPM_BUILD_ROOT%{l_prefix} -type d -depth -print | (xargs rmdir >/dev/null 2>&1 || true)
  150. # determine installed files
  151. eval `$perl -V:installarchlib -V:installprivlib -V:installsitearch -V:installsitelib`
  152. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  153. %{l_files_std} \
  154. '%not %dir %{l_prefix}/lib/perl5' \
  155. '%not %dir %{l_prefix}/lib/perl5/*' \
  156. "%not %dir $installarchlib" \
  157. "%not %dir $installprivlib" \
  158. "%not %dir $installsitearch" \
  159. "%not %dir $installsitelib" \
  160. "%not %dir $installarchlib/auto" \
  161. "%not %dir $installprivlib/auto" \
  162. "%not %dir $installsitearch/auto" \
  163. "%not %dir $installsitelib/auto"
  164. %files -f files
  165. %clean
  166. rm -rf $RPM_BUILD_ROOT