Sophie

Sophie

distrib > Fedora > 14 > x86_64 > by-pkgid > aaadd58981855066eaf906968e64749a > files > 4

libextractor-0.6.1-1403.fc14.src.rpm

%bcond_with	mpeg
%bcond_without	flac
%bcond_without	noarch

%global plugindir	%_libdir/%name

%{?with_noarch:%global noarch	BuildArch:	noarch}
%{!?release_func:%global release_func() %1%{?dist}}
%{!?apply:%global  apply(p:n:b:) %patch%%{-n:%%{-n*}} %%{-p:-p%%{-p*}} %%{-b:-b%%{-b*}} \
%nil}

Name:		libextractor
Version:	0.6.1
Release:	%release_func 1403
Summary:	Simple library for keyword extraction

Group:		System Environment/Libraries
License:	GPLv2+
URL:		http://gnunet.org/libextractor/
Source0:	http://ftp.gnu.org/gnu/libextractor/%name-%version.tar.gz
Source1:	http://ftp.gnu.org/gnu/libextractor/%name-%version.tar.gz.sig
Source10:	README.fedora
BuildRoot:	%_tmppath/%name-%version-%release-root

BuildRequires:	gettext
BuildRequires:	libtool-ltdl-devel
BuildRequires:	bzip2-devel zlib-devel
BuildRequires:	gtk2-devel libgsf-devel qt4-devel
Requires(post):		/sbin/install-info
Requires(preun):	/sbin/install-info

%package devel
Summary:	Development files for %name
Group:		Development/Libraries
Requires:	%name%{?_isa} = %version-%release
Requires:	%_libdir/pkgconfig


%package plugins
Summary:	Plugins for libextractor
Group:		System Environment/Libraries
Requires:	%name = %version-%release
Requires:	%name-plugins-base
Requires:	%name-plugins-exiv2
Requires:	%name-plugins-ogg
Requires:	%name-plugins-ole2
Requires:	%name-plugins-pdf
Requires:	%name-plugins-thumbnailgtk
Requires:	%name-plugins-thumbnailqt
Requires:	%name-plugins-rpm
%{?with_flac:Requires:	%name-plugins-flac}
%{?noarch}


%global pluginpkg(B:R:P:u)	\
%package plugins-%1	\
Summary:	The '%1' libextractor plugin\
Group:		System Environment/Libraries		\
Provides:	plugin(%name) = %1 %%{-P*}		\
%%{-u:Requires(post):	/usr/sbin/update-alternatives}	\
%%{-u:Requires(preun):	/usr/sbin/update-alternatives}	\
%%{-B:BuildRequires:	%%{-B*}}			\
Requires:	%name%{?_isa} = %version-%release %%{-R*}	\
	\
%description plugins-%1	\
libextractor is a simple library for keyword extraction.  libextractor\
does not support all formats but supports a simple plugging mechanism\
such that you can quickly add extractors for additional formats, even\
without recompiling libextractor.\
\
This package ships the '%1' plugin.\
\
%files plugins-%1			\
%defattr(-,root,root,-)			\
%plugindir/libextractor_%1.so*		\
%nil

%package plugins-base
Summary:	Base plugins for libextractor
Group:		System Environment/Libraries
Requires:	%name%{?_isa} = %version-%release

%{?with_mpeg:%pluginpkg mpeg -B mpeg2dec-devel}
%{?with_flac:%pluginpkg flac -B flac-devel}
%pluginpkg exiv2 -B exiv2-devel
%pluginpkg ogg -B libvorbis-devel
%pluginpkg ole2
%pluginpkg pdf -B poppler-devel
%pluginpkg rpm -B rpm-devel
%pluginpkg thumbnailgtk
%pluginpkg thumbnailqt


%description
libextractor is a simple library for keyword extraction.  libextractor
does not support all formats but supports a simple plugging mechanism
such that you can quickly add extractors for additional formats, even
without recompiling libextractor.  libextractor typically ships with a
dozen helper-libraries that can be used to obtain keywords from common
file-types.

libextractor is a part of the GNU project (http://www.gnu.org/).


%description plugins
libextractor is a simple library for keyword extraction.  libextractor
does not support all formats but supports a simple plugging mechanism
such that you can quickly add extractors for additional formats, even
without recompiling libextractor.

This is a metapackage which requires all supported plugins for
libextractor.

%description plugins-base
libextractor is a simple library for keyword extraction.  libextractor
does not support all formats but supports a simple plugging mechanism
such that you can quickly add extractors for additional formats, even
without recompiling libextractor.

This package contains all plugins for libextractor which do not
introduce additional dependencies.


%description devel
The %name-devel package contains libraries and header files for
developing applications that use %name.


%prep
%setup -q

install -pm644 %SOURCE10 .
rm -f README.debian

sed -i 's!\(-L\(/usr\|\$with_qt\)/lib\|-I/usr/include\) !!g' configure

%build
%{!?with_mpeg:export ac_cv_lib_mpeg2_mpeg2_init=no}
export lt_cv_sys_dlsearch_path='/%_lib:%_prefix/%_lib:%plugindir'
%configure --disable-static	\
	--disable-rpath		\
	--disable-xpdf		\
	--with-qt=/usr		\
	CPPFLAGS='-DLIBDIR=\"%_libdir\"'	\
	LDFLAGS='-Wl,-as-needed'

# build with --as-needed and disable rpath
sed -i \
	-e 's! -shared ! -Wl,--as-needed\0!g'					\
	-e '\!sys_lib_dlsearch_path_spec=\"/lib /usr/lib !s!\"/lib /usr/lib !\"/%_lib /usr/%_lib !g'	\
	libtool

# not SMP safe
make # %{?_smp_mflags}



%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT
find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';'

rm -f $RPM_BUILD_ROOT%plugindir/libextractor_thumbnail.so

echo '%defattr(-,root,root,-)' > filelists.base

for i in $RPM_BUILD_ROOT%plugindir/*.so; do
	readelf -a "$i" | \
	sed '/(NEEDED)/s!.*\[\(.*\)\].*!\1!p;d' | {
		target=base
		fname=${i##$RPM_BUILD_ROOT}
		while read lib; do
			lib=${lib%%.so*}
			case $lib in
				(libgcc_s|ld-linux)			;;
				(libz|libdl)				;;
				(libextractor|libextractor_common)	;;
				(libc|libm|libpthread)	;;
				(*)
					target=other
					echo "$fname -> $lib"
					;;
			esac
		done

		case $target in
			(base)	echo "$fname" >> filelists.base;;
		esac
	}
done

rm -f $RPM_BUILD_ROOT%_infodir/dir

mv $RPM_BUILD_ROOT%_bindir/{,libextractor-}extract
mv $RPM_BUILD_ROOT%_mandir/man1/{,libextractor-}extract.1

%find_lang libextractor


%clean
rm -rf $RPM_BUILD_ROOT


%post
/sbin/ldconfig
/sbin/install-info --info-dir %_infodir %_infodir/extractor.info || :

%preun
test $1 != 0 || /sbin/install-info --info-dir %_infodir --delete %_infodir/extractor.info || :

%postun -p /sbin/ldconfig


# TODO: remove me in F-15
%triggerpostun plugins-thumbnailgtk -- libextractor-plugins-thumbnailgtk < 0.6
/usr/sbin/update-alternatives --remove libextractor_thumbnail %plugindir/libextractor_thumbnailgtk.so &>/dev/null || :

# TODO: remove me in F-15
%triggerpostun plugins-thumbnailqt -- libextractor-plugins-thumbnailqt < 0.6
/usr/sbin/update-alternatives --remove libextractor_thumbnail %plugindir/libextractor_thumbnailqt.so &>/dev/null || :


%files -f libextractor.lang
%defattr(-,root,root,-)
%doc AUTHORS COPYING ChangeLog NEWS README* TODO
%_bindir/*
%_libdir/*.so.*
%_infodir/*info*
%_mandir/man1/*
%dir %plugindir

%files plugins
%files plugins-base -f filelists.base

%files devel
%defattr(-,root,root,-)
%doc
%_includedir/*
%_libdir/*.so
%_mandir/man3/*
%_libdir/pkgconfig/*


%changelog
* Thu Aug 19 2010 Rex Dieter <rdieter@fedoraproject.org> - 0.6.1-1403
- rebuild (poppler)

* Mon May 31 2010 Rex Dieter <rdieter@fedoraproject.org> - 0.6.1-1402 
- rebuild (exiv2)

* Wed May  5 2010 Marcela Maslanova <mmaslano@redhat.com> - 0.6.1-1401
- Rebuild against new poppler

* Sat Mar 20 2010 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.6.1-1400
- updated to 0.6.1
- added some %%{?_isa} annotations
- require -rpm plugin again

* Sat Jan 16 2010 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.6.0-1301
- updated to 0.6.0
- removed -pluginpath patch; upstream changed plugin loading mechanism
  which fixed the problem solved by the patch
- removed 'update-alternatives' registration of thumbnail* plugins; it
  conflicts with new loading mechanism

* Mon Jan 04 2010 Rex Dieter <rdieter@fedoraproject.org> - 0.5.23-1304
- rebuild (exiv2)

* Sun Nov 22 2009 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.5.23-1303
- fixed plugin loading by disabling various autodetections (#452504)

* Sun Sep 13 2009 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
- conditionalized build of 'flac' plugin and noarch subpackages to
  ease packaging under RHEL5

* Sat Sep 12 2009 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.5.23-0
- updated to 0.5.23
- reenabled rpm plugin
- build exiv2 plugin with system library

* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5.22-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild

* Sat Mar  7 2009 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.5.22-1
- updated to 0.5.22
- disabled rpm plugin for now as it does not build with rpm-4.6
- disabled builtin xpdf plugin

* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5.20b-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild

* Wed Nov 26 2008 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.5.21-1
- updated to 0.5.21
- added -rpm plugin

* Wed Jul 16 2008 Tom "spot" Callaway <tcallawa@redhat.com> - 0.5.20b-2
- fix license tag

* Sat Jun 21 2008 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.5.20b-1
- updated to 0.5.20b (SECURITY); fixes CVE-2008-1693 (xpdf embedded
  font vulnerability)
- build with -Wl,-as-needed
- fixed rpath issues

* Wed Feb 13 2008 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.5.19a-1
- updated to 0.5.19a
- added flac-plugin subpackage

* Sat Aug 25 2007 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.5.18a-1
- updated to 0.5.18a
- renamed 'extract' program to 'libextractor-extract'
- installed info file

* Sat Feb  3 2007 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.5.17a-1
- updated to 0.5.17a
- fixed URL
- removed -debug patch and the fixups in %%prep which were fixed
  upstream too

* Tue Jan  2 2007 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.5.17-2
- disabled debug messages
- fixed pkgconfig installation dir

* Tue Jan  2 2007 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.5.17-1
- updated to 0.5.17
- fixed 'datadir' brokeness
- added pkgconfig files

* Thu Dec 28 2006 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.5.16-4
- %%ghost'ified the files created by 'update-alternatives'
- initial fedora release (review #214087)
- removed glib-devel BR (should be glib2-devel which is implicated by gtk2-devel)

* Wed Dec 27 2006 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.5.16-3
- added a README.fedora
- removed the previously added 'Requires: plugin(%%name)'
- added the pdf plugin to the requirements of the -plugins subpackage

* Thu Dec 14 2006 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.5.16-2
- added a requirement for plugins to the main package
- do not ship README.debian anymore
- improved URL:

* Fri Nov 24 2006 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.5.16-1
- updated to 0.5.16; handling of libgsf linking of main library needs
  some rethinking: adding such a heavy dependency just to workaround a
  problem in one plugin is not acceptably

* Thu Nov  2 2006 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.5.15-2
- updated to 0.5.15

* Sun Oct  8 2006 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.5.14-1
- initial built