imagemagick.spec 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. ##
  2. ## imagemagick.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2017 OpenPKG Foundation e.V. <http://openpkg.net/>
  4. ##
  5. ## Permission to use, copy, modify, and distribute this software for
  6. ## any purpose with or without fee is hereby granted, provided that
  7. ## the above copyright notice and this permission notice appear in all
  8. ## copies.
  9. ##
  10. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  11. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  12. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  13. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  14. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  15. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  16. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  17. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  18. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  19. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  20. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  21. ## SUCH DAMAGE.
  22. ##
  23. # package version
  24. %define V_major 7.0.5
  25. %define V_minor 1
  26. %define V_dist %{V_major}-%{V_minor}
  27. %define V_opkg %{V_major}.%{V_minor}
  28. # package information
  29. Name: imagemagick
  30. Summary: Graphic Image Conversion Tool
  31. URL: http://www.imagemagick.org/
  32. Vendor: John Cristy
  33. Packager: OpenPKG Foundation e.V.
  34. Distribution: OpenPKG Community
  35. Class: BASE
  36. Group: Graphics
  37. License: ImageMagick
  38. Version: %{V_opkg}
  39. Release: 20170305
  40. # package options
  41. %option with_perl no
  42. # list of sources
  43. Source0: ftp://ftp.imagemagick.org/pub/ImageMagick/ImageMagick-%{V_dist}.tar.bz2
  44. Patch0: imagemagick.patch
  45. # build information
  46. BuildPreReq: OpenPKG, openpkg >= 20160101, make, gcc, grep, sed
  47. PreReq: OpenPKG, openpkg >= 20160101
  48. BuildPreReq: tiff, jpeg, jasper, bzip2, zlib, png, freetype, fontconfig, lcms, liblqr, libxml, libiconv
  49. PreReq: tiff, jpeg, jasper, bzip2, zlib, png, freetype, fontconfig, lcms, liblqr, libxml, libiconv
  50. %if "%{with_perl}" == "yes"
  51. BuildPreReq: perl, perl-openpkg
  52. PreReq: perl
  53. %endif
  54. %description
  55. ImageMagick is a robust collection of tools and libraries to read,
  56. write, and manipulate an image in many image formats (over 68 major
  57. formats) including popular formats like TIFF, JPEG, PNG, PDF, Photo
  58. CD, and GIF. With ImageMagick you can create images dynamically,
  59. making it suitable for Web applications. You can also resize,
  60. rotate, sharpen, color reduce, or add special effects to an image
  61. and save your completed work in the same or differing image format.
  62. Image processing operations are available from the command line, as
  63. well as through C, C++, and PERL-based programming interfaces.
  64. %track
  65. prog imagemagick = {
  66. version = %{V_dist}
  67. url = ftp://ftp.imagemagick.org/pub/ImageMagick/
  68. regex = ImageMagick-(\d+\.\d+\.\d+(-\d+)?)\.tar\.bz2
  69. }
  70. %prep
  71. %setup -q -n ImageMagick-%{V_dist}
  72. %patch -p0
  73. %build
  74. %{l_shtool} subst \
  75. -e 's/^\(MagickLibSubdir="\)[^"]*\("\)/\1imagemagick\2/' \
  76. -e 's/\(-lxml2\)/\1 -liconv/' \
  77. configure
  78. %{l_shtool} subst \
  79. -e "s;\\(-lMagickCore\\);\\1 `pkg-config fontconfig --libs`;" \
  80. PerlMagick/Makefile.PL.in
  81. cppflags=""
  82. case "%{l_platform -t}" in
  83. amd64-* ) cppflags="-DPNG_NO_ASSEMBLER_CODE" ;;
  84. esac
  85. CC="%{l_cc}" \
  86. CXX="%{l_cxx}" \
  87. CFLAGS="%{l_cflags -O} %{l_cppflags tiff}" \
  88. CPPFLAGS="%{l_cppflags tiff} $cppflags" \
  89. CXXFLAGS="%{l_cxxflags -O}" \
  90. LDFLAGS="%{l_ldflags}" \
  91. LIBS="-liconv" \
  92. CONFIG_SHELL="%{l_bash}" \
  93. %{l_bash} ./configure \
  94. --prefix=%{l_prefix} \
  95. --mandir=%{l_prefix}/man \
  96. --without-magick-plus-plus \
  97. --without-modules \
  98. --disable-shared \
  99. --with-zlib \
  100. --with-bzlib \
  101. --with-tiff \
  102. --with-jpeg \
  103. --with-png \
  104. --with-xml \
  105. --with-lcms \
  106. --with-lqr \
  107. --with-freetype \
  108. --without-djvu \
  109. --without-fftw \
  110. --without-gvc \
  111. --without-perl \
  112. --without-x \
  113. --without-threads
  114. %{l_make} %{l_mflags}
  115. %if "%{with_perl}" == "yes"
  116. %{l_prefix}/bin/perl-openpkg prepare
  117. %{l_prefix}/bin/perl-openpkg -d PerlMagick configure build
  118. %endif
  119. %install
  120. %{l_make} %{l_mflags} install \
  121. AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
  122. %if "%{with_perl}" == "yes"
  123. %{l_prefix}/bin/perl-openpkg -d PerlMagick 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/doc >/dev/null 2>&1 || true
  134. rm -rf share/ImageMagick-* >/dev/null 2>&1 || true
  135. ) || exit $?
  136. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  137. %{l_files_std} `cat perl-openpkg-files`
  138. %files -f files
  139. %clean