blob: 3ff19a310b05cbc840f1aecad79c39281c976a75 [file] [log] [blame]
cristy0b55dd32010-06-13 19:04:44 +00001%global VERSION @PACKAGE_VERSION@
cristy496c0902013-02-26 12:57:44 +00002%global MAJOR_VERSION @MAGICK_MAJOR_VERSION@
cristy0b55dd32010-06-13 19:04:44 +00003%global Patchlevel @PACKAGE_RELEASE@
cristy3ed852e2009-09-05 21:47:34 +00004
cristy32e78242012-03-06 02:42:46 +00005Name: @PACKAGE_NAME@
cristy7593c402012-04-08 02:03:24 +00006Version: %{VERSION}
7Release: %{Patchlevel}
cristy32e78242012-03-06 02:42:46 +00008Summary: Use ImageMagick to convert, edit, or compose bitmap images in a variety of formats. In addition resize, rotate, shear, distort and transform images.
9Group: Applications/Multimedia
10License: http://www.imagemagick.org/script/license.php
11Url: http://www.imagemagick.org/
12Source0: http://www.imagemagick.org/download/%{name}/%{name}-%{VERSION}-%{Patchlevel}.tar.bz2
cristy3ed852e2009-09-05 21:47:34 +000013
cristy32e78242012-03-06 02:42:46 +000014BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
15BuildRequires: bzip2-devel, freetype-devel, libjpeg-devel, libpng-devel
16BuildRequires: libtiff-devel, giflib-devel, zlib-devel, perl-devel >= 5.8.1
17BuildRequires: ghostscript-devel, djvulibre-devel
18BuildRequires: libwmf-devel, jasper-devel, libtool-ltdl-devel
19BuildRequires: libX11-devel, libXext-devel, libXt-devel
20BuildRequires: lcms-devel, libxml2-devel, librsvg2-devel, OpenEXR-devel
cristy3ed852e2009-09-05 21:47:34 +000021
22%description
cristy32e78242012-03-06 02:42:46 +000023ImageMagick is a software suite to create, edit, and compose bitmap images. It
24can read, convert and write images in a variety of formats (about 100)
25including DPX, GIF, JPEG, JPEG-2000, PDF, PhotoCD, PNG, Postscript, SVG,
26and TIFF. Use ImageMagick to translate, flip, mirror, rotate, scale, shear
27and transform images, adjust image colors, apply various special effects,
28or draw text, lines, polygons, ellipses and Bézier curves.
cristy3ed852e2009-09-05 21:47:34 +000029
cristy32e78242012-03-06 02:42:46 +000030The functionality of ImageMagick is typically utilized from the command line
31or you can use the features from programs written in your favorite programming
32language. Choose from these interfaces: G2F (Ada), MagickCore (C), MagickWand
33(C), ChMagick (Ch), Magick++ (C++), JMagick (Java), L-Magick (Lisp), nMagick
34(Neko/haXe), PascalMagick (Pascal), PerlMagick (Perl), MagickWand for PHP
35(PHP), PythonMagick (Python), RMagick (Ruby), or TclMagick (Tcl/TK). With a
36language interface, use ImageMagick to modify or create images automagically
37and dynamically.
38
39ImageMagick is free software delivered as a ready-to-run binary distribution
40or as source code that you may freely use, copy, modify, and distribute in
41both open and proprietary applications. It is distributed under an Apache
422.0-style license, approved by the OSI.
43
44The ImageMagick development process ensures a stable API and ABI. Before
45each ImageMagick release, we perform a comprehensive security assessment that
46includes memory and thread error detection to help prevent exploits.ImageMagick
47is free software delivered as a ready-to-run binary distribution or as source
48code that you may freely use, copy, modify, and distribute in both open and
49proprietary applications. It is distributed under an Apache 2.0-style license,
50approved by the OSI.
cristy8ae77f52011-02-26 15:20:00 +000051
cristy4a478472010-06-05 01:59:10 +000052
cristy3ed852e2009-09-05 21:47:34 +000053%package devel
cristy32e78242012-03-06 02:42:46 +000054Summary: Library links and header files for ImageMagick application development
cristy3ed852e2009-09-05 21:47:34 +000055Group: Development/Libraries
56Requires: %{name} = %{version}-%{release}
57Requires: libX11-devel, libXext-devel, libXt-devel
58Requires: ghostscript-devel
59Requires: bzip2-devel
60Requires: freetype-devel
61Requires: libtiff-devel
62Requires: libjpeg-devel
63Requires: lcms-devel
64Requires: jasper-devel
65Requires: pkgconfig
cristy72c167c2013-03-20 00:42:46 +000066Requires: %{name}-libs = %{version}-%{release}
cristy3ed852e2009-09-05 21:47:34 +000067
68%description devel
69ImageMagick-devel contains the library links and header files you'll
70need to develop ImageMagick applications. ImageMagick is an image
71manipulation program.
72
73If you want to create applications that will use ImageMagick code or
74APIs, you need to install ImageMagick-devel as well as ImageMagick.
75You do not need to install it if you just want to use ImageMagick,
76however.
77
cristy72c167c2013-03-20 00:42:46 +000078%package libs
79Summary: ImageMagick libraries to link with
80Group: Applications/Multimedia
81
82%description libs
83This packages contains a shared libraries to use within other applications.
84
cristy8ae77f52011-02-26 15:20:00 +000085%package djvu
86Summary: DjVu plugin for ImageMagick
87Group: Applications/Multimedia
88Requires: %{name} = %{version}-%{release}
89
90%description djvu
91This packages contains a plugin for ImageMagick which makes it possible to
92save and load DjvU files from ImageMagick and libMagickCore using applications.
93
94
cristy4e65ec22012-04-08 01:33:27 +000095%package doc
96Summary: ImageMagick HTML documentation
97Group: Documentation
98
cristy3ed852e2009-09-05 21:47:34 +000099%description doc
100ImageMagick documentation, this package contains usage (for the
cristy32e78242012-03-06 02:42:46 +0000101commandline tools) and API (for the libraries) documentation in HTML format.
cristy3ed852e2009-09-05 21:47:34 +0000102Note this documentation can also be found on the ImageMagick website:
cristy32e78242012-03-06 02:42:46 +0000103http://www.imagemagick.org/.
cristy8ae77f52011-02-26 15:20:00 +0000104
cristy3ed852e2009-09-05 21:47:34 +0000105
cristyaafc1922011-03-04 16:59:40 +0000106%package perl
cristy3ed852e2009-09-05 21:47:34 +0000107Summary: ImageMagick perl bindings
108Group: System Environment/Libraries
109Requires: %{name} = %{version}-%{release}
110Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
111
cristy32e78242012-03-06 02:42:46 +0000112
cristyaafc1922011-03-04 16:59:40 +0000113%description perl
cristy3ed852e2009-09-05 21:47:34 +0000114Perl bindings to ImageMagick.
115
116Install ImageMagick-perl if you want to use any perl scripts that use
117ImageMagick.
118
cristy8ae77f52011-02-26 15:20:00 +0000119
cristy3ed852e2009-09-05 21:47:34 +0000120%package c++
121Summary: ImageMagick Magick++ library (C++ bindings)
122Group: System Environment/Libraries
123Requires: %{name} = %{version}-%{release}
124
125%description c++
126This package contains the Magick++ library, a C++ binding to the ImageMagick
127graphics manipulation library.
128
129Install ImageMagick-c++ if you want to use any applications that use Magick++.
130
131
132%package c++-devel
133Summary: C++ bindings for the ImageMagick library
134Group: Development/Libraries
135Requires: %{name}-c++ = %{version}-%{release}
136Requires: %{name}-devel = %{version}-%{release}
137
138%description c++-devel
139ImageMagick-devel contains the static libraries and header files you'll
140need to develop ImageMagick applications using the Magick++ C++ bindings.
141ImageMagick is an image manipulation program.
142
143If you want to create applications that will use Magick++ code
144or APIs, you'll need to install ImageMagick-c++-devel, ImageMagick-devel and
145ImageMagick.
cristy32e78242012-03-06 02:42:46 +0000146
cristy3ed852e2009-09-05 21:47:34 +0000147You don't need to install it if you just want to use ImageMagick, or if you
148want to develop/compile applications using the ImageMagick C interface,
149however.
150
151
152%prep
153%setup -q -n %{name}-%{VERSION}-%{Patchlevel}
154sed -i 's/libltdl.la/libltdl.so/g' configure
cristye99fd5c2009-12-02 01:54:25 +0000155iconv -f ISO-8859-1 -t UTF-8 README.txt > README.txt.tmp
cristy3ed852e2009-09-05 21:47:34 +0000156touch -r README.txt README.txt.tmp
157mv README.txt.tmp README.txt
cristy32e78242012-03-06 02:42:46 +0000158# for %%doc
cristy3ed852e2009-09-05 21:47:34 +0000159mkdir Magick++/examples
160cp -p Magick++/demo/*.cpp Magick++/demo/*.miff Magick++/examples
161
162%build
163%configure --enable-shared \
164 --disable-static \
165 --with-modules \
166 --with-perl \
167 --with-x \
168 --with-threads \
169 --with-magick_plus_plus \
170 --with-gslib \
171 --with-wmf \
172 --with-lcms \
173 --with-rsvg \
174 --with-xml \
cristy72182d82012-03-19 00:37:22 +0000175 --with-perl-options="INSTALLDIRS=vendor %{?perl_prefix} CC='%__cc -L$PWD/magick/.libs' LDDLFLAGS='-shared -L$PWD/magick/.libs'" \
cristy78772dd2012-12-07 12:09:26 +0000176 --without-dps
cristy3ed852e2009-09-05 21:47:34 +0000177# Disable rpath
178sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
179sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
cristy8ae77f52011-02-26 15:20:00 +0000180# Do *NOT* use %%{?_smp_mflags}, this causes PerlMagick to be silently misbuild
cristy3ed852e2009-09-05 21:47:34 +0000181make
182
183
184%install
cristy72182d82012-03-19 00:37:22 +0000185rm -rf %{buildroot}
cristy3ed852e2009-09-05 21:47:34 +0000186
cristy72182d82012-03-19 00:37:22 +0000187make install DESTDIR=%{buildroot} INSTALL="install -p"
cristybdabdd62013-03-04 17:43:36 +0000188cp -a www/source %{buildroot}%{_datadir}/doc/%{name}-%{MAJOR_VERSION}
cristy72182d82012-03-19 00:37:22 +0000189rm %{buildroot}%{_libdir}/*.la
cristy3ed852e2009-09-05 21:47:34 +0000190
191# fix weird perl Magick.so permissions
cristy72182d82012-03-19 00:37:22 +0000192chmod 755 %{buildroot}%{perl_vendorarch}/auto/Image/Magick/Magick.so
cristy3ed852e2009-09-05 21:47:34 +0000193
194# perlmagick: fix perl path of demo files
195%{__perl} -MExtUtils::MakeMaker -e 'MY->fixin(@ARGV)' PerlMagick/demo/*.pl
196
197# perlmagick: cleanup various perl tempfiles from the build which get installed
cristy72182d82012-03-19 00:37:22 +0000198find %{buildroot} -name "*.bs" |xargs rm -f
199find %{buildroot} -name ".packlist" |xargs rm -f
200find %{buildroot} -name "perllocal.pod" |xargs rm -f
cristy3ed852e2009-09-05 21:47:34 +0000201
202# perlmagick: build files list
203echo "%defattr(-,root,root,-)" > perl-pkg-files
cristy72182d82012-03-19 00:37:22 +0000204find %{buildroot}/%{_libdir}/perl* -type f -print \
205 | sed "s@^%{buildroot}@@g" > perl-pkg-files
206find %{buildroot}%{perl_vendorarch} -type d -print \
207 | sed "s@^%{buildroot}@%dir @g" \
cristy3ed852e2009-09-05 21:47:34 +0000208 | grep -v '^%dir %{perl_vendorarch}$' \
209 | grep -v '/auto$' >> perl-pkg-files
210if [ -z perl-pkg-files ] ; then
211 echo "ERROR: EMPTY FILE LIST"
212 exit -1
213fi
214
cristy3ed852e2009-09-05 21:47:34 +0000215%clean
cristy72182d82012-03-19 00:37:22 +0000216rm -rf %{buildroot}
cristy3ed852e2009-09-05 21:47:34 +0000217
cristy72c167c2013-03-20 00:42:46 +0000218%post libs -p /sbin/ldconfig
cristy3ed852e2009-09-05 21:47:34 +0000219
220%post c++ -p /sbin/ldconfig
221
cristy72c167c2013-03-20 00:42:46 +0000222%postun libs -p /sbin/ldconfig
cristy3ed852e2009-09-05 21:47:34 +0000223
224%postun c++ -p /sbin/ldconfig
225
cristy3ed852e2009-09-05 21:47:34 +0000226%files
227%defattr(-,root,root,-)
228%doc QuickStart.txt ChangeLog Platforms.txt
229%doc README.txt LICENSE NOTICE AUTHORS.txt NEWS.txt
cristy78772dd2012-12-07 12:09:26 +0000230%{_libdir}/libMagickCore*so*
231%{_libdir}/libMagickWand*so*
cristy3ed852e2009-09-05 21:47:34 +0000232%{_bindir}/[a-z]*
cristy4e65ec22012-04-08 01:33:27 +0000233%{_libdir}/%{name}-%{VERSION}
cristybdabdd62013-03-04 17:43:36 +0000234%{_datadir}/%{name}-%{MAJOR_VERSION}
cristybcbacef2012-04-08 01:57:35 +0000235%{_mandir}/man[145]/[a-z]*
cristy3ed852e2009-09-05 21:47:34 +0000236%{_mandir}/man1/%{name}.*
cristy141b7542013-02-26 21:35:32 +0000237%exclude %{_libdir}/%{name}-%{VERSION}/modules-*/coders/djvu.*
cristybdabdd62013-03-04 17:43:36 +0000238%{_sysconfdir}/%{name}-%{MAJOR_VERSION}
cristy32e78242012-03-06 02:42:46 +0000239
cristy3ed852e2009-09-05 21:47:34 +0000240
241%files devel
242%defattr(-,root,root,-)
243%{_bindir}/MagickCore-config
cristy3ed852e2009-09-05 21:47:34 +0000244%{_bindir}/MagickWand-config
cristy78772dd2012-12-07 12:09:26 +0000245%{_libdir}/libMagickCore*so*
246%{_libdir}/libMagickWand*so*
cristycd473302012-12-10 14:32:52 +0000247%{_libdir}/pkgconfig/MagickCore*.pc
248%{_libdir}/pkgconfig/ImageMagick*.pc
249%{_libdir}/pkgconfig/MagickWand*.pc
cristybdabdd62013-03-04 17:43:36 +0000250%dir %{_includedir}/%{name}-%{MAJOR_VERSION}
251%{_includedir}/%{name}-%{MAJOR_VERSION}/MagickCore
252%{_includedir}/%{name}-%{MAJOR_VERSION}/MagickWand
cristy3ed852e2009-09-05 21:47:34 +0000253%{_mandir}/man1/MagickCore-config.*
cristy3ed852e2009-09-05 21:47:34 +0000254%{_mandir}/man1/MagickWand-config.*
255
cristy8ae77f52011-02-26 15:20:00 +0000256%files djvu
257%defattr(-,root,root,-)
cristy32e78242012-03-06 02:42:46 +0000258%{_libdir}/%{name}-%{version}/modules-Q16/coders/djvu.*
cristy8ae77f52011-02-26 15:20:00 +0000259
cristy3ed852e2009-09-05 21:47:34 +0000260%files doc
261%defattr(-,root,root,-)
cristybdabdd62013-03-04 17:43:36 +0000262%doc %{_datadir}/doc/%{name}-%{MAJOR_VERSION}
cristy8ae77f52011-02-26 15:20:00 +0000263%doc LICENSE
cristy3ed852e2009-09-05 21:47:34 +0000264
265%files c++
266%defattr(-,root,root,-)
267%doc Magick++/AUTHORS Magick++/ChangeLog Magick++/NEWS Magick++/README
268%doc www/Magick++/COPYING
cristy78772dd2012-12-07 12:09:26 +0000269%{_libdir}/libMagick++*so*
cristy3ed852e2009-09-05 21:47:34 +0000270
271%files c++-devel
272%defattr(-,root,root,-)
273%doc Magick++/examples
274%{_bindir}/Magick++-config
cristybdabdd62013-03-04 17:43:36 +0000275%{_includedir}/%{name}-%{MAJOR_VERSION}/Magick++
276%{_includedir}/%{name}-%{MAJOR_VERSION}/Magick++.h
cristy78772dd2012-12-07 12:09:26 +0000277%{_libdir}/libMagick++*so*
cristycd473302012-12-10 14:32:52 +0000278%{_libdir}/pkgconfig/Magick++*.pc
279%{_libdir}/pkgconfig/ImageMagick++*.pc
cristy3ed852e2009-09-05 21:47:34 +0000280%{_mandir}/man1/Magick++-config.*
281
282%files perl -f perl-pkg-files
283%defattr(-,root,root,-)
284%{_mandir}/man3/*
285%doc PerlMagick/demo/ PerlMagick/Changelog PerlMagick/README.txt
286
cristy32e78242012-03-06 02:42:46 +0000287
cristy3ed852e2009-09-05 21:47:34 +0000288%changelog
289* Sun May 01 2005 Cristy <cristy@mystic.es.dupont.com> 1.0-0
cristyf8d59ee2011-02-20 18:21:31 +0000290- Port of Redhat's RPM script to support ImageMagick.