perl-gd.spec 6.5 KB

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