All page names need to be in English.
en da  de  fr  it  ja  km  nl  ru  zh

How to build GraphicsMagick RPM package

From TYPO3Wiki
Jump to: navigation, search

How to build GraphicsMagick RPM package (--enable-magick-compat)

This is help for a RedHat-Linux-Server and is an installation-help for GraphicsMagick/ImageMagick.

Making workspace directories

$ cd
$ mkdir RPM
$ cd RPM
$ mkdir BUILD
$ mkdir -p RPMS/i386
$ mkdir -p RPMS/noarch
$ mkdir SOURCES
$ mkdir SPECS
$ mkdir SRPMS

Making a configuration file for rpm macros to specify the workspace directories

$ echo "%_topdir /home/(user name for working)/RPM" > ~/.rpmmacros

Downloading and extracting a source package

wget -P ~/RPM/SOURCES/
rpm -ihv  ~/RPM/SOURCES/GraphicsMagick-1.1.7-1.src.rpm

(This makes the file GraphicsMagick-1.1.7.tar.bz2 in the directory ~/RPM/SOURCES.)

Modifying the spec file

(When you use this code indeed, you need to remove those comments on the right. Spec file does not support such a way to comment.)

%{!?quant:%define quant 16}						# Chage 8 to 16 if you want higher quality.
%configure --enable-shared --disable-static \
	--with-modules --enable-lzw \
	--with-frozenpaths --enable-magick-compat \			# Add --enable-magick-compat
# Remove unpackaged files.
%if %{perlm}
rm -f `find $RPM_BUILD_ROOT%{_libdir}/perl*/ -name perllocal.pod -type f`
rm -f `find $RPM_BUILD_ROOT%{_libdir}/perl*/ -name .packlist -type f`
rm -f `find $RPM_BUILD_ROOT%{_bindir}/ -type l`				# Add this line to remove the unnecessary symbolic links.
%defattr(644, root, root, 755)
%doc ChangeLog Copyright.txt README.txt NEWS
%doc %{_datadir}/%{name}-%{base_version}
%dir %{_libdir}/%{name}-%{base_version}
%dir %{_libdir}/%{name}-%{base_version}/modules-Q%{quant}
%{_libdir}/%{name}-%{base_version}/modules-Q%{quant}/*/*.la		# Immigrate this line from the devel package.
%attr(755, root, root) %{_bindir}/gm
%attr(644, root, man) %{_mandir}/man1/gm.1.gz
%attr(644, root, man) %{_mandir}/man4/*gz
%attr(644, root, man) %{_mandir}/man5/*gz
%files devel
%defattr(644, root, root, 755)
%dir %{_includedir}/%{name}/wand
%dir %{_includedir}/%{name}/magick
%{_libdir}/lib%{name}						# Add the missing line.
# %%dir %%{_libdir}/%%{name}-%%{base_version}/modules-Q%%{quant}	# Remove this line for the directory to be empty.
# %%{_libdir}/%%{name}-%%{base_version}/modules-Q%%{quant}/*/*.la	# Emmigrate this line to the normal package.
# %%{_bindir}/%%{name}-config						# Remove this line for the redundancy.
%attr(755, root, root) %{_bindir}/%{name}-config
# %%{_bindir}/%%{name}Wand-config					# Remove this line for the redundancy.
%attr(755, root, root) %{_bindir}/%{name}Wand-config
%attr(644, root, man) %{_mandir}/man1/%{name}-config.1.gz
%attr(644, root, man) %{_mandir}/man1/%{name}Wand-config.1.gz
# %%{_bindir}/%%{name}++-config						# Remove this line for the redundancy.

Building the rpm package

rpmbuild -bb ~/RPM/SPECS/GraphicsMagick.spec

Installing the package

Chage to "root" user and

rpm -ihv /home/(user name for working)/RPM/RPMS/i386/GraphicsMagick-1.1.7-1.i386.rpm
(Or rpm -ihv /home/(user name for working)/RPM/RPMS/i386/GraphicsMagick*)

Excluding the package of automatic yum update

vi /etc/yum.conf
(Or exclude=GraphicsMagick*)