perl.spec 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. ##
  2. ## perl.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2007 OpenPKG Foundation e.V. <http://openpkg.net/>
  4. ## Copyright (c) 2000-2007 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 Foundation e.V.
  30. Distribution: OpenPKG Community
  31. Class: CORE
  32. Group: Perl
  33. License: GPL/Artistic
  34. Version: 5.8.8
  35. Release: 20071011
  36. # list of sources
  37. Source0: ftp://ftp.cpan.org/pub/CPAN/src/perl-%{version}.tar.gz
  38. Patch0: perl.patch
  39. Patch1: http://bugs.gentoo.org/attachment.cgi?id=111427
  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. %patch -p1 -P 1
  62. chmod -R u+w .
  63. %build
  64. # configure the Perl package
  65. %{l_shtool} subst \
  66. -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;' \
  67. -e 's;package=perl5;package=perl;' \
  68. Configure
  69. %{l_shtool} subst \
  70. -e 's; */usr/local/lib;;' \
  71. hints/freebsd.sh hints/netbsd.sh
  72. optimize=""
  73. case "%{l_platform -t}" in
  74. amd64-* ) optimize="%{l_cflags}" ;;
  75. *-aix* ) optimize="%{l_cflags}" ;;
  76. *-* ) optimize="%{l_cflags -O}" ;;
  77. esac
  78. if [ ".$optimize" = . ]; then
  79. optimize="-Uoptimize"
  80. else
  81. optimize="-Doptimize=$optimize"
  82. fi
  83. libdirs=""
  84. for dir in %{l_prefix}/lib /lib64 /usr/lib64 /lib /usr/lib /usr/ccs/lib; do
  85. [ -d $dir ] && libdirs="$libdirs $dir"
  86. done
  87. ./Configure \
  88. -d -e -s \
  89. -Dcf_by="%{l_openpkg_release}" \
  90. -Dcf_email="http://www.openpkg.org/" \
  91. -Dprefix=%{l_prefix} \
  92. -Dvendorprefix=%{l_prefix} \
  93. -Dinstallprefix=%{l_prefix} \
  94. -Dinstallstyle="lib/perl5" \
  95. -Dman1dir=%{l_prefix}/man/man1 \
  96. -Dman3dir=%{l_prefix}/man/man3 \
  97. -Dcc="%{l_prefix}/bin/gcc" "$optimize" \
  98. -Dlocincpth="%{l_prefix}/include" \
  99. -Dloclibpth="%{l_prefix}/lib" \
  100. -Dldflags="%{l_ldflags}" \
  101. -Dlibpth="$libdirs" \
  102. -Dglibpth="$libdirs" \
  103. -Dscriptdir="%{l_prefix}/bin" \
  104. -Uinstallusrbinperl \
  105. -Ui_malloc -Ui_iconv -Ui_db
  106. # build the Perl package
  107. %{l_make} %{l_mflags} -f Makefile
  108. %install
  109. rm -rf $RPM_BUILD_ROOT
  110. # install the Perl package via standard procedure
  111. %{l_make} %{l_mflags} -f Makefile install DESTDIR=$RPM_BUILD_ROOT
  112. # install Perl versions of system header files
  113. ( case "%{l_platform -t}" in
  114. *-darwin* ) export DYLD_LIBRARY_PATH="`pwd`" ;;
  115. esac
  116. cd /usr/include
  117. PERL5LIB=$RPM_BUILD_ROOT%{l_prefix}/lib/perl
  118. export PERL5LIB
  119. eval `$RPM_BUILD_ROOT%{l_prefix}/bin/perl -V:installarchlib`
  120. echo *.h sys/*.h |\
  121. xargs $RPM_BUILD_ROOT%{l_prefix}/bin/perl \
  122. $RPM_BUILD_ROOT%{l_prefix}/bin/h2ph -h -d $RPM_BUILD_ROOT$installarchlib
  123. ) || exit $?
  124. # post-adjustments to installation tree
  125. rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/perl%{version}
  126. rm -rf $RPM_BUILD_ROOT%{l_prefix}/man/man3
  127. for name in \
  128. libnetcfg perlaix perlamiga perlapollo \
  129. perlbeos perlbs2000 perlcygwin perldgux perlepoc perlfreebsd perlhpux \
  130. perlhurd perlirix perlmachten perlmacos perlmacosx perlmint perlmpeix \
  131. perlnetware perlos2 perlos390 perlos400 perlplan9 perlqnx perlsolaris \
  132. perlvmesa perlvms perlvos perlwin32; do
  133. rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man1/$name.1
  134. done
  135. # re-adjust configuration as mentioned in Perl's INSTALL document
  136. ( case "%{l_platform -t}" in
  137. *-darwin* ) export DYLD_LIBRARY_PATH="`pwd`" ;;
  138. esac
  139. $RPM_BUILD_ROOT%{l_prefix}/bin/perl -pi.orig \
  140. -e "s:$RPM_BUILD_ROOT%{l_prefix}:%{l_prefix}:g" \
  141. $RPM_BUILD_ROOT%{l_prefix}/lib/perl/%{version}/*/Config.pm \
  142. `find $RPM_BUILD_ROOT%{l_prefix}/lib/perl/%{version}/ \
  143. -type f -name ".packlist" -print`
  144. find $RPM_BUILD_ROOT%{l_prefix}/lib/perl/ \
  145. -name "*.orig" -print | xargs rm -f
  146. ) || exit $?
  147. # strip binary files
  148. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* 2>/dev/null || true
  149. # resolve file conflicts (with perl-locale)
  150. rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/enc2xs \
  151. $RPM_BUILD_ROOT%{l_prefix}/bin/piconv
  152. # determine installed files
  153. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
  154. %files -f files
  155. %clean
  156. rm -rf $RPM_BUILD_ROOT