perl-util.spec 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. ##
  2. ## perl-util.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_alias 2.32
  27. %define V_inline 0.43
  28. %define V_class_loader 2.02
  29. # package information
  30. Name: perl-util
  31. Summary: Perl Modules for general utility usage
  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: 20020521
  39. Release: 20020521
  40. # list of sources
  41. Source0: http://www.cpan.org/modules/by-module/Alias/Alias-%{V_alias}.tar.gz
  42. Source1: http://www.cpan.org/modules/by-module/Inline/Inline-%{V_inline}.tar.gz
  43. Source2: http://www.cpan.org/modules/by-module/Class/Class-Loader-%{V_class_loader}.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. Perl modules for general utility usage:
  53. - Alias (%{V_alias})
  54. - Inline (%{V_inline})
  55. - Class::Loader (%{V_class_loader})
  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 $RPM_BUILD_ROOT%{l_prefix}/lib/perl5
  64. # create a wrapper script which finds the includes
  65. eval `%{l_prefix}/bin/perl -V:version -V:archname`
  66. perl=$RPM_BUILD_ROOT/perl
  67. echo "#!/bin/sh" >$perl
  68. echo "exec %{l_prefix}/bin/perl \\" >>$perl
  69. echo " -I$RPM_BUILD_ROOT%{l_prefix}/lib/perl5/${version} \\" >>$perl
  70. echo " -I$RPM_BUILD_ROOT%{l_prefix}/lib/perl5/${version}/${archname} \\" >>$perl
  71. echo " -I$RPM_BUILD_ROOT%{l_prefix}/lib/perl5/site_perl \\" >>$perl
  72. echo " -I$RPM_BUILD_ROOT%{l_prefix}/lib/perl5/site_perl/${version} \\" >>$perl
  73. echo " -I$RPM_BUILD_ROOT%{l_prefix}/lib/perl5/site_perl/${version}/${archname} \\" >>$perl
  74. echo " \"\$@\"" >>$perl
  75. chmod a+x $perl
  76. # uncompress and build modules
  77. for mod in %{SOURCE0} %{SOURCE1} %{SOURCE2}; do
  78. dir=`echo "$mod" | sed -e 's;^.*/\([^/]*\)\.tar\.gz$;\1;'`
  79. cd $dir
  80. chmod -R u+rw .
  81. cp Makefile.PL Makefile.PL.orig
  82. sed -e "s:\$^X:'$perl':g" <Makefile.PL.orig >Makefile.PL
  83. $perl Makefile.PL PREFIX=$RPM_BUILD_ROOT%{l_prefix} PERL=$perl FULLPERL=$perl </dev/null
  84. %{l_make} %{l_mflags} PERL=$perl FULLPERL=$perl all
  85. %{l_make} %{l_mflags} PERL=$perl FULLPERL=$perl install
  86. cd ..
  87. done
  88. # clean up
  89. find $RPM_BUILD_ROOT%{l_prefix} -name perllocal.pod -print | xargs rm -f
  90. find $RPM_BUILD_ROOT%{l_prefix} -name .packlist -print | xargs rm -f
  91. find $RPM_BUILD_ROOT%{l_prefix} -type d -depth -print | (xargs rmdir >/dev/null 2>&1 || true)
  92. # avoid conflicts
  93. eval `$perl -V:installarchlib -V:installprivlib -V:installsitearch -V:installsitelib`
  94. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  95. %{l_files_std} \
  96. '%not %dir %{l_prefix}/lib/perl5' \
  97. '%not %dir %{l_prefix}/lib/perl5/*' \
  98. "%not %dir $installarchlib" \
  99. "%not %dir $installprivlib" \
  100. "%not %dir $installsitearch" \
  101. "%not %dir $installsitelib" \
  102. "%not %dir $installarchlib/auto" \
  103. "%not %dir $installprivlib/auto" \
  104. "%not %dir $installsitearch/auto" \
  105. "%not %dir $installsitelib/auto"
  106. %files -f files
  107. %clean
  108. rm -rf $RPM_BUILD_ROOT