perl.spec 6.1 KB

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