imagemagick.spec 5.9 KB

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