perl.spec 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. ##
  2. ## perl.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2004 The OpenPKG Project <http://www.openpkg.org/>
  4. ## Copyright (c) 2000-2004 Ralf S. Engelschall <rse@engelschall.com>
  5. ## Copyright (c) 2000-2004 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
  32. Class: CORE
  33. Group: Language
  34. License: GPL/Artistic
  35. Version: 5.8.5
  36. Release: 20040720
  37. # list of sources
  38. Source0: ftp://ftp.cpan.org/pub/CPAN/src/perl-%{version}.tar.gz
  39. Patch0: perl.patch
  40. # build information
  41. Prefix: %{l_prefix}
  42. BuildRoot: %{l_buildroot}
  43. BuildPreReq: OpenPKG, openpkg >= 20040130, gcc
  44. PreReq: OpenPKG, openpkg >= 20040130
  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. %track
  53. prog perl = {
  54. version = %{version}
  55. url = ftp://ftp.cpan.org/pub/CPAN/src/
  56. regex = perl-(5\.8\.\d+)\.tar\.gz
  57. }
  58. %prep
  59. %setup -q
  60. %patch -p0
  61. chmod -R u+w .
  62. %build
  63. # configure the Perl package
  64. %{l_shtool} subst \
  65. -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;' \
  66. -e 's;package=perl5;package=perl;' \
  67. Configure
  68. %{l_shtool} subst \
  69. -e 's; */usr/local/lib;;' \
  70. hints/freebsd.sh hints/netbsd.sh
  71. ./Configure \
  72. -d -e -s \
  73. -Dprefix=%{l_prefix} \
  74. -Dvendorprefix=%{l_prefix} \
  75. -Dinstallprefix=$RPM_BUILD_ROOT%{l_prefix} \
  76. -Dinstallstyle="lib/perl5" \
  77. -Dman1dir=%{l_prefix}/man/man1 \
  78. -Dman3dir=%{l_prefix}/man/man3 \
  79. -Dcc="%{l_cc}" -Doptimize="%{l_cflags -O}" \
  80. -Dlocincpth="%{l_prefix}/include" \
  81. -Dloclibpth="%{l_prefix}/lib" \
  82. -Dldflags="%{l_ldflags}" \
  83. -Dlibpth="%{l_prefix}/lib /lib /usr/lib /usr/ccs/lib" \
  84. -Dglibpth="%{l_prefix}/lib /lib /usr/lib /usr/ccs/lib" \
  85. -Dscriptdir="%{l_prefix}/bin" \
  86. -Uinstallusrbinperl \
  87. -Ui_malloc -Ui_iconv -Ui_db
  88. # build the Perl package
  89. %{l_make} %{l_mflags} -f Makefile
  90. %install
  91. rm -rf $RPM_BUILD_ROOT
  92. # install the Perl package via standard procedure
  93. %{l_make} %{l_mflags} -f Makefile install
  94. # install Perl versions of system header files
  95. ( cd /usr/include
  96. PERL5LIB=$RPM_BUILD_ROOT%{l_prefix}/lib/perl
  97. export PERL5LIB
  98. eval `$RPM_BUILD_ROOT%{l_prefix}/bin/perl -V:installarchlib`
  99. echo *.h sys/*.h |\
  100. xargs $RPM_BUILD_ROOT%{l_prefix}/bin/perl \
  101. $RPM_BUILD_ROOT%{l_prefix}/bin/h2ph -h -d $installarchlib
  102. ) || exit $?
  103. # post-adjustments to installation tree
  104. rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/perl%{version}
  105. rm -rf $RPM_BUILD_ROOT%{l_prefix}/man/man3
  106. for name in \
  107. libnetcfg perlaix perlamiga perlapollo \
  108. perlbeos perlbs2000 perlcygwin perldgux perlepoc perlfreebsd perlhpux \
  109. perlhurd perlirix perlmachten perlmacos perlmacosx perlmint perlmpeix \
  110. perlnetware perlos2 perlos390 perlos400 perlplan9 perlqnx perlsolaris \
  111. perlvmesa perlvms perlvos perlwin32; do
  112. rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man1/$name.1
  113. done
  114. # re-adjust configuration as mentioned in Perl's INSTALL document
  115. $RPM_BUILD_ROOT%{l_prefix}/bin/perl -pi.orig \
  116. -e "s:$RPM_BUILD_ROOT%{l_prefix}:%{l_prefix}:g" \
  117. $RPM_BUILD_ROOT%{l_prefix}/lib/perl/%{version}/*/Config.pm \
  118. `find $RPM_BUILD_ROOT%{l_prefix}/lib/perl/%{version}/ \
  119. -type f -name ".packlist" -print`
  120. find $RPM_BUILD_ROOT%{l_prefix}/lib/perl/ \
  121. -name "*.orig" -print | xargs rm -f
  122. # strip binary files
  123. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* 2>/dev/null || true
  124. # determine installed files
  125. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
  126. %files -f files
  127. %clean
  128. rm -rf $RPM_BUILD_ROOT