imagemagick.spec 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. ##
  2. ## imagemagick.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2004 The OpenPKG Project <http://www.openpkg.org/>
  4. ## Copyright (c) 2000-2004 Ralf S. Engelschall <rse@engelschall.com>
  5. ## Copyright (c) 2000-2004 Cable & Wireless <http://www.cw.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 version
  26. %define V_major 6.0.1
  27. %define V_minor 4
  28. %define V_dist1 %{V_major}
  29. %define V_dist2 %{V_major}-%{V_minor}
  30. %define V_dist %{V_dist2}
  31. # package information
  32. Name: imagemagick
  33. Summary: Graphic Image Conversion Tool
  34. URL: http://www.imagemagick.org/
  35. Vendor: John Cristy
  36. Packager: The OpenPKG Project
  37. Distribution: OpenPKG
  38. Class: BASE
  39. Group: Graphics
  40. License: GPL
  41. Version: %{V_major}.%{V_minor}
  42. Release: 20040530
  43. # package options
  44. %option with_perl no
  45. %option with_x11 yes
  46. # list of sources
  47. Source0: ftp://ftp.imagemagick.org/pub/ImageMagick/ImageMagick-%{V_dist}.tar.gz
  48. # build information
  49. Prefix: %{l_prefix}
  50. BuildRoot: %{l_buildroot}
  51. BuildPreReq: OpenPKG, openpkg >= 20040130, make, gcc
  52. PreReq: OpenPKG, openpkg >= 20040130
  53. BuildPreReq: tiff, jpeg, jasper, bzip2, zlib, png, freetype, lcms, libxml
  54. PreReq: tiff, jpeg, jasper, bzip2, zlib, png, freetype, lcms, libxml
  55. %if "%{with_perl}" == "yes"
  56. BuildPreReq: perl
  57. PreReq: perl
  58. %endif
  59. %if "%{with_x11}" == "yes"
  60. BuildPreReq: X11
  61. PreReq: X11
  62. %endif
  63. AutoReq: no
  64. AutoReqProv: no
  65. %description
  66. ImageMagick is a robust collection of tools and libraries to read,
  67. write, and manipulate an image in many image formats (over 68 major
  68. formats) including popular formats like TIFF, JPEG, PNG, PDF, Photo
  69. CD, and GIF. With ImageMagick you can create images dynamically,
  70. making it suitable for Web applications. You can also resize,
  71. rotate, sharpen, color reduce, or add special effects to an image
  72. and save your completed work in the same or differing image format.
  73. Image processing operations are available from the command line, as
  74. well as through C, C++, and PERL-based programming interfaces.
  75. %track
  76. prog imagemagick = {
  77. version = %{V_major}-%{V_minor}
  78. url = ftp://ftp.imagemagick.org/pub/ImageMagick/
  79. regex = ImageMagick-(\d+\.\d+\.\d+(-\d+)?)\.tar\.gz
  80. }
  81. %prep
  82. %setup -q -n ImageMagick-%{V_major}
  83. %{l_shtool} subst \
  84. -e 's/\([ ]*tagnames=.*echo.*tagnames,[FC][7X][7X].*\)/ if [ ".$tagnames" = . ]; then \1; fi/' \
  85. -e 's/\/magick -lMagick/\/magick\/.libs -lMagick/' \
  86. -e 's/^\(MagickLibSubdir="\)[^"]*\("\)/\1imagemagick\2/' \
  87. configure
  88. %{l_shtool} subst \
  89. -e 's;\(-L@MAGICKLIBDIR@\);-L../magick/.libs \1;g' \
  90. PerlMagick/Makefile.PL.in
  91. %build
  92. CC="%{l_cc}" \
  93. CXX="%{l_cxx}" \
  94. CFLAGS="%{l_cflags -O} %{l_cppflags tiff}" \
  95. CPPFLAGS="%{l_cppflags tiff}" \
  96. CXXFLAGS="%{l_cxxflags -O}" \
  97. LDFLAGS="%{l_ldflags}" \
  98. LIBS="-liconv" \
  99. ./configure \
  100. --prefix=%{l_prefix} \
  101. --without-magick-plus-plus \
  102. --without-modules \
  103. --disable-shared \
  104. --enable-lzw \
  105. --with-zlib \
  106. --with-bzlib \
  107. --with-tiff \
  108. --with-jpeg \
  109. --with-jp2 \
  110. --with-png \
  111. --with-ttf \
  112. --with-xml \
  113. --with-lcms \
  114. --without-perl \
  115. %if "%{with_x11}" == "yes"
  116. --with-x \
  117. --x-includes=`%{l_prefix}/etc/rc --query x11_incdir` \
  118. --x-libraries=`%{l_prefix}/etc/rc --query x11_libdir` \
  119. --without-dps \
  120. %else
  121. --without-x \
  122. %endif
  123. --without-threads
  124. %{l_make} %{l_mflags}
  125. %if "%{with_perl}" == "yes"
  126. %{l_prefix}/bin/perl-openpkg prepare
  127. %{l_prefix}/bin/perl-openpkg -d PerlMagick configure build
  128. %endif
  129. %install
  130. rm -rf $RPM_BUILD_ROOT
  131. %{l_make} %{l_mflags} install \
  132. AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
  133. %if "%{with_perl}" == "yes"
  134. %{l_prefix}/bin/perl-openpkg -d PerlMagick install
  135. %{l_prefix}/bin/perl-openpkg -F perl-openpkg-files fixate cleanup
  136. %else
  137. >perl-openpkg-files
  138. %endif
  139. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* 2>/dev/null || true
  140. ( cd $RPM_BUILD_ROOT%{l_prefix} || exit 1
  141. rm -f bin/cgimagick
  142. rm -f bin/iptcutil
  143. rm -f man/man4/miff.4
  144. rm -rf share/ImageMagick-%{V_major}/www
  145. rm -f share/ImageMagick-%{V_major}/[A-Z]*
  146. rm -f share/ImageMagick-%{V_major}/*.txt
  147. rm -f share/ImageMagick-%{V_major}/*.html
  148. rm -rf share/ImageMagick-%{V_major}/images
  149. rmdir share/ImageMagick* >/dev/null 2>&1 || true
  150. rm -f lib/libMagick.la
  151. ) || exit $?
  152. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  153. %{l_files_std} `cat perl-openpkg-files` \
  154. "%not %dir %{l_prefix}/lib/pkgconfig"
  155. %files -f files
  156. %clean
  157. rm -rf $RPM_BUILD_ROOT