perl.spec 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. ##
  2. ## perl.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. # 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.6.1
  35. Release: 20020810
  36. # list of sources
  37. Source0: ftp://ftp.cpan.org/pub/CPAN/src/%{name}-%{version}.tar.gz
  38. Patch0: perl.patch
  39. # build information
  40. Prefix: %{l_prefix}
  41. BuildRoot: %{l_buildroot}
  42. BuildPreReq: OpenPKG, openpkg >= 20020206, gcc
  43. PreReq: OpenPKG, openpkg >= 20020206, 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. %patch0 -p0
  54. chmod -R u+w .
  55. # Support both "ld: Software Generation Utilities" and "ld:
  56. # Solaris Link Editors" in the internal outputs of the Solaris
  57. # 2.8 ld (latest patch-cluster as of February 2002 with patch
  58. # #109147-14 or newer), because Perl's Configure else thinks the
  59. # Solaris ld is GNU ld and horribly horses up...
  60. %{l_shtool} subst -e 's;ld: Software Generation Utilities;ld: So;g' hints/solaris_2.sh
  61. %build
  62. # Eval hack for obsolete Linux versions (like Debian 2.2) with too old
  63. # binutils where our GCC 3.0 makes trouble on Perl loading DSO based modules.
  64. # In order to avoid having to require the user to update to binutils 2.11,
  65. # we have to force Perl to use the system-supplied compiler... :-(
  66. cc="%{l_cc}"
  67. cflags="%{l_cflags -O}"
  68. case "%{l_target}" in
  69. *-linux* )
  70. v=unknown
  71. if [ -f /etc/debian_version ]; then
  72. v=`/usr/bin/dpkg -l binutils | grep binutils | awk '{ print $3; }'`
  73. elif [ -f /etc/redhat-release ]; then
  74. v=`/bin/rpm -q --qf '%{VERSION}' binutils`
  75. elif [ -f /etc/SuSE-release ]; then
  76. v=`/bin/rpm -q --qf '%{VERSION}' binutils`
  77. else
  78. v=`(ld --version | grep "^GNU ld " | sed -e 's;^GNU ld ;;') 2>/dev/null`
  79. fi
  80. case "$v" in
  81. 2.1[1-9].* ) ;;
  82. * ) cc=`%{l_shtool} path -p/bin:/usr/bin:$PATH cc`; cflags="-O" ;;
  83. esac
  84. ;;
  85. esac
  86. # configure the Perl package
  87. ./Configure \
  88. -d -e -s \
  89. -Dprefix=%{l_prefix} \
  90. -Dinstallprefix=$RPM_BUILD_ROOT%{l_prefix} \
  91. -Dcc="$cc" -Doptimize="$cflags" \
  92. -Dlocincpth="%{l_prefix}/include" \
  93. -Dldflags="-L%{l_prefix}/lib" \
  94. -Dlibpth="%{l_prefix}/lib /lib /usr/lib /usr/ccs/lib" \
  95. -Uinstallusrbinperl \
  96. -Ui_db
  97. # build the Perl package
  98. %{l_make} %{l_mflags -O} -f Makefile
  99. %install
  100. rm -rf $RPM_BUILD_ROOT
  101. # install the Perl package via standard procedure
  102. %{l_make} %{l_mflags} -f Makefile install
  103. # install Perl versions of system header files
  104. ( cd /usr/include
  105. eval `$RPM_BUILD_ROOT%{l_prefix}/bin/perl -V:installsitearch`
  106. echo *.h sys/*.h |\
  107. xargs $RPM_BUILD_ROOT%{l_prefix}/bin/h2ph \
  108. -d "$RPM_BUILD_ROOT$installsitearch"
  109. )
  110. # post-adjustments to installation tree
  111. rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/perl%{version}
  112. # re-adjust configuration as mentioned in Perl's INSTALL document
  113. $RPM_BUILD_ROOT%{l_prefix}/bin/perl -pi.orig \
  114. -e "s:$RPM_BUILD_ROOT%{l_prefix}:%{l_prefix}:g" \
  115. $RPM_BUILD_ROOT%{l_prefix}/lib/perl5/%{version}/*/Config.pm \
  116. `find $RPM_BUILD_ROOT%{l_prefix}/lib/perl5/%{version}/ -type f -name ".packlist" -print`
  117. find $RPM_BUILD_ROOT%{l_prefix}/lib/perl5/ -name "*.orig" -print | xargs rm -f
  118. # strip binary files
  119. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* 2> /dev/null || true
  120. # determine installed files
  121. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
  122. %files -f files
  123. %clean
  124. rm -rf $RPM_BUILD_ROOT
  125. # FIXME: /re/bin/cc -L/re/lib -L/re/lib -L/re/lib/perl5/5.6.1/sun4-solaris/CORE -o eperl eperl_main.o eperl_perl5.o eperl_parse.o eperl_pp.o eperl_sys.o eperl_http.o eperl_getopt.o eperl_debug.o eperl_config.o eperl_version.o eperl_readme.o eperl_license.o eperl_logo.o eperl_powered.o /re/lib/perl5/5.6.1/sun4-solaris/auto/DynaLoader/DynaLoader.a -lperl -lsocket -lnsl -ldb -ldl -lm -lc
  126. # FIXME: ld: fatal: library -ldb: not found
  127. # FIXME: and that although we use -Ui_db