gd-perl.spec 6.4 KB

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