perl.spec 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. ##
  2. ## perl.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2006 OpenPKG Foundation e.V. <http://openpkg.net/>
  4. ## Copyright (c) 2000-2006 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.8
  35. Release: 20060826
  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. *-aix* ) optimize="%{l_cflags}" ;;
  73. *-* ) optimize="%{l_cflags -O}" ;;
  74. esac
  75. ./Configure \
  76. -d -e -s \
  77. -Dcf_by="%{l_openpkg_release}" \
  78. -Dcf_email="http://www.openpkg.org/" \
  79. -Dprefix=%{l_prefix} \
  80. -Dvendorprefix=%{l_prefix} \
  81. -Dinstallprefix=%{l_prefix} \
  82. -Dinstallstyle="lib/perl5" \
  83. -Dman1dir=%{l_prefix}/man/man1 \
  84. -Dman3dir=%{l_prefix}/man/man3 \
  85. -Dcc="%{l_cc}" -Doptimize="$optimize" \
  86. -Dlocincpth="%{l_prefix}/include" \
  87. -Dloclibpth="%{l_prefix}/lib" \
  88. -Dldflags="%{l_ldflags}" \
  89. -Dlibpth="%{l_prefix}/lib /lib /usr/lib /usr/ccs/lib" \
  90. -Dglibpth="%{l_prefix}/lib /lib /usr/lib /usr/ccs/lib" \
  91. -Dscriptdir="%{l_prefix}/bin" \
  92. -Uinstallusrbinperl \
  93. -Ui_malloc -Ui_iconv -Ui_db
  94. # build the Perl package
  95. %{l_make} %{l_mflags} -f Makefile
  96. %install
  97. rm -rf $RPM_BUILD_ROOT
  98. # install the Perl package via standard procedure
  99. %{l_make} %{l_mflags} -f Makefile install DESTDIR=$RPM_BUILD_ROOT
  100. # install Perl versions of system header files
  101. ( case "%{l_platform -t}" in
  102. *-darwin* ) export DYLD_LIBRARY_PATH="`pwd`" ;;
  103. esac
  104. cd /usr/include
  105. PERL5LIB=$RPM_BUILD_ROOT%{l_prefix}/lib/perl
  106. export PERL5LIB
  107. eval `$RPM_BUILD_ROOT%{l_prefix}/bin/perl -V:installarchlib`
  108. echo *.h sys/*.h |\
  109. xargs $RPM_BUILD_ROOT%{l_prefix}/bin/perl \
  110. $RPM_BUILD_ROOT%{l_prefix}/bin/h2ph -h -d $RPM_BUILD_ROOT$installarchlib
  111. ) || exit $?
  112. # post-adjustments to installation tree
  113. rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/perl%{version}
  114. rm -rf $RPM_BUILD_ROOT%{l_prefix}/man/man3
  115. for name in \
  116. libnetcfg perlaix perlamiga perlapollo \
  117. perlbeos perlbs2000 perlcygwin perldgux perlepoc perlfreebsd perlhpux \
  118. perlhurd perlirix perlmachten perlmacos perlmacosx perlmint perlmpeix \
  119. perlnetware perlos2 perlos390 perlos400 perlplan9 perlqnx perlsolaris \
  120. perlvmesa perlvms perlvos perlwin32; do
  121. rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man1/$name.1
  122. done
  123. # re-adjust configuration as mentioned in Perl's INSTALL document
  124. ( case "%{l_platform -t}" in
  125. *-darwin* ) export DYLD_LIBRARY_PATH="`pwd`" ;;
  126. esac
  127. $RPM_BUILD_ROOT%{l_prefix}/bin/perl -pi.orig \
  128. -e "s:$RPM_BUILD_ROOT%{l_prefix}:%{l_prefix}:g" \
  129. $RPM_BUILD_ROOT%{l_prefix}/lib/perl/%{version}/*/Config.pm \
  130. `find $RPM_BUILD_ROOT%{l_prefix}/lib/perl/%{version}/ \
  131. -type f -name ".packlist" -print`
  132. find $RPM_BUILD_ROOT%{l_prefix}/lib/perl/ \
  133. -name "*.orig" -print | xargs rm -f
  134. ) || exit $?
  135. # strip binary files
  136. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* 2>/dev/null || true
  137. # resolve file conflicts (with perl-locale)
  138. rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/enc2xs \
  139. $RPM_BUILD_ROOT%{l_prefix}/bin/piconv
  140. # determine installed files
  141. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
  142. %files -f files
  143. %clean
  144. rm -rf $RPM_BUILD_ROOT