]> git.pld-linux.org Git - packages/djvulibre.git/blobdiff - djvulibre.spec
- release 2
[packages/djvulibre.git] / djvulibre.spec
index 7e6d7a4a2ee7bc9129c8b56d8ee89d233ff69160..c5222231378b6faba0bd6f9cf46bc57b9aaa5aa9 100644 (file)
@@ -1,26 +1,35 @@
+# TODO
+# - test and add other browsers
+#
+# Conditional build:
+%bcond_without qt      # disable qt wrapper
+#
 Summary:       DjVu viewers, encoders and utilities
 Summary(pl):   DjVu - przegl±darki, dekodery oraz narzêdzia
 Name:          djvulibre
-Version:       3.5.13
-Release:       1
+Version:       3.5.16
+Release:       2
 License:       GPL
 Group:         Applications/Graphics
 Source0:       http://dl.sourceforge.net/djvu/%{name}-%{version}.tar.gz
-# Source0-md5: 75b53200c89b0ce2aff8a74aaaae0484
+# Source0-md5: 5591c99a50aed1613a796a5aa4978fc0
 Patch0:                %{name}-opt.patch
 Patch1:                %{name}-nostrip.patch
 Patch2:                %{name}-desktop.patch
 URL:           http://djvu.sourceforge.net/
-BuildRequires: autoconf
+BuildRequires: autoconf >= 2.50
 BuildRequires: automake
 BuildRequires: libjpeg-devel
 BuildRequires: libstdc++-devel
-BuildRequires: qt-devel >= 3.0.5
+BuildRequires: rpmbuild(macros) >= 1.236
+%{?with_qt:BuildRequires:      qt-devel >= 3.0.5}
 Obsoletes:     djvu
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
-%define                mozdir          /usr/%{_lib}/mozilla/plugins
-%define                nsdir           /usr/%{_lib}/netscape/plugins
+%define                _plugindir      %{_libdir}/browser-plugins
+
+# list of supported browsers, in free form text
+%define                browsers mozilla, netscape
 
 %description
 DjVu is a web-centric format and software platform for distributing
@@ -73,6 +82,20 @@ Ten pakiet zawiera: bibliotek
 i narzêdzi do plików w formacie DjVu. Przegl±darka oraz wtyczki do
 przegl±darek znajduj± siê w innych podpakietach.
 
+%package devel
+Summary:       Header file for DjVu library
+Summary(pl):   Plik nag³ówkowy biblioteki DjVu
+Group:         Development/Libraries
+Requires:      %{name} = %{version}-%{release}
+Requires:      libjpeg-devel
+Requires:      libstdc++-devel
+
+%description devel
+Header file for DjVu library.
+
+%description devel -l pl
+Plik nag³ówkowy biblioteki DjVu.
+
 %package djview
 Summary:       Qt-based DjVu viewer
 Summary(pl):   Oparta o Qt przegl±darka DjVu
@@ -86,32 +109,28 @@ Qt-based DjVu viewer.
 %description djview -l pl
 Oparta o Qt przegl±darka DjVu.
 
-%package -n mozilla-plugin-%{name}
-Summary:       DjVu plugin for Mozilla
-Summary(pl):   Wtyczka DjVu do Mozilli
+%package -n browser-plugin-%{name}
+Summary:       DjVu browser plugin
+Summary(pl):   Wtyczka DjVu do przegl±derek WWW
 Group:         X11/Libraries
 Requires:      %{name}-djview = %{version}-%{release}
-Requires:      mozilla-embedded
+Requires:      browser-plugins(%{_target_cpu})
+Obsoletes:     mozilla-plugin-djvulibre
+Obsoletes:     netscape-plugin-djvulibre
+Obsoletes:     djview-netscape
+# for migrate purposes (greedy poldek upgrade)
+Provides:      mozilla-plugin-djvulibre
+Provides:      netscape-plugin-djvulibre
 
-%description -n mozilla-plugin-%{name}
+%description -n browser-plugin-%{name}
 DjVu plugin for Mozilla and Mozilla-based browsers.
 
-%description -n mozilla-plugin-%{name} -l pl
-Wtyczka DjVu do Mozilli i przegl±darek na niej bazuj±cych.
+Supported browsers: %{browsers}.
 
-%package -n netscape-plugin-%{name}
-Summary:       DjVu plugin for Netscape
-Summary(pl):   Wtyczka DjVu do Netscape
-Group:         X11/Libraries
-Requires:      %{name}-djview = %{version}-%{release}
-Requires:      netscape-common
-Obsoletes:     djview-netscape
+%description -n browser-plugin-%{name} -l pl
+Wtyczka DjVu do przegl±darek zgodnych z Mozill±.
 
-%description -n netscape-plugin-%{name}
-DjVu plugin for Netscape.
-
-%description -n netscape-plugin-%{name} -l pl
-Wtyczka DjVu do Netscape.
+Obs³ugiwane przegl±darki: %{browsers}.
 
 %prep
 %setup -q
@@ -121,30 +140,30 @@ Wtyczka DjVu do Netscape.
 
 %build
 cp -f /usr/share/automake/config.sub config
-%{__aclocal} -I config
+%{__aclocal} -I config -I gui/desktop
 %{__autoconf}
 QT_LIBS="-L%{_libdir} -lqt-mt"; export QT_LIBS
 QT_CFLAGS="-I%{_includedir}/qt"; export QT_CFLAGS
-%configure
+%configure \
+       PTHREAD_LIBS="-lpthread"
 
-%{__make} depend
 %{__make}
 
 %install
 rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{%{mozdir},%{nsdir}}
+install -d $RPM_BUILD_ROOT%{_plugindir}
 
+# pass dtop_* to allow build w/o gnome/kde/etc. installed
 %{__make} install \
-       DESTDIR=$RPM_BUILD_ROOT
-
-mv -f $RPM_BUILD_ROOT%{_libdir}/netscape/plugins/nsdejavu.so \
-       $RPM_BUILD_ROOT%{mozdir}
-cp -f $RPM_BUILD_ROOT%{mozdir}/nsdejavu.so $RPM_BUILD_ROOT%{nsdir}
-
-# make desktop-file-install is too environment-dependent
-cd gui/desktop
-install -D hi48-mimetype-djvu.png $RPM_BUILD_ROOT%{_pixmapsdir}/djvu.png
-install -D djview.desktop $RPM_BUILD_ROOT%{_desktopdir}/djview.desktop
+       DESTDIR=$RPM_BUILD_ROOT \
+       plugindir=%{_plugindir} \
+       dtop_applications=%{_desktopdir} \
+       dtop_icons=%{_iconsdir} \
+       dtop_mimelnk=%{_datadir}/mimelnk \
+       dtop_applnk= \
+       dtop_pixmaps=%{_pixmapsdir} \
+       dtop_mime_info= \
+       dtop_application_registry=
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -152,13 +171,39 @@ rm -rf $RPM_BUILD_ROOT
 %post  -p /sbin/ldconfig
 %postun        -p /sbin/ldconfig
 
+%triggerin -n browser-plugin-%{name} -- mozilla
+%nsplugin_install -d %{_libdir}/mozilla/plugins nsdejavu.so
+
+%triggerun -n browser-plugin-%{name} -- mozilla
+%nsplugin_uninstall -d %{_libdir}/mozilla/plugins nsdejavu.so
+
+%triggerin -n browser-plugin-%{name} -- mozilla-firefox
+%nsplugin_install -d %{_libdir}/mozilla-firefox/plugins nsdejavu.so
+
+%triggerun -n browser-plugin-%{name} -- mozilla-forefox
+%nsplugin_uninstall -d %{_libdir}/mozilla-firefox/plugins nsdejavu.so
+
+%triggerin -n browser-plugin-%{name} -- netscape-common
+%nsplugin_install -d %{_libdir}/netscape/plugins nsdejavu.so
+
+%triggerun -n browser-plugin-%{name} -- netscape-common
+%nsplugin_uninstall -d %{_libdir}/netscape/plugins nsdejavu.so
+
+# as rpm removes the old obsoleted package files after the triggers
+# are ran, add another trigger to make the links there.
+%triggerpostun -n browser-plugin-%{name} -- mozilla-plugin-%{name}
+%nsplugin_install -f -d %{_libdir}/mozilla/plugins nsdejavu.so
+
+%triggerpostun -n browser-plugin-%{name} -- netscape-plugin-%{name}
+%nsplugin_install -f -d %{_libdir}/netscape/plugins nsdejavu.so
+
 %files
 %defattr(644,root,root,755)
 %doc COPYRIGHT NEWS README TODO doc/*
 %attr(755,root,root) %{_bindir}/[!d]*
 %attr(755,root,root) %{_bindir}/d[!j]*
 %attr(755,root,root) %{_bindir}/djv[!i]*
-%attr(755,root,root) %{_libdir}/lib*.so
+%attr(755,root,root) %{_libdir}/libdjvulibre.so.*.*.*
 %{_mandir}/man1/[!dn]*
 %{_mandir}/man1/d[!j]*
 %{_mandir}/man1/djv[!i]*
@@ -175,20 +220,26 @@ rm -rf $RPM_BUILD_ROOT
 %lang(zh) %{_datadir}/djvu/osi/zh
 %{_datadir}/djvu/pubtext
 
+%files devel
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_libdir}/libdjvulibre.so
+%{_libdir}/libdjvulibre.la
+%{_includedir}/libdjvu
+
+%if %{with qt}
 %files djview
 %defattr(644,root,root,755)
 %attr(755,root,root) %{_bindir}/djview
 %{_mandir}/man1/djview.1*
 %lang(ja) %{_mandir}/ja/man1/djview.1*
+%{_datadir}/mimelnk/image/x-djvu.desktop
 %{_desktopdir}/djview.desktop
+%{_iconsdir}/hicolor/*/mimetypes/djvu.png
 %{_pixmapsdir}/djvu.png
 
-%files -n mozilla-plugin-%{name}
+%files -n browser-plugin-%{name}
 %defattr(644,root,root,755)
-%attr(755,root,root) %{mozdir}/*.so
+%attr(755,root,root) %{_plugindir}/*.so
 %{_mandir}/man1/nsdejavu.1*
 %lang(ja) %{_mandir}/ja/man1/nsdejavu.1*
-
-%files -n netscape-plugin-%{name}
-%defattr(644,root,root,755)
-%attr(755,root,root) %{nsdir}/*.so
+%endif
This page took 0.069787 seconds and 4 git commands to generate.