perl.spec 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. ##
  2. ## perl.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2002 Cable & Wireless Deutschland GmbH
  4. ## Copyright (c) 2000-2002 The OpenPKG Project <http://www.openpkg.org/>
  5. ## Copyright (c) 2000-2002 Ralf S. Engelschall <rse@engelschall.com>
  6. ##
  7. ## Permission to use, copy, modify, and distribute this software for
  8. ## any purpose with or without fee is hereby granted, provided that
  9. ## the above copyright notice and this permission notice appear in all
  10. ## copies.
  11. ##
  12. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  13. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  14. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  15. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  16. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  17. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  18. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  19. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  20. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  21. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  22. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  23. ## SUCH DAMAGE.
  24. ##
  25. # package information
  26. Name: perl
  27. Summary: Practical Extraction and Reporting Language
  28. URL: http://www.perl.com/
  29. Vendor: The Perl Project
  30. Packager: The OpenPKG Project
  31. Distribution: OpenPKG [REL]
  32. Group: Language
  33. License: Artistic or GPL
  34. Version: 5.6.1
  35. Release: 20020206
  36. # list of sources
  37. Source0: ftp://ftp.cpan.org/CPAN/src/%{name}-%{version}.tar.gz
  38. Source1: http://www.cpan.org/modules/by-module/CGI/CGI.pm-3.02.tar.gz
  39. Source2: http://www.cpan.org/modules/by-module/Bit/Bit-Vector-6.1.tar.gz
  40. Source3: http://www.cpan.org/modules/by-module/Date/TimeDate-1.10.tar.gz
  41. Source4: http://www.cpan.org/modules/by-module/Date/DateManip-5.40.tar.gz
  42. Source5: http://www.cpan.org/modules/by-module/Config/Config-IniFiles-2.21.tar.gz
  43. Source6: http://www.cpan.org/modules/by-module/Parse/Parse-RecDescent-1.80.tar.gz
  44. Source7: http://www.cpan.org/modules/by-module/HTML/HTML-Parser-3.25.tar.gz
  45. Source8: http://www.cpan.org/modules/by-module/Net/Net-Daemon-0.36.tar.gz
  46. Source9: http://www.cpan.org/modules/by-module/Net/Net-Server-0.81.tar.gz
  47. Source10: http://www.cpan.org/modules/by-module/Net/Net-ext-0.932.tar.gz
  48. Source11: http://www.cpan.org/modules/by-module/Net/libnet-1.0704.tar.gz
  49. Source12: http://www.cpan.org/modules/by-module/URI/URI-1.17.tar.gz
  50. Source13: http://www.cpan.org/modules/by-module/Unix/Syslog-0.96.tar.gz
  51. Source14: http://www.cpan.org/modules/by-module/Time/Time-HiRes-01.20.tar.gz
  52. Source15: http://www.cpan.org/modules/by-module/MIME/MIME-tools-5.411.tar.gz
  53. Source16: http://www.cpan.org/modules/by-module/MIME/MIME-Base64-2.12.tar.gz
  54. Source17: http://www.cpan.org/modules/by-module/Digest/Digest-MD5-2.16.tar.gz
  55. Source18: http://www.cpan.org/modules/by-module/WWW/libwww-perl-5.62.tar.gz
  56. Source19: http://www.cpan.org/modules/by-module/Image/Image-Info-1.08.tar.gz
  57. Source20: http://www.cpan.org/modules/by-module/Alias/Alias-2.32.tar.gz
  58. Source21: http://www.cpan.org/modules/by-module/Archive/Archive-Tar-0.22.tar.gz
  59. Source22: http://www.cpan.org/modules/by-module/Expect/Expect-1.12.tar.gz
  60. Source23: http://www.cpan.org/modules/by-module/IPC/IPC-Shareable-0.60.tar.gz
  61. Source24: http://www.cpan.org/modules/by-module/Image/Image-Size-2.96.tar.gz
  62. Source25: http://www.cpan.org/modules/by-module/Inline/Inline-0.43.tar.gz
  63. Source26: http://www.cpan.org/modules/by-module/Mail/Mail-Sendmail-0.78.tar.gz
  64. Source27: http://www.cpan.org/modules/by-module/Set/Set-Scalar-1.16.tar.gz
  65. Source28: http://www.cpan.org/modules/by-module/Mail/MailTools-1.41.tar.gz
  66. Source29: http://www.cpan.org/modules/by-module/Date/Date-Calc-5.0.tar.gz
  67. Source30: http://www.cpan.org/modules/by-module/File/File-Tail-0.98.tar.gz
  68. Source31: http://www.cpan.org/modules/by-module/Net/Net-Netmask-1.9002.tar.gz
  69. # build information
  70. Prefix: %{l_prefix}
  71. BuildRoot: %{l_buildroot}
  72. BuildPreReq: OpenPKG, openpkg >= 20020206, gcc, gzip
  73. PreReq: OpenPKG, openpkg >= 20020206
  74. AutoReq: no
  75. AutoReqProv: no
  76. %description
  77. Perl ("Practical Reporting and Extraction Language") is a very
  78. sophisticated and flexible (but this way also complex) programming
  79. language. This is the original implementation of the Perl 5 interpreter
  80. from Larry Wall and his community.
  81. %prep
  82. %setup -q
  83. %build
  84. # Eval hack for obsolete Linux versions (like Debian 2.2) with too old
  85. # binutils where our GCC 3.0 makes trouble on Perl loading DSO based modules.
  86. # In order to avoid having to require the user to update to binutils 2.11,
  87. # we have to force Perl to use the system-supplied compiler... :-(
  88. cc="%{l_cc}"
  89. cflags="%{l_cflags -O}"
  90. case "%{l_target}" in
  91. *-linux* )
  92. v=unknown
  93. if [ -f /etc/debian_version ]; then
  94. v=`/usr/bin/dpkg -l binutils | grep binutils | awk '{ print $3; }'`
  95. elif [ -f /etc/redhat-release ]; then
  96. v=`/bin/rpm -q --qf '%{VERSION}' binutils`
  97. else
  98. v=`(rpm -q --qf '%{VERSION}' binutils) 2>/dev/null`
  99. fi
  100. case "$v" in
  101. 2.1[1-9].* ) ;;
  102. * ) cc=`%{l_shtool} path -p/bin:/usr/bin:$PATH cc`; cflags="-O" ;;
  103. esac
  104. ;;
  105. esac
  106. # configure the Perl package
  107. ./Configure \
  108. -d -e -s \
  109. -Dprefix=%{l_prefix} \
  110. -Dinstallprefix=$RPM_BUILD_ROOT%{l_prefix} \
  111. -Dcc="$cc" -Doptimize="$cflags" \
  112. -Dlocincpth="%{l_prefix}/include" \
  113. -Dldflags="-L%{l_prefix}/lib" \
  114. -Dlibpth="%{l_prefix}/lib /lib /usr/lib /usr/ccs/lib" \
  115. -Uinstallusrbinperl \
  116. -Ui_db
  117. # build the Perl package
  118. %{l_make} %{l_mflags -O} -f Makefile
  119. %install
  120. rm -rf $RPM_BUILD_ROOT
  121. # install the Perl package via standard procedure
  122. %{l_make} %{l_mflags} -f Makefile install
  123. # post-adjustments to installation tree
  124. rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/perl%{version}
  125. # re-adjust configuration for installation of modules
  126. $RPM_BUILD_ROOT%{l_prefix}/bin/perl \
  127. -pi.orig \
  128. -e "s:([\"'])%{l_prefix}/lib:\$1$RPM_BUILD_ROOT%{l_prefix}/lib:g;" \
  129. -e "s:([\"'])%{l_prefix}([\"']):\$1$RPM_BUILD_ROOT%{l_prefix}\$2:g;" \
  130. $RPM_BUILD_ROOT%{l_prefix}/lib/perl5/%{version}/*/Config.pm
  131. # create a wrapper script which finds the includes
  132. eval `grep "^archname=" $RPM_BUILD_ROOT%{l_prefix}/lib/perl5/%{version}/*/Config.pm`
  133. perl=$RPM_BUILD_ROOT/perl
  134. echo "#!/bin/sh" >$perl
  135. echo "exec $RPM_BUILD_ROOT%{l_prefix}/bin/perl \\" >>$perl
  136. echo " -I$RPM_BUILD_ROOT%{l_prefix}/lib/perl5/%{version} \\" >>$perl
  137. echo " -I$RPM_BUILD_ROOT%{l_prefix}/lib/perl5/%{version}/${archname} \\" >>$perl
  138. echo " -I$RPM_BUILD_ROOT%{l_prefix}/lib/perl5/site_perl \\" >>$perl
  139. echo " -I$RPM_BUILD_ROOT%{l_prefix}/lib/perl5/site_perl/%{version} \\" >>$perl
  140. echo " -I$RPM_BUILD_ROOT%{l_prefix}/lib/perl5/site_perl/%{version}/${archname} \\" >>$perl
  141. echo " \"\$@\"" >>$perl
  142. chmod a+x $perl
  143. # add additional third-party modules
  144. rm -rf $RPM_BUILD_DIR/%{name}-%{version}-modules
  145. mkdir $RPM_BUILD_DIR/%{name}-%{version}-modules
  146. cd $RPM_BUILD_DIR/%{name}-%{version}-modules
  147. for mod in \
  148. CGI.pm-3.02.tar.gz \
  149. Bit-Vector-6.1.tar.gz \
  150. Set-Scalar-1.16.tar.gz \
  151. TimeDate-1.10.tar.gz \
  152. DateManip-5.40.tar.gz \
  153. Config-IniFiles-2.21.tar.gz \
  154. Parse-RecDescent-1.80.tar.gz \
  155. Net-Daemon-0.36.tar.gz \
  156. Net-Server-0.81.tar.gz \
  157. Net-ext-0.932.tar.gz \
  158. libnet-1.0704.tar.gz \
  159. Syslog-0.96.tar.gz \
  160. Time-HiRes-01.20.tar.gz \
  161. Digest-MD5-2.16.tar.gz \
  162. HTML-Parser-3.25.tar.gz \
  163. URI-1.17.tar.gz \
  164. MIME-tools-5.411.tar.gz \
  165. MIME-Base64-2.12.tar.gz \
  166. libwww-perl-5.62.tar.gz \
  167. Image-Info-1.08.tar.gz \
  168. Image-Size-2.96.tar.gz \
  169. Alias-2.32.tar.gz \
  170. Archive-Tar-0.22.tar.gz \
  171. Expect-1.12.tar.gz \
  172. IPC-Shareable-0.60.tar.gz \
  173. Inline-0.43.tar.gz \
  174. Mail-Sendmail-0.78.tar.gz \
  175. MailTools-1.41.tar.gz \
  176. Date-Calc-5.0.tar.gz \
  177. File-Tail-0.98.tar.gz \
  178. Net-Netmask-1.9002.tar.gz; \
  179. do
  180. %{l_gzip} -dc $RPM_SOURCE_DIR/$mod | %{l_tar} xf -
  181. dir=`echo "$mod" | sed -e 's;\.tar\.gz$;;'`
  182. cd $dir
  183. chmod -R u+rw .
  184. cp Makefile.PL Makefile.PL.orig
  185. sed -e "s:\$^X:'$perl':g" <Makefile.PL.orig >Makefile.PL
  186. $perl Makefile.PL PREFIX="$RPM_BUILD_ROOT%{l_prefix}" PERL=$perl FULLPERL=$perl </dev/null
  187. %{l_make} %{l_mflags} PERL=$perl FULLPERL=$perl all
  188. %{l_make} %{l_mflags} PERL=$perl FULLPERL=$perl install
  189. cd ..
  190. done
  191. cd $RPM_BUILD_DIR
  192. # re-adjust configuration as mentioned in Perl's INSTALL document
  193. $perl -pi.orig -e "s:$RPM_BUILD_ROOT%{l_prefix}:%{l_prefix}:g" \
  194. $RPM_BUILD_ROOT%{l_prefix}/lib/perl5/%{version}/*/Config.pm \
  195. `find $RPM_BUILD_ROOT%{l_prefix}/lib/perl5/%{version}/ -type f -name ".packlist" -print`
  196. find $RPM_BUILD_ROOT%{l_prefix}/lib/perl5/ -name "*.orig" -print | xargs rm -f
  197. # strip binary files
  198. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* 2> /dev/null || true
  199. # determine installed files
  200. %{l_rpmtool} files -v -o$RPM_BUILD_DIR/perl-%{version}/files -r$RPM_BUILD_ROOT %{l_files_std}
  201. %files -f files
  202. %clean
  203. rm -rf $RPM_BUILD_ROOT
  204. rm -rf $RPM_BUILD_DIR/%{name}-%{version}-modules