perl59.spec 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. ##
  2. ## perl59.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: perl59
  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: EVAL
  32. Group: Perl
  33. License: GPL/Artistic
  34. Version: 5.9.5
  35. Release: 20070719
  36. # package options
  37. %option with_perl no
  38. # list of sources
  39. Source0: ftp://ftp.cpan.org/pub/CPAN/src/perl-%{version}.tar.gz
  40. Patch0: perl59.patch
  41. # build information
  42. Prefix: %{l_prefix}
  43. BuildRoot: %{l_buildroot}
  44. BuildPreReq: OpenPKG, openpkg >= 20040130, gcc
  45. PreReq: OpenPKG, openpkg >= 20040130
  46. AutoReq: no
  47. AutoReqProv: no
  48. %if "%{with_perl}" == "yes"
  49. Provides: perl = %{version}-%{release}
  50. %endif
  51. %description
  52. Perl ("Practical Reporting and Extraction Language") is a very
  53. sophisticated and flexible (but this way also complex) programming
  54. language. This is the original implementation of the Perl 5
  55. interpreter from Larry Wall and his community.
  56. ATTENTION: THIS IS THE DEVELOPMENT SERIES OF PERL 5!
  57. IT IS NOT INTENDED FOR PRODUCTION USE. USE IT ON YOUR OWN RISK.
  58. %track
  59. prog perl59 = {
  60. version = %{version}
  61. url = ftp://ftp.cpan.org/pub/CPAN/src/
  62. regex = perl-(5\.9\.\d+)\.tar\.gz
  63. }
  64. %prep
  65. %setup -q -n perl-%{version}
  66. %patch -p0
  67. chmod -R u+w .
  68. %build
  69. # configure the Perl package
  70. %{l_shtool} subst \
  71. -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;' \
  72. -e 's;package=perl5;package=perl;' \
  73. Configure
  74. %{l_shtool} subst \
  75. -e 's; */usr/local/lib;;' \
  76. hints/freebsd.sh hints/netbsd.sh
  77. case "%{l_platform -t}" in
  78. amd64-* ) optimize="%{l_cflags}" ;;
  79. *-aix* ) optimize="%{l_cflags}" ;;
  80. *-* ) optimize="%{l_cflags -O}" ;;
  81. esac
  82. ./Configure \
  83. -d -e -s \
  84. -Dprefix=%{l_prefix} \
  85. -Dvendorprefix=%{l_prefix} \
  86. -Dinstallprefix=%{l_prefix} \
  87. -Dinstallstyle="lib/perl5" \
  88. -Dman1dir=%{l_prefix}/man/man1 \
  89. -Dman3dir=%{l_prefix}/man/man3 \
  90. -Dcc="%{l_cc}" -Doptimize="$optimize" \
  91. -Dlocincpth="%{l_prefix}/include" \
  92. -Dloclibpth="%{l_prefix}/lib" \
  93. -Dldflags="%{l_ldflags}" \
  94. -Dlibpth="%{l_prefix}/lib /lib /usr/lib /usr/ccs/lib" \
  95. -Dglibpth="%{l_prefix}/lib /lib /usr/lib /usr/ccs/lib" \
  96. -Dscriptdir="%{l_prefix}/bin" \
  97. -Uinstallusrbinperl \
  98. -Ui_malloc -Ui_iconv -Ui_db \
  99. -Dusedevel
  100. # build the Perl package
  101. %{l_make} %{l_mflags} -f Makefile
  102. %install
  103. rm -rf $RPM_BUILD_ROOT
  104. # install the Perl package via standard procedure
  105. %{l_make} %{l_mflags} -f Makefile install DESTDIR=$RPM_BUILD_ROOT
  106. # install Perl versions of system header files
  107. ( case "%{l_platform -t}" in
  108. *-darwin* ) export DYLD_LIBRARY_PATH="`pwd`" ;;
  109. esac
  110. cd /usr/include
  111. PERL5LIB=$RPM_BUILD_ROOT%{l_prefix}/lib/perl
  112. export PERL5LIB
  113. eval `$RPM_BUILD_ROOT%{l_prefix}/bin/perl -V:installarchlib`
  114. echo *.h sys/*.h |\
  115. xargs $RPM_BUILD_ROOT%{l_prefix}/bin/perl%{version} \
  116. $RPM_BUILD_ROOT%{l_prefix}/bin/h2ph%{version} -h -d $RPM_BUILD_ROOT$installarchlib
  117. ) || exit $?
  118. # post-adjustments to installation tree
  119. rm -rf $RPM_BUILD_ROOT%{l_prefix}/man/man3
  120. for name in \
  121. libnetcfg perlaix perlamiga perlapollo \
  122. perlbeos perlbs2000 perlcygwin perldgux perlepoc perlfreebsd perlhpux \
  123. perlhurd perlirix perlmachten perlmacos perlmacosx perlmint perlmpeix \
  124. perlnetware perlos2 perlos390 perlos400 perlplan9 perlqnx perlsolaris \
  125. perlvmesa perlvms perlvos perlwin32; do
  126. rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man1/$name.1
  127. done
  128. # re-adjust configuration as mentioned in Perl's INSTALL document
  129. ( case "%{l_platform -t}" in
  130. *-darwin* ) export DYLD_LIBRARY_PATH="`pwd`" ;;
  131. esac
  132. $RPM_BUILD_ROOT%{l_prefix}/bin/perl%{version} -pi.orig \
  133. -e "s:$RPM_BUILD_ROOT%{l_prefix}:%{l_prefix}:g" \
  134. $RPM_BUILD_ROOT%{l_prefix}/lib/perl/%{version}/*/Config.pm \
  135. `find $RPM_BUILD_ROOT%{l_prefix}/lib/perl/%{version}/ \
  136. -type f -name ".packlist" -print`
  137. find $RPM_BUILD_ROOT%{l_prefix}/lib/perl/ \
  138. -name "*.orig" -print | xargs rm -f
  139. ) || exit $?
  140. # strip binary files
  141. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* 2>/dev/null || true
  142. # resolve file conflicts (with perl-locale)
  143. rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/enc2xs \
  144. $RPM_BUILD_ROOT%{l_prefix}/bin/piconv
  145. # resolve filename conflicts
  146. %if "%{with_perl}" == "yes"
  147. ( cd $RPM_BUILD_ROOT%{l_prefix}/bin
  148. for file in *; do
  149. [ ".$file" = ".*" ] && continue
  150. mv ${file} `echo ${file} | sed -e 's;%{version}$;;'`
  151. done
  152. ) || exit $?
  153. %else
  154. ln $RPM_BUILD_ROOT%{l_prefix}/bin/perl%{version} \
  155. $RPM_BUILD_ROOT%{l_prefix}/bin/perl59
  156. ( cd $RPM_BUILD_ROOT%{l_prefix}/man/man1
  157. for file in *; do
  158. [ ".$file" = ".*" ] && continue
  159. mv ${file} `echo ${file} | sed -e 's;^\([^.]*\)\(\..*\)$;\1%{version}\2;'`
  160. done
  161. ) || exit $?
  162. %endif
  163. # determine installed files
  164. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
  165. %files -f files
  166. %clean
  167. rm -rf $RPM_BUILD_ROOT