mirror of the now-defunct rocklinux.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

90 lines
2.8 KiB

  1. #!/bin/bash
  2. # --- ROCK-COPYRIGHT-NOTE-BEGIN ---
  3. #
  4. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  5. # Please add additional copyright information _after_ the line containing
  6. # the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by
  7. # the ./scripts/Create-CopyPatch script. Do not edit this copyright text!
  8. #
  9. # ROCK Linux: rock-src/package/base/perl5/perl5.conf
  10. # ROCK Linux is Copyright (C) 1998 - 2006 Clifford Wolf
  11. #
  12. # This program is free software; you can redistribute it and/or modify
  13. # it under the terms of the GNU General Public License as published by
  14. # the Free Software Foundation; either version 2 of the License, or
  15. # (at your option) any later version. A copy of the GNU General Public
  16. # License can be found at Documentation/COPYING.
  17. #
  18. # Many people helped and are helping developing ROCK Linux. Please
  19. # have a look at http://www.rocklinux.org/ and the Documentation/TEAM
  20. # file for details.
  21. #
  22. # --- ROCK-COPYRIGHT-NOTE-END ---
  23. runconfig=0
  24. confopt="-des -Dprefix=/usr -Dinstallprefix=$root/usr -Darchname=$arch_target \
  25. -Dmyhostname=$ROCKCFG_PKG_PERL5_HOST_NAME \
  26. -Dsiteprefix=/$ROCKCFG_PKG_PERL5_SITE_PREFIX \
  27. -Dvendorprefix=/$ROCKCFG_PKG_PERL5_VENDOR_PREFIX"
  28. [ "$ROCKCFG_PKG_PERL5_SUIDPERL" != "0" ] && confopt="$confopt -Dd_dosuid"
  29. [ "$ROCKCFG_PKG_PERL5_THREADS" = "1" ] && confopt="$confopt -Dusethreads"
  30. [ "$ROCKCFG_PKG_PERL5_USE_DB3" = "1" ] && patchfiles="$patchfiles $confdir/use_db3.diff"
  31. if [ "$stagelevel" -le 2 ] ; then
  32. custmain=pkg_perl_custmain
  33. else
  34. hook_add preconf 2 "( rm -f config.sh Policy.sh; sh Configure \$confopt; )"
  35. hook_add postmake 4 "pkg_perl_postmake"
  36. fi
  37. pkg_perl_custmain () {
  38. if [ "$ROCKCFG_CROSSBUILD" = 1 ] ; then
  39. sed -i -e 's/miniperl/miniperl-cross/g' \
  40. ext/util/make_ext x2p/Makefile.SH utils/Makefile
  41. fi
  42. rm -f config.sh Policy.sh
  43. eval sh Configure $confopt -Dstatic_ext='Data/Dumper IO Fcntl POSIX'
  44. if [ "$ROCKCFG_CROSSBUILD" = 1 ] ; then
  45. make miniperl
  46. mv miniperl miniperl-cross
  47. make clean
  48. sed -i -e "s@\(^ar=\).*@\1'${AR}'@g" \
  49. -e "s@\(^ranlib=\).*@\1'${RANLIB}'@g" \
  50. -e "s@\(^cc=\).*@\1'${CC}'@g" \
  51. -e "s@\(^ld=\).*@\1'${CC}'@g" config.sh
  52. make miniperl
  53. sed -i -e 's|(LDLIBPTH) ./miniperl|(LDLIBPTH) ./miniperl-cross|g' Makefile
  54. fi
  55. make perl utilities
  56. cp perl pod/pod2man $root/usr/bin
  57. install -d $root/usr/lib/perl5/$ver
  58. cp -R lib/* $root/usr/lib/perl5/$ver
  59. }
  60. pkg_perl_postmake() {
  61. h2ph $( grep ' usr/include/.*\.h$' \
  62. $root/var/adm/flists/glibc* | sed "s,^.*: ,$root/," )
  63. cat > $root/usr/bin/cpan <<- EOT
  64. #!/usr/bin/perl
  65. use POSIX;
  66. use locale;
  67. use CPAN;
  68. setlocale(LANGUAGE, "en_US");
  69. setlocale(LC_ALL, "en_US");
  70. shell;
  71. EOT
  72. chmod +x $root/usr/bin/cpan
  73. mkdir -p $root/usr/lib/perl5/$ver/${archprefix%-}
  74. touch $root/usr/lib/perl5/$ver/${archprefix%-}/perllocal.pod
  75. }