perl-gd.spec 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. ##
  2. ## perl-gd.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. # versions of individual parts
  26. %define V_gd 1.40
  27. %define V_gdtextutil 0.83
  28. %define V_gdbarcode 1.13
  29. %define V_gdgraph 1.35
  30. %define V_gdgraph3d 0.56
  31. %define V_gdgraphmap 1.05
  32. %define V_chart 1.0.1
  33. %define V_chartthreed 0.01
  34. %define V_chartplot 0.11
  35. %define V_imagetimeline 0.05
  36. # package information
  37. Name: perl-gd
  38. Summary: Perl Modules for use with GD
  39. URL: http://www.cpan.org/
  40. Vendor: Perl Community
  41. Packager: The OpenPKG Project
  42. Distribution: OpenPKG [REL]
  43. Group: Language
  44. License: GPL/Artistic
  45. Version: 20020621
  46. Release: 20020621
  47. # list of sources
  48. Source0: http://www.cpan.org/modules/by-module/GD/GD-%{V_gd}.tar.gz
  49. Source1: http://www.cpan.org/modules/by-module/GD/GDTextUtil-%{V_gdtextutil}.tar.gz
  50. Source2: http://www.cpan.org/modules/by-module/GD/GD-Barcode-%{V_gdbarcode}.tar.gz
  51. Source3: http://www.cpan.org/modules/by-module/GD/GDGraph-%{V_gdgraph}.tar.gz
  52. Source4: http://www.cpan.org/modules/by-module/GD/GDGraph3d-%{V_gdgraph3d}.tar.gz
  53. Source5: http://www.cpan.org/modules/by-module/GD/GDGraph-Map-%{V_gdgraphmap}.tgz
  54. Source6: http://www.cpan.org/modules/by-module/Chart/Chart-%{V_chart}.tar.gz
  55. Source7: http://www.cpan.org/modules/by-module/Chart/Chart-ThreeD-%{V_chartthreed}.tar.gz
  56. Source8: http://www.cpan.org/modules/by-module/Chart/Chart-Plot-%{V_chartplot}.tar.gz
  57. Source9: http://www.cpan.org/modules/by-module/Image/Image-Timeline-%{V_imagetimeline}.tar.gz
  58. # build information
  59. Prefix: %{l_prefix}
  60. BuildRoot: %{l_buildroot}
  61. BuildPreReq: OpenPKG, openpkg >= 20020206, perl, gd
  62. PreReq: OpenPKG, openpkg >= 20020206, perl, gd
  63. AutoReq: no
  64. AutoReqProv: no
  65. %description
  66. Various modules for using the GD library from within the Perl
  67. language plus additional functionality for drawing various types of
  68. charts and graphs.
  69. - GD (%{V_gd})
  70. - GD::TextUtil (%{V_gdtextutil})
  71. - GD::Barcode (%{V_gdbarcode})
  72. - GD::Graph (%{V_gdgraph})
  73. - GD::Graph::3d (%{V_gdgraph3d})
  74. - GD::Graph::Map (%{V_gdgraphmap})
  75. - Chart (%{V_chart})
  76. - Chart::ThreeD (%{V_chartthreed})
  77. - Chart::Plot (%{V_chartplot})
  78. - Image::Timeline (%{V_imagetimeline})
  79. %prep
  80. %setup0 -q -c -n %{name}-%{version}
  81. %setup1 -q -T -D -a 1
  82. %setup2 -q -T -D -a 2
  83. %setup3 -q -T -D -a 3
  84. %setup4 -q -T -D -a 4
  85. %setup5 -q -T -D -a 5
  86. %setup6 -q -T -D -a 6
  87. %setup7 -q -T -D -a 7
  88. %setup8 -q -T -D -a 8
  89. %setup9 -q -T -D -a 9
  90. %build
  91. %install
  92. rm -rf $RPM_BUILD_ROOT
  93. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/lib/perl5
  94. # create a wrapper script which finds the includes
  95. eval `%{l_prefix}/bin/perl -V:version -V:archname`
  96. perl=$RPM_BUILD_ROOT/perl
  97. echo "#!/bin/sh" >$perl
  98. echo "exec %{l_prefix}/bin/perl \\" >>$perl
  99. echo " -I$RPM_BUILD_ROOT%{l_prefix}/lib/perl5/${version} \\" >>$perl
  100. echo " -I$RPM_BUILD_ROOT%{l_prefix}/lib/perl5/${version}/${archname} \\" >>$perl
  101. echo " -I$RPM_BUILD_ROOT%{l_prefix}/lib/perl5/site_perl \\" >>$perl
  102. echo " -I$RPM_BUILD_ROOT%{l_prefix}/lib/perl5/site_perl/${version} \\" >>$perl
  103. echo " -I$RPM_BUILD_ROOT%{l_prefix}/lib/perl5/site_perl/${version}/${archname} \\" >>$perl
  104. echo " \"\$@\"" >>$perl
  105. chmod a+x $perl
  106. # determine general tools and arguments
  107. perlargs="PREFIX=$RPM_BUILD_ROOT%{l_prefix} PERL=$perl FULLPERL=$perl"
  108. make="%{l_make} %{l_mflags}"
  109. makeargs="PERL=$perl FULLPERL=$perl"
  110. # make sure our Perl is used
  111. %{l_shtool} subst \
  112. -e "s:\$^X:'$perl':g" \
  113. `find . -name Makefile.PL -print`
  114. # build and install GD glue module
  115. ( cd GD-%{V_gd}
  116. (echo "y"; echo "y") |\
  117. GD_INC="-I%{l_prefix}/include/freetype2 -I%{l_prefix}/include" \
  118. GD_LIBS="-L%{l_prefix}/lib -lfreetype" \
  119. $perl Makefile.PL $perlargs
  120. $make $makeargs all
  121. $make $makeargs install
  122. )
  123. # build add-on modules
  124. for module in \
  125. GDTextUtil-%{V_gdtextutil} \
  126. GD-Barcode-%{V_gdbarcode} \
  127. GDGraph-%{V_gdgraph} \
  128. GDGraph3d-%{V_gdgraph3d} \
  129. GDGraph-Map-%{V_gdgraphmap} \
  130. Chart-%{V_chart} \
  131. Chart-ThreeD-%{V_chartthreed} \
  132. Chart-Plot-%{V_chartplot} \
  133. Image-Timeline-%{V_imagetimeline} \
  134. ; do
  135. cd $module
  136. $perl Makefile.PL $perlargs
  137. $make $makeargs all
  138. $make $makeargs install
  139. cd ..
  140. done
  141. # strip down installation tree
  142. find $RPM_BUILD_ROOT%{l_prefix} -name perllocal.pod -print | xargs rm -f
  143. find $RPM_BUILD_ROOT%{l_prefix} -name .packlist -print | xargs rm -f
  144. find $RPM_BUILD_ROOT%{l_prefix} -type d -depth -print | (xargs rmdir >/dev/null 2>&1 || true)
  145. # determine installed files
  146. eval `$perl -V:installarchlib -V:installprivlib -V:installsitearch -V:installsitelib`
  147. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  148. %{l_files_std} \
  149. '%not %dir %{l_prefix}/lib/perl5' \
  150. '%not %dir %{l_prefix}/lib/perl5/*' \
  151. "%not %dir $installarchlib" \
  152. "%not %dir $installprivlib" \
  153. "%not %dir $installsitearch" \
  154. "%not %dir $installsitelib" \
  155. "%not %dir $installarchlib/auto" \
  156. "%not %dir $installprivlib/auto" \
  157. "%not %dir $installsitearch/auto" \
  158. "%not %dir $installsitelib/auto"
  159. %files -f files
  160. %clean
  161. rm -rf $RPM_BUILD_ROOT