imagemagick.spec 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  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 options
  26. %option with_perl %{l_test -p perl}
  27. %option with_x11 %{l_test -p x11}
  28. # package version
  29. %define V_major 5.5.3
  30. %define V_minor 1
  31. %if "%{V_minor}" == "0"
  32. %define V_dist %{V_major}
  33. %else
  34. %define V_dist %{V_major}-%{V_minor}
  35. %endif
  36. # package information
  37. Name: imagemagick
  38. Summary: Graphic Image Conversion Tool
  39. URL: http://www.imagemagick.org/
  40. Vendor: John Cristy
  41. Packager: The OpenPKG Project
  42. Distribution: OpenPKG [BASE]
  43. Group: Graphics
  44. License: GPL
  45. Version: %{V_major}.%{V_minor}
  46. Release: 20021230
  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 >= 20021230, make, gcc, tiff, jpeg, bzip2, zlib, png, freetype
  53. PreReq: OpenPKG, openpkg >= 20021230
  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. %options
  75. %prep
  76. %setup -q -n ImageMagick-%{V_major}
  77. %{l_shtool} subst \
  78. -e 's/\([ ]*tagnames=.*echo.*tagnames,[FC][7X][7X].*\)/ if [ ".$tagnames" = . ]; then \1; fi/' \
  79. -e 's/\/magick -lMagick/\/magick\/.libs -lMagick/' \
  80. -e 's/^\(MagickLibSubdir="\)[^"]*\("\)/\1imagemagick\2/' \
  81. configure
  82. %build
  83. CC="%{l_cc}" \
  84. CXX="%{l_cxx}" \
  85. CFLAGS="%{l_cflags -O} %{l_cppflags tiff}" \
  86. CPPFLAGS="%{l_cppflags tiff}" \
  87. CXXFLAGS="%{l_cxxflags -O}" \
  88. LDFLAGS="%{l_ldflags}" \
  89. ./configure \
  90. --prefix=%{l_prefix} \
  91. --without-magick-plus-plus \
  92. --enable-lzw \
  93. --with-tiff \
  94. --with-jpeg \
  95. --with-png \
  96. --without-perl \
  97. %if "%{with_x11}" == "yes"
  98. --with-x \
  99. --x-includes=`%{l_prefix}/etc/rc --query x11_incdir` \
  100. --x-libraries=`%{l_prefix}/etc/rc --query x11_libdir` \
  101. %else
  102. --without-x \
  103. %endif
  104. --without-threads
  105. %{l_make} %{l_mflags}
  106. %install
  107. rm -rf $RPM_BUILD_ROOT
  108. %{l_make} %{l_mflags} install \
  109. AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
  110. %if "%{with_perl}" == "yes"
  111. ( cd PerlMagick
  112. %{l_shtool} mkdir -f -p -m 755 \
  113. $RPM_BUILD_ROOT%{l_prefix}/lib/perl
  114. %{l_shtool} subst \
  115. -e "s;-L%{l_prefix}/lib;-L$RPM_BUILD_ROOT%{l_prefix}/lib;g" \
  116. -e "s;-I%{l_prefix}/include;-I$RPM_BUILD_ROOT%{l_prefix}/include;g" \
  117. Makefile.PL
  118. %{l_prefix}/bin/perl Makefile.PL \
  119. PREFIX=$RPM_BUILD_ROOT%{l_prefix} \
  120. PERL=%{l_prefix}/bin/perl \
  121. FULLPERL=%{l_prefix}/bin/perl
  122. %{l_make} %{l_mflags}
  123. %{l_make} %{l_mflags} install
  124. )
  125. %endif
  126. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* 2> /dev/null || true
  127. ( cd $RPM_BUILD_ROOT%{l_prefix} || exit 1
  128. rm -f bin/cgimagick
  129. rm -f bin/iptcutil
  130. rm -f man/man4/miff.4
  131. rm -rf share/ImageMagick/www
  132. rm -f share/ImageMagick/*.txt
  133. rm -f share/ImageMagick/*.html
  134. rm -rf share/ImageMagick/images
  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