perl.spec 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. ##
  2. ## perl.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2003 The OpenPKG Project <http://www.openpkg.org/>
  4. ## Copyright (c) 2000-2003 Ralf S. Engelschall <rse@engelschall.com>
  5. ## Copyright (c) 2000-2003 Cable & Wireless <http://www.cw.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.1
  35. Release: 20030926
  36. # list of sources
  37. Source0: ftp://ftp.cpan.org/pub/CPAN/src/perl-%{version}.tar.gz
  38. Patch0: perl.patch
  39. # build information
  40. Prefix: %{l_prefix}
  41. BuildRoot: %{l_buildroot}
  42. BuildPreReq: OpenPKG, openpkg >= 20030708, gcc
  43. PreReq: OpenPKG, openpkg >= 20030708, gcc
  44. AutoReq: no
  45. AutoReqProv: no
  46. %description
  47. Perl ("Practical Reporting and Extraction Language") is a very
  48. sophisticated and flexible (but this way also complex) programming
  49. language. This is the original implementation of the Perl 5 interpreter
  50. from Larry Wall and his community.
  51. %prep
  52. %setup -q
  53. %patch -p0
  54. chmod -R u+w .
  55. %build
  56. # configure the Perl package
  57. %{l_shtool} subst \
  58. -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;' \
  59. -e 's;package=perl5;package=perl;' \
  60. Configure
  61. %{l_shtool} subst \
  62. -e 's; */usr/local/lib;;' \
  63. hints/freebsd.sh hints/netbsd.sh
  64. ./Configure \
  65. -d -e -s \
  66. -Dprefix=%{l_prefix} \
  67. -Dvendorprefix=%{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_ldflags}" \
  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:installarchlib`
  89. echo *.h sys/*.h |\
  90. xargs $RPM_BUILD_ROOT%{l_prefix}/bin/perl \
  91. $RPM_BUILD_ROOT%{l_prefix}/bin/h2ph -h -d $installarchlib
  92. ) || exit $?
  93. # post-adjustments to installation tree
  94. rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/perl%{version}
  95. rm -rf $RPM_BUILD_ROOT%{l_prefix}/man/man3
  96. # re-adjust configuration as mentioned in Perl's INSTALL document
  97. $RPM_BUILD_ROOT%{l_prefix}/bin/perl -pi.orig \
  98. -e "s:$RPM_BUILD_ROOT%{l_prefix}:%{l_prefix}:g" \
  99. $RPM_BUILD_ROOT%{l_prefix}/lib/perl/%{version}/*/Config.pm \
  100. `find $RPM_BUILD_ROOT%{l_prefix}/lib/perl/%{version}/ \
  101. -type f -name ".packlist" -print`
  102. find $RPM_BUILD_ROOT%{l_prefix}/lib/perl/ \
  103. -name "*.orig" -print | xargs rm -f
  104. # strip binary files
  105. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* 2>/dev/null || true
  106. # determine installed files
  107. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
  108. %files -f files
  109. %clean
  110. rm -rf $RPM_BUILD_ROOT