imagemagick.spec 5.7 KB

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