perl.spec 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. ##
  2. ## perl.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2008 OpenPKG Foundation e.V. <http://openpkg.net/>
  4. ##
  5. ## Permission to use, copy, modify, and distribute this software for
  6. ## any purpose with or without fee is hereby granted, provided that
  7. ## the above copyright notice and this permission notice appear in all
  8. ## copies.
  9. ##
  10. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  11. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  12. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  13. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  14. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  15. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  16. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  17. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  18. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  19. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  20. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  21. ## SUCH DAMAGE.
  22. ##
  23. # package information
  24. Name: perl
  25. Summary: Practical Extraction and Reporting Language
  26. URL: http://www.perl.com/
  27. Vendor: The Perl Project
  28. Packager: OpenPKG Foundation e.V.
  29. Distribution: OpenPKG Community
  30. Class: CORE
  31. Group: Perl
  32. License: GPL/Artistic
  33. Version: 5.10.0
  34. Release: 20080413
  35. # list of sources
  36. Source0: ftp://ftp.cpan.org/pub/CPAN/src/perl-%{version}.tar.gz
  37. Patch0: perl.patch
  38. # build information
  39. Prefix: %{l_prefix}
  40. BuildRoot: %{l_buildroot}
  41. BuildPreReq: OpenPKG, openpkg >= 20040130, gcc
  42. PreReq: OpenPKG, openpkg >= 20040130
  43. AutoReq: no
  44. AutoReqProv: no
  45. %description
  46. Perl ("Practical Reporting and Extraction Language") is a very
  47. sophisticated and flexible (but this way also complex) programming
  48. language. This is the original implementation of the Perl 5
  49. interpreter from Larry Wall and his community.
  50. %track
  51. prog perl = {
  52. version = %{version}
  53. url = ftp://ftp.cpan.org/pub/CPAN/src/
  54. regex = perl-(5\.10\.\d+)\.tar\.gz
  55. }
  56. %prep
  57. %setup -q
  58. %patch -p0
  59. chmod -R u+w .
  60. %build
  61. # configure the Perl package
  62. %{l_shtool} subst \
  63. -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;' \
  64. -e 's;package=perl5;package=perl;' \
  65. Configure
  66. %{l_shtool} subst \
  67. -e 's; */usr/local/lib;;' \
  68. hints/freebsd.sh hints/netbsd.sh
  69. optimize=""
  70. case "%{l_platform -t}" in
  71. amd64-* ) optimize="%{l_cflags}" ;;
  72. *-aix* ) optimize="%{l_cflags}" ;;
  73. *-* ) optimize="%{l_cflags -O}" ;;
  74. esac
  75. if [ ".$optimize" = . ]; then
  76. optimize="-Uoptimize"
  77. else
  78. optimize="-Doptimize=$optimize"
  79. fi
  80. libdirs=""
  81. for dir in %{l_prefix}/lib /lib64 /usr/lib64 /lib /usr/lib /usr/ccs/lib; do
  82. [ -d $dir ] && libdirs="$libdirs $dir"
  83. done
  84. ./Configure \
  85. -d -e -s \
  86. -Dcf_by="%{l_openpkg_release}" \
  87. -Dcf_email="http://www.openpkg.org/" \
  88. -Dprefix=%{l_prefix} \
  89. -Dvendorprefix=%{l_prefix} \
  90. -Dinstallprefix=%{l_prefix} \
  91. -Dinstallstyle="lib/perl5" \
  92. -Dman1dir=%{l_prefix}/man/man1 \
  93. -Dman3dir=%{l_prefix}/man/man3 \
  94. -Dcc="%{l_prefix}/bin/gcc" "$optimize" \
  95. -Dlocincpth="%{l_prefix}/include" \
  96. -Dloclibpth="%{l_prefix}/lib" \
  97. -Dldflags="%{l_ldflags}" \
  98. -Dlibpth="$libdirs" \
  99. -Dglibpth="$libdirs" \
  100. -Dscriptdir="%{l_prefix}/bin" \
  101. -Uinstallusrbinperl \
  102. -Ui_malloc -Ui_iconv -Ui_db \
  103. -Uusedevel
  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. # assume ownership for various arch/site/vendor install dirs
  146. ( eval "`./perl -V:installarchlib`"
  147. eval "`./perl -V:installprivlib`"
  148. eval "`./perl -V:installsitearch`"
  149. eval "`./perl -V:installsitelib`"
  150. eval "`./perl -V:installvendorarch`"
  151. eval "`./perl -V:installvendorlib`"
  152. %{l_shtool} mkdir -f -p -m 755 \
  153. $RPM_BUILD_ROOT$installarchlib/auto \
  154. $RPM_BUILD_ROOT$installprivlib/auto \
  155. $RPM_BUILD_ROOT$installsitearch/auto \
  156. $RPM_BUILD_ROOT$installsitelib/auto \
  157. $RPM_BUILD_ROOT$installvendorarch/auto \
  158. $RPM_BUILD_ROOT$installvendorlib/auto
  159. ) || exit $?
  160. # strip binary files
  161. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* 2>/dev/null || true
  162. # resolve file conflicts (with perl-locale)
  163. rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/enc2xs \
  164. $RPM_BUILD_ROOT%{l_prefix}/bin/piconv
  165. # resolve file conflicts (with perl-module)
  166. rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/corelist \
  167. $RPM_BUILD_ROOT%{l_prefix}/bin/config_data \
  168. $RPM_BUILD_ROOT%{l_prefix}/man/man1/config_data.1
  169. # resolve file conflicts (with perl-sys)
  170. rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/ptar \
  171. $RPM_BUILD_ROOT%{l_prefix}/bin/ptardiff \
  172. $RPM_BUILD_ROOT%{l_prefix}/man/man1/ptar.1 \
  173. $RPM_BUILD_ROOT%{l_prefix}/man/man1/ptardiff.1
  174. # resolve file conflicts (with perl-crypto)
  175. rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/shasum \
  176. $RPM_BUILD_ROOT%{l_prefix}/man/man1/shasum.1
  177. # determine installed files
  178. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
  179. %files -f files
  180. %clean
  181. rm -rf $RPM_BUILD_ROOT