imagemagick.spec 5.8 KB

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