perl.spec 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. ##
  2. ## perl.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2003 Cable & Wireless Deutschland GmbH
  4. ## Copyright (c) 2000-2003 The OpenPKG Project <http://www.openpkg.org/>
  5. ## Copyright (c) 2000-2003 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. # package information
  26. Name: perl
  27. Summary: Practical Extraction and Reporting Language
  28. URL: http://www.perl.com/
  29. Vendor: The Perl Project
  30. Packager: The OpenPKG Project
  31. Distribution: OpenPKG [CORE]
  32. Group: Language
  33. License: GPL/Artistic
  34. Version: 5.8.0
  35. Release: 20030103
  36. # list of sources
  37. Source0: ftp://ftp.cpan.org/pub/CPAN/src/perl-%{version}.tar.gz
  38. Source1: perl-openpkg.sh
  39. Patch0: perl.patch
  40. # build information
  41. Prefix: %{l_prefix}
  42. BuildRoot: %{l_buildroot}
  43. BuildPreReq: OpenPKG, openpkg >= 20021230, gcc
  44. PreReq: OpenPKG, openpkg >= 20021230, gcc
  45. AutoReq: no
  46. AutoReqProv: no
  47. %description
  48. Perl ("Practical Reporting and Extraction Language") is a very
  49. sophisticated and flexible (but this way also complex) programming
  50. language. This is the original implementation of the Perl 5 interpreter
  51. from Larry Wall and his community.
  52. %prep
  53. %setup -q
  54. %patch -p0
  55. chmod -R u+w .
  56. %build
  57. # configure the Perl package
  58. %{l_shtool} subst \
  59. -e 's;\(.*for thislib in $libswanted.*\);libswanted=`echo " $libswanted " | sed -e "s/ bind / /g" -e "s/ db / /g" -e "s/ gdbm / /g" -e "s/ iconv / /g"`\; \1;' \
  60. -e 's;package=perl5;package=perl;' \
  61. Configure
  62. %{l_shtool} subst \
  63. -e 's; */usr/local/lib;;' \
  64. hints/freebsd.sh hints/netbsd.sh
  65. ./Configure \
  66. -d -e -s \
  67. -Dprefix=%{l_prefix} \
  68. -Dinstallprefix=$RPM_BUILD_ROOT%{l_prefix} \
  69. -Dcc="%{l_cc}" -Doptimize="%{l_cflags -O}" \
  70. -Dlocincpth="%{l_prefix}/include" \
  71. -Dloclibpth="%{l_prefix}/lib" \
  72. -Dldflags="-L%{l_prefix}/lib" \
  73. -Dlibpth="%{l_prefix}/lib /lib /usr/lib /usr/ccs/lib" \
  74. -Dglibpth="%{l_prefix}/lib /lib /usr/lib /usr/ccs/lib" \
  75. -Dscriptdir="%{l_prefix}/bin" \
  76. -Uinstallusrbinperl \
  77. -Ui_malloc -Ui_iconv -Ui_db
  78. # build the Perl package
  79. %{l_make} %{l_mflags} -f Makefile
  80. %install
  81. rm -rf $RPM_BUILD_ROOT
  82. # install the Perl package via standard procedure
  83. %{l_make} %{l_mflags} -f Makefile install
  84. # install Perl versions of system header files
  85. ( cd /usr/include
  86. PERL5LIB=$RPM_BUILD_ROOT%{l_prefix}/lib/perl
  87. export PERL5LIB
  88. eval `$RPM_BUILD_ROOT%{l_prefix}/bin/perl -V:installsitearch`
  89. echo *.h sys/*.h |\
  90. xargs $RPM_BUILD_ROOT%{l_prefix}/bin/perl \
  91. $RPM_BUILD_ROOT%{l_prefix}/bin/h2ph
  92. )
  93. # install OpenPKG utility for Perl module packages
  94. %{l_shtool} install -c -m 755 -e 's;@l_prefix@;%{l_prefix};g' \
  95. %{SOURCE perl-openpkg.sh} \
  96. $RPM_BUILD_ROOT%{l_prefix}/bin/perl-openpkg
  97. # post-adjustments to installation tree
  98. rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/perl%{version}
  99. rm -rf $RPM_BUILD_ROOT%{l_prefix}/man/man3
  100. # re-adjust configuration as mentioned in Perl's INSTALL document
  101. $RPM_BUILD_ROOT%{l_prefix}/bin/perl -pi.orig \
  102. -e "s:$RPM_BUILD_ROOT%{l_prefix}:%{l_prefix}:g" \
  103. $RPM_BUILD_ROOT%{l_prefix}/lib/perl/%{version}/*/Config.pm \
  104. `find $RPM_BUILD_ROOT%{l_prefix}/lib/perl/%{version}/ \
  105. -type f -name ".packlist" -print`
  106. find $RPM_BUILD_ROOT%{l_prefix}/lib/perl/ \
  107. -name "*.orig" -print | xargs rm -f
  108. # strip binary files
  109. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* 2> /dev/null || true
  110. # determine installed files
  111. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
  112. %files -f files
  113. %clean
  114. rm -rf $RPM_BUILD_ROOT