perl.spec 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. ##
  2. ## perl.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2005 OpenPKG Foundation e.V. <http://openpkg.net/>
  4. ## Copyright (c) 2000-2005 Ralf S. Engelschall <http://engelschall.com/>
  5. ##
  6. ## Permission to use, copy, modify, and distribute this software for
  7. ## any purpose with or without fee is hereby granted, provided that
  8. ## the above copyright notice and this permission notice appear in all
  9. ## copies.
  10. ##
  11. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  12. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  13. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  14. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  15. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  16. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  17. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  18. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  19. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  20. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  21. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  22. ## SUCH DAMAGE.
  23. ##
  24. # package information
  25. Name: perl
  26. Summary: Practical Extraction and Reporting Language
  27. URL: http://www.perl.com/
  28. Vendor: The Perl Project
  29. Packager: OpenPKG
  30. Distribution: OpenPKG
  31. Class: CORE
  32. Group: Language
  33. License: GPL/Artistic
  34. Version: 5.8.7
  35. Release: 20050603
  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 >= 20040130, gcc
  43. PreReq: OpenPKG, openpkg >= 20040130
  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. %track
  52. prog perl = {
  53. version = %{version}
  54. url = ftp://ftp.cpan.org/pub/CPAN/src/
  55. regex = perl-(5\.8\.\d+)\.tar\.gz
  56. }
  57. %prep
  58. %setup -q
  59. %patch -p0
  60. chmod -R u+w .
  61. %build
  62. # configure the Perl package
  63. %{l_shtool} subst \
  64. -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;' \
  65. -e 's;package=perl5;package=perl;' \
  66. Configure
  67. %{l_shtool} subst \
  68. -e 's; */usr/local/lib;;' \
  69. hints/freebsd.sh hints/netbsd.sh
  70. case "%{l_platform -t}" in
  71. amd64-* ) optimize="%{l_cflags}" ;;
  72. *-* ) optimize="%{l_cflags -O}" ;;
  73. esac
  74. ./Configure \
  75. -d -e -s \
  76. -Dprefix=%{l_prefix} \
  77. -Dvendorprefix=%{l_prefix} \
  78. -Dinstallprefix=%{l_prefix} \
  79. -Dinstallstyle="lib/perl5" \
  80. -Dman1dir=%{l_prefix}/man/man1 \
  81. -Dman3dir=%{l_prefix}/man/man3 \
  82. -Dcc="%{l_cc}" -Doptimize="$optimize" \
  83. -Dlocincpth="%{l_prefix}/include" \
  84. -Dloclibpth="%{l_prefix}/lib" \
  85. -Dldflags="%{l_ldflags}" \
  86. -Dlibpth="%{l_prefix}/lib /lib /usr/lib /usr/ccs/lib" \
  87. -Dglibpth="%{l_prefix}/lib /lib /usr/lib /usr/ccs/lib" \
  88. -Dscriptdir="%{l_prefix}/bin" \
  89. -Uinstallusrbinperl \
  90. -Ui_malloc -Ui_iconv -Ui_db
  91. # build the Perl package
  92. %{l_make} %{l_mflags} -f Makefile
  93. %install
  94. rm -rf $RPM_BUILD_ROOT
  95. # install the Perl package via standard procedure
  96. %{l_make} %{l_mflags} -f Makefile install DESTDIR=$RPM_BUILD_ROOT
  97. # install Perl versions of system header files
  98. ( case "%{l_platform -t}" in
  99. *-darwin* ) export DYLD_LIBRARY_PATH="`pwd`" ;;
  100. esac
  101. cd /usr/include
  102. PERL5LIB=$RPM_BUILD_ROOT%{l_prefix}/lib/perl
  103. export PERL5LIB
  104. eval `$RPM_BUILD_ROOT%{l_prefix}/bin/perl -V:installarchlib`
  105. echo *.h sys/*.h |\
  106. xargs $RPM_BUILD_ROOT%{l_prefix}/bin/perl \
  107. $RPM_BUILD_ROOT%{l_prefix}/bin/h2ph -h -d $RPM_BUILD_ROOT$installarchlib
  108. ) || exit $?
  109. # post-adjustments to installation tree
  110. rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/perl%{version}
  111. rm -rf $RPM_BUILD_ROOT%{l_prefix}/man/man3
  112. for name in \
  113. libnetcfg perlaix perlamiga perlapollo \
  114. perlbeos perlbs2000 perlcygwin perldgux perlepoc perlfreebsd perlhpux \
  115. perlhurd perlirix perlmachten perlmacos perlmacosx perlmint perlmpeix \
  116. perlnetware perlos2 perlos390 perlos400 perlplan9 perlqnx perlsolaris \
  117. perlvmesa perlvms perlvos perlwin32; do
  118. rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man1/$name.1
  119. done
  120. # re-adjust configuration as mentioned in Perl's INSTALL document
  121. ( case "%{l_platform -t}" in
  122. *-darwin* ) export DYLD_LIBRARY_PATH="`pwd`" ;;
  123. esac
  124. $RPM_BUILD_ROOT%{l_prefix}/bin/perl -pi.orig \
  125. -e "s:$RPM_BUILD_ROOT%{l_prefix}:%{l_prefix}:g" \
  126. $RPM_BUILD_ROOT%{l_prefix}/lib/perl/%{version}/*/Config.pm \
  127. `find $RPM_BUILD_ROOT%{l_prefix}/lib/perl/%{version}/ \
  128. -type f -name ".packlist" -print`
  129. find $RPM_BUILD_ROOT%{l_prefix}/lib/perl/ \
  130. -name "*.orig" -print | xargs rm -f
  131. ) || exit $?
  132. # strip binary files
  133. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* 2>/dev/null || true
  134. # resolve file conflicts (with perl-locale)
  135. rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/enc2xs \
  136. $RPM_BUILD_ROOT%{l_prefix}/bin/piconv
  137. # determine installed files
  138. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
  139. %files -f files
  140. %clean
  141. rm -rf $RPM_BUILD_ROOT