imagemagick.spec 5.3 KB

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