Summary: DjVu viewers, encoders and utilities.
Summary(ja): DjVu 画像形式ファイル操作用ライブラリ、ツール
Name: djvulibre
Version: 3.5.22
Release: 2%{?_dist_release}
License: GPL
Group: System Environment/Libraries
Source0: http://prdownloads.sourceforge.net/djvu/djvulibre-%{version}.tar.gz
#Source1: djview.png
BuildRoot: %{_tmppath}/%{name}-%{version}-root
URL: http://djvu.sourceforge.net
BuildRequires: qt-devel, qt-designer
BuildRequires: libtiff-devel
BuildRequires: libjpeg-devel
BuildRequires: glibc-devel
Requires: qt, libtiff, libjpeg, glibc-devel
Distribution: Project Vine
Vendor: Vine Linux

%description 
DjVu is a web-centric format and software platform for distributing documents
and images.  DjVu content downloads faster, displays and renders faster, looks
nicer on a screen, and consume less client resources than competing formats.
DjVu was originally developed at AT&T Labs-Research by Leon Bottou, Yann
LeCun, Patrick Haffner, and many others.  In March 2000, AT&T sold DjVu to
LizardTech Inc. who now distributes Windows/Mac plug-ins, and commercial
encoders (mostly on Windows)

In an effort to promote DjVu as a Web standard, the LizardTech management was
enlightened enough to release the reference implementation of DjVu under the
GNU GPL in October 2000.  DjVuLibre (which means free DjVu), is an enhanced
version of that code maintained by the original inventors of DjVu. It is
compatible with version 3.5 of the LizardTech DjVu software suite.

DjVulibre-3.5 contains:
- a standalone DjVu viewer based on the Qt library. 
- A browser plugin that works with most Unix browsers.
- A full-fledged wavelet-based compressor for pictures. 
- A simple compressor for bitonal (black and white) scanned pages. 
- A compressor for palettized images (a la GIF/PNG). 
- A set of utilities to manipulate and assemble DjVu images and documents. 
- A set of decoders to convert DjVu to a number of other formats. 
- An up-to-date version of the C++ DjVu Reference Library.

%package devel
Summary: The libraries and header files needed for djvulibre development.
Group: Development/Libraries
Requires: djvulibre = %{version}
%description devel
DjVulibre libraries and header files for development.

%package plugin
Summary: The plug-in files needed for mozilla.
Group: Applications/Internet
Requires: djvulibre = %{version}
%description plugin
DjVulibre plug-in files for mozilla.

%prep
%setup -q
cp gui/nsdejavu/Makefile.in gui/nsdejavu/Makefile.in.orig
sed "s|netscape|mozilla|" gui/nsdejavu/Makefile.in.orig \
	> gui/nsdejavu/Makefile.in

%build
%ifarch i386
export CXXFLAGS="-march=i686"
%endif
%configure

# don't set smp option (-j n) with make
make depend
make

%install
rm -rf %{buildroot}
make DESTDIR=%{buildroot} install

# fix to stop ldconfig from complaining
find %{buildroot}%{_libdir} -name "*.so*" -exec chmod 755 {} \;

# cleanup of the docs
rm -rf doc/CVS 2>/dev/null || :

cat > djview.desktop <<EOF
[Desktop Entry]
Encoding=UTF-8
Name=djview
Name[ja]=Djvuビュアー
Comment=Standalone Djvu Viewer
Comment[ja]=スタンドアロンでDjvu画像を表示するツールです
Icon=djview
Terminal=false
Exec=djview
Type=Application
Categories=Application;Graphics;
EOF

mkdir -p $RPM_BUILD_ROOT%{_datadir}/applications
install -m644 djview.desktop $RPM_BUILD_ROOT%{_datadir}/applications/
#mkdir -p $RPM_BUILD_ROOT%{_datadir}/pixmaps
#cp %SOURCE1 $RPM_BUILD_ROOT%{_datadir}/pixmaps/


%clean
rm -rf %{buildroot}

%post 
/sbin/ldconfig
if test -x /sbin/update-alternatives ; then
	m1=`ls -1 %{_mandir}/man1/djview3.* | head -1`
	m2=`echo $m1 | sed -e 's/djview3/djview/'`
	/sbin/update-alternatives \
		--install %{_bindir}/djview djview %{_bindir}/djview3 103 \
		--slave $m2 `basename $m2` $m1
fi

%preun
if test "$1" = 0 ; then
	if test -x /sbin/update-alternatives ; then
		/sbin/update-alternatives --remove djview %{_bindir}/djview3
	fi
fi

%postun 
/sbin/ldconfig

%files
%defattr(-, root, root)
%doc README COPYRIGHT COPYING INSTALL NEWS TODO doc
%{_bindir}
%{_libdir}
%exclude %{_libdir}/mozilla
%exclude %{_libdir}/pkgconfig
%exclude %{_libdir}/libdjvulibre.la

%{_datadir}/applications/djview.desktop
#%{_datadir}/pixmaps/djview.png
%{_datadir}/djvu/djview3
%{_datadir}/djvu/pubtext
%{_datadir}/djvu/osi/languages.xml
%{_datadir}/djvu/osi/en
%{_datadir}/djvu/osi/cs/messages.xml
%lang(ja) %{_datadir}/djvu/osi/ja*
%lang(fr) %{_datadir}/djvu/osi/fr*
%lang(de) %{_datadir}/djvu/osi/de*
%lang(zh) %{_datadir}/djvu/osi/zh*
%{_mandir}/man?
%lang(ja) %{_mandir}/ja*
%lang(fr) %{_mandir}/fr*
%lang(de) %{_mandir}/de*

%files devel
%defattr(-, root, root)
%{_includedir}/libdjvu
%{_libdir}/pkgconfig/ddjvuapi.pc

%files plugin
%defattr(-, root, root)
%{_libdir}/mozilla/plugins/nsdejavu.so

%changelog
* Wed Jul 01 2009 Shu KONNO <owa@bg.wakwak.com> 3.5.22-2
- rebuilt with new toolchain

* Wed Jul 01 2009 Shu KONNO <owa@bg.wakwak.com> 3.5.22-1
- updated djvulibre to 3.5.22

* Tue Dec 30 2008 Shu KONNO <owa@bg.wakwak.com> 3.5.21-1
- initial build for VineSeed
- spec in utf-8, and applied vine versioning policy
- updated djvulibre to 3.5.21
- added CXXFLAG="-march=i686" if i386
- added djview desktop file

* Tue Apr 03 2007 Shu KONNO <owa@bg.wakwak.com> 3.5.19-uvl1
- updated djvulibre to 3.5.19
- added scripts to alternative djview at %%post, %%preun

* Thu Dec 01 2005 Shu KONNO <owa@bg.wakwak.com> 3.5.16-uvl1
- updated djvulibre to 3.5.16
- changed suffix
- divided into djvulibre, djvulibre-devel, djvulibre-plugin

* Tue Nov 09 2004 Shu KONNO <owa@bg.wakwak.com> 3.5.14-uvl2
- updated djvulibre to 3.5.14 (realese 2)

* Thu Jun 17 2004 Leon Bottou <leon@bottou.org> 3.5.13-4
- changed runtime generation of file list.
* Mon May 31 2004 Leon Bottou <leon@bottou.org> 3.5.13-3
- removed 'make install-desktop-files'
* Wed May  5 2004 Leon Bottou <leon@bottou.org> 3.5.13-2
* Fri Apr  9 2004 Leon Bottou <leon@bottou.org> 3.5.13-1
- added runtime generation of file list.
- using DESTDIR instead of %makeinstall.
- added 'make install-desktop-files'
* Wed Nov  5 2003 Leon Bottou <leon@bottou.org> 3.5.12-3
- added support for i18n
- renamed symlink in mozilla plugin dirs.
* Mon Jul  7 2003 Leon Bottou <leon@bottou.org> 3.5.12-1
* Thu Apr 24 2003 Leon Bottou <leon@bottou.org> 3.5.11-1
* Thu Feb  6 2003 Leon Bottou <leon@bottou.org> 3.5.10-2
* Fri Jan 24 2003 Leon Bottou <leon@bottou.org> 3.5.10-1
* Wed Oct  9 2002 Leon Bottou <leonb@users.sourceforge.net> 3.5.9-2
- fixed logic for uninstalling nsdejavu links.
- learned a few tricks from the freshrpms spec file.
* Sun Oct  6 2002 Leon Bottou <leonb@users.sourceforge.net> 3.5.9-1
- added logic to install nsdejavu for mozilla.
* Wed May 29 2002 Leon Bottou <leonb@users.sourceforge.net> 3.5.6-1
* Mon Apr 1 2002  Leon Bottou <leonb@users.sourceforge.net> 3.5.5-2
- changed group to Applications/Publishing.
* Tue Mar 25 2002 Leon Bottou <leonb@users.sourceforge.net> 3.5.5-2
* Tue Jan 22 2002 Leon Bottou <leonb@users.sourceforge.net> 3.5.4-2
- added macros to locate man directory.
* Wed Jan 16 2002 Leon Bottou <leonb@users.sourceforge.net> 3.5.3-1
* Fri Dec  7 2001 Leon Bottou <leonb@users.sourceforge.net> 3.5.2-1
* Wed Dec  5 2001 Leon Bottou <leonb@users.sourceforge.net> 3.5.1-1
- created initial file.

