perl-xml.spec 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. ##
  2. ## perl-xml.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_html_tagset 3.03
  27. %define V_html_parser 3.26
  28. # package information
  29. Name: perl-xml
  30. Summary: Perl Modules for use with XML
  31. URL: http://www.cpan.org/
  32. Vendor: Perl Community
  33. Packager: The OpenPKG Project
  34. Distribution: OpenPKG [REL]
  35. Group: Language
  36. License: GPL/Artistic
  37. Version: 20020517
  38. Release: 20020517
  39. # list of sources
  40. Source0: http://www.cpan.org/modules/by-module/HTML/HTML-Tagset-%{V_html_tagset}.tar.gz
  41. Source1: http://www.cpan.org/modules/by-module/HTML/HTML-Parser-%{V_html_parser}.tar.gz
  42. # build information
  43. Prefix: %{l_prefix}
  44. BuildRoot: %{l_buildroot}
  45. BuildPreReq: OpenPKG, openpkg >= 20020206, perl
  46. PreReq: OpenPKG, openpkg >= 20020206, perl
  47. AutoReq: no
  48. AutoReqProv: no
  49. %description
  50. Perl modules for use with XML:
  51. - HTML::Tagset (%{V_html_tagset})
  52. - HTML::Parser (%{V_html_parser})
  53. - HTML::Entities (%{V_html_parser})
  54. - HTML::HeadParser (%{V_html_parser})
  55. - HTML::LinkExtor (%{V_html_parser})
  56. - HTML::PullParser (%{V_html_parser})
  57. - HTML::TokParser (%{V_html_parser})
  58. %prep
  59. %setup0 -q -c -n %{name}-%{version}
  60. %setup1 -q -T -D -a 1
  61. %build
  62. %install
  63. rm -rf $RPM_BUILD_ROOT
  64. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/lib/perl5
  65. # create a wrapper script which finds the includes
  66. eval `%{l_prefix}/bin/perl -V:version -V:archname`
  67. perl=$RPM_BUILD_ROOT/perl
  68. echo "#!/bin/sh" >$perl
  69. echo "exec %{l_prefix}/bin/perl \\" >>$perl
  70. echo " -I$RPM_BUILD_ROOT%{l_prefix}/lib/perl5/${version} \\" >>$perl
  71. echo " -I$RPM_BUILD_ROOT%{l_prefix}/lib/perl5/${version}/${archname} \\" >>$perl
  72. echo " -I$RPM_BUILD_ROOT%{l_prefix}/lib/perl5/site_perl \\" >>$perl
  73. echo " -I$RPM_BUILD_ROOT%{l_prefix}/lib/perl5/site_perl/${version} \\" >>$perl
  74. echo " -I$RPM_BUILD_ROOT%{l_prefix}/lib/perl5/site_perl/${version}/${archname} \\" >>$perl
  75. echo " \"\$@\"" >>$perl
  76. chmod a+x $perl
  77. # uncompress and build modules
  78. for mod in %{SOURCE0} %{SOURCE1}; do
  79. dir=`echo "$mod" | sed -e 's;^.*/\([^/]*\)\.tar\.gz$;\1;'`
  80. cd $dir
  81. chmod -R u+rw .
  82. cp Makefile.PL Makefile.PL.orig
  83. sed -e "s:\$^X:'$perl':g" <Makefile.PL.orig >Makefile.PL
  84. $perl Makefile.PL PREFIX=$RPM_BUILD_ROOT%{l_prefix} PERL=$perl FULLPERL=$perl </dev/null
  85. %{l_make} %{l_mflags} PERL=$perl FULLPERL=$perl all
  86. %{l_make} %{l_mflags} PERL=$perl FULLPERL=$perl install
  87. cd ..
  88. done
  89. # clean up
  90. find $RPM_BUILD_ROOT%{l_prefix} -name perllocal.pod -print | xargs rm -f
  91. find $RPM_BUILD_ROOT%{l_prefix} -name .packlist -print | xargs rm -f
  92. find $RPM_BUILD_ROOT%{l_prefix} -type d -depth -print | (xargs rmdir >/dev/null 2>&1 || true)
  93. # avoid conflicts
  94. eval `$perl -V:installarchlib -V:installprivlib -V:installsitearch -V:installsitelib`
  95. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  96. %{l_files_std} \
  97. '%not %dir %{l_prefix}/lib/perl5' \
  98. '%not %dir %{l_prefix}/lib/perl5/*' \
  99. "%not %dir $installarchlib" \
  100. "%not %dir $installprivlib" \
  101. "%not %dir $installsitearch" \
  102. "%not %dir $installsitelib" \
  103. "%not %dir $installarchlib/auto" \
  104. "%not %dir $installprivlib/auto" \
  105. "%not %dir $installsitearch/auto" \
  106. "%not %dir $installsitelib/auto"
  107. %files -f files
  108. %clean
  109. rm -rf $RPM_BUILD_ROOT