[packages/fail] - added magick bcond; (try to) allow srpm build without ImageMagick inttalled - build html5 viewer

qboosh qboosh at pld-linux.org
Sat Apr 13 12:16:16 CEST 2013


commit 97165e04d481aa543877d04e153facb7691f3838
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Sat Apr 13 12:16:32 2013 +0200

    - added magick bcond; (try to) allow srpm build without ImageMagick inttalled
    - build html5 viewer

 fail.spec | 51 ++++++++++++++++++++++++++++++++++++++++++++++++---
 1 file changed, 48 insertions(+), 3 deletions(-)
---
diff --git a/fail.spec b/fail.spec
index 97907da..0117b22 100644
--- a/fail.spec
+++ b/fail.spec
@@ -1,4 +1,11 @@
-# TODO: register gnome thumbnailer in more package-friendly way (not multiple gconftool runs)
+# TODO:
+# - register gnome thumbnailer in more package-friendly way (not multiple gconftool runs)
+# - webapp config for -html5? (optional, may be used also locally)
+#
+# Conditional build:
+%bcond_without	html5	# HTML5 viewer
+%bcond_without	magick	# ImageMagick coder
+#
 Summary:	FAIL - First Atari Image Library
 Summary(pl.UTF-8):	FAIL (First Atari Image Library) - biblioteka do obrazów w formatach Atari
 Name:		fail
@@ -9,14 +16,18 @@ Group:		Applications/Graphics
 Source0:	http://downloads.sourceforge.net/fail/%{name}-%{version}.tar.gz
 # Source0-md5:	de3592b78144ef3c6b2e98377522df69
 URL:		http://fail.sourceforge.net/
-BuildRequires:	ImageMagick-devel >= 6.8
+%{?with_magick:BuildRequires:	ImageMagick-devel >= 6.8}
+%{?with_html5:BuildRequires:	asciidoc}
+%{?with_html5:BuildRequires:	cito}
 BuildRequires:	libpng-devel
 BuildRequires:	libxslt-progs
 BuildRequires:	zlib-devel
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
-%define		magick_ver	%(MagickCore-config --version)
+%if %{with magick}
+%define		magick_ver	%(MagickCore-config --version || echo ERROR)
 %define		im_coders_dir	%{_libdir}/%(MagickCore-config --version | sed -e 's,^\\([.0-9]\\+\\) \\+\\(Q[0-9]\\+\\)\\( \\+\\(HDRI\\)\\)\\?.*,ImageMagick-\\1/modules-\\2\\4,')/coders
+%endif
 
 %description
 FAIL is a viewer of pictures in native formats of Atari 8-bit, Atari
@@ -39,11 +50,24 @@ FAIL support for viewing Atari files in GNOME.
 %description gnome -l pl.UTF-8
 Wsparcie FAIL do oglądania plików z Atari w GNOME.
 
+%package html5
+Summary:	HTML5 FAIL viewer for Atari files
+Summary(pl.UTF-8):	Przeglądarka FAIL do plików z Atari w HTML5
+Group:		Applications/WWW
+
+%description html5
+HTML5 FAIL viewer for Atari files.
+
+%description html5 -l pl.UTF-8
+Przeglądarka FAIL do plików z Atari w HTML5.
+
 %package -n ImageMagick-coder-fail
 Summary:	FAIL coder for ImageMagick
 Summary(pl.UTF-8):	Koder FAIL dla ImageMagicka
 Group:		Libraries
+%if %{with magick}
 Requires:	ImageMagick >= %{magick_ver}
+%endif
 
 %description -n ImageMagick-coder-fail
 FAIL coder for ImageMagick to read Atari formats.
@@ -58,8 +82,14 @@ Koder FAIL dla ImageMagicka, czytający formaty Atari.
 %{__make} all fail-mime.xml \
 	CC="%{__cc}" \
 	CFLAGS="%{rpmcflags} -Wall" \
+%if %{with magick}
 	MAGICK_INCLUDE_PATH=/usr/include/ImageMagick-6/private \
 	CAN_INSTALL_MAGICK=1
+%endif
+
+%if %{with html5}
+%{__make} -C html5
+%endif
 
 %install
 rm -rf $RPM_BUILD_ROOT
@@ -70,8 +100,15 @@ rm -rf $RPM_BUILD_ROOT
 # install-thumbnailer is ugly; for now, install only this one
 install -D fail-mime.xml $RPM_BUILD_ROOT%{_datadir}/mime/packages/fail-mime.xml
 
+%if %{with magick}
 install -D fail.so $RPM_BUILD_ROOT%{im_coders_dir}/fail.so
 echo "dlname='fail.so'" >$RPM_BUILD_ROOT%{im_coders_dir}/fail.la
+%endif
+
+%if %{with html5}
+install -d $RPM_BUILD_ROOT%{_datadir}/fail-html5
+cp -p html5/*.{js,html} $RPM_BUILD_ROOT%{_datadir}/fail-html5
+%endif
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -86,7 +123,15 @@ rm -rf $RPM_BUILD_ROOT
 %{_datadir}/mime/packages/fail-mime.xml
 # TODO: gconf files?
 
+%if %{with html5}
+%files html5
+%defattr(644,root,root,755)
+%{_datadir}/fail-html5
+%endif
+
+%if %{with magick}
 %files -n ImageMagick-coder-fail
 %defattr(644,root,root,755)
 %attr(755,root,root) %{im_coders_dir}/fail.so
 %{im_coders_dir}/fail.la
+%endif
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/fail.git/commitdiff/97165e04d481aa543877d04e153facb7691f3838



More information about the pld-cvs-commit mailing list