imagemagick.spec 5.8 KB

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