imagemagick.spec 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  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.2
  27. %define V_minor 0
  28. %define V_dist1 %{V_major}
  29. %define V_dist2 %{V_major}-%{V_minor}
  30. %define V_dist %{V_dist1}
  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: 20040606
  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. %{l_shtool} subst \
  92. -e 's; && !defined(HAVE_STRLCPY_PROTOTYPE);;g' \
  93. -e 's; && !defined(HAVE_VSNPRINTF_PROTOTYPE);;g' \
  94. -e 's;^#if \(defined(HAVE_STRLCPY)\);#if !\1;g' \
  95. -e 's;^#if \(defined(HAVE_VSNPRINTF)\);#if !\1;g' \
  96. magick/studio.h
  97. %build
  98. CC="%{l_cc}" \
  99. CXX="%{l_cxx}" \
  100. CFLAGS="%{l_cflags -O} %{l_cppflags tiff}" \
  101. CPPFLAGS="%{l_cppflags tiff}" \
  102. CXXFLAGS="%{l_cxxflags -O}" \
  103. LDFLAGS="%{l_ldflags}" \
  104. LIBS="-liconv" \
  105. ./configure \
  106. --prefix=%{l_prefix} \
  107. --without-magick-plus-plus \
  108. --without-modules \
  109. --disable-shared \
  110. --enable-lzw \
  111. --with-zlib \
  112. --with-bzlib \
  113. --with-tiff \
  114. --with-jpeg \
  115. --with-jp2 \
  116. --with-png \
  117. --with-ttf \
  118. --with-xml \
  119. --with-lcms \
  120. --without-perl \
  121. %if "%{with_x11}" == "yes"
  122. --with-x \
  123. --x-includes=`%{l_prefix}/etc/rc --query x11_incdir` \
  124. --x-libraries=`%{l_prefix}/etc/rc --query x11_libdir` \
  125. --without-dps \
  126. %else
  127. --without-x \
  128. %endif
  129. --without-threads
  130. %{l_make} %{l_mflags}
  131. %if "%{with_perl}" == "yes"
  132. %{l_prefix}/bin/perl-openpkg prepare
  133. %{l_prefix}/bin/perl-openpkg -d PerlMagick configure build
  134. %endif
  135. %install
  136. rm -rf $RPM_BUILD_ROOT
  137. %{l_make} %{l_mflags} install \
  138. AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
  139. %if "%{with_perl}" == "yes"
  140. %{l_prefix}/bin/perl-openpkg -d PerlMagick install
  141. %{l_prefix}/bin/perl-openpkg -F perl-openpkg-files fixate cleanup
  142. %else
  143. >perl-openpkg-files
  144. %endif
  145. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* 2>/dev/null || true
  146. ( cd $RPM_BUILD_ROOT%{l_prefix} || exit 1
  147. rm -f bin/cgimagick
  148. rm -f bin/iptcutil
  149. rm -f man/man4/miff.4
  150. rm -rf share/ImageMagick-%{V_major}/www
  151. rm -f share/ImageMagick-%{V_major}/[A-Z]*
  152. rm -f share/ImageMagick-%{V_major}/*.txt
  153. rm -f share/ImageMagick-%{V_major}/*.html
  154. rm -rf share/ImageMagick-%{V_major}/images
  155. rmdir share/ImageMagick* >/dev/null 2>&1 || true
  156. rm -f lib/libMagick.la
  157. ) || exit $?
  158. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  159. %{l_files_std} `cat perl-openpkg-files` \
  160. "%not %dir %{l_prefix}/lib/pkgconfig"
  161. %files -f files
  162. %clean
  163. rm -rf $RPM_BUILD_ROOT