imagemagick.spec 5.9 KB

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