perl.spec 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  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. %options
  53. %prep
  54. %setup -q
  55. %patch -p0
  56. chmod -R u+w .
  57. %build
  58. # configure the Perl package
  59. %{l_shtool} subst \
  60. -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;' \
  61. -e 's;package=perl5;package=perl;' \
  62. Configure
  63. %{l_shtool} subst \
  64. -e 's; */usr/local/lib;;' \
  65. hints/freebsd.sh hints/netbsd.sh
  66. ./Configure \
  67. -d -e -s \
  68. -Dprefix=%{l_prefix} \
  69. -Dinstallprefix=$RPM_BUILD_ROOT%{l_prefix} \
  70. -Dcc="%{l_cc}" -Doptimize="%{l_cflags -O}" \
  71. -Dlocincpth="%{l_prefix}/include" \
  72. -Dloclibpth="%{l_prefix}/lib" \
  73. -Dldflags="-L%{l_prefix}/lib" \
  74. -Dlibpth="%{l_prefix}/lib /lib /usr/lib /usr/ccs/lib" \
  75. -Dglibpth="%{l_prefix}/lib /lib /usr/lib /usr/ccs/lib" \
  76. -Dscriptdir="%{l_prefix}/bin" \
  77. -Uinstallusrbinperl \
  78. -Ui_malloc -Ui_iconv -Ui_db
  79. # build the Perl package
  80. %{l_make} %{l_mflags} -f Makefile
  81. %install
  82. rm -rf $RPM_BUILD_ROOT
  83. # install the Perl package via standard procedure
  84. %{l_make} %{l_mflags} -f Makefile install
  85. # install Perl versions of system header files
  86. ( cd /usr/include
  87. PERL5LIB=$RPM_BUILD_ROOT%{l_prefix}/lib/perl
  88. export PERL5LIB
  89. eval `$RPM_BUILD_ROOT%{l_prefix}/bin/perl -V:installsitearch`
  90. echo *.h sys/*.h |\
  91. xargs $RPM_BUILD_ROOT%{l_prefix}/bin/perl \
  92. $RPM_BUILD_ROOT%{l_prefix}/bin/h2ph
  93. )
  94. # install OpenPKG utility for Perl module packages
  95. %{l_shtool} install -c -m 755 -e 's;@l_prefix@;%{l_prefix};g' \
  96. %{SOURCE perl-openpkg.sh} \
  97. $RPM_BUILD_ROOT%{l_prefix}/bin/perl-openpkg
  98. # post-adjustments to installation tree
  99. rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/perl%{version}
  100. rm -rf $RPM_BUILD_ROOT%{l_prefix}/man/man3
  101. # re-adjust configuration as mentioned in Perl's INSTALL document
  102. $RPM_BUILD_ROOT%{l_prefix}/bin/perl -pi.orig \
  103. -e "s:$RPM_BUILD_ROOT%{l_prefix}:%{l_prefix}:g" \
  104. $RPM_BUILD_ROOT%{l_prefix}/lib/perl/%{version}/*/Config.pm \
  105. `find $RPM_BUILD_ROOT%{l_prefix}/lib/perl/%{version}/ \
  106. -type f -name ".packlist" -print`
  107. find $RPM_BUILD_ROOT%{l_prefix}/lib/perl/ \
  108. -name "*.orig" -print | xargs rm -f
  109. # strip binary files
  110. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* 2> /dev/null || true
  111. # determine installed files
  112. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
  113. %files -f files
  114. %clean
  115. rm -rf $RPM_BUILD_ROOT