imagemagick.spec 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. ##
  2. ## imagemagick.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2021 OpenPKG Project <http://openpkg.org/>
  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.1.0
  25. %define V_minor 14
  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 Project
  34. Distribution: OpenPKG Community
  35. Class: BASE
  36. Group: Graphics
  37. License: ImageMagick
  38. Version: %{V_opkg}
  39. Release: 20211115
  40. # package options
  41. %option with_perl no
  42. # list of sources
  43. Source0: https://download.imagemagick.org/ImageMagick/download/ImageMagick-%{V_dist}.tar.gz
  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, flif, webp, freetype, fontconfig, lcms, liblqr, libxml, libiconv
  49. PreReq: tiff, jpeg, jasper, bzip2, zlib, png, flif, webp, 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 = https://imagemagick.org/script/download.php
  68. regex = ImageMagick-(\d+\.\d+\.\d+-\d+)
  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. %{l_shtool} subst \
  82. -e 's;#!/usr/bin/sh;#!/bin/sh;' \
  83. config/ar-lib \
  84. config/compile \
  85. config/config.guess \
  86. config/config.sub \
  87. config/depcomp \
  88. config/install-sh \
  89. config/missing \
  90. config/mkinstalldirs \
  91. config/tap-driver.sh \
  92. config/test-driver
  93. cppflags=""
  94. case "%{l_platform -t}" in
  95. amd64-* ) cppflags="-DPNG_NO_ASSEMBLER_CODE" ;;
  96. esac
  97. CC="%{l_cc} -pthread" \
  98. CXX="%{l_cxx} -pthread" \
  99. CFLAGS="%{l_cflags -O} %{l_cppflags tiff}" \
  100. CPPFLAGS="%{l_cppflags tiff} $cppflags" \
  101. CXXFLAGS="%{l_cxxflags -O}" \
  102. LDFLAGS="%{l_ldflags}" \
  103. LIBS="-lz -liconv -lstdc++" \
  104. CONFIG_SHELL="%{l_bash}" \
  105. %{l_bash} ./configure \
  106. --prefix=%{l_prefix} \
  107. --mandir=%{l_prefix}/man \
  108. --without-magick-plus-plus \
  109. --without-modules \
  110. --disable-dependency-tracking \
  111. --disable-shared \
  112. --with-zlib \
  113. --with-bzlib \
  114. --with-tiff \
  115. --with-jpeg \
  116. --with-png \
  117. --with-flif \
  118. --with-webp \
  119. --with-xml \
  120. --with-lcms \
  121. --with-lqr \
  122. --with-freetype \
  123. --without-djvu \
  124. --without-fftw \
  125. --without-gvc \
  126. --without-perl \
  127. --without-x \
  128. --without-threads
  129. %{l_make} %{l_mflags}
  130. %if "%{with_perl}" == "yes"
  131. %{l_prefix}/bin/perl-openpkg prepare
  132. %{l_prefix}/bin/perl-openpkg -d PerlMagick configure build
  133. %endif
  134. %install
  135. %{l_make} %{l_mflags} install \
  136. AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
  137. %if "%{with_perl}" == "yes"
  138. %{l_prefix}/bin/perl-openpkg -d PerlMagick install
  139. %{l_prefix}/bin/perl-openpkg -F perl-openpkg-files fixate cleanup
  140. %else
  141. >perl-openpkg-files
  142. %endif
  143. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* 2>/dev/null || true
  144. ( cd $RPM_BUILD_ROOT%{l_prefix} || exit 1
  145. rm -f bin/cgimagick
  146. rm -f bin/iptcutil
  147. rm -f man/man4/miff.4
  148. rm -rf share/doc >/dev/null 2>&1 || true
  149. rm -rf share/ImageMagick-* >/dev/null 2>&1 || true
  150. ) || exit $?
  151. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  152. %{l_files_std} `cat perl-openpkg-files`
  153. %files -f files
  154. %clean