Small change to innosetup script so that install can be performed by non-privileged user
This commit is contained in:
commit
59747d0291
1294 changed files with 445671 additions and 0 deletions
121
.hgignore
Normal file
121
.hgignore
Normal file
|
@ -0,0 +1,121 @@
|
|||
syntax: glob
|
||||
*.dep
|
||||
*.dep.stamp
|
||||
*.o
|
||||
.libs
|
||||
*.la
|
||||
stamp-h1
|
||||
.dirstamp
|
||||
libtool
|
||||
.deps
|
||||
*.lo
|
||||
*~
|
||||
\#*
|
||||
*.obj
|
||||
*.sdf
|
||||
*.tlog
|
||||
*.lib
|
||||
*.idb
|
||||
*.log
|
||||
*.pdb
|
||||
.vs
|
||||
*.exe
|
||||
*.ilk
|
||||
ptrans
|
||||
src/aclocal.m4
|
||||
src/compile
|
||||
src/config.guess
|
||||
src/config.sub
|
||||
src/depcomp
|
||||
src/install-sh
|
||||
src/Makefile.in
|
||||
src/ltmain.sh
|
||||
src/m4/libtool.m4
|
||||
src/m4/ltoptions.m4
|
||||
src/m4/ltsugar.m4
|
||||
src/m4/ltversion.m4
|
||||
src/m4/lt~obsolete.m4
|
||||
src/missing
|
||||
src/config.log
|
||||
src/config.status
|
||||
src/configure
|
||||
src/Makefile
|
||||
src/autom4te.cache
|
||||
src/common/autoconfig.h
|
||||
src/common/rclversion.h
|
||||
src/doc/user/RCL.INDEXING.CONFIG.html
|
||||
src/doc/user/RCL.INDEXING.EXTATTR.html
|
||||
src/doc/user/RCL.INDEXING.EXTTAGS.html
|
||||
src/doc/user/RCL.INDEXING.MONITOR.html
|
||||
src/doc/user/RCL.INDEXING.PERIODIC.html
|
||||
src/doc/user/RCL.INDEXING.STORAGE.html
|
||||
src/doc/user/RCL.INDEXING.WEBQUEUE.html
|
||||
src/doc/user/RCL.INDEXING.html
|
||||
src/doc/user/RCL.INSTALL.BUILDING.html
|
||||
src/doc/user/RCL.INSTALL.CONFIG.html
|
||||
src/doc/user/RCL.INSTALL.EXTERNAL.html
|
||||
src/doc/user/RCL.INSTALL.html
|
||||
src/doc/user/RCL.INTRODUCTION.RECOLL.html
|
||||
src/doc/user/RCL.INTRODUCTION.SEARCH.html
|
||||
src/doc/user/RCL.INTRODUCTION.html
|
||||
src/doc/user/RCL.PROGRAM.API.html
|
||||
src/doc/user/RCL.PROGRAM.FIELDS.html
|
||||
src/doc/user/RCL.PROGRAM.html
|
||||
src/doc/user/RCL.SEARCH.ANCHORWILD.html
|
||||
src/doc/user/RCL.SEARCH.CASEDIAC.html
|
||||
src/doc/user/RCL.SEARCH.COMMANDLINE.html
|
||||
src/doc/user/RCL.SEARCH.DESKTOP.html
|
||||
src/doc/user/RCL.SEARCH.KIO.html
|
||||
src/doc/user/RCL.SEARCH.LANG.html
|
||||
src/doc/user/RCL.SEARCH.PTRANS.html
|
||||
src/doc/user/RCL.SEARCH.html
|
||||
src/doc/user/index.html
|
||||
src/doc/user/usermanual.pdf
|
||||
src/filters/rclexecm.pyc
|
||||
src/filters/rcllatinclass.pyc
|
||||
src/recollindex
|
||||
src/recollq
|
||||
src/xadump
|
||||
src/kde/kioslave/kio_recoll/builddir
|
||||
src/python/recoll/build
|
||||
src/python/recoll/recoll/__init__.pyc
|
||||
src/python/recoll/setup.py
|
||||
src/python/samples/recollgui/rclmain.py
|
||||
src/python/samples/recollgui/rclmain.pyc
|
||||
src/qtgui/.moc/*
|
||||
src/qtgui/.obj/*
|
||||
src/qtgui/.ui/*
|
||||
src/qtgui/Makefile
|
||||
src/qtgui/qrc_recoll.cpp
|
||||
src/qtgui/recoll
|
||||
src/qtgui/recoll.pro
|
||||
src/qtgui/recoll.app
|
||||
src/sampleconf/rclmon.sh
|
||||
src/sampleconf/recoll.conf
|
||||
tests/casediac/aspdict.en.rws
|
||||
tests/casediac/idxstatus.txt
|
||||
tests/casediac/index.pid
|
||||
tests/casediac/mimeview
|
||||
tests/casediac/missing
|
||||
tests/casediac/recoll.conf
|
||||
tests/casediac/xapiandb
|
||||
tests/config/aspdict.en.rws
|
||||
tests/config/history
|
||||
tests/config/idxstatus.txt
|
||||
tests/config/index.pid
|
||||
tests/config/missing
|
||||
tests/config/xapiandb
|
||||
tests/indexedmimetypes/aspdict.en.rws
|
||||
tests/indexedmimetypes/idxstatus.txt
|
||||
tests/indexedmimetypes/index.pid
|
||||
tests/indexedmimetypes/mimeview
|
||||
tests/indexedmimetypes/missing
|
||||
tests/indexedmimetypes/recoll.conf
|
||||
tests/indexedmimetypes/xapiandb
|
||||
tests/xattr/mimeview
|
||||
website/usermanual/*
|
||||
website/idxthreads/forkingRecoll.html
|
||||
website/idxthreads/xapDocCopyCrash.html
|
||||
website/pages/recoll-mingw.html
|
||||
website/pages/recoll-windows.html
|
||||
src/doc/user/RCL.SEARCH.SYNONYMS.html
|
34
packaging/FreeBSD/recoll/Makefile
Normal file
34
packaging/FreeBSD/recoll/Makefile
Normal file
|
@ -0,0 +1,34 @@
|
|||
# New ports collection makefile for: recoll
|
||||
# Date created: 5 December 2005
|
||||
# Whom: J.F. Dockes <jean-francois.dockes@wanadoo.fr>
|
||||
#
|
||||
# $FreeBSD: ports/deskutils/recoll/Makefile,v 1.44 2010/10/09 17:52:42 makc Exp $
|
||||
#
|
||||
|
||||
PORTNAME= recoll
|
||||
PORTVERSION= 1.16.2
|
||||
CATEGORIES= deskutils
|
||||
MASTER_SITES= http://www.lesbonscomptes.com/recoll/
|
||||
|
||||
MAINTAINER= jf@dockes.org
|
||||
COMMENT= A personal full text search package, based on QT and Xapian
|
||||
|
||||
BUILD_DEPENDS= xapian-core>=1.0.12:${PORTSDIR}/databases/xapian-core
|
||||
RUN_DEPENDS:= ${BUILD_DEPENDS}
|
||||
|
||||
USE_QT_VER= 4
|
||||
QT_COMPONENTS= gui qmake_build uic_build moc_build rcc_build
|
||||
GNU_CONFIGURE= yes
|
||||
USE_GMAKE= yes
|
||||
USE_ICONV= yes
|
||||
INSTALLS_ICONS= yes
|
||||
USE_FAM= yes
|
||||
|
||||
MAN1= recoll.1 recollindex.1
|
||||
MAN5= recoll.conf.5
|
||||
|
||||
post-patch:
|
||||
${REINPLACE_CMD} -e 's/^CXXFLAGS =/CXXFLAGS ?=/' \
|
||||
${WRKSRC}/mk/localdefs.in
|
||||
|
||||
.include <bsd.port.mk>
|
2
packaging/FreeBSD/recoll/distinfo
Normal file
2
packaging/FreeBSD/recoll/distinfo
Normal file
|
@ -0,0 +1,2 @@
|
|||
SHA256 (recoll-1.16.2.tar.gz) = f0f29dff2d82ef8541c51963870f31daf28472f3c8822c81c17c346769b77355
|
||||
SIZE (recoll-1.16.2.tar.gz) = 1422148
|
24
packaging/FreeBSD/recoll/pkg-descr
Normal file
24
packaging/FreeBSD/recoll/pkg-descr
Normal file
|
@ -0,0 +1,24 @@
|
|||
Recoll is a personal full text search package with a QT graphical
|
||||
interface. It is based on a very strong backend (Xapian), for which it
|
||||
provides an easy to use and feature-rich interface.
|
||||
|
||||
Features:
|
||||
* Free, GPL license.
|
||||
* QT-based GUI.
|
||||
* Supports the following document types (and their compressed versions):
|
||||
- Natively: text, html, OpenOffice files, maildir and mailbox
|
||||
(Mozilla and Thunderbird mail ok) with attachments, gaim log files.
|
||||
- With external helpers: pdf (pdftotext), postscript (ghostscript),
|
||||
msword (antiword), excel, ppt (catdoc), rtf (unrtf),
|
||||
* Powerful query facilities, with boolean searches, phrases, filter on
|
||||
file types and directory tree.
|
||||
* Support for multiple charsets. Internal processing and storage uses
|
||||
Unicode UTF-8.
|
||||
* Stemming performed at query time (can switch stemming language after
|
||||
indexing)
|
||||
* Easy installation. No database daemon, web server or exotic language
|
||||
necessary.
|
||||
* An indexer which runs either as a thread inside the GUI or as an
|
||||
external, cron'able program.
|
||||
|
||||
WWW: http://www.lesbonscomptes.com/recoll/
|
100
packaging/FreeBSD/recoll/pkg-plist
Normal file
100
packaging/FreeBSD/recoll/pkg-plist
Normal file
|
@ -0,0 +1,100 @@
|
|||
bin/recoll
|
||||
bin/recollindex
|
||||
share/applications/recoll-searchgui.desktop
|
||||
share/icons/hicolor/48x48/apps/recoll.png
|
||||
share/pixmaps/recoll.png
|
||||
%%DATADIR%%/doc/docbook.css
|
||||
%%DATADIR%%/doc/usermanual.html
|
||||
%%DATADIR%%/examples/fields
|
||||
%%DATADIR%%/examples/mimeconf
|
||||
%%DATADIR%%/examples/mimemap
|
||||
%%DATADIR%%/examples/mimeview
|
||||
%%DATADIR%%/examples/rclmon.sh
|
||||
%%DATADIR%%/examples/recoll.conf
|
||||
%%DATADIR%%/filters/hotrecoll.py
|
||||
%%DATADIR%%/filters/rclabw
|
||||
%%DATADIR%%/filters/rclaptosidman
|
||||
%%DATADIR%%/filters/rclaudio
|
||||
%%DATADIR%%/filters/rclchm
|
||||
%%DATADIR%%/filters/rcldjvu
|
||||
%%DATADIR%%/filters/rcldoc
|
||||
%%DATADIR%%/filters/rcldvi
|
||||
%%DATADIR%%/filters/rclexecm.py
|
||||
%%DATADIR%%/filters/rclfb2
|
||||
%%DATADIR%%/filters/rclflac
|
||||
%%DATADIR%%/filters/rclgaim
|
||||
%%DATADIR%%/filters/rclics
|
||||
%%DATADIR%%/filters/rclid3
|
||||
%%DATADIR%%/filters/rclimg
|
||||
%%DATADIR%%/filters/rclinfo
|
||||
%%DATADIR%%/filters/rclkar
|
||||
%%DATADIR%%/filters/rclkwd
|
||||
%%DATADIR%%/filters/rcllatinclass.py
|
||||
%%DATADIR%%/filters/rcllatinstops.zip
|
||||
%%DATADIR%%/filters/rcllyx
|
||||
%%DATADIR%%/filters/rclman
|
||||
%%DATADIR%%/filters/rclnull
|
||||
%%DATADIR%%/filters/rclogg
|
||||
%%DATADIR%%/filters/rclopxml
|
||||
%%DATADIR%%/filters/rclpdf
|
||||
%%DATADIR%%/filters/rclppt
|
||||
%%DATADIR%%/filters/rclps
|
||||
%%DATADIR%%/filters/rclpurple
|
||||
%%DATADIR%%/filters/rclpython
|
||||
%%DATADIR%%/filters/rclrar
|
||||
%%DATADIR%%/filters/rclrtf
|
||||
%%DATADIR%%/filters/rclscribus
|
||||
%%DATADIR%%/filters/rclshowinfo
|
||||
%%DATADIR%%/filters/rclsiduxman
|
||||
%%DATADIR%%/filters/rclsoff
|
||||
%%DATADIR%%/filters/rclsvg
|
||||
%%DATADIR%%/filters/rcltex
|
||||
%%DATADIR%%/filters/rcltext
|
||||
%%DATADIR%%/filters/rcluncomp
|
||||
%%DATADIR%%/filters/rclwar
|
||||
%%DATADIR%%/filters/rclwpd
|
||||
%%DATADIR%%/filters/rclxls
|
||||
%%DATADIR%%/filters/rclzip
|
||||
%%DATADIR%%/filters/rcl7z
|
||||
%%DATADIR%%/filters/xdg-open
|
||||
%%DATADIR%%/images/aptosid-book.png
|
||||
%%DATADIR%%/images/aptosid-manual.png
|
||||
%%DATADIR%%/images/document.png
|
||||
%%DATADIR%%/images/drawing.png
|
||||
%%DATADIR%%/images/folder.png
|
||||
%%DATADIR%%/images/html.png
|
||||
%%DATADIR%%/images/image.png
|
||||
%%DATADIR%%/images/message.png
|
||||
%%DATADIR%%/images/mozilla_doc.png
|
||||
%%DATADIR%%/images/pdf.png
|
||||
%%DATADIR%%/images/pidgin.png
|
||||
%%DATADIR%%/images/postscript.png
|
||||
%%DATADIR%%/images/presentation.png
|
||||
%%DATADIR%%/images/sidux-book.png
|
||||
%%DATADIR%%/images/source.png
|
||||
%%DATADIR%%/images/sownd.png
|
||||
%%DATADIR%%/images/soffice.png
|
||||
%%DATADIR%%/images/spreadsheet.png
|
||||
%%DATADIR%%/images/text-x-python.png
|
||||
%%DATADIR%%/images/txt.png
|
||||
%%DATADIR%%/images/wordprocessing.png
|
||||
%%DATADIR%%/translations/recoll_cs.qm
|
||||
%%DATADIR%%/translations/recoll_fr.qm
|
||||
%%DATADIR%%/translations/recoll_it.qm
|
||||
%%DATADIR%%/translations/recoll_lt.qm
|
||||
%%DATADIR%%/translations/recoll_de.qm
|
||||
%%DATADIR%%/translations/recoll_uk.qm
|
||||
%%DATADIR%%/translations/recoll_ru.qm
|
||||
%%DATADIR%%/translations/recoll_tr.qm
|
||||
%%DATADIR%%/translations/recoll_xx.qm
|
||||
@dirrm %%DATADIR%%/doc
|
||||
@dirrm %%DATADIR%%/examples
|
||||
@dirrm %%DATADIR%%/filters
|
||||
@dirrm %%DATADIR%%/images
|
||||
@dirrm %%DATADIR%%/translations
|
||||
@dirrm %%DATADIR%%
|
||||
@dirrmtry share/applications
|
||||
@dirrmtry share/icons/hicolor/48x48/apps
|
||||
@dirrmtry share/icons/hicolor/48x48
|
||||
@dirrmtry share/icons/hicolor
|
||||
@dirrmtry share/icons
|
185
packaging/debian/buildppa.sh
Normal file
185
packaging/debian/buildppa.sh
Normal file
|
@ -0,0 +1,185 @@
|
|||
#!/bin/sh
|
||||
# Packages needed
|
||||
# sudo apt-get install g++ gnupg dput lintian mini-dinstall yaclc bzr devscripts
|
||||
# For the kio: (and kdesdk?)
|
||||
# sudo apt-get install pkg-kde-tools cdbs
|
||||
|
||||
RCLVERS=1.22.0
|
||||
LENSVERS=1.19.10.3543
|
||||
SCOPEVERS=1.20.2.4
|
||||
PPAVERS=1
|
||||
|
||||
#
|
||||
RCLSRC=/y/home/dockes/projets/fulltext/recoll/src
|
||||
SCOPESRC=/y/home/dockes/projets/fulltext/unity-scope-recoll
|
||||
RCLDOWNLOAD=/y/home/dockes/projets/lesbonscomptes/recoll
|
||||
|
||||
case $RCLVERS in
|
||||
[23]*) PPANAME=recollexp-ppa;;
|
||||
1.14*) PPANAME=recoll-ppa;;
|
||||
*) PPANAME=recoll15-ppa;;
|
||||
esac
|
||||
PPANAME=recollexp-ppa
|
||||
echo "PPA: $PPANAME. Type CR if Ok, else ^C"
|
||||
read rep
|
||||
|
||||
fatal()
|
||||
{
|
||||
echo $*; exit 1
|
||||
}
|
||||
|
||||
check_recoll_orig()
|
||||
{
|
||||
if test ! -f recoll_${RCLVERS}.orig.tar.gz ; then
|
||||
cp -p $RCLDOWNLOAD/recoll-${RCLVERS}.tar.gz \
|
||||
recoll_${RCLVERS}.orig.tar.gz || \
|
||||
fatal "Can find neither recoll_${RCLVERS}.orig.tar.gz nor " \
|
||||
"recoll-${RCLVERS}.tar.gz"
|
||||
fi
|
||||
}
|
||||
|
||||
####### QT4
|
||||
debdir=debian
|
||||
# Note: no new releases for lucid: no webkit. Or use old debianrclqt4 dir.
|
||||
#series="precise trusty vivid"
|
||||
series=trusty
|
||||
|
||||
if test "X$series" != X ; then
|
||||
check_recoll_orig
|
||||
test -d recoll-${RCLVERS} || tar xvzf recoll_${RCLVERS}.orig.tar.gz
|
||||
fi
|
||||
|
||||
for series in $series ; do
|
||||
|
||||
rm -rf recoll-${RCLVERS}/debian
|
||||
cp -rp ${debdir}/ recoll-${RCLVERS}/debian || exit 1
|
||||
|
||||
if test -f $debdir/control-$series ; then
|
||||
cp -f -p $debdir/control-$series recoll-${RCLVERS}/debian/control
|
||||
else
|
||||
cp -f -p $debdir/control recoll-${RCLVERS}/debian/control
|
||||
fi
|
||||
|
||||
sed -e s/SERIES/${series}/g \
|
||||
-e s/PPAVERS/${PPAVERS}/g \
|
||||
< ${debdir}/changelog > recoll-${RCLVERS}/debian/changelog
|
||||
|
||||
(cd recoll-${RCLVERS};debuild -S -sa) || break
|
||||
|
||||
dput $PPANAME recoll_${RCLVERS}-1~ppa${PPAVERS}~${series}1_source.changes
|
||||
done
|
||||
|
||||
### KIO
|
||||
series="precise trusty vivid"
|
||||
series=
|
||||
|
||||
debdir=debiankio
|
||||
topdir=kio-recoll-${RCLVERS}
|
||||
if test "X$series" != X ; then
|
||||
check_recoll_orig
|
||||
if test ! -f kio-recoll_${RCLVERS}.orig.tar.gz ; then
|
||||
cp -p recoll_${RCLVERS}.orig.tar.gz \
|
||||
kio-recoll_${RCLVERS}.orig.tar.gz || exit 1
|
||||
fi
|
||||
if test ! -d $topdir ; then
|
||||
mkdir temp
|
||||
cd temp
|
||||
tar xvzf ../recoll_${RCLVERS}.orig.tar.gz || exit 1
|
||||
mv recoll-${RCLVERS} ../$topdir || exit 1
|
||||
cd ..
|
||||
fi
|
||||
fi
|
||||
for series in $series ; do
|
||||
|
||||
rm -rf $topdir/debian
|
||||
cp -rp ${debdir}/ $topdir/debian || exit 1
|
||||
|
||||
sed -e s/SERIES/$series/g \
|
||||
-e s/PPAVERS/${PPAVERS}/g \
|
||||
< ${debdir}/changelog > $topdir/debian/changelog ;
|
||||
|
||||
(cd $topdir;debuild -S -sa) || exit 1
|
||||
|
||||
dput $PPANAME kio-recoll_${RCLVERS}-0~ppa${PPAVERS}~${series}1_source.changes
|
||||
|
||||
done
|
||||
|
||||
### Unity Lens
|
||||
series="precise"
|
||||
series=
|
||||
|
||||
debdir=debianunitylens
|
||||
topdir=recoll-lens-${LENSVERS}
|
||||
if test "X$series" != X ; then
|
||||
if test ! -f recoll-lens_${LENSVERS}.orig.tar.gz ; then
|
||||
if test -f recoll-lens-${LENSVERS}.tar.gz ; then
|
||||
mv recoll-lens-${LENSVERS}.tar.gz \
|
||||
recoll-lens_${LENSVERS}.orig.tar.gz
|
||||
else
|
||||
fatal "Can find neither recoll-lens_${LENSVERS}.orig.tar.gz nor " \
|
||||
"recoll-lens-${LENSVERS}.tar.gz"
|
||||
fi
|
||||
fi
|
||||
test -d $topdir || tar xvzf recoll-lens_${LENSVERS}.orig.tar.gz || exit 1
|
||||
fi
|
||||
|
||||
for series in $series ; do
|
||||
|
||||
rm -rf $topdir/debian
|
||||
cp -rp ${debdir}/ $topdir/debian || exit 1
|
||||
|
||||
sed -e s/SERIES/$series/g \
|
||||
-e s/PPAVERS/${PPAVERS}/g \
|
||||
< ${debdir}/changelog > $topdir/debian/changelog ;
|
||||
|
||||
(cd $topdir;debuild -S -sa) || break
|
||||
|
||||
dput $PPANAME \
|
||||
recoll-lens_${LENSVERS}-1~ppa${PPAVERS}~${series}1_source.changes
|
||||
|
||||
done
|
||||
|
||||
### Unity Scope
|
||||
series="trusty vivid"
|
||||
series=
|
||||
|
||||
debdir=debianunityscope
|
||||
if test ! -d ${debdir}/ ; then
|
||||
rm -f ${debdir}
|
||||
ln -s ${SCOPESRC}/debian $debdir
|
||||
fi
|
||||
topdir=unity-scope-recoll-${SCOPEVERS}
|
||||
if test "X$series" != X ; then
|
||||
if test ! -f unity-scope-recoll_${SCOPEVERS}.orig.tar.gz ; then
|
||||
if test -f unity-scope-recoll-${SCOPEVERS}.tar.gz ; then
|
||||
mv unity-scope-recoll-${SCOPEVERS}.tar.gz \
|
||||
unity-scope-recoll_${SCOPEVERS}.orig.tar.gz
|
||||
else
|
||||
if test -f $RCLDOWNLOAD/unity-scope-recoll-${SCOPEVERS}.tar.gz;then
|
||||
cp -p $RCLDOWNLOAD/unity-scope-recoll-${SCOPEVERS}.tar.gz \
|
||||
unity-scope-recoll_${SCOPEVERS}.orig.tar.gz || fatal copy
|
||||
else
|
||||
fatal "Can find neither " \
|
||||
"unity-scope-recoll_${SCOPEVERS}.orig.tar.gz nor " \
|
||||
"$RCLDOWNLOAD/unity-scope-recoll-${SCOPEVERS}.tar.gz"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
test -d $topdir || tar xvzf unity-scope-recoll_${SCOPEVERS}.orig.tar.gz \
|
||||
|| exit 1
|
||||
fi
|
||||
for series in $series ; do
|
||||
|
||||
rm -rf $topdir/debian
|
||||
cp -rp ${debdir}/ $topdir/debian || exit 1
|
||||
|
||||
sed -e s/SERIES/$series/g \
|
||||
-e s/PPAVERS/${PPAVERS}/g \
|
||||
< ${debdir}/changelog > $topdir/debian/changelog ;
|
||||
|
||||
(cd $topdir;debuild -S -sa) || break
|
||||
|
||||
dput $PPANAME \
|
||||
unity-scope-recoll_${SCOPEVERS}-1~ppa${PPAVERS}~${series}1_source.changes
|
||||
|
||||
done
|
23
packaging/debian/debian/README.Debian
Normal file
23
packaging/debian/debian/README.Debian
Normal file
|
@ -0,0 +1,23 @@
|
|||
README for Debian
|
||||
-----------------
|
||||
|
||||
Installing over an older version: 1.18 introduces significant index formats
|
||||
changes to support optional character case and diacritics sensitivity, and it
|
||||
will be advisable to reset the index in most cases. This will be best done by
|
||||
destroying the index directory (rm -rf ~/.recoll/xapiandb).
|
||||
|
||||
If 1.18 is not configured for case and diacritics sensitivity, it is mostly
|
||||
compatible with 1.17 indexes.
|
||||
|
||||
-- Kartik Mistry <kartik@debian.org> Tue, 13 Nov 2012 12:33:00 +0530
|
||||
|
||||
Installing over an older version: 1.16 is mostly compatible with 1.15 indexes,
|
||||
except for a few differences for weird terms containing punctuation signs.
|
||||
Perform a full index pass if installing over an older version. The simplest
|
||||
way to do this is to quit all recoll programs and just delete the index
|
||||
directory (rm -rf ~/.recoll/xapiandb), then start recoll or recollindex.
|
||||
recollindex -z will do the same in most cases.
|
||||
|
||||
Also, using the anchored search feature requires a full reindex.
|
||||
|
||||
-- Kartik Mistry <kartik@debian.org> Thu, 22 Sep 2011 21:30:05 +0530
|
579
packaging/debian/debian/changelog
Normal file
579
packaging/debian/debian/changelog
Normal file
|
@ -0,0 +1,579 @@
|
|||
recoll (1.22.0-1~ppaPPAVERS~SERIES1) SERIES; urgency=low
|
||||
|
||||
* New build based on autotools
|
||||
* Synonyms
|
||||
* Windows port
|
||||
|
||||
-- Jean-Francois Dockes <jf@dockes.org> Sat, 21 Nov 2015 16:01:00 +0200
|
||||
|
||||
recoll (1.20.6-1~ppaPPAVERS~SERIES1) SERIES; urgency=low
|
||||
|
||||
* Fix some decompression issues with serious performance and
|
||||
system load consequences in some cases (depending on data): minimum
|
||||
checking that enough temp space is available before uncompressing, no
|
||||
need to uncompress tar.gz files, set a default of 20 MBs for
|
||||
maxcompressedfilekbs.
|
||||
* rclscribus fixes.
|
||||
* GUI messages: Danish translation and fix 2 dialogs which were not
|
||||
translated improvements.
|
||||
|
||||
-- Jean-Francois Dockes <jf@dockes.org> Sat, 25 Apr 2015 14:36:00 +0200
|
||||
|
||||
recoll (1.20.4-1~ppaPPAVERS~SERIES1) SERIES; urgency=low
|
||||
|
||||
* Should have been in 1.20.3: skip compressed fs image files like xxx.img.gz
|
||||
by default (mimemap:recoll_noindex).
|
||||
|
||||
-- Jean-Francois Dockes <jf@dockes.org> Mon, 30 Mar 2015 10:06:00 +0200
|
||||
|
||||
recoll (1.20.3-1~ppaPPAVERS~SERIES1) SERIES; urgency=low
|
||||
|
||||
* fixes a bug where the real time indexer did not process the web queue
|
||||
* miscellaneous usability improvements in the GUI.
|
||||
* Copy sample fragbuts.xml file if it does not exist
|
||||
|
||||
-- Jean-Francois Dockes <jf@dockes.org> Sat, 28 Mar 2015 09:40:00 +0200
|
||||
|
||||
recoll (1.20.1-1~ppaPPAVERS~SERIES1) SERIES; urgency=low
|
||||
|
||||
* 1.20.1 brings improved indexing of compound words like email addresses
|
||||
and miscellaneous usability improvements in the GUI.
|
||||
|
||||
-- Jean-Francois Dockes <jf@dockes.org> Fri, 19 Dec 2014 08:14:00 +0200
|
||||
|
||||
recoll (1.19.14p2-1~ppaPPAVERS~SERIES1) SERIES; urgency=low
|
||||
|
||||
* 1.19.14p2 fixes Bengali diacritics processing, a memory leak in the
|
||||
Python module, and a few minor issues in the filters.
|
||||
|
||||
-- Jean-Francois Dockes <jf@dockes.org> Thu, 11 Sep 2014 07:47:00 +0200
|
||||
|
||||
recoll (1.19.14p1-1~ppaPPAVERS~SERIES1) SERIES; urgency=low
|
||||
|
||||
* 1.19.14p1 fixes a descriptor and memory leak in the Python module. The
|
||||
main programs and library are unchanged.
|
||||
|
||||
-- Jean-Francois Dockes <jf@dockes.org> Thu, 26 Jun 2014 13:14:00 +0200
|
||||
|
||||
recoll (1.19.14-1~ppaPPAVERS~SERIES1) SERIES; urgency=low
|
||||
|
||||
* 1.19.14 fixes two relatively minor but ennoying issues in indexing:
|
||||
|
||||
- The use of a separate readonly Database object for querying the index
|
||||
while indexing would trigger Xapian errors, (bad block reads), and
|
||||
subsequent up-to-date check failures (leading to unnecessary
|
||||
reindexing). The jury is out as to the cause, but using the same
|
||||
object for reading and writing seems to eliminate the problem.
|
||||
|
||||
- A spurious log message in the child process between forking and
|
||||
executing the filter could block on a mutex, and lead to a 20 mn
|
||||
timeout for the affected father process thread (happened only in
|
||||
multithread mode).
|
||||
|
||||
-- Jean-Francois Dockes <jf@dockes.org> Sat, 07 Jun 2014 18:56:00 +0200
|
||||
|
||||
recoll (1.19.13-1~ppaPPAVERS~SERIES1) SERIES; urgency=low
|
||||
|
||||
* 1.19.13 hopefully fixes the multithreaded indexing crashes and silences
|
||||
the noisy ppt extractor failures.
|
||||
|
||||
-- Jean-Francois Dockes <jf@dockes.org> Thu, 06 May 2014 14:22:00 +0200
|
||||
|
||||
recoll (1.19.12p2-1~ppaPPAVERS~SERIES1) SERIES; urgency=low
|
||||
|
||||
* 1.19.12 p1 + restable doubleclick
|
||||
|
||||
-- Jean-Francois Dockes <jf@dockes.org> Sun, 07 Apr 2014 16:17:00 +0200
|
||||
|
||||
recoll (1.19.12p1-1~ppaPPAVERS~SERIES1) SERIES; urgency=low
|
||||
|
||||
* 1.19.12 install forgot the xls filter
|
||||
|
||||
-- Jean-Francois Dockes <jf@dockes.org> Sun, 06 Apr 2014 06:57:00 +0200
|
||||
|
||||
recoll (1.19.12-1~ppaPPAVERS~SERIES1) SERIES; urgency=low
|
||||
|
||||
* Minor fixes to 1.19.11. Make metadata stored length a parameter.
|
||||
* New xls dumper based on mso-dumper removes catdoc dependancy
|
||||
* Move out the code for the Ubuntu Unity lens and scope
|
||||
|
||||
-- Jean-Francois Dockes <jf@dockes.org> Mon, 02 Apr 2014 15:12:00 +0200
|
||||
|
||||
recoll (1.19.11p1-1~ppaPPAVERS~SERIES1) SERIES; urgency=low
|
||||
|
||||
* minor fixes to 1.19.10
|
||||
|
||||
-- Jean-Francois Dockes <jf@dockes.org> Mon, 27 Nov 2013 09:54:00 +0200
|
||||
|
||||
recoll (1.19.10-1~ppaPPAVERS~SERIES1) SERIES; urgency=low
|
||||
|
||||
* Support for saucy in 1.19. Separate python and python3 packages
|
||||
|
||||
-- Jean-Francois Dockes <jf@dockes.org> Sat, 23 Nov 2013 16:01:46 +0100
|
||||
|
||||
recoll (1.18.1-1) experimental; urgency=low
|
||||
|
||||
* New upstream version:
|
||||
+ Please read README.Debian for changes in index db format.
|
||||
* debian/patches/txtcsvopen.diff:
|
||||
+ Dropped. Merged upstream.
|
||||
* debian/patches/fix-manpage-typos.patch:
|
||||
+ Added patch to fix manpage typos and groff errors.
|
||||
* debian/control:
|
||||
+ Added VCS-* fields.
|
||||
|
||||
-- Kartik Mistry <kartik@debian.org> Tue, 13 Nov 2012 12:29:46 +0530
|
||||
|
||||
recoll (1.17.3-2) unstable; urgency=medium
|
||||
|
||||
* debian/rules:
|
||||
+ Call dh_python2 for python-recoll. (Closes: #681586)
|
||||
* debian/control:
|
||||
+ Added X-Python-Version field for correct Python version dependency.
|
||||
|
||||
-- Kartik Mistry <kartik@debian.org> Sat, 14 Jul 2012 20:20:56 +0530
|
||||
|
||||
recoll (1.17.3-1) unstable; urgency=low
|
||||
|
||||
* New upstream release.
|
||||
* debian/patches/txtcsvopen.diff:
|
||||
+ Added patch to fix opening of compressed text-files with gnumeric.
|
||||
(Closes: #674756)
|
||||
|
||||
-- Kartik Mistry <kartik@debian.org> Fri, 08 Jun 2012 11:46:57 +0530
|
||||
|
||||
recoll (1.17.2-1) unstable; urgency=low
|
||||
|
||||
* New upstream release:
|
||||
+ Dropped patches: fix-kFreeBSD-ftbfs.patch, recoll_ionice_getpid.patch.
|
||||
These are merged with upstream.
|
||||
+ Refreshed patch: fix-python-install.patch.
|
||||
* debian/rules, debian/control:
|
||||
+ Added hardening support.
|
||||
* debian/copyright:
|
||||
+ Fixed duplicate Copyright sections.
|
||||
|
||||
-- Kartik Mistry <kartik@debian.org> Fri, 18 May 2012 10:59:21 +0530
|
||||
|
||||
recoll (1.17.1-2) unstable; urgency=low
|
||||
|
||||
* debian/patches:
|
||||
+ fix-kFreeBSD-ftbfs.patch: Added patch to fix FTBFS on kFreeBSD from
|
||||
upstream (Closes: #667083)
|
||||
+ recoll_ionice_getpid.patch: Added patch to fix FTBFS with gcc-4.7 from
|
||||
upstream (Closes: #667352)
|
||||
|
||||
-- Kartik Mistry <kartik@debian.org> Wed, 04 Apr 2012 12:16:48 +0530
|
||||
|
||||
recoll (1.17.1-1) unstable; urgency=low
|
||||
|
||||
* New upstream release.
|
||||
* Enable Python module resulting into new binary: python-recoll.
|
||||
* debian/control:
|
||||
+ Updated Build-Deps: libqtwebkit-dev, python-all-dev.
|
||||
+ Added python-recoll binary.
|
||||
+ Updated Standards-Version to 3.9.3
|
||||
* debian/rules:
|
||||
+ Build Python module by default.
|
||||
* debian/recoll.menu, debian/python-recoll.install, debian/recoll.install:
|
||||
+ Changes for new binary package.
|
||||
* debian/copyright:
|
||||
+ Updated to copyright-format 1.0
|
||||
+ Updated upstream and Debian copyright.
|
||||
+ Fixed unicode.org/copyright.html URL.
|
||||
|
||||
-- Kartik Mistry <kartik@debian.org> Tue, 27 Mar 2012 12:15:51 +0530
|
||||
|
||||
recoll (1.16.2-1) unstable; urgency=low
|
||||
|
||||
* New upstream release.
|
||||
* debian/copyright:
|
||||
+ Updated as per DEP-5 format, simplying copyright file.
|
||||
* debian/control:
|
||||
+ Dropped: flac, vorbis-tools and libid3-tools from Suggests, as
|
||||
python-mutagen handles audio now.
|
||||
+ Dropped: lyx from Suggests, as it will be too heavy for most of users as
|
||||
discussed with upstream.
|
||||
* debian/rules:
|
||||
+ Use STRIP variable to strip during install phase. This makes patch
|
||||
01_nostrip_final_binaries_437901.diff obsolete, removed this patch.
|
||||
|
||||
-- Kartik Mistry <kartik@debian.org> Wed, 09 Nov 2011 20:35:16 +0530
|
||||
|
||||
recoll (1.16.1-1) unstable; urgency=low
|
||||
|
||||
* New upstream release.
|
||||
* debian/copyright:
|
||||
+ Added missing GPL-3 URL in debian/* copyright section.
|
||||
|
||||
-- Kartik Mistry <kartik@debian.org> Thu, 29 Sep 2011 10:06:54 +0530
|
||||
|
||||
recoll (1.16.0-1) unstable; urgency=low
|
||||
|
||||
* New upstream release:
|
||||
+ See README.Debian for upgrade note and information.
|
||||
* debian/copyright:
|
||||
+ Updated as per latest DEP-5 format.
|
||||
* debian/control:
|
||||
+ Recommends: xdg-utils now.
|
||||
* debian/rules:
|
||||
+ Added recommends build targets.
|
||||
|
||||
-- Kartik Mistry <kartik@debian.org> Thu, 22 Sep 2011 21:30:25 +0530
|
||||
|
||||
recoll (1.15.9-1) unstable; urgency=low
|
||||
|
||||
* New upstream release:
|
||||
+ Dropped patch 02_recoll_staticfix_626882.diff, merged upstream
|
||||
|
||||
-- Kartik Mistry <kartik@debian.org> Wed, 15 Jun 2011 09:20:20 +0530
|
||||
|
||||
recoll (1.15.8-2) unstable; urgency=low
|
||||
|
||||
* debian/patches/02_recoll_staticfix_626882.diff:
|
||||
+ Added patch to fix segfault in 1.15.8. Patch from Jean-Francois Dockes
|
||||
<jf@dockes.org> (Closes: #626882)
|
||||
|
||||
-- Kartik Mistry <kartik@debian.org> Tue, 17 May 2011 09:57:50 +0530
|
||||
|
||||
recoll (1.15.8-1) unstable; urgency=low
|
||||
|
||||
* New upstream release.
|
||||
* debian/patches/02_kfreebsd-ftbfs.diff:
|
||||
+ Removed. Merged with upstream.
|
||||
* debian/control:
|
||||
+ Updated to Standards-Version 3.9.2 (no changes needed)
|
||||
|
||||
-- Kartik Mistry <kartik@debian.org> Thu, 12 May 2011 09:47:21 +0530
|
||||
|
||||
recoll (1.15.7-2) unstable; urgency=low
|
||||
|
||||
* Applied patch 02_kfreebsd-ftbfs.diff from upstream to fix FTBFS
|
||||
on kFreeBSD-* (Closes: #618796)
|
||||
* debian/copyright:
|
||||
+ Updated to latest DEP-5 specification
|
||||
|
||||
-- Kartik Mistry <kartik@debian.org> Fri, 15 Apr 2011 18:38:54 +0530
|
||||
|
||||
recoll (1.15.7-1) unstable; urgency=low
|
||||
|
||||
* New upstream release:
|
||||
+ Fixed: Segmentation fault when file type radio button clicked.
|
||||
(Closes: #617353)
|
||||
* debian/patches/02_manpage_fix.diff:
|
||||
+ Removed. Merged with upstream.
|
||||
|
||||
-- Kartik Mistry <kartik@debian.org> Sun, 13 Mar 2011 09:07:57 +0530
|
||||
|
||||
recoll (1.15.2-1) unstable; urgency=low
|
||||
|
||||
* Upload to unstable
|
||||
* New upstream release
|
||||
* debian/patches:
|
||||
+ Refreshed 01_nostrip_final_binaries_437901.diff
|
||||
+ Added 02_manpage_fix.diff to fix manpage groff issues
|
||||
|
||||
-- Kartik Mistry <kartik@debian.org> Tue, 15 Feb 2011 11:25:58 +0530
|
||||
|
||||
recoll (1.14.4-1) experimental; urgency=low
|
||||
|
||||
* New upstream release
|
||||
* debian/copyright:
|
||||
+ Updated for DEP-5 format specification
|
||||
|
||||
-- Kartik Mistry <kartik@debian.org> Thu, 02 Dec 2010 00:29:06 +0530
|
||||
|
||||
recoll (1.14.2-1) experimental; urgency=low
|
||||
|
||||
* New upstream release
|
||||
* debian/control:
|
||||
+ Added xlstproc as Recommends (Closes: #587684)
|
||||
+ Added python-mutagen as Suggests
|
||||
* debian/patches:
|
||||
+ Refreshed 01_nostrip_final_binaries_437901.diff
|
||||
+ Removed 02_recoll-prepare-for-xapian-1.2.diff, merged with upstream
|
||||
|
||||
-- Kartik Mistry <kartik@debian.org> Mon, 27 Sep 2010 17:52:17 +0530
|
||||
|
||||
recoll (1.13.04-3) unstable; urgency=low
|
||||
|
||||
* Added patch for xapian 1.2 compatibility from Olly Betts <olly@survex.com>
|
||||
(Closes: #579929)
|
||||
|
||||
-- Kartik Mistry <kartik@debian.org> Mon, 03 May 2010 09:47:16 +0530
|
||||
|
||||
recoll (1.13.04-2) unstable; urgency=low
|
||||
|
||||
* debian/control:
|
||||
+ Added missing packages to Suggests: flac, libid3-tools, lyx, pstotext,
|
||||
python-chm, untex, vorbis-tools Thanks to Ivan Vilata i Balaguer
|
||||
<ivan@selidor.net> (Closes: #578441)
|
||||
|
||||
-- Kartik Mistry <kartik@debian.org> Fri, 23 Apr 2010 11:07:00 +0530
|
||||
|
||||
recoll (1.13.04-1) unstable; urgency=low
|
||||
|
||||
* New upstream release
|
||||
|
||||
-- Kartik Mistry <kartik@debian.org> Fri, 16 Apr 2010 10:39:02 +0530
|
||||
|
||||
recoll (1.13.02-2) unstable; urgency=low
|
||||
|
||||
* debian/control:
|
||||
+ Don't suggest xpdf (Closes: #569333)
|
||||
* debian/copyright:
|
||||
+ Updated Debian package copyright year
|
||||
* Removed unused README.source file
|
||||
|
||||
-- Kartik Mistry <kartik@debian.org> Fri, 19 Feb 2010 10:42:53 +0530
|
||||
|
||||
recoll (1.13.02-1) unstable; urgency=low
|
||||
|
||||
* New upstream release
|
||||
* debian/control:
|
||||
+ Updated to Standards-Version 3.8.4 (no changes needed)
|
||||
|
||||
-- Kartik Mistry <kartik@debian.org> Wed, 03 Feb 2010 11:00:53 +0530
|
||||
|
||||
recoll (1.13.01-1) unstable; urgency=low
|
||||
|
||||
* New upstream release
|
||||
+ Fixed bug that causes field values ignored for Capitalized words and
|
||||
phrases
|
||||
|
||||
-- Kartik Mistry <kartik@debian.org> Fri, 08 Jan 2010 10:09:15 +0530
|
||||
|
||||
recoll (1.13.00-1) unstable; urgency=low
|
||||
|
||||
* New upstream release
|
||||
* debian/control:
|
||||
+ Fixed package descriptions, replaced QT->Qt (Closes: #563725)
|
||||
* debian/patches/01_nostrip_final_binaries_437901.diff:
|
||||
+ Refreshed patch for upstream changes
|
||||
* Converted package to new source format '3.0 (quilt)'
|
||||
|
||||
-- Kartik Mistry <kartik@debian.org> Tue, 05 Jan 2010 23:23:30 +0530
|
||||
|
||||
recoll (1.12.4-1) unstable; urgency=low
|
||||
|
||||
* New upstream release:
|
||||
+ Fixed FTBFS with binutils-gold (Closes: #556315)
|
||||
|
||||
-- Kartik Mistry <kartik@debian.org> Fri, 11 Dec 2009 00:08:37 +0530
|
||||
|
||||
recoll (1.12.3-1) unstable; urgency=low
|
||||
|
||||
* New upstream release
|
||||
* debian/control:
|
||||
+ Updated Build-Depends on libqt4-dev as we are building Qt4 ui now
|
||||
* debian/rules:
|
||||
+ Make sure that we call qmake-qt4
|
||||
|
||||
-- Kartik Mistry <kartik@debian.org> Thu, 29 Oct 2009 22:44:50 +0530
|
||||
|
||||
recoll (1.12.2-1) unstable; urgency=low
|
||||
|
||||
* New upstream release:
|
||||
+ Dropped patch 02_manpage_fixes.diff, merged with upstream
|
||||
* Added debian/README.source file to confirm with latest policy
|
||||
* Removed debian/docs, we are using dh_installdocs in debian/rules
|
||||
* debian/control:
|
||||
+ Wrapped up Build-Depends
|
||||
+ Depends on quilt, since patch system is using quilt now
|
||||
+ Updated to Standards-Version 3.8.3
|
||||
+ Updated dependency on libxapian-dev (>= 1.0.15)
|
||||
* debian/rules:
|
||||
+ Changes for quilt migration
|
||||
|
||||
-- Kartik Mistry <kartik@debian.org> Fri, 23 Oct 2009 10:14:05 +0530
|
||||
|
||||
recoll (1.12.1-1) unstable; urgency=low
|
||||
|
||||
* New upstream release
|
||||
* debian/control:
|
||||
+ Updated to Standards-Version 3.8.2 (no changes needed)
|
||||
* debian/copyright:
|
||||
+ [Lintian] Removed licenses URL links to symlink
|
||||
|
||||
-- Kartik Mistry <kartik@debian.org> Sat, 27 Jun 2009 20:08:28 +0530
|
||||
|
||||
recoll (1.12.0-1) unstable; urgency=low
|
||||
|
||||
* New upstream release
|
||||
* debian/copyright:
|
||||
+ [Lintian] Updated for use of correct copyright symbol © instead of (C)
|
||||
+ Updated Debian packaging copyright year
|
||||
* debian/rules:
|
||||
+ Used dh_prep instead of deprecated dh_clean -k
|
||||
* debian/control:
|
||||
+ Updated debhelper dependency to 7
|
||||
* debian/patches:
|
||||
+ Dropped 02_gcc-snapshot-missing-headers-fix.dpatch, merged with upstream
|
||||
+ Added patch 02_manpage_fixes.dpatch for groff warnings
|
||||
|
||||
-- Kartik Mistry <kartik@debian.org> Sat, 28 Feb 2009 14:33:53 +0530
|
||||
|
||||
recoll (1.11.0-2) unstable; urgency=low
|
||||
|
||||
* debian/control:
|
||||
+ Added versioned build-dep on libxapian-dev, Thanks to Brad Sawatzky
|
||||
<brad+debian@swatter.net> for catch (Closes: #507473)
|
||||
+ Add libimage-exiftool-perl as Suggests in which I forgot in
|
||||
previous upload
|
||||
* debian/changelog:
|
||||
+ Fixed typo from previous upload entry
|
||||
|
||||
-- Kartik Mistry <kartik@debian.org> Wed, 03 Dec 2008 15:05:55 +0530
|
||||
|
||||
recoll (1.11.0-1) unstable; urgency=low
|
||||
|
||||
* New upstream release:
|
||||
+ Remembers missing filters in first run (Closes: #500690)
|
||||
* debian/control:
|
||||
+ Added libimage-exiftool-perl as Suggests (Closes: #502427)
|
||||
+ Added Python as recommaded due to filters/rclpython script
|
||||
although, its not necessary as it will be installed only
|
||||
when Python is present
|
||||
* debian/patches:
|
||||
+ Refreshed patch for gcc 4.4 FTBFS (Closes: #505376)
|
||||
* debian/copyright:
|
||||
+ Updated for newly added filter and image files
|
||||
|
||||
-- Kartik Mistry <kartik@debian.org> Thu, 13 Nov 2008 21:18:15 +0530
|
||||
|
||||
recoll (1.10.6-1) unstable; urgency=low
|
||||
|
||||
* New upstream release
|
||||
+ Fixed typo in tooltip in indexing configuration (Closes: #486689)
|
||||
+ Dropped patch 03_manpage_fixes.dpatch, merged with upstream
|
||||
* debian/control:
|
||||
+ Updated to Standards-Version 3.8.0 (no changes needed)
|
||||
+ Updated my maintainer email address
|
||||
* debian/copyright:
|
||||
+ Updated my maintainer email address
|
||||
+ Updated license text to proposed license format
|
||||
+ Updated upstream copyright year
|
||||
|
||||
-- Kartik Mistry <kartik@debian.org> Thu, 11 Sep 2008 16:06:48 +0530
|
||||
|
||||
recoll (1.10.2-1) unstable; urgency=low
|
||||
|
||||
* New upstream release
|
||||
+ Updated patch debian/patches/02_gcc-snapshot-missing-headers-fix.dpatch
|
||||
Some portions are now merged with upstream
|
||||
* debian/copyright:
|
||||
+ Fixed indentation to 80 characters
|
||||
+ Updated Debian package copyright year
|
||||
|
||||
-- Kartik Mistry <kartik.mistry@gmail.com> Thu, 29 May 2008 23:25:40 +0530
|
||||
|
||||
recoll (1.10.1-1) unstable; urgency=low
|
||||
|
||||
* New upstream release
|
||||
+ Updated debian/patches/02_gcc-snapshot-missing-headers-fix.dpatch
|
||||
Some portions are merged with upstream
|
||||
* debian/control:
|
||||
+ Fixed short description, Thanks to Mohammed Adnène Trojette
|
||||
<adn+deb@diwi.org>
|
||||
* debian/patches/03_manpage_fixes.dpatch:
|
||||
+ Added patch to fix manpage groff warnings
|
||||
|
||||
-- Kartik Mistry <kartik.mistry@gmail.com> Wed, 27 Feb 2008 18:41:25 +0530
|
||||
|
||||
recoll (1.10.0-5) unstable; urgency=low
|
||||
|
||||
* debian/patches/02_gcc-snapshot-missing-headers-fix.dpatch:
|
||||
+ Really fixed the FTBFS with gcc-4.3/g++-4.3 (Closes: #455652)
|
||||
|
||||
-- Kartik Mistry <kartik.mistry@gmail.com> Sun, 27 Jan 2008 14:37:53 +0530
|
||||
|
||||
recoll (1.10.0-4) unstable; urgency=low
|
||||
|
||||
* debian/patches/02_gcc-snapshot-missing-headers-fix.dpatch:
|
||||
+ Updated patch to fix missing include header in qtgui/main.cpp
|
||||
(Closes: #455652)
|
||||
* debian/copyright:
|
||||
+ Updated missing license for qtgui/q3richtext_p.h
|
||||
+ Moved other copyright holders for GPL above license
|
||||
to make it readable
|
||||
|
||||
-- Kartik Mistry <kartik.mistry@gmail.com> Wed, 23 Jan 2008 10:42:20 +0530
|
||||
|
||||
recoll (1.10.0-3) unstable; urgency=low
|
||||
|
||||
* debian/control:
|
||||
+ Added external helper programs and utilities to Suggests field
|
||||
(Closes: #441629, #457033)
|
||||
|
||||
-- Kartik Mistry <kartik.mistry@gmail.com> Fri, 28 Dec 2007 08:12:52 +0530
|
||||
|
||||
recoll (1.10.0-2) unstable; urgency=low
|
||||
|
||||
* debian/control:
|
||||
+ Updated Standards-Version to 3.7.3
|
||||
* debian/patches/02_gcc-snapshot-missing-headers-fix.dpatch:
|
||||
+ Added patch to fix compilation with gcc-snapshot due to
|
||||
missing headers (Closes: #455652)
|
||||
* debian/rules:
|
||||
+ Fixed clean target
|
||||
|
||||
-- Kartik Mistry <kartik.mistry@gmail.com> Tue, 11 Dec 2007 14:42:47 +0530
|
||||
|
||||
recoll (1.10.0-1) unstable; urgency=low
|
||||
|
||||
* New upstream release
|
||||
* debian/control:
|
||||
+ Moved Homepage: entry to control field
|
||||
+ Dropped unnecessary dependency on qt3-dev-tools
|
||||
|
||||
-- Kartik Mistry <kartik.mistry@gmail.com> Wed, 28 Nov 2007 19:54:58 +0530
|
||||
|
||||
recoll (1.9.0-1) unstable; urgency=low
|
||||
|
||||
* New upstream release
|
||||
* debian/patches: dropped 02_desktop_entry_fixes.dpatch, merged with
|
||||
upstream, rewrote 01_nostrip_final_binary_437901.dpatch after upstream
|
||||
changes
|
||||
* debian/menu: used Data Management since it is better and appropriate
|
||||
* debian/copyright: added missing copyright from index/csguess.cpp
|
||||
|
||||
-- Kartik Mistry <kartik.mistry@gmail.com> Wed, 12 Sep 2007 14:05:39 +0530
|
||||
|
||||
recoll (1.8.2-3) unstable; urgency=low
|
||||
|
||||
* debian/rules: added better clean target, better configure flags,
|
||||
separated LDFLAGS
|
||||
* Added dpatch support
|
||||
* debian/patches/01_nostrip_final_binary_437901.dpatch: added patch to not
|
||||
strip binary from upstream (Closes: #437901)
|
||||
* debian/patches/02_desktop_entry_fixes.dpatch: added patch to fix desktop
|
||||
menu entry according to freedesktop standards
|
||||
* debian/menu: fixed according to latest menu policy, changed subsection to
|
||||
Tools from Databases (hint taken from beagle)
|
||||
* debian/copyright: moved copyright out of license section, adjusted
|
||||
copyrights portions under proper license
|
||||
|
||||
-- Kartik Mistry <kartik.mistry@gmail.com> Sat, 18 Aug 2007 20:28:49 +0530
|
||||
|
||||
recoll (1.8.2-2) unstable; urgency=low
|
||||
|
||||
* debian/rules: xapian is dynamically linked now, Thanks to
|
||||
Jean-Francois Dockes <jean-francois.dockes@wanadoo.fr> (Closes: #427783)
|
||||
* Fixed debian/watch file, Thanks to Vincent Fourmond <fourmond@debian.org>
|
||||
|
||||
-- Kartik Mistry <kartik.mistry@gmail.com> Fri, 08 Jun 2007 10:51:01 +0530
|
||||
|
||||
recoll (1.8.2-1) unstable; urgency=low
|
||||
|
||||
* New upstream release
|
||||
* debian/watch: fixed now
|
||||
* debian/control: fixed long descriptions
|
||||
|
||||
-- Kartik Mistry <kartik.mistry@gmail.com> Tue, 22 May 2007 15:24:54 +0530
|
||||
|
||||
recoll (1.8.1-1) unstable; urgency=low
|
||||
|
||||
* Initial release (Closes: #422039)
|
||||
* Based on package prepared by Jean-Francois Dockes <jean-francois.dockes@wanadoo.fr>
|
||||
|
||||
-- Kartik Mistry <kartik.mistry@gmail.com> Thu, 3 May 2007 12:15:02 +0530
|
1
packaging/debian/debian/compat
Normal file
1
packaging/debian/debian/compat
Normal file
|
@ -0,0 +1 @@
|
|||
5
|
85
packaging/debian/debian/control
Normal file
85
packaging/debian/debian/control
Normal file
|
@ -0,0 +1,85 @@
|
|||
Source: recoll
|
||||
Section: x11
|
||||
Priority: optional
|
||||
Maintainer: Jean-Francois Dockes <jfd@recoll.org>
|
||||
Build-Depends: autotools-dev,
|
||||
debhelper (>= 7),
|
||||
dh-python,
|
||||
bison,
|
||||
libqt4-dev,
|
||||
libqtwebkit-dev,
|
||||
libx11-dev,
|
||||
libxapian-dev (>= 1.2.0),
|
||||
libz-dev,
|
||||
python-all-dev (>= 2.6.6-3~),
|
||||
python3-all-dev,
|
||||
Standards-Version: 3.9.6
|
||||
X-Python-Version: >= 2.7
|
||||
Homepage: http://www.lesbonscomptes.com/recoll
|
||||
Vcs-Git: git://anonscm.debian.org/collab-maint/recoll.git
|
||||
Vcs-Browser: http://anonscm.debian.org/gitweb/?p=collab-maint/recoll.git;a=summary
|
||||
|
||||
Package: recoll
|
||||
Architecture: any
|
||||
Depends: ${misc:Depends}, ${shlibs:Depends}, python2, python
|
||||
Recommends: python-recoll, aspell, xdg-utils, xsltproc
|
||||
Suggests: antiword,
|
||||
catdoc,
|
||||
ghostscript,
|
||||
libimage-exiftool-perl,
|
||||
poppler-utils,
|
||||
pstotext,
|
||||
python-chm,
|
||||
python-mutagen,
|
||||
unrtf,
|
||||
untex
|
||||
Description: Personal full text search package with a Qt GUI
|
||||
This package is a personal full text search package is based on a very strong
|
||||
backend (Xapian), for which it provides an easy to use and feature-rich
|
||||
interface.
|
||||
.
|
||||
Features:
|
||||
* Qt-based GUI
|
||||
* Supports the following document types (and their compressed versions)
|
||||
- Natively: text, html, OpenOffice files, maildir and mailbox (Mozilla and
|
||||
IceDove mail) with attachments, pidgin log files
|
||||
- With external helpers: pdf (pdftotext), postscript (ghostscript), msword
|
||||
(antiword), excel, ppt (catdoc), rtf (unrtf)
|
||||
* Powerful query facilities, with boolean searches, phrases, filter on file
|
||||
types and directory tree
|
||||
* Support for multiple charsets, Internal processing and storage uses Unicode
|
||||
UTF-8
|
||||
* Stemming performed at query time (can switch stemming language after
|
||||
indexing)
|
||||
* Easy installation. No database daemon, web server or exotic language
|
||||
necessary
|
||||
* An indexer which runs either as a thread inside the GUI or as an external,
|
||||
cron'able program
|
||||
|
||||
Package: python-recoll
|
||||
Architecture: any
|
||||
Section: python
|
||||
Depends: recoll (= ${binary:Version}),
|
||||
${misc:Depends},
|
||||
${python:Depends},
|
||||
${shlibs:Depends}
|
||||
Description: Python extension for recoll
|
||||
Personal full text search package which is based on a very strong backend
|
||||
(Xapian), for which it provides an easy to use and feature-rich interface.
|
||||
.
|
||||
This package provides Python extension module for recoll which can be use to
|
||||
extend recoll such as an Ubuntu Unity Lens.
|
||||
|
||||
Package: python3-recoll
|
||||
Architecture: any
|
||||
Section: python
|
||||
Depends: recoll (= ${binary:Version}),
|
||||
${misc:Depends},
|
||||
${python3:Depends},
|
||||
${shlibs:Depends}
|
||||
Description: Python extension for recoll
|
||||
Personal full text search package which is based on a very strong backend
|
||||
(Xapian), for which it provides an easy to use and feature-rich interface.
|
||||
.
|
||||
This package provides Python extension module for recoll which can be use to
|
||||
extend recoll such as an Ubuntu Unity Lens.
|
194
packaging/debian/debian/copyright
Normal file
194
packaging/debian/debian/copyright
Normal file
|
@ -0,0 +1,194 @@
|
|||
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
|
||||
Upstream-Name: recoll
|
||||
Upstream-Contact: Jean-Francois Dockes <jean-francois.dockes@wanadoo.fr>
|
||||
Source: http://www.lesbonscomptes.com/recoll/
|
||||
|
||||
Files: *
|
||||
Copyright: 2005-2012, Jean-Francois Dockes <jean-francois.dockes@wanadoo.fr>
|
||||
License: GPL-2+
|
||||
|
||||
Files: Binc IMAP project (bincimapmime/*)
|
||||
Copyright: 2002-2005, Andreas Aardal Hanssen <andreas-binc@bincimap.org>
|
||||
License: GPL-2+
|
||||
|
||||
Files: filters/rcl* files index/csguess.cpp internfile/htmlparse.cpp
|
||||
Copyright: 2000-2004, Mikio Hirabayashi
|
||||
License: GPL-2+
|
||||
|
||||
Files: filters/rclpython
|
||||
Copyright: J\xfcrgen Hermann, Mike Brown, Christopher Arndt
|
||||
<http://chrisarndt.de/en/software/python/colorize.html>
|
||||
License: GPL-2+
|
||||
|
||||
Files: internfile/htmlparse.cpp mh_html.cpp
|
||||
Copyright: 1999-2001, BrightStation PLC,
|
||||
2001, Ananova Ltd,
|
||||
2002-2004, Olly Betts.
|
||||
License: GPL-2+
|
||||
|
||||
Files: unac/*
|
||||
Copyright: 2000-2002, Loic Dachary <loic@senga.org>
|
||||
License: GPL-2+
|
||||
|
||||
Files: common/*
|
||||
Copyright: 2004-2005, J.F.Dockes
|
||||
License: GPL-2+
|
||||
|
||||
Files: debian/*
|
||||
Copyright: 2007-2012, Kartik Mistry <kartik@debian.org>
|
||||
License: GPL-2+
|
||||
|
||||
License: GPL-2+
|
||||
This package is free software; you can redistribute it and/or modify it under
|
||||
the terms of the GNU General Public License as published by the Free Software
|
||||
Foundation; either version 2 of the License, or (at your option) any later
|
||||
version.
|
||||
.
|
||||
This package is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
.
|
||||
You should have received a copy of the GNU General Public License along with
|
||||
this package; if not, write to the Free Software Foundation, Inc., 51 Franklin
|
||||
St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
.
|
||||
On Debian systems, the complete text of the GNU General Public License can be
|
||||
found in `/usr/share/common-licenses/GPL-2' and
|
||||
`/usr/share/common-licenses/GPL-3'.
|
||||
|
||||
Files: aspell/*
|
||||
Copyright: 2001-2002, by Kevin Atkinson
|
||||
License: LGPL-2+
|
||||
|
||||
Files: images/text-x-python.png
|
||||
Copyright: David Vignoni <http://www.oxygen-icons.org/>
|
||||
License: LGPL-2+
|
||||
|
||||
License: LGPL-2+
|
||||
This package is free software; you can redistribute it and/or modify it under
|
||||
the terms of the GNU Lesser General Public License as published by the Free
|
||||
Software Foundation; either version 2 of the License, or (at your option) any
|
||||
later version.
|
||||
.
|
||||
This package is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
|
||||
details.
|
||||
.
|
||||
You should have received a copy of the GNU Lesser General Public License along
|
||||
with this package; if not, write to the Free Software Foundation, Inc., 51
|
||||
Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
.
|
||||
On Debian systems, the complete text of the GNU Lesser General Public License
|
||||
can be found in `/usr/share/common-licenses/LGPL-2' and
|
||||
`/usr/share/common-licenses/LGPL-2.1' and `/usr/share/common-licenses/LGPL-3'.
|
||||
|
||||
Files: common/uproplist.h
|
||||
Copyright: 1991-2006, Unicode, Inc.
|
||||
License: Unicode
|
||||
|
||||
License: Unicode
|
||||
All rights reserved. Distributed under the Terms of Use in
|
||||
http://www.unicode.org/copyright.html
|
||||
.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of the Unicode data files and any associated documentation (the "Data Files")
|
||||
or Unicode software and any associated documentation (the "Software") to deal
|
||||
in the Data Files or Software without restriction, including without
|
||||
limitation the rights to use, copy, modify, merge, publish, distribute, and/or
|
||||
sell copies of the Data Files or Software, and to permit persons to whom the
|
||||
Data Files or Software are furnished to do so, provided that (a) the above
|
||||
copyright notice(s) and this permission notice appear with all copies of the
|
||||
Data Files or Software, (b) both the above copyright notice(s) and this
|
||||
permission notice appear in associated documentation, and (c) there is clear
|
||||
notice in each modified Data File or in the Software as well as in the
|
||||
documentation associated with the Data File(s) or Software that the data or
|
||||
software has been modified.
|
||||
.
|
||||
THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
|
||||
KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD
|
||||
PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN
|
||||
THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL
|
||||
DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
|
||||
PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
|
||||
ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE
|
||||
DATA FILES OR SOFTWARE.
|
||||
.
|
||||
Except as contained in this notice, the name of a copyright holder shall not
|
||||
be used in advertising or otherwise to promote the sale, use or other dealings
|
||||
in these Data Files or Software without prior written authorization of the
|
||||
copyright holder.
|
||||
|
||||
Files: utils/md5.*
|
||||
Copyright: 1991-1992, RSA Data Security, Inc. All rights reserved.
|
||||
License: RSA
|
||||
|
||||
License:RSA
|
||||
MD5C.C - RSA Data Security, Inc., MD5 message-digest algorithm
|
||||
.
|
||||
License to copy and use this software is granted provided that it is
|
||||
identified as the "RSA Data Security, Inc. MD5 Message-Digest Algorithm" in
|
||||
all material mentioning or referencing this software or this function.
|
||||
.
|
||||
License is also granted to make and use derivative works provided that such
|
||||
works are identified as "derived from the RSA Data Security, Inc. MD5
|
||||
Message-Digest Algorithm" in all material mentioning or referencing the
|
||||
derived work.
|
||||
.
|
||||
RSA Data Security, Inc. makes no representations concerning either the
|
||||
merchantability of this software or the suitability of this software for any
|
||||
particular purpose. It is provided "as is" without express or implied warranty
|
||||
of any kind.
|
||||
.
|
||||
These notices must be retained in any copies of any part of this documentation
|
||||
and/or software.
|
||||
|
||||
Files: desktop/xdg-utils-1.0.1/*
|
||||
Copyright: 2006, Kevin Krammer <kevin.krammer@gmx.at>,
|
||||
Jeremy White <jwhite@codeweavers.com>.
|
||||
License: MIT
|
||||
|
||||
License: MIT
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
.
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
Files: index/csguess.cpp
|
||||
Copyright: 2000-2004, Mikio Hirabayashi
|
||||
License: LGPL-2.1+
|
||||
|
||||
License: LGPL-2.1+
|
||||
This file is part of QDBM, Quick Database Manager.
|
||||
.
|
||||
QDBM is free software; you can redistribute it and/or modify it under
|
||||
the terms of the GNU Lesser General Public License as published by the
|
||||
Free Software Foundation; either version 2.1 of the License or any later
|
||||
version.
|
||||
.
|
||||
QDBM is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
|
||||
License for more details.
|
||||
.
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with QDBM; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
.
|
||||
On Debian systems, the complete text of the GNU Lesser General Public License
|
||||
can be found in `/usr/share/common-licenses/LGPL-2.1' and
|
||||
`/usr/share/common-licenses/LGPL-3'.
|
0
packaging/debian/debian/patches/series
Normal file
0
packaging/debian/debian/patches/series
Normal file
2
packaging/debian/debian/python-recoll.install
Normal file
2
packaging/debian/debian/python-recoll.install
Normal file
|
@ -0,0 +1,2 @@
|
|||
usr/lib/python2*/*-packages/*.egg-info
|
||||
usr/lib/python2*/*-packages/recoll/*
|
2
packaging/debian/debian/python3-recoll.install
Normal file
2
packaging/debian/debian/python3-recoll.install
Normal file
|
@ -0,0 +1,2 @@
|
|||
usr/lib/python3*/*-packages/*.egg-info
|
||||
usr/lib/python3*/*-packages/recoll/*
|
12
packaging/debian/debian/recoll.install
Normal file
12
packaging/debian/debian/recoll.install
Normal file
|
@ -0,0 +1,12 @@
|
|||
usr/bin
|
||||
usr/lib/recoll
|
||||
usr/share/applications
|
||||
usr/share/icons
|
||||
usr/share/man
|
||||
usr/share/pixmaps
|
||||
usr/share/recoll/doc
|
||||
usr/share/recoll/examples
|
||||
usr/share/recoll/filters
|
||||
usr/share/recoll/filters
|
||||
usr/share/recoll/images
|
||||
usr/share/recoll/translations
|
2
packaging/debian/debian/recoll.menu
Normal file
2
packaging/debian/debian/recoll.menu
Normal file
|
@ -0,0 +1,2 @@
|
|||
?package(recoll):needs="X11" section="Applications/Data Management" \
|
||||
title="Personal Search Tool" command="/usr/bin/recoll"
|
89
packaging/debian/debian/rules
Executable file
89
packaging/debian/debian/rules
Executable file
|
@ -0,0 +1,89 @@
|
|||
#!/usr/bin/make -f
|
||||
|
||||
# Uncomment this to turn on verbose mode.
|
||||
#export DH_VERBOSE=1
|
||||
|
||||
DPKG_EXPORT_BUILDFLAGS = 1
|
||||
include /usr/share/dpkg/buildflags.mk
|
||||
|
||||
DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
|
||||
DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
|
||||
|
||||
CFLAGS += -Wall -g
|
||||
#LDFLAGS += -Wl,-z,defs
|
||||
|
||||
#build qt4 UI only
|
||||
export QMAKE=qmake-qt4
|
||||
|
||||
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
|
||||
CFLAGS += -O0
|
||||
else
|
||||
CFLAGS += -O2
|
||||
endif
|
||||
|
||||
config.status: configure
|
||||
dh_testdir
|
||||
./configure CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" \
|
||||
--host=$(DEB_HOST_GNU_TYPE) \
|
||||
--build=$(DEB_BUILD_GNU_TYPE) \
|
||||
--mandir=\$${prefix}/share/man \
|
||||
--prefix=/usr
|
||||
|
||||
build: build-arch build-indep
|
||||
build-arch: build-stamp
|
||||
build-indep: build-stamp
|
||||
build-stamp: config.status
|
||||
dh_testdir
|
||||
$(MAKE) -j 5
|
||||
touch $@
|
||||
|
||||
clean:
|
||||
dh_testdir
|
||||
dh_testroot
|
||||
rm -f build-stamp config.log
|
||||
[ ! -f Makefile ] || $(MAKE) distclean
|
||||
dh_clean Makefile
|
||||
|
||||
install:
|
||||
dh_testdir
|
||||
dh_testroot
|
||||
dh_prep
|
||||
dh_installdirs
|
||||
$(MAKE) prefix=$(CURDIR)/debian/tmp/usr install
|
||||
chmod a+x $(CURDIR)/debian/tmp/usr/share/recoll/examples/rclmon.sh
|
||||
chmod a-x $(CURDIR)/debian/tmp/usr/share/recoll/filters/rclxslt.py
|
||||
chmod a-x $(CURDIR)/debian/tmp/usr/share/recoll/filters/rclexec1.py
|
||||
chmod a-x $(CURDIR)/debian/tmp/usr/share/recoll/filters/rclexec1.py
|
||||
rm -f $(CURDIR)/debian/tmp/usr/lib/recoll/librecoll.la
|
||||
(cd python/recoll; python setup.py install \
|
||||
--install-layout=deb \
|
||||
--prefix=$(CURDIR)/debian/tmp/usr )
|
||||
(cd python/recoll; python3 setup.py install \
|
||||
--install-layout=deb \
|
||||
--prefix=$(CURDIR)/debian/tmp/usr )
|
||||
|
||||
binary-arch: build install
|
||||
dh_testdir
|
||||
dh_testroot
|
||||
dh_installchangelogs ChangeLog
|
||||
dh_installdocs README
|
||||
dh_installmenu
|
||||
dh_installman
|
||||
dh_install --sourcedir=debian/tmp
|
||||
dh_makeshlibs
|
||||
dh_python2 -p python-recoll
|
||||
dh_python3 -p python3-recoll
|
||||
dh_link
|
||||
dh_strip
|
||||
dh_compress
|
||||
dh_fixperms
|
||||
dh_installdeb
|
||||
dh_shlibdeps
|
||||
dh_gencontrol
|
||||
dh_md5sums
|
||||
dh_builddeb
|
||||
|
||||
binary-indep: build install
|
||||
|
||||
binary: binary-indep binary-arch
|
||||
.PHONY: build build-arch build-indep clean binary-indep binary-arch binary install
|
1
packaging/debian/debian/source/format
Normal file
1
packaging/debian/debian/source/format
Normal file
|
@ -0,0 +1 @@
|
|||
3.0 (quilt)
|
2
packaging/debian/debian/watch
Normal file
2
packaging/debian/debian/watch
Normal file
|
@ -0,0 +1,2 @@
|
|||
version=3
|
||||
http://www.lesbonscomptes.com/recoll/download.html recoll-(.*)\.tar\.gz
|
92
packaging/debian/debiankio/changelog
Normal file
92
packaging/debian/debiankio/changelog
Normal file
|
@ -0,0 +1,92 @@
|
|||
kio-recoll (1.21.0-0~ppaPPAVERS~SERIES1) SERIES; urgency=low
|
||||
|
||||
* No changes specific to the KIO, just use the 1.21 lib.
|
||||
|
||||
-- Jean-Francois Dockes <jf@dockes.org> Tue, 16 Jun 2015 18:21:00 +0200
|
||||
|
||||
kio-recoll (1.20.6-0~ppaPPAVERS~SERIES1) SERIES; urgency=low
|
||||
|
||||
* Increase the default maximum number of entries displayed in a directory
|
||||
window (can be adjusted with the kio_max_direntries configuration
|
||||
variable).
|
||||
* Display entries incrementally instead of sending the whole
|
||||
list at once.
|
||||
|
||||
-- Jean-Francois Dockes <jf@dockes.org> Sat, 25 Apr 2015 14:47:00 +0200
|
||||
|
||||
kio-recoll (1.20.1-0~ppaPPAVERS~SERIES1) SERIES; urgency=low
|
||||
* Updated package to version 1.20.1
|
||||
-- Jean-Francois Dockes <jf@dockes.org> Fri, 19 Dec 2014 08:14:00 +0200
|
||||
|
||||
kio-recoll (1.19.14p2-0~ppaPPAVERS~SERIES1) SERIES; urgency=low
|
||||
* No changes, build for Ubuntu Utopic
|
||||
-- Jean-Francois Dockes <jf@dockes.org> Sat, 06 Dec 2014 08:44:00 +0200
|
||||
|
||||
kio-recoll (1.19.12-0~ppaPPAVERS~SERIES1) SERIES; urgency=low
|
||||
* Updated package to recoll version 1.19.12
|
||||
-- Jean-Francois Dockes <jf@dockes.org> Wed, 02 Apr 2014 15:50:00 +0200
|
||||
|
||||
kio-recoll (1.19.10-0~ppaPPAVERS~SERIES1) SERIES; urgency=low
|
||||
* Updated package to recoll version 1.19.10
|
||||
-- Jean-Francois Dockes <jf@dockes.org> Sat, 25 Nov 2013 18:00:00 +0100
|
||||
|
||||
kio-recoll (1.19.2-0~ppaPPAVERS~SERIES1) SERIES; urgency=low
|
||||
* Updated package to recoll version 1.19.2
|
||||
-- Jean-Francois Dockes <jf@dockes.org> Mon, 13 May 2013 12:09:00 +0100
|
||||
|
||||
kio-recoll (1.18.2-0~ppaPPAVERS~SERIES1) SERIES; urgency=low
|
||||
* Updated package to recoll version 1.18.2
|
||||
-- Jean-Francois Dockes <jf@dockes.org> Mon, 18 Apr 2013 18:05:00 +0100
|
||||
|
||||
kio-recoll (1.18.1-0~ppaPPAVERS~SERIES1) SERIES; urgency=low
|
||||
* Updated package to recoll version 1.18.1
|
||||
-- Jean-Francois Dockes <jf@dockes.org> Mon, 05 Nov 2012 13:25:00 +0100
|
||||
|
||||
kio-recoll (1.17.0-0~ppaPPAVERS~SERIES1) SERIES; urgency=low
|
||||
* Updated package to recoll version 1.17.0
|
||||
-- Jean-Francois Dockes <jf@dockes.org> Sun, 25 Mar 2012 18:05:00 +0200
|
||||
|
||||
kio-recoll (1.16.2-0~ppa1~SERIES1) SERIES; urgency=low
|
||||
* Updated package to recoll version 1.16.2
|
||||
-- Jean-Francois Dockes <jf@dockes.org> Mon, 07 Nov 2011 17:57:00 +0200
|
||||
|
||||
kio-recoll (1.16.1-0~ppa1~SERIES1) SERIES; urgency=low
|
||||
* Updated package to recoll version 1.16.1
|
||||
-- Jean-Francois Dockes <jf@dockes.org> Wed, 28 Sep 2011 15:07:00 +0200
|
||||
|
||||
kio-recoll (1.16.0-0~ppa1~SERIES1) SERIES; urgency=low
|
||||
* Updated package to recoll version 1.16.0
|
||||
-- Jean-Francois Dockes <jf@dockes.org> Wed, 07 Sep 2011 18:30:00 +0200
|
||||
|
||||
kio-recoll (1.15.8-0~ppa1~SERIES1) SERIES; urgency=low
|
||||
* Updated package to recoll version 1.15.8
|
||||
-- Jean-Francois Dockes <jf@dockes.org> Mon, 02 May 2011 17:27:00 +0200
|
||||
|
||||
kio-recoll (1.15.5-0~ppa1~SERIES1) SERIES; urgency=low
|
||||
* Update to recoll version 1.15.5
|
||||
-- Jean-Francois Dockes <jf@dockes.org> Fri, 04 Mar 2011 13:54:00 +0200
|
||||
|
||||
kio-recoll (1.15.2-0~ppa1~SERIES1) SERIES; urgency=low
|
||||
* Update to recoll version 1.15.2
|
||||
-- Jean-Francois Dockes <jf@dockes.org> Thu, 15 Feb 2011 08:43:00 +0200
|
||||
|
||||
kio-recoll (1.15.0-0~ppa1~SERIES1) SERIES; urgency=low
|
||||
* Update to recoll version 1.15.0
|
||||
-- Jean-Francois Dockes <jf@dockes.org> Wed, 02 Feb 2011 09:48:00 +0200
|
||||
|
||||
kio-recoll (1.14.3-0~ppa1~SERIES1) SERIES; urgency=low
|
||||
* Update to recoll version 1.14.3
|
||||
-- Jean-Francois Dockes <jf@dockes.org> Thu, 25 Nov 2010 10:25:00 +0200
|
||||
|
||||
kio-recoll (1.14.2-0~ppa1~SERIES1) SERIES; urgency=low
|
||||
* Update to recoll version 1.14.2
|
||||
-- Jean-Francois Dockes <jf@dockes.org> Sat, 25 Sep 2010 09:37:20 +0200
|
||||
|
||||
kio-recoll (1.13.01-0~ppa4~SERIES1) SERIES; urgency=low
|
||||
* Update to recoll version 1.13.01
|
||||
-- Jean-Francois Dockes <jf@dockes.org> Thu, 07 Jan 2010 11:26:00 +0100
|
||||
|
||||
kio-recoll (1.12.3-0~ppa4~jaunty1) jaunty; urgency=low
|
||||
* Initial release
|
||||
-- Jean-Francois Dockes <jf@dockes.org> Tue, 24 Nov 2009 08:55:00 +0100
|
||||
|
1
packaging/debian/debiankio/compat
Normal file
1
packaging/debian/debiankio/compat
Normal file
|
@ -0,0 +1 @@
|
|||
7
|
32
packaging/debian/debiankio/control
Normal file
32
packaging/debian/debiankio/control
Normal file
|
@ -0,0 +1,32 @@
|
|||
Source: kio-recoll
|
||||
Section: kde
|
||||
Priority: extra
|
||||
Maintainer: Jean-Francois Dockes <jfd@recoll.org>
|
||||
Build-Depends: cdbs,
|
||||
cmake,
|
||||
debhelper (>= 7),
|
||||
bison,
|
||||
kdelibs5-dev (>= 4:4.2.2),
|
||||
pkg-kde-tools (>= 0.4.0),
|
||||
libxapian-dev,
|
||||
libz-dev
|
||||
Standards-Version: 3.9.5
|
||||
Homepage: http://www.recoll.org/
|
||||
|
||||
Package: kio-recoll
|
||||
Architecture: any
|
||||
Depends: ${misc:Depends}, ${shlibs:Depends}, recoll
|
||||
Description: A Recoll KIO slave for KDE 4
|
||||
A Recoll KIO slave for KDE 4, allows performing a Recoll search by
|
||||
entering an appropriate URL in a KDE open dialog, or with an HTML-based
|
||||
interface displayed in Konqueror.
|
||||
The HTML-based interface is similar to the Recoll GUI QT-based interface,
|
||||
slightly less powerful. It allows performing a search while staying fully
|
||||
within the KDE framework: drag and drop from the result list works
|
||||
normally and you have your normal choice of applications for opening files.
|
||||
An alternative interface uses a directory view of search results. Due to
|
||||
limitations in the current KIO slave interface, it is currently not
|
||||
obviously useful.
|
||||
The interface is described in more detail inside a help file which you can
|
||||
access by entering recoll:/ inside the konqueror URL line (this works only
|
||||
if the recoll KIO slave has been previously installed).
|
113
packaging/debian/debiankio/copyright
Normal file
113
packaging/debian/debiankio/copyright
Normal file
|
@ -0,0 +1,113 @@
|
|||
This package was debianized by Jean-Francois Dockes <jfd@recoll.org> on
|
||||
Wed, 10 Jan 2007 16:04:13 +0100.
|
||||
|
||||
It was downloaded from http://www.recoll.org
|
||||
|
||||
Upstream Author: Jean-Francois Dockes <jfd@recoll.org>
|
||||
|
||||
Copyright: (C) 2005,2006, Jean-Francois Dockes <jfd@recoll.org>
|
||||
|
||||
License:
|
||||
|
||||
This package is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This package is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this package; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
On Debian systems, the complete text of the GNU General
|
||||
Public License can be found in `/usr/share/common-licenses/GPL'.
|
||||
|
||||
The Debian packaging is (C) 2007, Jean-Francois Dockes <jfd@recoll.org> and
|
||||
is licensed under the GPL, see above.
|
||||
|
||||
Portions of the software are:
|
||||
|
||||
Copyright (C) 2001-2002 by Kevin Atkinson under the GNU LGPL:
|
||||
/* This file is part of The New Aspell
|
||||
* Copyright (C) 2001-2002 by Kevin Atkinson under the GNU LGPL
|
||||
* license version 2.0 or 2.1. You should have received a copy of the
|
||||
* LGPL license along with this library if you did not you can find it
|
||||
* at http://www.gnu.org/.
|
||||
|
||||
On Debian systems, the complete text of the GNU LGPL
|
||||
can be found in `/usr/share/common-licenses/LGPL-2'.
|
||||
|
||||
|
||||
Copyright 2002-2005 Andreas Aardal Hanssen
|
||||
Copyright (C) 2000-2004 Mikio Hirabayashi
|
||||
Copyright 1999,2000,2001 BrightStation PLC
|
||||
Copyright 2001 Ananova Ltd
|
||||
Copyright 2002 Olly Betts
|
||||
Copyright (C) 2000, 2001, 2002 Loic Dachary <loic@senga.org>
|
||||
- GPL V2 or later, same license text as above
|
||||
|
||||
Copyright (c) 1991-2004 Unicode, Inc.
|
||||
|
||||
COPYRIGHT AND PERMISSION NOTICE
|
||||
|
||||
Copyright © 1991-2006 Unicode, Inc. All rights reserved. Distributed under
|
||||
the Terms of Use in http://www.unicode.org/copyright.html.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a
|
||||
copy of the Unicode data files and any associated documentation (the "Data
|
||||
Files") or Unicode software and any associated documentation (the
|
||||
"Software") to deal in the Data Files or Software without restriction,
|
||||
including without limitation the rights to use, copy, modify, merge,
|
||||
publish, distribute, and/or sell copies of the Data Files or Software, and
|
||||
to permit persons to whom the Data Files or Software are furnished to do
|
||||
so, provided that (a) the above copyright notice(s) and this permission
|
||||
notice appear with all copies of the Data Files or Software, (b) both the
|
||||
above copyright notice(s) and this permission notice appear in associated
|
||||
documentation, and (c) there is clear notice in each modified Data File or
|
||||
in the Software as well as in the documentation associated with the Data
|
||||
File(s) or Software that the data or software has been modified.
|
||||
|
||||
THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
|
||||
KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
|
||||
THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS
|
||||
INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR
|
||||
CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
|
||||
USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
||||
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
PERFORMANCE OF THE DATA FILES OR SOFTWARE.
|
||||
|
||||
Except as contained in this notice, the name of a copyright holder shall
|
||||
not be used in advertising or otherwise to promote the sale, use or other
|
||||
dealings in these Data Files or Software without prior written
|
||||
authorization of the copyright holder.
|
||||
|
||||
Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
|
||||
/*
|
||||
* MD5C.C - RSA Data Security, Inc., MD5 message-digest algorithm
|
||||
*
|
||||
* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
|
||||
* rights reserved.
|
||||
*
|
||||
* License to copy and use this software is granted provided that it
|
||||
* is identified as the "RSA Data Security, Inc. MD5 Message-Digest
|
||||
* Algorithm" in all material mentioning or referencing this software
|
||||
* or this function.
|
||||
*
|
||||
* License is also granted to make and use derivative works provided
|
||||
* that such works are identified as "derived from the RSA Data
|
||||
* Security, Inc. MD5 Message-Digest Algorithm" in all material
|
||||
* mentioning or referencing the derived work.
|
||||
*
|
||||
* RSA Data Security, Inc. makes no representations concerning either
|
||||
* the merchantability of this software or the suitability of this
|
||||
* software for any particular purpose. It is provided "as is"
|
||||
* without express or implied warranty of any kind.
|
||||
*
|
||||
* These notices must be retained in any copies of any part of this
|
||||
* documentation and/or software.
|
||||
*/
|
2
packaging/debian/debiankio/dirs
Normal file
2
packaging/debian/debiankio/dirs
Normal file
|
@ -0,0 +1,2 @@
|
|||
usr/lib/kde4
|
||||
usr/share/kde4/services
|
1
packaging/debian/debiankio/docs
Normal file
1
packaging/debian/debiankio/docs
Normal file
|
@ -0,0 +1 @@
|
|||
|
|
@ -0,0 +1,21 @@
|
|||
diff -r 1e9d7ca73884 src/kde/kioslave/kio_recoll/CMakeLists.txt
|
||||
--- a/kde/kioslave/kio_recoll/CMakeLists.txt Tue Jun 16 15:06:07 2015 +0200
|
||||
+++ b/kde/kioslave/kio_recoll/CMakeLists.txt Wed Jun 17 09:08:36 2015 +0200
|
||||
@@ -57,11 +57,16 @@
|
||||
|
||||
kde4_add_plugin(kio_recoll ${kio_recoll_SRCS})
|
||||
|
||||
+add_custom_target(parser
|
||||
+ COMMAND make wasaparse.tab.cpp
|
||||
+ WORKING_DIRECTORY ${rcltop}/query
|
||||
+)
|
||||
add_custom_target(rcllib
|
||||
COMMAND make librecoll.a
|
||||
WORKING_DIRECTORY ${rcltop}/lib
|
||||
)
|
||||
-add_dependencies(kio_recoll rcllib)
|
||||
+add_dependencies(rcllib parser)
|
||||
+add_dependencies(kio_recoll parser rcllib)
|
||||
|
||||
target_link_libraries(kio_recoll recoll xapian z ${EXTRA_LIBS} ${KDE4_KIO_LIBS})
|
||||
|
1
packaging/debian/debiankio/patches/series
Normal file
1
packaging/debian/debiankio/patches/series
Normal file
|
@ -0,0 +1 @@
|
|||
fix-cmake-build-parser.patch
|
6
packaging/debian/debiankio/rules
Executable file
6
packaging/debian/debiankio/rules
Executable file
|
@ -0,0 +1,6 @@
|
|||
#!/usr/bin/make -f
|
||||
|
||||
include /usr/share/cdbs/1/rules/debhelper.mk
|
||||
include /usr/share/pkg-kde-tools/makefiles/1/cdbs/kde.mk
|
||||
|
||||
DEB_SRCDIR = kde/kioslave/kio_recoll
|
1
packaging/debian/debiankio/source/format
Normal file
1
packaging/debian/debiankio/source/format
Normal file
|
@ -0,0 +1 @@
|
|||
3.0 (quilt)
|
4
packaging/debian/debiankio/watch
Normal file
4
packaging/debian/debiankio/watch
Normal file
|
@ -0,0 +1,4 @@
|
|||
version=3
|
||||
|
||||
|
||||
http://www.recoll.org/download.html recoll-(.*)\.tar\.gz
|
30
packaging/debian/debianunitylens/changelog
Normal file
30
packaging/debian/debianunitylens/changelog
Normal file
|
@ -0,0 +1,30 @@
|
|||
recoll-lens (1.19.10.3543-1~ppaPPAVERS~SERIES1) SERIES; urgency=low
|
||||
* Updated lens to release 1.19.10
|
||||
-- Jean-Francois Dockes <jf@dockes.org> Sat, 23 Nov 2013 18:00:00 +0100
|
||||
|
||||
recoll-lens (1.19.2.3328-1~ppaPPAVERS~SERIES1) SERIES; urgency=low
|
||||
* Updated lens to release 1.19.2, for consistency, same as 1.19.0 in fact
|
||||
-- Jean-Francois Dockes <jf@dockes.org> Mon, 14 May 2013 08:22:00 +0100
|
||||
|
||||
recoll-lens (1.19.0.3315-1~ppaPPAVERS~SERIES1) SERIES; urgency=low
|
||||
* Updated lens to vers. 1.19.0
|
||||
-- Jean-Francois Dockes <jf@dockes.org> Sun, 12 May 2013 14:43:00 +0100
|
||||
|
||||
recoll-lens (1.18.1.2997-1~ppaPPAVERS~SERIES1) SERIES; urgency=low
|
||||
* Updated lens to vers. 1.18.1
|
||||
-- Jean-Francois Dockes <jf@dockes.org> Mon, 05 Nov 2012 13:31:00 +0100
|
||||
recoll-lens (1.17.2.2697-1~ppaPPAVERS~SERIES1) SERIES; urgency=low
|
||||
* Updated lens to vers. 1.17.1.2697 : display thumbnails when they exist
|
||||
-- Jean-Francois Dockes <jf@dockes.org> Tue, 15 May 2012 13:51:00 +0200
|
||||
recoll-lens (1.17.1.2654-1~ppaPPAVERS~SERIES1) SERIES; urgency=low
|
||||
* Updated lens to vers. 1.17.1.2654 : display/open results for embedded files
|
||||
-- Jean-Francois Dockes <jf@dockes.org> Tue, 27 Mar 2012 16:22:00 +0200
|
||||
recoll-lens (1.17.0.2648-1~ppaPPAVERS~SERIES1) SERIES; urgency=low
|
||||
* Updated lens to vers. 1.17.0.2648 : don't use app shortcut 'a'
|
||||
-- Jean-Francois Dockes <jf@dockes.org> Mon, 26 Mar 2012 22:05:00 +0200
|
||||
recoll-lens (1.17.0.2646-1~ppaPPAVERS~SERIES1) SERIES; urgency=low
|
||||
* Updated lens to vers. 1.17.0.2646 : Unity 5.0/Ubuntu 12.04 compatibility
|
||||
-- Jean-Francois Dockes <jf@dockes.org> Sun, 25 Mar 2012 16:42:00 +0200
|
||||
recoll-lens (1.17.0.2645-1~ppaPPAVERS~SERIES1) SERIES; urgency=low
|
||||
* Updated package to recoll version 1.17.0
|
||||
-- Jean-Francois Dockes <jf@dockes.org> Sun, 25 Mar 2012 16:42:00 +0200
|
1
packaging/debian/debianunitylens/compat
Normal file
1
packaging/debian/debianunitylens/compat
Normal file
|
@ -0,0 +1 @@
|
|||
5
|
18
packaging/debian/debianunitylens/control
Normal file
18
packaging/debian/debianunitylens/control
Normal file
|
@ -0,0 +1,18 @@
|
|||
Source: recoll-lens
|
||||
Section: x11
|
||||
Priority: optional
|
||||
Maintainer: Jean-Francois Dockes <jfd@recoll.org>
|
||||
Build-Depends: debhelper (>= 7),
|
||||
autotools-dev,
|
||||
recoll,
|
||||
python-recoll,
|
||||
python
|
||||
Standards-Version: 3.9.3
|
||||
|
||||
Package: recoll-lens
|
||||
Architecture: all
|
||||
Depends: ${misc:Depends}, python, recoll, unity
|
||||
Description:Unity Lens for searching the Recoll index.
|
||||
Allows querying the Recoll index from the Unity Dash, optionally
|
||||
filtering on file category.
|
||||
Homepage: http://www.recoll.org
|
20
packaging/debian/debianunitylens/copyright
Normal file
20
packaging/debian/debianunitylens/copyright
Normal file
|
@ -0,0 +1,20 @@
|
|||
This package was debianized by Jean-Francois Dockes <jfd@recoll.org> on
|
||||
Sun, 25 Mar 2012 16:31:00 +0200.
|
||||
|
||||
It was downloaded from http://www.recoll.org
|
||||
|
||||
Upstream Author: Jean-Francois Dockes <jfd@recoll.org>
|
||||
|
||||
Copyright: (C) 2012 Jean-Francois Dockes <jfd@recoll.org>
|
||||
|
||||
License: GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007
|
||||
|
||||
On Debian systems, the complete text of the GNU General
|
||||
Public License can be found in `/usr/share/common-licenses/GPL'.
|
||||
|
||||
Debian packaging is (C) 2012, Jean-Francois Dockes, same license.
|
||||
|
||||
Derived from Original bliss apps lens by Mikkel Kamstrup Erlandsen:
|
||||
Copyright 2011, Canonical Ltd
|
||||
Authored by Mikkel Kamstrup Erlandsen <mikkel.kamstrup@canonical.com>
|
||||
Distribute under the terms of the GNU General Public License v3
|
1
packaging/debian/debianunitylens/docs
Normal file
1
packaging/debian/debianunitylens/docs
Normal file
|
@ -0,0 +1 @@
|
|||
README
|
52
packaging/debian/debianunitylens/rules
Executable file
52
packaging/debian/debianunitylens/rules
Executable file
|
@ -0,0 +1,52 @@
|
|||
#!/usr/bin/make -f
|
||||
|
||||
# Uncomment this to turn on verbose mode.
|
||||
#export DH_VERBOSE=1
|
||||
|
||||
DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
|
||||
DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
|
||||
|
||||
config.status: configure
|
||||
dh_testdir
|
||||
./configure --host=$(DEB_HOST_GNU_TYPE) \
|
||||
--build=$(DEB_BUILD_GNU_TYPE) \
|
||||
--mandir=\$${prefix}/share/man \
|
||||
--prefix=/usr \
|
||||
--sysconfdir=/etc
|
||||
|
||||
build: build-stamp
|
||||
build-stamp: config.status
|
||||
dh_testdir
|
||||
$(MAKE)
|
||||
touch $@
|
||||
|
||||
clean:
|
||||
dh_testdir
|
||||
dh_testroot
|
||||
rm -f build-stamp config.log
|
||||
[ ! -f Makefile ] || $(MAKE) distclean
|
||||
dh_clean Makefile
|
||||
|
||||
install:
|
||||
dh_testdir
|
||||
dh_testroot
|
||||
dh_prep
|
||||
dh_installdirs
|
||||
$(MAKE) prefix=$(CURDIR)/debian/recoll-lens/usr install
|
||||
|
||||
binary-indep: build install
|
||||
dh_testdir
|
||||
dh_testroot
|
||||
dh_installchangelogs ChangeLog
|
||||
dh_installdocs README
|
||||
dh_python2
|
||||
dh_link
|
||||
dh_compress
|
||||
dh_fixperms
|
||||
dh_installdeb
|
||||
dh_gencontrol
|
||||
dh_md5sums
|
||||
dh_builddeb
|
||||
|
||||
binary: binary-indep
|
||||
.PHONY: build clean binary-indep binary-arch binary install
|
12
packaging/debian/debianunitylens/watch
Normal file
12
packaging/debian/debianunitylens/watch
Normal file
|
@ -0,0 +1,12 @@
|
|||
# Example watch control file for uscan
|
||||
# Rename this file to "watch" and then you can run the "uscan" command
|
||||
# to check for upstream updates and more.
|
||||
# See uscan(1) for format
|
||||
|
||||
# Compulsory line, this is a version 3 file
|
||||
version=3
|
||||
|
||||
# Uncomment to examine a Webpage
|
||||
# <Webpage URL> <string match>
|
||||
http://www.recoll.org/download.html recoll-lens-(.*)\.tar\.gz
|
||||
|
10
packaging/homebrew/00README.txt
Normal file
10
packaging/homebrew/00README.txt
Normal file
|
@ -0,0 +1,10 @@
|
|||
|
||||
|
||||
Package building file for Mac homebrew: http://brew.sh/
|
||||
|
||||
Install homebrew following the instructions on the home page, then copy
|
||||
recoll.rb to /usr/local/Library/Formula/, then "brew install recoll" should
|
||||
just work.
|
||||
|
||||
Also see: https://github.com/medoc92/homebrew/tree/recoll
|
||||
|
35
packaging/homebrew/recoll.rb
Normal file
35
packaging/homebrew/recoll.rb
Normal file
|
@ -0,0 +1,35 @@
|
|||
require 'formula'
|
||||
|
||||
class Recoll < Formula
|
||||
homepage 'http://www.recoll.org'
|
||||
url 'http://www.recoll.org/recoll-1.19.11p1.tar.gz'
|
||||
sha1 'f4259c21faff9f30882d0bf1e8f952c19ed9936b'
|
||||
|
||||
depends_on 'xapian'
|
||||
depends_on 'qt'
|
||||
def patches
|
||||
DATA
|
||||
end
|
||||
def install
|
||||
system "./configure", "--prefix=#{prefix}"
|
||||
system "make", "install"
|
||||
end
|
||||
|
||||
test do
|
||||
system "#{bin}/recollindex", "-h"
|
||||
end
|
||||
end
|
||||
|
||||
__END__
|
||||
--- a/configure.orig 2014-01-07 12:39:40.606718201 +0100
|
||||
+++ b/configure 2014-01-07 12:39:58.574599715 +0100
|
||||
@@ -5120,7 +5120,7 @@
|
||||
# basically to enable using a Macbook for development
|
||||
if test X$sys = XDarwin ; then
|
||||
# The default is xcode
|
||||
- QMAKE="${QMAKE} -spec macx-g++"
|
||||
+ QMAKE="${QMAKE}"
|
||||
fi
|
||||
|
||||
# Discriminate qt3/4. Qt3 qmake prints its version on stderr but we don't
|
||||
|
24
packaging/macports/README.txt
Normal file
24
packaging/macports/README.txt
Normal file
|
@ -0,0 +1,24 @@
|
|||
To use/test the port out of the official macports tree:
|
||||
|
||||
- Edit sources.conf /opt/local/etc/macports/sources.conf, and insert a URL
|
||||
pointing to your local repository before the rsync one:
|
||||
file:///Users/dockes/projets/fulltext/recoll/packaging/macports
|
||||
rsync://rsync.macports.org/release/ports [default]
|
||||
|
||||
(inserting before ensures it's used before the macports one)
|
||||
|
||||
- The port should live under category/portname (ie: textproc/
|
||||
|
||||
- After you create or update your Portfile, use the MacPorts portindex
|
||||
command in the local repository's directory to create or update the index
|
||||
of the ports in your local repository.
|
||||
|
||||
%% cd ~/path/to/macports
|
||||
%% portindex
|
||||
|
||||
Once the local port is added to the PortIndex, it becomes available for
|
||||
searching or installation as with any other Portfile in the MacPorts
|
||||
tree
|
||||
|
||||
http://guide.macports.org/#development.local-repositories
|
||||
|
45
packaging/macports/textproc/recoll/Portfile
Normal file
45
packaging/macports/textproc/recoll/Portfile
Normal file
|
@ -0,0 +1,45 @@
|
|||
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
|
||||
# $Id: Portfile 111989 2013-10-08 17:10:55Z ryandesign@macports.org $
|
||||
|
||||
PortSystem 1.0
|
||||
PortGroup app 1.0
|
||||
|
||||
name recoll
|
||||
version 1.19.11p1
|
||||
categories textproc
|
||||
platforms darwin
|
||||
license GPL-2+
|
||||
maintainers dockes.org:jf openmaintainer
|
||||
|
||||
description Desktop full text search
|
||||
|
||||
long_description Recoll is a desktop search tool based on Xapian
|
||||
|
||||
homepage http://www.recoll.org/
|
||||
master_sites ${homepage}
|
||||
|
||||
checksums rmd160 de98039d80174a5da6e3cdbcc8b7bc0f4407e44a \
|
||||
sha256 8d1d040b8de1f65f01bc0a56053a6df7677360031bf9a6779d3496ced4a61186
|
||||
|
||||
depends_lib port:xapian-core \
|
||||
port:qt4-mac \
|
||||
port:aspell \
|
||||
port:libiconv \
|
||||
port:zlib
|
||||
|
||||
depends_run port:antiword \
|
||||
port:catdoc \
|
||||
port:libxslt \
|
||||
port:poppler \
|
||||
port:unrtf \
|
||||
port:unzip
|
||||
|
||||
patchfiles patch-sampleconf-mimeview.diff
|
||||
|
||||
configure.args --without-x \
|
||||
--disable-x11mon
|
||||
|
||||
build.args CC=${configure.cc} CXX=${configure.cxx}
|
||||
|
||||
# g++-4.2: -E, -S, -save-temps and -M options are not allowed with multiple -arch flags
|
||||
universal_variant no
|
|
@ -0,0 +1,147 @@
|
|||
--- sampleconf/mimeview 2013-09-30 18:45:06.000000000 +0200
|
||||
+++ sampleconf/mimeview.mac 2013-09-30 18:45:06.000000000 +0200
|
||||
@@ -2,7 +2,8 @@
|
||||
|
||||
## ##########################################
|
||||
# External viewers, launched by the recoll GUI when you click on a result
|
||||
-# 'edit' link
|
||||
+# 'Open' link - MAC version
|
||||
+# On the MAC, we use "open" for everything...
|
||||
|
||||
# Mime types which we should not uncompress if they are found gzipped or
|
||||
# bzipped because the native viewer knows how to handle. These would be
|
||||
@@ -16,20 +17,17 @@
|
||||
# search string
|
||||
# - For pages of CHM and EPUB documents where we can choose to open the
|
||||
# parent document instead of a temporary html file.
|
||||
-xallexcepts = application/pdf application/postscript application/x-dvi \
|
||||
- text/html|gnuinfo text/html|chm text/html|epub \
|
||||
- application/x-fsdirectory|parentopen inode/directory|parentopen
|
||||
+#xallexcepts = application/pdf application/postscript application/x-dvi \
|
||||
+# text/html|gnuinfo text/html|chm text/html|epub
|
||||
|
||||
[view]
|
||||
# Pseudo entry used if the 'use desktop' preference is set in the GUI
|
||||
-application/x-all = xdg-open %u
|
||||
+application/x-all = open %f
|
||||
|
||||
application/epub+zip = ebook-viewer %f
|
||||
-# Open the parent epub document for epub parts instead of opening them as
|
||||
-# html documents. This is almost always what we want.
|
||||
-text/html|epub = ebook-viewer %F;ignoreipath=1
|
||||
-
|
||||
-application/x-gnote = gnote %f
|
||||
+# If you want to open the parent epub document for epub parts instead of
|
||||
+# opening them as html documents:
|
||||
+#text/html|epub = ebook-viewer %F;ignoreipath=1
|
||||
|
||||
application/x-mobipocket-ebook = ebook-viewer %f
|
||||
|
||||
@@ -76,13 +74,9 @@
|
||||
application/vnd.wordperfect = libreoffice %f
|
||||
text/rtf = libreoffice %f
|
||||
|
||||
+application/x-chm = kchmviewer %f
|
||||
application/x-dia-diagram = dia %f
|
||||
-
|
||||
application/x-fsdirectory = dolphin %f
|
||||
-inode/directory = dolphin %f
|
||||
-application/x-fsdirectory|parentopen = dolphin --select %(childurl) %f
|
||||
-inode/directory|parentopen = dolphin --select %(childurl) %f
|
||||
-
|
||||
application/x-gnuinfo = xterm -e "info -f %f"
|
||||
application/x-gnumeric = gnumeric %f
|
||||
|
||||
@@ -102,11 +96,6 @@
|
||||
image/x-ms-bmp = gwenview %f
|
||||
image/x-xpmi = gwenview %f
|
||||
|
||||
-# Opening mail messages not always works.
|
||||
-# - Thunderbird will only open a single-message file if it has an .emf
|
||||
-# extension
|
||||
-# - "sylpheed %f" seems to work ok as of version 3.3
|
||||
-# - "kmail --view %u" works
|
||||
message/rfc822 = thunderbird -file %f
|
||||
text/x-mail = thunderbird -file %f
|
||||
application/x-mimehtml = thunderbird -file %f
|
||||
@@ -119,11 +108,11 @@
|
||||
application/x-tar = ark %f
|
||||
application/zip = ark %f
|
||||
|
||||
-application/x-awk = emacsclient --no-wait %f
|
||||
-application/x-perl = emacsclient --no-wait %f
|
||||
-text/x-perl = emacsclient --no-wait %f
|
||||
-application/x-shellscript = emacsclient --no-wait %f
|
||||
-text/x-shellscript = emacsclient --no-wait %f
|
||||
+application/x-awk = emacsclient %f
|
||||
+application/x-perl = emacsclient %f
|
||||
+text/x-perl = emacsclient %f
|
||||
+application/x-shellscript = emacsclient %f
|
||||
+text/x-shellscript = emacsclient %f
|
||||
|
||||
# Or firefox -remote "openFile(%u)"
|
||||
text/html = firefox %u
|
||||
@@ -135,41 +124,39 @@
|
||||
|
||||
application/x-webarchive = konqueror %f
|
||||
text/x-fictionbook = ebook-viewer %f
|
||||
-application/x-tex = emacsclient --no-wait %f
|
||||
-application/xml = emacsclient --no-wait %f
|
||||
-text/xml = emacsclient --no-wait %f
|
||||
-text/x-tex = emacsclient --no-wait %f
|
||||
-text/plain = emacsclient --no-wait %f
|
||||
-text/x-awk = emacsclient --no-wait %f
|
||||
-text/x-c = emacsclient --no-wait %f
|
||||
-text/x-c+ = emacsclient --no-wait %f
|
||||
-text/x-c++ = emacsclient --no-wait %f
|
||||
+application/x-tex = emacsclient %f
|
||||
+application/xml = emacsclient %f
|
||||
+text/xml = emacsclient %f
|
||||
+text/x-tex = emacsclient %f
|
||||
+text/plain = emacsclient %f
|
||||
+text/x-awk = emacsclient %f
|
||||
+text/x-c = emacsclient %f
|
||||
+text/x-c+ = emacsclient %f
|
||||
+text/x-c++ = emacsclient %f
|
||||
text/x-csv = libreoffice %f
|
||||
text/x-html-sidux-man = konqueror %f
|
||||
text/x-html-aptosid-man = iceweasel %f
|
||||
|
||||
-application/x-chm = kchmviewer %f
|
||||
# Html pages inside a chm have a chm rclaptg set by the filter. Kchmviewer
|
||||
# knows how to use the ipath (which is the internal chm path) to open the
|
||||
# file at the right place
|
||||
text/html|chm = kchmviewer --url %i %F
|
||||
|
||||
-text/x-ini = emacsclient --no-wait %f
|
||||
+text/x-ini = emacsclient %f
|
||||
text/x-man = xterm -u8 -e "groff -T ascii -man %f | more"
|
||||
text/x-python = idle %f
|
||||
-text/x-gaim-log = emacsclient --no-wait %f
|
||||
-text/x-purple-html-log = emacsclient --no-wait %f
|
||||
-text/x-purple-log = emacsclient --no-wait %f
|
||||
+text/x-gaim-log = emacsclient %f
|
||||
+text/x-purple-html-log = emacsclient %f
|
||||
+text/x-purple-log = emacsclient %f
|
||||
|
||||
# The video types will usually be handled by the desktop default, but they
|
||||
# need entries here to get an "Open" link
|
||||
-video/3gpp = vlc %f
|
||||
-video/mp2p = vlc %f
|
||||
-video/mp2t = vlc %f
|
||||
-video/mp4 = vlc %f
|
||||
-video/mpeg = vlc %f
|
||||
-video/quicktime = vlc %f
|
||||
-video/x-matroska = vlc %f
|
||||
-video/x-ms-asf = vlc %f
|
||||
-video/x-msvideo = vlc %f
|
||||
-
|
||||
+video/3gpp = open %f
|
||||
+video/mp2p = open %f
|
||||
+video/mp2t = open %f
|
||||
+video/mp4 = open %f
|
||||
+video/mpeg = open %f
|
||||
+video/quicktime = open %f
|
||||
+video/x-matroska = open %f
|
||||
+video/x-ms-asf = open %f
|
||||
+video/x-msvideo = open %f
|
77
packaging/rpm/kio_recoll.spec
Normal file
77
packaging/rpm/kio_recoll.spec
Normal file
|
@ -0,0 +1,77 @@
|
|||
%define name kio_recoll
|
||||
%define version 1.17.0
|
||||
%define release 0
|
||||
|
||||
Name: %{name}
|
||||
Version: %{version}
|
||||
Release: %{release}
|
||||
|
||||
Summary: KIO slave for the Recoll full text search tool
|
||||
Source0: http://www.recoll.org/recoll-%{version}.tar.gz
|
||||
URL: http://www.recoll.org/
|
||||
Group: Applications/Databases
|
||||
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
|
||||
License: GPL
|
||||
|
||||
BuildRequires: libkde4-devel zlib-devel xapian-core-devel libuuid-devel
|
||||
Requires: recoll
|
||||
|
||||
%description
|
||||
Recoll is a personal full text search package for Linux, FreeBSD and
|
||||
other Unix systems. It is based on a very strong backend (Xapian), for
|
||||
which it provides an easy to use, feature-rich, easy administration
|
||||
interface.
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
%prep
|
||||
%setup -q -n recoll-%{version}
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
%build
|
||||
|
||||
%cmake_kde4 kde/kioslave/kio_recoll
|
||||
pwd
|
||||
make %{?_smp_mflags}
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
%install
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
%makeinstall
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
%clean
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
%files
|
||||
%defattr(-,root,root,-)
|
||||
%{_libdir}/kde4/kio_recoll.so
|
||||
%{_datadir}/kde4/apps/kio_recoll
|
||||
%{_datadir}/kde4/apps/kio_recoll/help.html
|
||||
%{_datadir}/kde4/apps/kio_recoll/welcome.html
|
||||
%{_datadir}/kde4/services/recoll.protocol
|
||||
%{_datadir}/kde4/services/recollf.protocol
|
||||
%if 0%{?suse_version} > 1120
|
||||
%dir %{_datadir}/kde4/apps
|
||||
%dir %{_datadir}/kde4/services
|
||||
%dir %{_libdir}/kde4
|
||||
%endif
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
%changelog
|
||||
* Sun Mar 18 2012 Jean-Francois Dockes <jfd@recoll.org> 1.17.0-0
|
||||
- 1.17.0
|
||||
* Mon May 02 2011 Jean-Francois Dockes <jfd@recoll.org> 1.16.2-0
|
||||
- 1.16.2
|
||||
* Mon May 02 2011 Jean-Francois Dockes <jfd@recoll.org> 1.15.8-0
|
||||
- 1.15.8
|
||||
* Sun Mar 06 2011 Jean-Francois Dockes <jfd@recoll.org> 1.15.5-0
|
||||
- Initial spec file for kio
|
||||
|
75
packaging/rpm/recoll-mageia.spec
Normal file
75
packaging/rpm/recoll-mageia.spec
Normal file
|
@ -0,0 +1,75 @@
|
|||
Name: recoll
|
||||
Version: 1.19.9
|
||||
Release: %mkrel 1
|
||||
Summary: Desktop full text search tool with a Qt GUI
|
||||
URL: http://www.lesbonscomptes.com/recoll/
|
||||
Group: Databases
|
||||
License: GPLv2
|
||||
|
||||
Source0: http://www.lesbonscomptes.com/recoll/%{name}-%{version}.tar.gz
|
||||
|
||||
BuildRequires: xapian-devel
|
||||
BuildRequires: pkgconfig(QtCore)
|
||||
BuildRequires: pkgconfig(QtWebKit)
|
||||
|
||||
Requires: xapian
|
||||
|
||||
|
||||
%description
|
||||
Recoll is a personal full text search package for Linux, FreeBSD and
|
||||
other Unix systems. It is based on a very strong backend (Xapian), for
|
||||
which it provides an easy to use, feature-rich, easy administration
|
||||
interface.
|
||||
|
||||
|
||||
%package -n kio-%{name}
|
||||
Summary: Kioslave for %{name}
|
||||
Group: Graphical desktop/KDE
|
||||
BuildRequires: cmake
|
||||
BuildRequires: kdelibs4-devel
|
||||
Requires: %{name} = %{version}-%{release}
|
||||
Requires: kdebase4-workspace
|
||||
|
||||
%description -n kio-%{name}
|
||||
Kioslave for %{name}. Enables to perform querries and extract
|
||||
results in konqueror and dolphin.
|
||||
|
||||
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
|
||||
%build
|
||||
%configure2_5x --disable-python-module
|
||||
%make
|
||||
|
||||
|
||||
%install
|
||||
%makeinstall_std
|
||||
|
||||
rm lib/librecoll.so*
|
||||
pushd kde/kioslave/kio_recoll
|
||||
%cmake_kde4
|
||||
%make
|
||||
%makeinstall_std
|
||||
popd
|
||||
|
||||
|
||||
%files
|
||||
%doc README
|
||||
%{_bindir}/*
|
||||
%{_datadir}/applications/recoll-searchgui.desktop
|
||||
%{_datadir}/icons/hicolor/48x48/apps/recoll.png
|
||||
%{_datadir}/pixmaps/recoll.png
|
||||
%{_datadir}/%{name}
|
||||
%{_mandir}/man1/recoll*
|
||||
%{_mandir}/man5/recoll*
|
||||
%{_kde_libdir}/%name/librecoll.so.%version
|
||||
|
||||
|
||||
%files -n kio-%{name}
|
||||
%{_kde_libdir}/kde4/kio_recoll.so
|
||||
%{_kde_datadir}/apps/kio_recoll/help.html
|
||||
%{_kde_datadir}/apps/kio_recoll/welcome.html
|
||||
%{_kde_datadir}/kde4/services/recoll.protocol
|
||||
%{_kde_datadir}/kde4/services/recollf.protocol
|
224
packaging/rpm/recoll.spec
Normal file
224
packaging/rpm/recoll.spec
Normal file
|
@ -0,0 +1,224 @@
|
|||
Summary: Desktop full text search tool with Qt GUI
|
||||
Name: recoll
|
||||
Version: 1.20.6
|
||||
Release: 1%{?dist}
|
||||
Group: Applications/Databases
|
||||
License: GPLv2+
|
||||
URL: http://www.lesbonscomptes.com/recoll/
|
||||
Source0: http://www.lesbonscomptes.com/recoll/recoll-%{version}.tar.gz
|
||||
BuildRequires: qt-devel
|
||||
BuildRequires: qtwebkit-devel
|
||||
BuildRequires: python-devel
|
||||
BuildRequires: zlib-devel
|
||||
BuildRequires: aspell-devel
|
||||
BuildRequires: xapian-core-devel
|
||||
BuildRequires: desktop-file-utils
|
||||
Requires: xdg-utils
|
||||
|
||||
%description
|
||||
Recoll is a personal full text search package for Linux, FreeBSD and
|
||||
other Unix systems. It is based on a very strong back end (Xapian), for
|
||||
which it provides an easy to use, feature-rich, easy administration
|
||||
interface.
|
||||
%global __provides_exclude_from ^%{_libdir}/recoll/librecoll\\.so.*$
|
||||
%global __requires_exclude ^librecoll\\.so.*$
|
||||
|
||||
%prep
|
||||
%setup -q -n %{name}-%{version}
|
||||
chmod 0644 utils/{conftree.cpp,conftree.h,debuglog.cpp,debuglog.h}
|
||||
|
||||
%build
|
||||
export QMAKE=qmake-qt4
|
||||
%configure
|
||||
make %{?_smp_mflags}
|
||||
|
||||
%install
|
||||
make install DESTDIR=%{buildroot} STRIP=/bin/true INSTALL='install -p'
|
||||
|
||||
desktop-file-install --delete-original \
|
||||
--dir=%{buildroot}/%{_datadir}/applications \
|
||||
%{buildroot}/%{_datadir}/applications/%{name}-searchgui.desktop
|
||||
|
||||
# use /usr/bin/xdg-open
|
||||
rm -f %{buildroot}/usr/share/recoll/filters/xdg-open
|
||||
|
||||
# fix perms
|
||||
chmod 0755 %{buildroot}/usr/share/recoll/filters/rclexecm.py
|
||||
chmod 0755 %{buildroot}%{_libdir}/recoll/librecoll.so.*
|
||||
|
||||
%post
|
||||
touch --no-create %{_datadir}/icons/hicolor
|
||||
if [ -x %{_bindir}/gtk-update-icon-cache ] ; then
|
||||
%{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor
|
||||
fi
|
||||
if [ -x %{_bindir}/update-desktop-database ] ; then
|
||||
%{_bindir}/update-desktop-database &> /dev/null
|
||||
fi
|
||||
exit 0
|
||||
|
||||
%postun
|
||||
touch --no-create %{_datadir}/icons/hicolor
|
||||
if [ -x %{_bindir}/gtk-update-icon-cache ] ; then
|
||||
%{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor
|
||||
fi
|
||||
if [ -x %{_bindir}/update-desktop-database ] ; then
|
||||
%{_bindir}/update-desktop-database &> /dev/null
|
||||
fi
|
||||
exit 0
|
||||
|
||||
%files
|
||||
%doc COPYING ChangeLog README
|
||||
%{_bindir}/%{name}
|
||||
%{_bindir}/%{name}index
|
||||
%{_datadir}/%{name}
|
||||
%{_datadir}/appdata/%{name}.appdata.xml
|
||||
%{_datadir}/applications/%{name}-searchgui.desktop
|
||||
%{_datadir}/icons/hicolor/48x48/apps/%{name}.png
|
||||
%{_datadir}/pixmaps/%{name}.png
|
||||
%{_libdir}/recoll
|
||||
%{python_sitearch}/recoll
|
||||
%{python_sitearch}/Recoll*.egg-info
|
||||
%{_mandir}/man1/%{name}.1*
|
||||
%{_mandir}/man1/recollq.1*
|
||||
%{_mandir}/man1/%{name}index.1*
|
||||
%{_mandir}/man5/%{name}.conf.5*
|
||||
|
||||
%changelog
|
||||
* Sat Apr 25 2015 Jean-Francois Dockes <jf@dockes.org> - 1.20.6-1
|
||||
- 1.20.6
|
||||
|
||||
* Fri Dec 19 2014 Jean-Francois Dockes <jf@dockes.org> - 1.20.1-1
|
||||
- 1.20.1
|
||||
|
||||
* Sun Nov 09 2014 Jean-Francois Dockes <jf@dockes.org> - 1.19.14p2-1
|
||||
- 1.19.14p2
|
||||
|
||||
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.19.13-3
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
|
||||
|
||||
* Sun Jun 08 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.19.13-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
|
||||
|
||||
* Tue May 06 2014 Terje Rosten <terje.rosten@ntnu.no> - 1.19.13-1
|
||||
- 1.19.13
|
||||
|
||||
* Mon Jan 20 2014 Terje Rosten <terje.rosten@ntnu.no> - 1.19.11-1
|
||||
- 1.19.11
|
||||
|
||||
* Mon Nov 11 2013 Terje Rosten <terje.rosten@ntnu.no> - 1.19.9-1
|
||||
- 1.19.9
|
||||
|
||||
* Tue Nov 05 2013 Terje Rosten <terje.rosten@ntnu.no> - 1.19.8-1
|
||||
- 1.19.8
|
||||
|
||||
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.19.4-3
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
|
||||
|
||||
* Wed Jun 12 2013 Terje Rosten <terje.rosten@ntnu.no> - 1.19.4-2
|
||||
- Fix filter setup
|
||||
|
||||
* Mon Jun 10 2013 Terje Rosten <terje.rosten@ntnu.no> - 1.19.4-1
|
||||
- 1.19.4
|
||||
|
||||
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.18.1-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
|
||||
|
||||
* Mon Nov 19 2012 Terje Rosten <terje.rosten@ntnu.no> - 1.18.1-1
|
||||
- 1.18.1
|
||||
|
||||
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.17.3-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
|
||||
|
||||
* Wed May 30 2012 Terje Rosten <terje.rosten@ntnu.no> - 1.17.3-1
|
||||
- 1.17.3
|
||||
|
||||
* Sat Mar 31 2012 Terje Rosten <terje.rosten@ntnu.no> - 1.17.1-1
|
||||
- 1.17.1
|
||||
|
||||
* Sun Mar 25 2012 Terje Rosten <terje.rosten@ntnu.no> - 1.17-1
|
||||
- 1.17
|
||||
|
||||
* Tue Feb 28 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.16.2-3
|
||||
- Rebuilt for c++ ABI breakage
|
||||
|
||||
* Wed Feb 15 2012 Terje Rosten <terje.rosten@ntnu.no> - 1.16.2-2
|
||||
- Add patch to build with gcc 4.7
|
||||
|
||||
* Wed Feb 01 2012 Terje Rosten <terje.rosten@ntnu.no> - 1.16.2-1
|
||||
- 1.16.2
|
||||
|
||||
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.16.1-3
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
|
||||
|
||||
* Mon Oct 24 2011 Terje Rosten <terje.rosten@ntnu.no> - 1.16.1-2
|
||||
- Add patch to fix crash (bz #747472)
|
||||
|
||||
* Tue Oct 18 2011 Terje Rosten <terje.rosten@ntnu.no> - 1.16.1-1
|
||||
- 1.16.1
|
||||
|
||||
* Tue May 24 2011 Terje Rosten <terje.rosten@ntnu.no> - 1.15.8-2
|
||||
- add patch from upstream to fix crash.
|
||||
|
||||
* Sun May 08 2011 Terje Rosten <terje.rosten@ntnu.no> - 1.15.8-1
|
||||
- 1.15.8
|
||||
|
||||
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.14.4-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
|
||||
|
||||
* Fri Jan 28 2011 Terje Rosten <terje.rosten@ntnu.no> - 1.14.4-1
|
||||
- 1.14.4
|
||||
|
||||
* Mon Nov 15 2010 Terje Rosten <terje.rosten@ntnu.no> - 1.14.2-2
|
||||
- Add patch to fix #631704
|
||||
|
||||
* Sun Nov 7 2010 Terje Rosten <terje.rosten@ntnu.no> - 1.14.2-1
|
||||
- 1.14.2
|
||||
|
||||
* Thu Jul 15 2010 Terje Rosten <terje.rosten@ntnu.no> - 1.13.04-6
|
||||
- add patch to build with xapian 1.2 (from J.F. Dockes, thanks)
|
||||
|
||||
* Sat Jul 10 2010 Terje Rosten <terje.rosten@ntnu.no> - 1.13.04-5
|
||||
- use system xdg-open
|
||||
- trim chagenlog
|
||||
|
||||
* Fri Jul 9 2010 Terje Rosten <terje.rosten@ntnu.no> - 1.13.04-4
|
||||
- fix some review comments
|
||||
|
||||
* Mon May 10 2010 Terje Rosten <terje.rosten@ntnu.no> - 1.13.04-3
|
||||
- use version macro in source url
|
||||
- don't strip bins, giving non empty debuginfo package
|
||||
- more explicit file listing
|
||||
- try to preserve timestamps
|
||||
- use proper name for spec file
|
||||
- fix changelog
|
||||
- license seems to be GPLv2+
|
||||
- include some %%doc files
|
||||
- add buildroot tag
|
||||
- some source add execute bit set
|
||||
- explicit enable inotify
|
||||
- add aspell-devel to bulldreq
|
||||
- make with _smp_mflags seems to work
|
||||
- add post scripts
|
||||
- add patch to build gui with correct flags (ref: 338791)
|
||||
|
||||
* Sun May 9 2010 J.F. Dockes <jfd@recoll.org> 1.13.04-2
|
||||
- bumped the release number to issue new rpms for fc10
|
||||
|
||||
* Sun May 9 2010 J.F. Dockes 1.13.04
|
||||
- updated to recoll release 1.13.04
|
||||
|
||||
* Fri Feb 12 2010 Terry Duell 1.13.02
|
||||
- updated to release 1.13.02
|
||||
|
||||
* Tue Jan 12 2010 Terry Duell 1.13.01-3
|
||||
- updated to fix Fedora desktop-file-install and install icon
|
||||
|
||||
* Sun Jan 10 2010 Jean-Francois Dockes <jfd@recoll.org> 1.13.01-2
|
||||
- updated for recent fedoras: depend on xapian packages, use qt4
|
||||
|
||||
* Thu Jan 07 2010 Jean-Francois Dockes <jfd@recoll.org> 1.13.01-1
|
||||
- update to release 1.13.01
|
||||
|
||||
* Wed Feb 1 2006 Jean-Francois Dockes <jfd@recoll.org> 1.2.0-1
|
||||
- initial packaging
|
||||
|
88
packaging/rpm/recollCooker.spec
Normal file
88
packaging/rpm/recollCooker.spec
Normal file
|
@ -0,0 +1,88 @@
|
|||
Summary: Desktop full text search tool with a qt gui
|
||||
Name: recoll
|
||||
Version: 1.12.0
|
||||
Release: %mkrel 1
|
||||
License: GPL
|
||||
Group: Databases
|
||||
URL: http://www.recoll.org/
|
||||
Source0: http://www.lesbonscomptes.com/recoll/%{name}-%{version}.tar.bz2
|
||||
Patch1: %{name}-configure.patch
|
||||
BuildRequires: libxapian-devel
|
||||
BuildRequires: libfam-devel
|
||||
BuildRequires: libqt-devel >= 3.3.7
|
||||
BuildRequires: libaspell-devel
|
||||
Requires: xapian
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}--buildroot
|
||||
|
||||
%description
|
||||
Recoll is a personal full text search tool for Unix/Linux.
|
||||
It is based on the very strong Xapian backend, for which
|
||||
it provides an easy to use, feature-rich, easy administration,
|
||||
QT graphical interface.
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
%patch1 -p0
|
||||
|
||||
%build
|
||||
%configure2_5x \
|
||||
--with-fam \
|
||||
--with-aspell
|
||||
|
||||
%make
|
||||
|
||||
%install
|
||||
[ "%{buildroot}" != "/" ] && rm -rf %{buildroot}
|
||||
|
||||
%makeinstall_std
|
||||
desktop-file-install --vendor="" \
|
||||
--add-category="X-MandrivaLinux-MoreApplications-Databases" \
|
||||
--dir %{buildroot}%{_datadir}/applications %{buildroot}%{_datadir}/applications/*
|
||||
|
||||
%clean
|
||||
[ "%{buildroot}" != "/" ] && rm -rf %{buildroot}
|
||||
|
||||
%files
|
||||
%defattr(644,root,root,755)
|
||||
%doc %{_datadir}/%{name}/doc
|
||||
%attr(755,root,root) %{_bindir}/%{name}*
|
||||
%{_datadir}/applications/recoll-searchgui.desktop
|
||||
%{_datadir}/icons/hicolor/48x48/apps/recoll-searchgui.png
|
||||
%dir %{_datadir}/%{name}
|
||||
%dir %{_datadir}/%{name}/examples
|
||||
%dir %{_datadir}/%{name}/filters
|
||||
%dir %{_datadir}/%{name}/images
|
||||
%dir %{_datadir}/%{name}/translations
|
||||
%{_datadir}/%{name}/examples/mime*
|
||||
%{_datadir}/%{name}/examples/*.conf
|
||||
%attr(755,root,root) %{_datadir}/%{name}/examples/rclmon.sh
|
||||
%attr(755,root,root) %{_datadir}/%{name}/filters/rc*
|
||||
%{_datadir}/%{name}/filters/xdg-open
|
||||
%{_datadir}/%{name}/images/*png
|
||||
%{_mandir}/man1/recoll*
|
||||
%{_mandir}/man5/recoll*
|
||||
%{_datadir}/%{name}/translations/*.qm
|
||||
|
||||
|
||||
%changelog
|
||||
* Fri Apr 20 2007 Tomasz Pawel Gajc <tpg@mandriva.org> 1.12.1-1mdv2008.0
|
||||
+ Revision: 16093
|
||||
- new version
|
||||
- drop P0
|
||||
|
||||
+ Mandriva <devel@mandriva.com>
|
||||
|
||||
|
||||
* Tue Mar 06 2007 Tomasz Pawel Gajc <tpg@mandriva.org> 1.7.5-2mdv2007.0
|
||||
+ Revision: 134128
|
||||
- rebuild
|
||||
|
||||
* Tue Jan 30 2007 Tomasz Pawel Gajc <tpg@mandriva.org> 1.7.5-1mdv2007.1
|
||||
+ Revision: 115423
|
||||
- add patch 1 - fix build on x86_64
|
||||
- add patch 0 - fix menu entry
|
||||
- fix group
|
||||
- add buildrequires
|
||||
- set correct bits on files
|
||||
- Import recoll
|
||||
|
224
packaging/rpm/recollfedora.spec
Normal file
224
packaging/rpm/recollfedora.spec
Normal file
|
@ -0,0 +1,224 @@
|
|||
Summary: Desktop full text search tool with Qt GUI
|
||||
Name: recoll
|
||||
Version: 1.20.6
|
||||
Release: 1%{?dist}
|
||||
Group: Applications/Databases
|
||||
License: GPLv2+
|
||||
URL: http://www.lesbonscomptes.com/recoll/
|
||||
Source0: http://www.lesbonscomptes.com/recoll/recoll-%{version}.tar.gz
|
||||
BuildRequires: qt-devel
|
||||
BuildRequires: qtwebkit-devel
|
||||
BuildRequires: python-devel
|
||||
BuildRequires: zlib-devel
|
||||
BuildRequires: aspell-devel
|
||||
BuildRequires: xapian-core-devel
|
||||
BuildRequires: desktop-file-utils
|
||||
Requires: xdg-utils
|
||||
|
||||
%description
|
||||
Recoll is a personal full text search package for Linux, FreeBSD and
|
||||
other Unix systems. It is based on a very strong back end (Xapian), for
|
||||
which it provides an easy to use, feature-rich, easy administration
|
||||
interface.
|
||||
%global __provides_exclude_from ^%{_libdir}/recoll/librecoll\\.so.*$
|
||||
%global __requires_exclude ^librecoll\\.so.*$
|
||||
|
||||
%prep
|
||||
%setup -q -n %{name}-%{version}
|
||||
chmod 0644 utils/{conftree.cpp,conftree.h,debuglog.cpp,debuglog.h}
|
||||
|
||||
%build
|
||||
export QMAKE=qmake-qt4
|
||||
%configure
|
||||
make %{?_smp_mflags}
|
||||
|
||||
%install
|
||||
make install DESTDIR=%{buildroot} STRIP=/bin/true INSTALL='install -p'
|
||||
|
||||
desktop-file-install --delete-original \
|
||||
--dir=%{buildroot}/%{_datadir}/applications \
|
||||
%{buildroot}/%{_datadir}/applications/%{name}-searchgui.desktop
|
||||
|
||||
# use /usr/bin/xdg-open
|
||||
rm -f %{buildroot}/usr/share/recoll/filters/xdg-open
|
||||
|
||||
# fix perms
|
||||
chmod 0755 %{buildroot}/usr/share/recoll/filters/rclexecm.py
|
||||
chmod 0755 %{buildroot}%{_libdir}/recoll/librecoll.so.*
|
||||
|
||||
%post
|
||||
touch --no-create %{_datadir}/icons/hicolor
|
||||
if [ -x %{_bindir}/gtk-update-icon-cache ] ; then
|
||||
%{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor
|
||||
fi
|
||||
if [ -x %{_bindir}/update-desktop-database ] ; then
|
||||
%{_bindir}/update-desktop-database &> /dev/null
|
||||
fi
|
||||
exit 0
|
||||
|
||||
%postun
|
||||
touch --no-create %{_datadir}/icons/hicolor
|
||||
if [ -x %{_bindir}/gtk-update-icon-cache ] ; then
|
||||
%{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor
|
||||
fi
|
||||
if [ -x %{_bindir}/update-desktop-database ] ; then
|
||||
%{_bindir}/update-desktop-database &> /dev/null
|
||||
fi
|
||||
exit 0
|
||||
|
||||
%files
|
||||
%doc COPYING ChangeLog README
|
||||
%{_bindir}/%{name}
|
||||
%{_bindir}/%{name}index
|
||||
%{_datadir}/%{name}
|
||||
%{_datadir}/appdata/%{name}.appdata.xml
|
||||
%{_datadir}/applications/%{name}-searchgui.desktop
|
||||
%{_datadir}/icons/hicolor/48x48/apps/%{name}.png
|
||||
%{_datadir}/pixmaps/%{name}.png
|
||||
%{_libdir}/recoll
|
||||
%{python_sitearch}/recoll
|
||||
%{python_sitearch}/Recoll*.egg-info
|
||||
%{_mandir}/man1/%{name}.1*
|
||||
%{_mandir}/man1/recollq.1*
|
||||
%{_mandir}/man1/%{name}index.1*
|
||||
%{_mandir}/man5/%{name}.conf.5*
|
||||
|
||||
%changelog
|
||||
* Sat Apr 25 2015 Jean-Francois Dockes <jf@dockes.org> - 1.20.6-1
|
||||
- 1.20.6
|
||||
|
||||
* Fri Dec 19 2014 Jean-Francois Dockes <jf@dockes.org> - 1.20.1-1
|
||||
- 1.20.1
|
||||
|
||||
* Sun Nov 09 2014 Jean-Francois Dockes <jf@dockes.org> - 1.19.14p2-1
|
||||
- 1.19.14p2
|
||||
|
||||
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.19.13-3
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
|
||||
|
||||
* Sun Jun 08 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.19.13-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
|
||||
|
||||
* Tue May 06 2014 Terje Rosten <terje.rosten@ntnu.no> - 1.19.13-1
|
||||
- 1.19.13
|
||||
|
||||
* Mon Jan 20 2014 Terje Rosten <terje.rosten@ntnu.no> - 1.19.11-1
|
||||
- 1.19.11
|
||||
|
||||
* Mon Nov 11 2013 Terje Rosten <terje.rosten@ntnu.no> - 1.19.9-1
|
||||
- 1.19.9
|
||||
|
||||
* Tue Nov 05 2013 Terje Rosten <terje.rosten@ntnu.no> - 1.19.8-1
|
||||
- 1.19.8
|
||||
|
||||
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.19.4-3
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
|
||||
|
||||
* Wed Jun 12 2013 Terje Rosten <terje.rosten@ntnu.no> - 1.19.4-2
|
||||
- Fix filter setup
|
||||
|
||||
* Mon Jun 10 2013 Terje Rosten <terje.rosten@ntnu.no> - 1.19.4-1
|
||||
- 1.19.4
|
||||
|
||||
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.18.1-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
|
||||
|
||||
* Mon Nov 19 2012 Terje Rosten <terje.rosten@ntnu.no> - 1.18.1-1
|
||||
- 1.18.1
|
||||
|
||||
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.17.3-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
|
||||
|
||||
* Wed May 30 2012 Terje Rosten <terje.rosten@ntnu.no> - 1.17.3-1
|
||||
- 1.17.3
|
||||
|
||||
* Sat Mar 31 2012 Terje Rosten <terje.rosten@ntnu.no> - 1.17.1-1
|
||||
- 1.17.1
|
||||
|
||||
* Sun Mar 25 2012 Terje Rosten <terje.rosten@ntnu.no> - 1.17-1
|
||||
- 1.17
|
||||
|
||||
* Tue Feb 28 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.16.2-3
|
||||
- Rebuilt for c++ ABI breakage
|
||||
|
||||
* Wed Feb 15 2012 Terje Rosten <terje.rosten@ntnu.no> - 1.16.2-2
|
||||
- Add patch to build with gcc 4.7
|
||||
|
||||
* Wed Feb 01 2012 Terje Rosten <terje.rosten@ntnu.no> - 1.16.2-1
|
||||
- 1.16.2
|
||||
|
||||
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.16.1-3
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
|
||||
|
||||
* Mon Oct 24 2011 Terje Rosten <terje.rosten@ntnu.no> - 1.16.1-2
|
||||
- Add patch to fix crash (bz #747472)
|
||||
|
||||
* Tue Oct 18 2011 Terje Rosten <terje.rosten@ntnu.no> - 1.16.1-1
|
||||
- 1.16.1
|
||||
|
||||
* Tue May 24 2011 Terje Rosten <terje.rosten@ntnu.no> - 1.15.8-2
|
||||
- add patch from upstream to fix crash.
|
||||
|
||||
* Sun May 08 2011 Terje Rosten <terje.rosten@ntnu.no> - 1.15.8-1
|
||||
- 1.15.8
|
||||
|
||||
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.14.4-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
|
||||
|
||||
* Fri Jan 28 2011 Terje Rosten <terje.rosten@ntnu.no> - 1.14.4-1
|
||||
- 1.14.4
|
||||
|
||||
* Mon Nov 15 2010 Terje Rosten <terje.rosten@ntnu.no> - 1.14.2-2
|
||||
- Add patch to fix #631704
|
||||
|
||||
* Sun Nov 7 2010 Terje Rosten <terje.rosten@ntnu.no> - 1.14.2-1
|
||||
- 1.14.2
|
||||
|
||||
* Thu Jul 15 2010 Terje Rosten <terje.rosten@ntnu.no> - 1.13.04-6
|
||||
- add patch to build with xapian 1.2 (from J.F. Dockes, thanks)
|
||||
|
||||
* Sat Jul 10 2010 Terje Rosten <terje.rosten@ntnu.no> - 1.13.04-5
|
||||
- use system xdg-open
|
||||
- trim chagenlog
|
||||
|
||||
* Fri Jul 9 2010 Terje Rosten <terje.rosten@ntnu.no> - 1.13.04-4
|
||||
- fix some review comments
|
||||
|
||||
* Mon May 10 2010 Terje Rosten <terje.rosten@ntnu.no> - 1.13.04-3
|
||||
- use version macro in source url
|
||||
- don't strip bins, giving non empty debuginfo package
|
||||
- more explicit file listing
|
||||
- try to preserve timestamps
|
||||
- use proper name for spec file
|
||||
- fix changelog
|
||||
- license seems to be GPLv2+
|
||||
- include some %%doc files
|
||||
- add buildroot tag
|
||||
- some source add execute bit set
|
||||
- explicit enable inotify
|
||||
- add aspell-devel to bulldreq
|
||||
- make with _smp_mflags seems to work
|
||||
- add post scripts
|
||||
- add patch to build gui with correct flags (ref: 338791)
|
||||
|
||||
* Sun May 9 2010 J.F. Dockes <jfd@recoll.org> 1.13.04-2
|
||||
- bumped the release number to issue new rpms for fc10
|
||||
|
||||
* Sun May 9 2010 J.F. Dockes 1.13.04
|
||||
- updated to recoll release 1.13.04
|
||||
|
||||
* Fri Feb 12 2010 Terry Duell 1.13.02
|
||||
- updated to release 1.13.02
|
||||
|
||||
* Tue Jan 12 2010 Terry Duell 1.13.01-3
|
||||
- updated to fix Fedora desktop-file-install and install icon
|
||||
|
||||
* Sun Jan 10 2010 Jean-Francois Dockes <jfd@recoll.org> 1.13.01-2
|
||||
- updated for recent fedoras: depend on xapian packages, use qt4
|
||||
|
||||
* Thu Jan 07 2010 Jean-Francois Dockes <jfd@recoll.org> 1.13.01-1
|
||||
- update to release 1.13.01
|
||||
|
||||
* Wed Feb 1 2006 Jean-Francois Dockes <jfd@recoll.org> 1.2.0-1
|
||||
- initial packaging
|
||||
|
130
packaging/rpm/recollmdk.spec
Normal file
130
packaging/rpm/recollmdk.spec
Normal file
|
@ -0,0 +1,130 @@
|
|||
%define name recoll
|
||||
%define version 1.18.1
|
||||
%define release %mkrel 1
|
||||
|
||||
Name: %{name}
|
||||
Version: %{version}
|
||||
Release: %{release}
|
||||
|
||||
Summary: Desktop full text search tool with a qt gui
|
||||
Source0: http://www.recoll.org/%{name}-%{version}.tar.gz
|
||||
URL: http://www.recoll.org/
|
||||
Group: Applications/Databases
|
||||
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
|
||||
License: GPL
|
||||
BuildRequires: libqt4-devel
|
||||
BuildRequires: libqtwebkit2.2-devel
|
||||
BuildRequires: libpython-devel
|
||||
BuildRequires: libxapian-devel
|
||||
|
||||
%description
|
||||
Recoll is a personal full text search package for Linux, FreeBSD and
|
||||
other Unix systems. It is based on a very strong backend (Xapian), for
|
||||
which it provides an easy to use, feature-rich, easy administration
|
||||
interface.
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
%build
|
||||
[ -n "$QTDIR" ] || . %{_sysconfdir}/profile.d/60qt4.sh
|
||||
%configure
|
||||
make %{?_smp_mflags}
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
%install
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
%makeinstall
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
%clean
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
%files
|
||||
%defattr(-,root,root,-)
|
||||
%{_bindir}/*
|
||||
%{_datadir}/applications/recoll-searchgui.desktop
|
||||
%{_datadir}/icons/hicolor/48x48/apps/recoll.png
|
||||
%{_datadir}/pixmaps/recoll.png
|
||||
%{_datadir}/%{name}
|
||||
%{_mandir}/man1/recoll*
|
||||
%{_mandir}/man5/recoll*
|
||||
%{python_sitearch}/Recoll*.egg-info
|
||||
%{python_sitearch}/recoll.so
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
%changelog
|
||||
* Mon Nov 05 2012 Jean-Francois Dockes <jfd@recoll.org> 1.18.1-1
|
||||
- Update to release 1.18.1
|
||||
* Thu May 17 2012 Jean-Francois Dockes <jfd@recoll.org> 1.17.2-1
|
||||
- Update to release 1.17.2
|
||||
* Mon Nov 07 2011 Jean-Francois Dockes <jfd@recoll.org> 1.16.2-1
|
||||
- Update to release 1.16.2
|
||||
* Wed Sep 28 2011 Jean-Francois Dockes <jfd@recoll.org> 1.16.1-1
|
||||
- Update to release 1.16.1
|
||||
* Wed Sep 21 2011 Jean-Francois Dockes <jfd@recoll.org> 1.16.0-1
|
||||
- Update to release 1.16.0
|
||||
* Tue May 03 2011 Jean-Francois Dockes <jfd@recoll.org> 1.15.8-1
|
||||
- Update to release 1.15.8
|
||||
* Fri Mar 04 2011 Jean-Francois Dockes <jfd@recoll.org> 1.15.5-1
|
||||
- Update to release 1.15.5
|
||||
* Thu Feb 15 2011 Jean-Francois Dockes <jfd@recoll.org> 1.15.2-1
|
||||
- Update to release 1.15.2
|
||||
* Wed Feb 02 2011 Jean-Francois Dockes <jfd@recoll.org> 1.15.0-1
|
||||
- Update to release 1.15.0
|
||||
* Thu Nov 25 2010 Jean-Francois Dockes <jfd@recoll.org> 1.14.3-1
|
||||
- Update to release 1.14.2
|
||||
* Sat Sep 24 2010 Jean-Francois Dockes <jfd@recoll.org> 1.14.2-1
|
||||
- Update to release 1.14.2
|
||||
* Mon Sep 13 2010 Jean-Francois Dockes <jfd@recoll.org> 1.14.0-1
|
||||
- Update to release 1.14.0
|
||||
* Thu Apr 14 2010 Jean-Francois Dockes <jfd@recoll.org> 1.13.04-1
|
||||
- Update to release 1.13.01
|
||||
* Thu Jan 07 2010 Jean-Francois Dockes <jfd@recoll.org> 1.13.01-1
|
||||
- Update to release 1.13.01
|
||||
* Thu Dec 10 2009 Jean-Francois Dockes <jfd@recoll.org> 1.12.4-1
|
||||
- Update to release 1.12.2
|
||||
* Mon Oct 19 2009 Jean-Francois Dockes <jfd@recoll.org> 1.12.2-1
|
||||
- Update to release 1.12.2
|
||||
* Thu Jan 29 2009 Jean-Francois Dockes <jfd@recoll.org> 1.12.0-1
|
||||
- Update to release 1.12.0
|
||||
* Mon Oct 13 2008 Jean-Francois Dockes <jfd@recoll.org> 1.11.0-1
|
||||
- Update to release 1.11.0
|
||||
* Thu May 27 2008 Jean-Francois Dockes <jfd@recoll.org> 1.10.2-1
|
||||
- Update to release 1.10.2
|
||||
* Thu Jan 31 2008 Jean-Francois Dockes <jfd@recoll.org> 1.10.1-1
|
||||
- Update to release 1.10.1
|
||||
* Wed Nov 21 2007 Jean-Francois Dockes <jfd@recoll.org> 1.10.0-1
|
||||
- Update to release 1.10.0
|
||||
* Tue Sep 11 2007 Jean-Francois Dockes <jfd@recoll.org> 1.9.0-1
|
||||
- Update to release 1.9.0
|
||||
* Tue Mar 6 2007 Jean-Francois Dockes <jfd@recoll.org> 1.8.1-1
|
||||
- Update to release 1.8.1
|
||||
* Mon Jan 15 2007 Jean-Francois Dockes <jfd@recoll.org> 1.7.5-1
|
||||
- Update to release 1.7.5
|
||||
* Mon Jan 08 2007 Jean-Francois Dockes <jfd@recoll.org> 1.7.3-1
|
||||
- Update to release 1.7.3
|
||||
* Tue Nov 28 2006 Jean-Francois Dockes <jfd@recoll.org> 1.6.1-1
|
||||
- Update to release 1.6.1
|
||||
* Mon Nov 20 2006 Jean-Francois Dockes <jfd@recoll.org> 1.5.11-1
|
||||
- Update to release 1.5.11
|
||||
* Mon Oct 2 2006 Jean-Francois Dockes <jfd@recoll.org> 1.5.2-1
|
||||
- Update to release 1.5.2
|
||||
* Sun May 7 2006 Jean-Francois Dockes <jfd@recoll.org> 1.4.3-1
|
||||
- Update to release 1.4.3
|
||||
* Fri Mar 31 2006 Jean-Francois Dockes <jfd@recoll.org> 1.3.3-1
|
||||
- Update to release 1.3.3
|
||||
* Thu Feb 2 2006 Jean-Francois Dockes <jfd@recoll.org> 1.2.2-1
|
||||
- Update to release 1.2.2
|
||||
* Thu Jan 10 2006 Jean-Francois Dockes <jfd@recoll.org> 1.1.0-1
|
||||
- Initial packaging
|
340
src/COPYING
Normal file
340
src/COPYING
Normal file
|
@ -0,0 +1,340 @@
|
|||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Library General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) year name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Library General
|
||||
Public License instead of this License.
|
10552
src/ChangeLog
Normal file
10552
src/ChangeLog
Normal file
File diff suppressed because it is too large
Load diff
1348
src/INSTALL
Normal file
1348
src/INSTALL
Normal file
File diff suppressed because it is too large
Load diff
638
src/Makefile.am
Normal file
638
src/Makefile.am
Normal file
|
@ -0,0 +1,638 @@
|
|||
|
||||
CXXFLAGS ?= @CXXFLAGS@
|
||||
LIBXAPIAN=@LIBXAPIAN@
|
||||
XAPIANCXXFLAGS=@XAPIANCXXFLAGS@
|
||||
LIBICONV=@LIBICONV@
|
||||
INCICONV=@INCICONV@
|
||||
LIBFAM = @LIBFAM@
|
||||
RCLLIBVERSION=@RCLLIBVERSION@
|
||||
X_CFLAGS=@X_CFLAGS@
|
||||
X_PRE_LIBS=@X_PRE_LIBS@
|
||||
X_LIBS=@X_LIBS@
|
||||
X_EXTRA_LIBS=@X_EXTRA_LIBS@
|
||||
X_LIBX11=@X_LIBX11@
|
||||
DEFS=@DEFS@
|
||||
|
||||
COMMONCPPFLAGS = -I. \
|
||||
-I$(top_srcdir)/aspell \
|
||||
-I$(top_srcdir)/bincimapmime \
|
||||
-I$(top_srcdir)/common \
|
||||
-I$(top_srcdir)/index \
|
||||
-I$(top_srcdir)/internfile \
|
||||
-I$(top_srcdir)/rcldb \
|
||||
-I$(top_srcdir)/unac \
|
||||
-I$(top_srcdir)/utils \
|
||||
-I$(top_srcdir)/xaposix \
|
||||
-DBUILDING_RECOLL
|
||||
|
||||
AM_CPPFLAGS = -Wall -Wno-unused \
|
||||
$(COMMONCPPFLAGS) \
|
||||
$(INCICONV) \
|
||||
$(XAPIANCXXFLAGS) \
|
||||
$(X_CFLAGS) \
|
||||
-DRECOLL_DATADIR=\"${pkgdatadir}\" \
|
||||
-D_GNU_SOURCE \
|
||||
$(DEFS)
|
||||
|
||||
ACLOCAL_AMFLAGS = -I m4
|
||||
|
||||
if NOTHREADS
|
||||
LIBTHREADS=
|
||||
else
|
||||
LIBTHREADS= $(LIBSYSTHREADS)
|
||||
endif
|
||||
|
||||
librcldir = $(libdir)/recoll
|
||||
librcl_LTLIBRARIES = librecoll.la
|
||||
|
||||
librecoll_la_SOURCES = \
|
||||
aspell/aspell-local.h \
|
||||
aspell/rclaspell.cpp \
|
||||
aspell/rclaspell.h \
|
||||
bincimapmime/config.h \
|
||||
bincimapmime/convert.cc \
|
||||
bincimapmime/convert.h \
|
||||
bincimapmime/mime-inputsource.h \
|
||||
bincimapmime/mime-parsefull.cc \
|
||||
bincimapmime/mime-parseonlyheader.cc \
|
||||
bincimapmime/mime-printbody.cc \
|
||||
bincimapmime/mime-utils.h \
|
||||
bincimapmime/mime.cc \
|
||||
bincimapmime/mime.h \
|
||||
common/beaglequeuecache.cpp \
|
||||
common/beaglequeuecache.h \
|
||||
common/conf_post.h \
|
||||
common/cstr.cpp \
|
||||
common/cstr.h \
|
||||
common/rclconfig.cpp \
|
||||
common/rclconfig.h \
|
||||
common/rclinit.cpp \
|
||||
common/rclinit.h \
|
||||
common/syngroups.cpp \
|
||||
common/syngroups.h \
|
||||
common/textsplit.cpp \
|
||||
common/textsplit.h \
|
||||
common/unacpp.cpp \
|
||||
common/unacpp.h \
|
||||
common/uproplist.h \
|
||||
index/beaglequeue.cpp \
|
||||
index/beaglequeue.h \
|
||||
index/bglfetcher.cpp \
|
||||
index/bglfetcher.h \
|
||||
index/checkretryfailed.cpp \
|
||||
index/checkretryfailed.h \
|
||||
index/fetcher.cpp \
|
||||
index/fetcher.h \
|
||||
index/fsfetcher.cpp \
|
||||
index/fsfetcher.h \
|
||||
index/fsindexer.cpp \
|
||||
index/fsindexer.h \
|
||||
index/indexer.cpp \
|
||||
index/indexer.h \
|
||||
index/mimetype.cpp \
|
||||
index/mimetype.h \
|
||||
index/rclmon.h \
|
||||
index/recollindex.h \
|
||||
index/subtreelist.cpp \
|
||||
index/subtreelist.h \
|
||||
internfile/Filter.h \
|
||||
internfile/extrameta.cpp \
|
||||
internfile/extrameta.h \
|
||||
internfile/htmlparse.cpp \
|
||||
internfile/htmlparse.h \
|
||||
internfile/indextext.h \
|
||||
internfile/internfile.cpp \
|
||||
internfile/internfile.h \
|
||||
internfile/mh_exec.cpp \
|
||||
internfile/mh_exec.h \
|
||||
internfile/mh_execm.cpp \
|
||||
internfile/mh_execm.h \
|
||||
internfile/mh_html.cpp \
|
||||
internfile/mh_html.h \
|
||||
internfile/mh_mail.cpp \
|
||||
internfile/mh_mail.h \
|
||||
internfile/mh_mbox.cpp \
|
||||
internfile/mh_mbox.h \
|
||||
internfile/mh_null.h \
|
||||
internfile/mh_symlink.h \
|
||||
internfile/mh_text.cpp \
|
||||
internfile/mh_text.h \
|
||||
internfile/mh_unknown.h \
|
||||
internfile/mimehandler.cpp \
|
||||
internfile/mimehandler.h \
|
||||
internfile/myhtmlparse.cpp \
|
||||
internfile/myhtmlparse.h \
|
||||
internfile/txtdcode.cpp \
|
||||
internfile/uncomp.cpp \
|
||||
internfile/uncomp.h \
|
||||
query/docseq.cpp \
|
||||
query/docseq.h \
|
||||
query/docseqdb.cpp \
|
||||
query/docseqdb.h \
|
||||
query/docseqdocs.h \
|
||||
query/docseqhist.cpp \
|
||||
query/docseqhist.h \
|
||||
query/dynconf.cpp \
|
||||
query/dynconf.h \
|
||||
query/filtseq.cpp \
|
||||
query/filtseq.h \
|
||||
query/plaintorich.cpp \
|
||||
query/plaintorich.h \
|
||||
query/recollq.cpp \
|
||||
query/recollq.h \
|
||||
query/reslistpager.cpp \
|
||||
query/reslistpager.h \
|
||||
query/sortseq.cpp \
|
||||
query/sortseq.h \
|
||||
query/wasaparse.ypp \
|
||||
query/wasaparseaux.cpp \
|
||||
query/wasaparserdriver.h \
|
||||
query/wasatorcl.h \
|
||||
rcldb/daterange.cpp \
|
||||
rcldb/daterange.h \
|
||||
rcldb/expansiondbs.cpp \
|
||||
rcldb/expansiondbs.h \
|
||||
rcldb/rclabstract.cpp \
|
||||
rcldb/rcldb.cpp \
|
||||
rcldb/rcldb.h \
|
||||
rcldb/rcldb_p.h \
|
||||
rcldb/rcldoc.cpp \
|
||||
rcldb/rcldoc.h \
|
||||
rcldb/rcldups.cpp \
|
||||
rcldb/rclquery.cpp \
|
||||
rcldb/rclquery.h \
|
||||
rcldb/rclquery_p.h \
|
||||
rcldb/rclterms.cpp \
|
||||
rcldb/searchdata.cpp \
|
||||
rcldb/searchdata.h \
|
||||
rcldb/searchdatatox.cpp \
|
||||
rcldb/searchdataxml.cpp \
|
||||
rcldb/stemdb.cpp \
|
||||
rcldb/stemdb.h \
|
||||
rcldb/stoplist.cpp \
|
||||
rcldb/stoplist.h \
|
||||
rcldb/synfamily.cpp \
|
||||
rcldb/synfamily.h \
|
||||
rcldb/termproc.h \
|
||||
rcldb/xmacros.h \
|
||||
unac/unac.cpp \
|
||||
unac/unac.h \
|
||||
unac/unac_version.h \
|
||||
utils/appformime.cpp \
|
||||
utils/appformime.h \
|
||||
utils/base64.cpp \
|
||||
utils/base64.h \
|
||||
utils/cancelcheck.cpp \
|
||||
utils/cancelcheck.h \
|
||||
utils/chrono.h \
|
||||
utils/chrono.cpp \
|
||||
utils/circache.cpp \
|
||||
utils/circache.h \
|
||||
utils/closefrom.cpp \
|
||||
utils/closefrom.h \
|
||||
utils/conftree.cpp \
|
||||
utils/conftree.h \
|
||||
utils/copyfile.cpp \
|
||||
utils/copyfile.h \
|
||||
utils/cpuconf.cpp \
|
||||
utils/cpuconf.h \
|
||||
utils/debuglog.cpp \
|
||||
utils/debuglog.h \
|
||||
utils/ecrontab.cpp \
|
||||
utils/ecrontab.h \
|
||||
utils/execmd.cpp \
|
||||
utils/execmd.h \
|
||||
utils/fileudi.cpp \
|
||||
utils/fileudi.h \
|
||||
utils/fstreewalk.cpp \
|
||||
utils/fstreewalk.h \
|
||||
utils/hldata.h \
|
||||
utils/idfile.cpp \
|
||||
utils/idfile.h \
|
||||
utils/md5.cpp \
|
||||
utils/md5.h \
|
||||
utils/md5ut.cpp \
|
||||
utils/md5ut.h \
|
||||
utils/mimeparse.cpp \
|
||||
utils/mimeparse.h \
|
||||
utils/netcon.cpp \
|
||||
utils/netcon.h \
|
||||
utils/pathut.cpp \
|
||||
utils/pathut.h \
|
||||
utils/ptmutex.h \
|
||||
utils/pxattr.cpp \
|
||||
utils/pxattr.h \
|
||||
utils/rclionice.cpp \
|
||||
utils/rclionice.h \
|
||||
utils/readfile.cpp \
|
||||
utils/readfile.h \
|
||||
utils/refcntr.h \
|
||||
utils/smallut.cpp \
|
||||
utils/smallut.h \
|
||||
utils/strmatcher.cpp \
|
||||
utils/strmatcher.h \
|
||||
utils/transcode.cpp \
|
||||
utils/transcode.h \
|
||||
utils/utf8iter.h \
|
||||
utils/wipedir.cpp \
|
||||
utils/wipedir.h \
|
||||
utils/workqueue.h \
|
||||
utils/x11mon.cpp \
|
||||
utils/x11mon.h \
|
||||
xaposix/safefcntl.h \
|
||||
xaposix/safesysstat.h \
|
||||
xaposix/safesyswait.h \
|
||||
xaposix/safeunistd.h
|
||||
|
||||
BUILT_SOURCES = query/wasaparse.cpp
|
||||
AM_YFLAGS = -d
|
||||
|
||||
# We use -release: the lib is only shared
|
||||
# between recoll programs from the same release.
|
||||
# -version-info $(VERSION_INFO)
|
||||
librecoll_la_LDFLAGS = -release $(VERSION) \
|
||||
-Wl,--no-undefined -Wl,--warn-unresolved-symbols
|
||||
|
||||
librecoll_la_LIBADD = $(LIBXAPIAN) $(LIBICONV) $(X_LIBX11) $(LIBTHREADS)
|
||||
|
||||
# There is probably a better way to do this. The KIO needs to be linked
|
||||
# with librecoll, but librecoll is installed into a non-standard place
|
||||
# (/usr/lib/recoll). Debian packaging has something against setting an
|
||||
# rpath on the kio (cause it's not the same package as the lib), so I don't
|
||||
# know how to link it dynamically. The other thing I don't know is how to
|
||||
# force automake to build a static lib with the PIC objects. So the
|
||||
# following target, which is only used from the KIO build, deletes any .a
|
||||
# and .so and rebuilds the .a with the pic objs (the kio build calls
|
||||
# configured --disable-static).
|
||||
# Of course this is very uncomfortably close to automake/libtool internals
|
||||
# and may not work on all systems.
|
||||
PicStatic: $(librecoll_la_OBJECTS)
|
||||
rm -f .libs/librecoll.a
|
||||
rm -f .libs/librecoll.so
|
||||
libtool --mode=link gcc -g -O -o librecoll.la \
|
||||
$(librecoll_la_OBJECTS)
|
||||
|
||||
bin_PROGRAMS = recollindex
|
||||
if MAKECMDLINE
|
||||
bin_PROGRAMS += recollq
|
||||
endif
|
||||
|
||||
if MAKEXADUMP
|
||||
bin_PROGRAMS += xadump
|
||||
endif
|
||||
|
||||
recollindex_SOURCES = \
|
||||
index/recollindex.cpp \
|
||||
index/rclmonprc.cpp \
|
||||
index/rclmonrcv.cpp
|
||||
recollindex_LDADD = librecoll.la
|
||||
|
||||
recollq_SOURCES = query/recollqmain.cpp
|
||||
recollq_LDADD = librecoll.la
|
||||
|
||||
xadump_SOURCES = query/xadump.cpp
|
||||
xadump_LDADD = librecoll.la $(LIBXAPIAN) $(LIBICONV)
|
||||
|
||||
# Note: I'd prefer the generated query parser files not to be distributed
|
||||
# at all, but failed to achieve this
|
||||
EXTRA_DIST = \
|
||||
bincimapmime/00README.recoll bincimapmime/AUTHORS bincimapmime/COPYING \
|
||||
\
|
||||
desktop/hotrecoll.py \
|
||||
desktop/recoll.appdata.xml \
|
||||
desktop/recollindex.desktop \
|
||||
desktop/recoll_index_on_ac.sh \
|
||||
desktop/recoll-searchgui.desktop \
|
||||
desktop/recoll.png desktop/recoll.svg desktop/recoll.xcf \
|
||||
\
|
||||
doc/man \
|
||||
doc/prog \
|
||||
doc/user/*.html doc/user/*.css doc/user/*.txt doc/user/*.xml doc/user/Makefile \
|
||||
\
|
||||
filters \
|
||||
\
|
||||
index/rclmon.sh \
|
||||
\
|
||||
kde/kioslave/kio_recoll/00README.txt \
|
||||
kde/kioslave/kio_recoll/CMakeLists.txt \
|
||||
kde/kioslave/kio_recoll/data/help.html \
|
||||
kde/kioslave/kio_recoll/data/searchable.html \
|
||||
kde/kioslave/kio_recoll/data/welcome.html \
|
||||
kde/kioslave/kio_recoll/dirif.cpp \
|
||||
kde/kioslave/kio_recoll/htmlif.cpp \
|
||||
kde/kioslave/kio_recoll/kio_recoll.cpp \
|
||||
kde/kioslave/kio_recoll/kio_recoll.h \
|
||||
kde/kioslave/kio_recoll/recollf.protocol \
|
||||
kde/kioslave/kio_recoll/recollnolist.protocol \
|
||||
kde/kioslave/kio_recoll/recoll.protocol \
|
||||
\
|
||||
query/location.hh query/position.hh query/stack.hh \
|
||||
\
|
||||
qtgui/advsearch.ui \
|
||||
qtgui/advsearch_w.cpp \
|
||||
qtgui/advsearch_w.h \
|
||||
qtgui/advshist.cpp \
|
||||
qtgui/advshist.h \
|
||||
qtgui/confgui/confgui.cpp \
|
||||
qtgui/confgui/confgui.h \
|
||||
qtgui/confgui/confguiindex.cpp \
|
||||
qtgui/confgui/confguiindex.h \
|
||||
qtgui/confgui/conflinkrcl.h \
|
||||
qtgui/confgui/main.cpp \
|
||||
qtgui/crontool.cpp \
|
||||
qtgui/crontool.h \
|
||||
qtgui/crontool.ui \
|
||||
qtgui/editdialog.h \
|
||||
qtgui/editdialog.ui \
|
||||
qtgui/firstidx.h \
|
||||
qtgui/firstidx.ui \
|
||||
qtgui/fragbuts.cpp \
|
||||
qtgui/fragbuts.h \
|
||||
qtgui/guiutils.cpp \
|
||||
qtgui/guiutils.h \
|
||||
qtgui/i18n/recoll_cs.qm qtgui/i18n/recoll_cs.ts \
|
||||
qtgui/i18n/recoll_da.qm qtgui/i18n/recoll_da.ts \
|
||||
qtgui/i18n/recoll_de.qm qtgui/i18n/recoll_de.ts \
|
||||
qtgui/i18n/recoll_el.qm qtgui/i18n/recoll_el.ts \
|
||||
qtgui/i18n/recoll_es.qm qtgui/i18n/recoll_es.ts \
|
||||
qtgui/i18n/recoll_fr.qm qtgui/i18n/recoll_fr.ts \
|
||||
qtgui/i18n/recoll_it.qm qtgui/i18n/recoll_it.ts \
|
||||
qtgui/i18n/recoll_lt.qm qtgui/i18n/recoll_lt.ts \
|
||||
qtgui/i18n/recoll_pl.qm qtgui/i18n/recoll_pl.ts \
|
||||
qtgui/i18n/recoll_ru.qm qtgui/i18n/recoll_ru.ts \
|
||||
qtgui/i18n/recoll_tr.qm qtgui/i18n/recoll_tr.ts \
|
||||
qtgui/i18n/recoll_uk.qm qtgui/i18n/recoll_uk.ts \
|
||||
qtgui/i18n/recoll_xx.qm qtgui/i18n/recoll_xx.ts \
|
||||
qtgui/i18n/recoll_zh.qm qtgui/i18n/recoll_zh.ts \
|
||||
qtgui/i18n/recoll_zh_CN.qm qtgui/i18n/recoll_zh_CN.ts \
|
||||
qtgui/idxsched.h \
|
||||
qtgui/idxsched.ui \
|
||||
qtgui/images/asearch.png \
|
||||
qtgui/images/cancel.png \
|
||||
qtgui/images/close.png \
|
||||
qtgui/images/code-block.png \
|
||||
qtgui/images/down.png \
|
||||
qtgui/images/firstpage.png \
|
||||
qtgui/images/history.png \
|
||||
qtgui/images/nextpage.png \
|
||||
qtgui/images/prevpage.png \
|
||||
qtgui/images/recoll.icns \
|
||||
qtgui/images/recoll.png \
|
||||
qtgui/images/sortparms.png \
|
||||
qtgui/images/spell.png \
|
||||
qtgui/images/table.png \
|
||||
qtgui/images/up.png \
|
||||
qtgui/listdialog.h \
|
||||
qtgui/listdialog.ui \
|
||||
qtgui/main.cpp \
|
||||
qtgui/mtpics/License_sidux.txt \
|
||||
qtgui/mtpics/README \
|
||||
qtgui/mtpics/aptosid-book.png \
|
||||
qtgui/mtpics/aptosid-manual-copyright.txt \
|
||||
qtgui/mtpics/aptosid-manual.png \
|
||||
qtgui/mtpics/archive.png \
|
||||
qtgui/mtpics/book.png \
|
||||
qtgui/mtpics/bookchap.png \
|
||||
qtgui/mtpics/document.png \
|
||||
qtgui/mtpics/drawing.png \
|
||||
qtgui/mtpics/emblem-symbolic-link.png \
|
||||
qtgui/mtpics/folder.png \
|
||||
qtgui/mtpics/html.png \
|
||||
qtgui/mtpics/image.png \
|
||||
qtgui/mtpics/message.png \
|
||||
qtgui/mtpics/mozilla_doc.png \
|
||||
qtgui/mtpics/pdf.png \
|
||||
qtgui/mtpics/pidgin.png \
|
||||
qtgui/mtpics/postscript.png \
|
||||
qtgui/mtpics/presentation.png \
|
||||
qtgui/mtpics/sidux-book.png \
|
||||
qtgui/mtpics/soffice.png \
|
||||
qtgui/mtpics/source.png \
|
||||
qtgui/mtpics/sownd.png \
|
||||
qtgui/mtpics/spreadsheet.png \
|
||||
qtgui/mtpics/text-x-python.png \
|
||||
qtgui/mtpics/txt.png \
|
||||
qtgui/mtpics/video.png \
|
||||
qtgui/mtpics/wordprocessing.png \
|
||||
qtgui/multisave.cpp \
|
||||
qtgui/multisave.h \
|
||||
qtgui/preview_load.cpp \
|
||||
qtgui/preview_load.h \
|
||||
qtgui/preview_plaintorich.cpp \
|
||||
qtgui/preview_plaintorich.h \
|
||||
qtgui/preview_w.cpp \
|
||||
qtgui/preview_w.h \
|
||||
qtgui/ptrans.ui \
|
||||
qtgui/ptrans_w.cpp \
|
||||
qtgui/ptrans_w.h \
|
||||
qtgui/rclhelp.cpp \
|
||||
qtgui/rclhelp.h \
|
||||
qtgui/rclm_idx.cpp \
|
||||
qtgui/rclm_preview.cpp \
|
||||
qtgui/rclm_saveload.cpp \
|
||||
qtgui/rclm_view.cpp \
|
||||
qtgui/rclm_wins.cpp \
|
||||
qtgui/rclmain.ui \
|
||||
qtgui/rclmain_w.cpp \
|
||||
qtgui/rclmain_w.h \
|
||||
qtgui/rclzg.cpp \
|
||||
qtgui/rclzg.h \
|
||||
qtgui/recoll.h \
|
||||
qtgui/recoll.pro.in \
|
||||
qtgui/recoll.qrc \
|
||||
qtgui/reslist.cpp \
|
||||
qtgui/reslist.h \
|
||||
qtgui/respopup.cpp \
|
||||
qtgui/respopup.h \
|
||||
qtgui/restable.cpp \
|
||||
qtgui/restable.h \
|
||||
qtgui/restable.ui \
|
||||
qtgui/rtitool.cpp \
|
||||
qtgui/rtitool.h \
|
||||
qtgui/rtitool.ui \
|
||||
qtgui/searchclause_w.cpp \
|
||||
qtgui/searchclause_w.h \
|
||||
qtgui/snippets.ui \
|
||||
qtgui/snippets_w.cpp \
|
||||
qtgui/snippets_w.h \
|
||||
qtgui/specialindex.h \
|
||||
qtgui/specialindex.ui \
|
||||
qtgui/spell.ui \
|
||||
qtgui/spell_w.cpp \
|
||||
qtgui/spell_w.h \
|
||||
qtgui/ssearchb.ui \
|
||||
qtgui/ssearch_w.cpp \
|
||||
qtgui/ssearch_w.h \
|
||||
qtgui/systray.cpp \
|
||||
qtgui/systray.h \
|
||||
qtgui/uiprefs.ui \
|
||||
qtgui/uiprefs_w.cpp \
|
||||
qtgui/uiprefs_w.h \
|
||||
qtgui/ui_rclmain.h-4.5 \
|
||||
qtgui/viewaction.ui \
|
||||
qtgui/viewaction_w.cpp \
|
||||
qtgui/viewaction_w.h \
|
||||
qtgui/xmltosd.cpp \
|
||||
qtgui/xmltosd.h \
|
||||
\
|
||||
python/README.txt \
|
||||
python/recoll/Makefile \
|
||||
python/recoll/pyrclextract.cpp \
|
||||
python/recoll/pyrecoll.cpp \
|
||||
python/recoll/pyrecoll.h \
|
||||
python/recoll/recoll/__init__.py \
|
||||
python/recoll/recoll/rclconfig.py \
|
||||
python/recoll/setup.py.in \
|
||||
python/samples/docdups.py \
|
||||
python/samples/mutt-recoll.py \
|
||||
python/samples/rcldlkp.py \
|
||||
python/samples/rclmbox.py \
|
||||
python/samples/recollgui/Makefile \
|
||||
python/samples/recollgui/qrecoll.py \
|
||||
python/samples/recollgui/rclmain.ui \
|
||||
python/samples/recollq.py \
|
||||
python/samples/recollqsd.py \
|
||||
\
|
||||
\
|
||||
sampleconf/fields sampleconf/fragbuts.xml sampleconf/mimeconf \
|
||||
sampleconf/mimemap sampleconf/mimeview sampleconf/mimeview.mac \
|
||||
sampleconf/recoll.conf sampleconf/recoll.qss \
|
||||
\
|
||||
unac/AUTHORS unac/COPYING unac/README unac/README.recoll unac/unac.c \
|
||||
\
|
||||
VERSION
|
||||
|
||||
# EXTRA_DIST: The Php Code does not build anymore. No need to ship it until
|
||||
# someone fixes it:
|
||||
# php/00README.txt php/recoll/config.m4 php/recoll/make.sh
|
||||
# php/recoll/php_recoll.h php/recoll/recoll.cpp php/sample/shell.php
|
||||
|
||||
if MAKEPYTHON
|
||||
all-local: recollpython
|
||||
recollpython: librecoll.la
|
||||
${MAKE} -C python/recoll libdir=$(libdir)
|
||||
install-exec-local: recollpython-install
|
||||
recollpython-install:
|
||||
(cd python/recoll; \
|
||||
if test -f /etc/debian_version ; then \
|
||||
OPTSFORPYTHON=--install-layout=deb; \
|
||||
fi; \
|
||||
set -x; \
|
||||
python setup.py install \
|
||||
--prefix=${prefix} --root=$${DESTDIR:-/} $${OPTSFORPYTHON})
|
||||
clean-local: recollpython-clean
|
||||
recollpython-clean:
|
||||
rm -rf python/recoll/build
|
||||
endif
|
||||
|
||||
if MAKEQT
|
||||
all-local: recollqt
|
||||
recollqt: librecoll.la
|
||||
(cd $(QTGUI); ${QMAKE} PREFIX=${prefix} recoll.pro)
|
||||
$(MAKE) -C $(QTGUI) LFLAGS="$(LDFLAGS)" prefix=$(prefix) \
|
||||
exec_prefix=$(exec_prefix) libdir=$(libdir)
|
||||
clean-local: recollqt-clean
|
||||
recollqt-clean:
|
||||
-$(MAKE) -C $(QTGUI) clean
|
||||
install-exec-local: recollqt-install
|
||||
recollqt-install:
|
||||
$(MAKE) -C $(QTGUI) LFLAGS="$(LDFLAGS)" prefix=$(prefix) \
|
||||
exec_prefix=$(exec_prefix) libdir=$(libdir) install
|
||||
endif
|
||||
|
||||
defconfdir = $(pkgdatadir)/examples
|
||||
defconf_DATA = \
|
||||
desktop/recollindex.desktop \
|
||||
index/rclmon.sh \
|
||||
sampleconf/fragbuts.xml \
|
||||
sampleconf/fields \
|
||||
sampleconf/recoll.conf \
|
||||
sampleconf/mimeconf \
|
||||
sampleconf/recoll.qss \
|
||||
sampleconf/mimemap \
|
||||
sampleconf/mimeview
|
||||
|
||||
filterdir = $(pkgdatadir)/filters
|
||||
filter_DATA = \
|
||||
desktop/hotrecoll.py \
|
||||
filters/rcl7z \
|
||||
filters/rclabw \
|
||||
filters/rclaptosidman \
|
||||
filters/rclaudio \
|
||||
filters/rclcheckneedretry.sh \
|
||||
filters/rclchm \
|
||||
filters/rclconfig.py \
|
||||
filters/rcldia \
|
||||
filters/rcldjvu \
|
||||
filters/rcldoc.py \
|
||||
filters/rcldvi \
|
||||
filters/rclepub \
|
||||
filters/rclexec1.py \
|
||||
filters/rclexecm.py \
|
||||
filters/rclfb2 \
|
||||
filters/rclgaim \
|
||||
filters/rclgnm \
|
||||
filters/rclics \
|
||||
filters/rclimg \
|
||||
filters/rclimg.py \
|
||||
filters/rclinfo \
|
||||
filters/rclkar \
|
||||
filters/rclkwd \
|
||||
filters/rcllatinclass.py \
|
||||
filters/rcllatinstops.zip \
|
||||
filters/rcllyx \
|
||||
filters/rclman \
|
||||
filters/rclmpdf.py \
|
||||
filters/rclokulnote \
|
||||
filters/rclopxml.py \
|
||||
filters/rclppt.py \
|
||||
filters/rclps \
|
||||
filters/rclpurple \
|
||||
filters/rclpython \
|
||||
filters/rclrar \
|
||||
filters/rclrtf.py \
|
||||
filters/rclscribus \
|
||||
filters/rclshowinfo \
|
||||
filters/rclsiduxman \
|
||||
filters/rclsoff.py \
|
||||
filters/rclsvg.py \
|
||||
filters/rcltar \
|
||||
filters/rcltex \
|
||||
filters/rcltext.py \
|
||||
filters/rcluncomp \
|
||||
filters/rcluncomp.py \
|
||||
filters/rclwar \
|
||||
filters/rclwpd \
|
||||
filters/rclxls.py \
|
||||
filters/rclxml.py \
|
||||
filters/rclxslt.py \
|
||||
filters/rclzip \
|
||||
filters/ppt-dump.py \
|
||||
filters/xls-dump.py \
|
||||
filters/xlsxmltocsv.py \
|
||||
filters/msodump.zip \
|
||||
python/recoll/recoll/rclconfig.py
|
||||
|
||||
install-data-hook:
|
||||
(cd $(DESTDIR)/$(filterdir); \
|
||||
chmod a+x rcl* ppt-dump.py xls-dump.py xlsxmltocsv.py hotrecoll.py; \
|
||||
chmod 0644 msodump.zip rclexecm.py rcllatinstops.zip rclconfig.py)
|
||||
|
||||
if MAKEUSERDOC
|
||||
rdocdir = $(pkgdatadir)/doc
|
||||
rdoc_DATA = doc/user/usermanual.html doc/user/docbook-xsl.css
|
||||
doc/user/usermanual.html: doc/user/usermanual.xml
|
||||
mkdir -p doc/user
|
||||
test -f doc/user/Makefile || \
|
||||
cp -p $(top_srcdir)/doc/user/Makefile doc/user
|
||||
$(MAKE) -C doc/user VPATH=../../$(VPATH)/doc/user usermanual.html
|
||||
endif
|
||||
|
||||
dist_man1_MANS = doc/man/recoll.1 doc/man/recollq.1 doc/man/recollindex.1
|
||||
dist_man5_MANS = doc/man/recoll.conf.5
|
||||
|
||||
dist-hook:
|
||||
modified=`hg status | grep -v /$(distdir)/`; \
|
||||
if test ! -z "$$modified"; then \
|
||||
echo Local directory is modified: $$modified ; exit 1; fi
|
||||
hg tag -f -m "Release $(VERSION) tagged" RECOLL-$(VERSION)
|
4612
src/README
Normal file
4612
src/README
Normal file
File diff suppressed because it is too large
Load diff
1
src/VERSION
Normal file
1
src/VERSION
Normal file
|
@ -0,0 +1 @@
|
|||
1.22.0
|
12
src/aspell/Makefile
Normal file
12
src/aspell/Makefile
Normal file
|
@ -0,0 +1,12 @@
|
|||
PROGS = rclaspell
|
||||
all: $(PROGS)
|
||||
|
||||
RCLASPELL_OBJS= trrclaspell.o
|
||||
rclaspell : $(RCLASPELL_OBJS)
|
||||
$(CXX) $(ALL_CXXFLAGS) -o rclaspell $(RCLASPELL_OBJS) \
|
||||
$(LIBRECOLL)
|
||||
trrclaspell.o : rclaspell.cpp
|
||||
$(CXX) $(ALL_CXXFLAGS) -DTEST_RCLASPELL -c -o trrclaspell.o \
|
||||
rclaspell.cpp
|
||||
|
||||
include ../utils/utmkdefs.mk
|
729
src/aspell/aspell-local.h
Normal file
729
src/aspell/aspell-local.h
Normal file
|
@ -0,0 +1,729 @@
|
|||
/* Automatically generated file. Do not edit directly. */
|
||||
|
||||
/* This file is part of The New Aspell
|
||||
* Copyright (C) 2001-2002 by Kevin Atkinson under the GNU LGPL
|
||||
* license version 2.0 or 2.1. You should have received a copy of the
|
||||
* LGPL license along with this library if you did not you can find it
|
||||
* at http://www.gnu.org/. */
|
||||
|
||||
#ifndef ASPELL_ASPELL__H
|
||||
#define ASPELL_ASPELL__H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/******************************* type id *******************************/
|
||||
|
||||
|
||||
union AspellTypeId {
|
||||
|
||||
unsigned int num;
|
||||
|
||||
char str[4];
|
||||
|
||||
};
|
||||
|
||||
|
||||
typedef union AspellTypeId AspellTypeId;
|
||||
|
||||
|
||||
/************************** mutable container **************************/
|
||||
|
||||
|
||||
typedef struct AspellMutableContainer AspellMutableContainer;
|
||||
|
||||
|
||||
int aspell_mutable_container_add(struct AspellMutableContainer * ths, const char * to_add);
|
||||
|
||||
int aspell_mutable_container_remove(struct AspellMutableContainer * ths, const char * to_rem);
|
||||
|
||||
void aspell_mutable_container_clear(struct AspellMutableContainer * ths);
|
||||
|
||||
struct AspellMutableContainer * aspell_mutable_container_to_mutable_container(struct AspellMutableContainer * ths);
|
||||
|
||||
|
||||
|
||||
/******************************* key info *******************************/
|
||||
|
||||
|
||||
|
||||
enum AspellKeyInfoType {AspellKeyInfoString, AspellKeyInfoInt, AspellKeyInfoBool, AspellKeyInfoList};
|
||||
typedef enum AspellKeyInfoType AspellKeyInfoType;
|
||||
|
||||
|
||||
struct AspellKeyInfo {
|
||||
|
||||
/* The name of the key. */
|
||||
const char * name;
|
||||
|
||||
/* The key type. */
|
||||
enum AspellKeyInfoType type;
|
||||
|
||||
/* The default value of the key. */
|
||||
const char * def;
|
||||
|
||||
/* A brief description of the key or NULL if internal value. */
|
||||
const char * desc;
|
||||
|
||||
int flags;
|
||||
|
||||
int other_data;
|
||||
|
||||
};
|
||||
|
||||
|
||||
typedef struct AspellKeyInfo AspellKeyInfo;
|
||||
|
||||
|
||||
/******************************** config ********************************/
|
||||
|
||||
|
||||
typedef struct AspellKeyInfoEnumeration AspellKeyInfoEnumeration;
|
||||
|
||||
|
||||
int aspell_key_info_enumeration_at_end(const struct AspellKeyInfoEnumeration * ths);
|
||||
|
||||
const struct AspellKeyInfo * aspell_key_info_enumeration_next(struct AspellKeyInfoEnumeration * ths);
|
||||
|
||||
void delete_aspell_key_info_enumeration(struct AspellKeyInfoEnumeration * ths);
|
||||
|
||||
struct AspellKeyInfoEnumeration * aspell_key_info_enumeration_clone(const struct AspellKeyInfoEnumeration * ths);
|
||||
|
||||
void aspell_key_info_enumeration_assign(struct AspellKeyInfoEnumeration * ths, const struct AspellKeyInfoEnumeration * other);
|
||||
|
||||
|
||||
|
||||
typedef struct AspellConfig AspellConfig;
|
||||
|
||||
|
||||
struct AspellConfig * new_aspell_config();
|
||||
|
||||
void delete_aspell_config(struct AspellConfig * ths);
|
||||
|
||||
struct AspellConfig * aspell_config_clone(const struct AspellConfig * ths);
|
||||
|
||||
void aspell_config_assign(struct AspellConfig * ths, const struct AspellConfig * other);
|
||||
|
||||
unsigned int aspell_config_error_number(const struct AspellConfig * ths);
|
||||
|
||||
const char * aspell_config_error_message(const struct AspellConfig * ths);
|
||||
|
||||
const struct AspellError * aspell_config_error(const struct AspellConfig * ths);
|
||||
|
||||
/* Sets extra keys which this config class should
|
||||
* accept. begin and end are expected to point to
|
||||
* the beginning and ending of an array of Aspell
|
||||
* Key Info. */
|
||||
void aspell_config_set_extra(struct AspellConfig * ths, const struct AspellKeyInfo * begin, const struct AspellKeyInfo * end);
|
||||
|
||||
/* Returns the KeyInfo object for the
|
||||
* corresponding key or returns NULL and sets
|
||||
* error_num to PERROR_UNKNOWN_KEY if the key is
|
||||
* not valid. The pointer returned is valid for
|
||||
* the lifetime of the object. */
|
||||
const struct AspellKeyInfo * aspell_config_keyinfo(struct AspellConfig * ths, const char * key);
|
||||
|
||||
/* Returns a newly allocated enumeration of all
|
||||
* the possible objects this config class uses. */
|
||||
struct AspellKeyInfoEnumeration * aspell_config_possible_elements(struct AspellConfig * ths, int include_extra);
|
||||
|
||||
/* Returns the default value for given key which
|
||||
* may involve substituting variables, thus it is
|
||||
* not the same as keyinfo(key)->def returns NULL
|
||||
* and sets error_num to PERROR_UNKNOWN_KEY if
|
||||
* the key is not valid. Uses the temporary
|
||||
* string. */
|
||||
const char * aspell_config_get_default(struct AspellConfig * ths, const char * key);
|
||||
|
||||
/* Returns a newly allocated enumeration of all
|
||||
* the key/value pairs. This DOES not include ones
|
||||
* which are set to their default values. */
|
||||
struct AspellStringPairEnumeration * aspell_config_elements(struct AspellConfig * ths);
|
||||
|
||||
/* Inserts an item, if the item already exists it
|
||||
* will be replaced. Returns TRUE if it succeeded
|
||||
* or FALSE on error. If the key in not valid it
|
||||
* sets error_num to PERROR_UNKNOWN_KEY, if the
|
||||
* value is not valid it will set error_num to
|
||||
* PERROR_BAD_VALUE, if the value can not be
|
||||
* changed it sets error_num to
|
||||
* PERROR_CANT_CHANGE_VALUE, and if the value is
|
||||
* a list and you are trying to set its directory,
|
||||
* it sets error_num to PERROR_LIST_SET */
|
||||
int aspell_config_replace(struct AspellConfig * ths, const char * key, const char * value);
|
||||
|
||||
/* Remove a key and returns TRUE if it exists
|
||||
* otherwise return FALSE. This effectively sets
|
||||
* the key to its default value. Calling replace
|
||||
* with a value of "<default>" will also call
|
||||
* remove. If the key does not exist then it sets
|
||||
* error_num to 0 or PERROR_NOT, if the key is
|
||||
* not valid then it sets error_num to
|
||||
* PERROR_UNKNOWN_KEY, if the value can not be
|
||||
* changed then it sets error_num to
|
||||
* PERROR_CANT_CHANGE_VALUE */
|
||||
int aspell_config_remove(struct AspellConfig * ths, const char * key);
|
||||
|
||||
int aspell_config_have(const struct AspellConfig * ths, const char * key);
|
||||
|
||||
/* Returns NULL on error. */
|
||||
const char * aspell_config_retrieve(struct AspellConfig * ths, const char * key);
|
||||
|
||||
int aspell_config_retrieve_list(struct AspellConfig * ths, const char * key, struct AspellMutableContainer * lst);
|
||||
|
||||
/* Return -1 on error, 0 if false, 1 if true. */
|
||||
int aspell_config_retrieve_bool(struct AspellConfig * ths, const char * key);
|
||||
|
||||
/* Return -1 on error. */
|
||||
int aspell_config_retrieve_int(struct AspellConfig * ths, const char * key);
|
||||
|
||||
|
||||
|
||||
/******************************** error ********************************/
|
||||
|
||||
|
||||
struct AspellError {
|
||||
|
||||
const char * mesg;
|
||||
|
||||
const struct AspellErrorInfo * err;
|
||||
|
||||
};
|
||||
|
||||
|
||||
typedef struct AspellError AspellError;
|
||||
|
||||
int aspell_error_is_a(const struct AspellError * ths, const struct AspellErrorInfo * e);
|
||||
|
||||
|
||||
struct AspellErrorInfo {
|
||||
|
||||
const struct AspellErrorInfo * isa;
|
||||
|
||||
const char * mesg;
|
||||
|
||||
unsigned int num_parms;
|
||||
|
||||
const char * parms[3];
|
||||
|
||||
};
|
||||
|
||||
|
||||
typedef struct AspellErrorInfo AspellErrorInfo;
|
||||
|
||||
|
||||
/**************************** can have error ****************************/
|
||||
|
||||
|
||||
typedef struct AspellCanHaveError AspellCanHaveError;
|
||||
|
||||
|
||||
unsigned int aspell_error_number(const struct AspellCanHaveError * ths);
|
||||
|
||||
const char * aspell_error_message(const struct AspellCanHaveError * ths);
|
||||
|
||||
const struct AspellError * aspell_error(const struct AspellCanHaveError * ths);
|
||||
|
||||
void delete_aspell_can_have_error(struct AspellCanHaveError * ths);
|
||||
|
||||
|
||||
|
||||
/******************************** errors ********************************/
|
||||
|
||||
|
||||
extern const struct AspellErrorInfo * const aerror_other;
|
||||
extern const struct AspellErrorInfo * const aerror_operation_not_supported;
|
||||
extern const struct AspellErrorInfo * const aerror_cant_copy;
|
||||
extern const struct AspellErrorInfo * const aerror_unimplemented_method;
|
||||
extern const struct AspellErrorInfo * const aerror_file;
|
||||
extern const struct AspellErrorInfo * const aerror_cant_open_file;
|
||||
extern const struct AspellErrorInfo * const aerror_cant_read_file;
|
||||
extern const struct AspellErrorInfo * const aerror_cant_write_file;
|
||||
extern const struct AspellErrorInfo * const aerror_invalid_name;
|
||||
extern const struct AspellErrorInfo * const aerror_bad_file_format;
|
||||
extern const struct AspellErrorInfo * const aerror_dir;
|
||||
extern const struct AspellErrorInfo * const aerror_cant_read_dir;
|
||||
extern const struct AspellErrorInfo * const aerror_config;
|
||||
extern const struct AspellErrorInfo * const aerror_unknown_key;
|
||||
extern const struct AspellErrorInfo * const aerror_cant_change_value;
|
||||
extern const struct AspellErrorInfo * const aerror_bad_key;
|
||||
extern const struct AspellErrorInfo * const aerror_bad_value;
|
||||
extern const struct AspellErrorInfo * const aerror_duplicate;
|
||||
extern const struct AspellErrorInfo * const aerror_key_not_string;
|
||||
extern const struct AspellErrorInfo * const aerror_key_not_int;
|
||||
extern const struct AspellErrorInfo * const aerror_key_not_bool;
|
||||
extern const struct AspellErrorInfo * const aerror_key_not_list;
|
||||
extern const struct AspellErrorInfo * const aerror_no_value_reset;
|
||||
extern const struct AspellErrorInfo * const aerror_no_value_enable;
|
||||
extern const struct AspellErrorInfo * const aerror_no_value_disable;
|
||||
extern const struct AspellErrorInfo * const aerror_no_value_clear;
|
||||
extern const struct AspellErrorInfo * const aerror_language_related;
|
||||
extern const struct AspellErrorInfo * const aerror_unknown_language;
|
||||
extern const struct AspellErrorInfo * const aerror_unknown_soundslike;
|
||||
extern const struct AspellErrorInfo * const aerror_language_not_supported;
|
||||
extern const struct AspellErrorInfo * const aerror_no_wordlist_for_lang;
|
||||
extern const struct AspellErrorInfo * const aerror_mismatched_language;
|
||||
extern const struct AspellErrorInfo * const aerror_affix;
|
||||
extern const struct AspellErrorInfo * const aerror_corrupt_affix;
|
||||
extern const struct AspellErrorInfo * const aerror_invalid_cond;
|
||||
extern const struct AspellErrorInfo * const aerror_invalid_cond_strip;
|
||||
extern const struct AspellErrorInfo * const aerror_incorrect_encoding;
|
||||
extern const struct AspellErrorInfo * const aerror_encoding;
|
||||
extern const struct AspellErrorInfo * const aerror_unknown_encoding;
|
||||
extern const struct AspellErrorInfo * const aerror_encoding_not_supported;
|
||||
extern const struct AspellErrorInfo * const aerror_conversion_not_supported;
|
||||
extern const struct AspellErrorInfo * const aerror_pipe;
|
||||
extern const struct AspellErrorInfo * const aerror_cant_create_pipe;
|
||||
extern const struct AspellErrorInfo * const aerror_process_died;
|
||||
extern const struct AspellErrorInfo * const aerror_bad_input;
|
||||
extern const struct AspellErrorInfo * const aerror_invalid_string;
|
||||
extern const struct AspellErrorInfo * const aerror_invalid_word;
|
||||
extern const struct AspellErrorInfo * const aerror_invalid_affix;
|
||||
extern const struct AspellErrorInfo * const aerror_inapplicable_affix;
|
||||
extern const struct AspellErrorInfo * const aerror_unknown_unichar;
|
||||
extern const struct AspellErrorInfo * const aerror_word_list_flags;
|
||||
extern const struct AspellErrorInfo * const aerror_invalid_flag;
|
||||
extern const struct AspellErrorInfo * const aerror_conflicting_flags;
|
||||
extern const struct AspellErrorInfo * const aerror_version_control;
|
||||
extern const struct AspellErrorInfo * const aerror_bad_version_string;
|
||||
extern const struct AspellErrorInfo * const aerror_filter;
|
||||
extern const struct AspellErrorInfo * const aerror_cant_dlopen_file;
|
||||
extern const struct AspellErrorInfo * const aerror_empty_filter;
|
||||
extern const struct AspellErrorInfo * const aerror_no_such_filter;
|
||||
extern const struct AspellErrorInfo * const aerror_confusing_version;
|
||||
extern const struct AspellErrorInfo * const aerror_bad_version;
|
||||
extern const struct AspellErrorInfo * const aerror_identical_option;
|
||||
extern const struct AspellErrorInfo * const aerror_options_only;
|
||||
extern const struct AspellErrorInfo * const aerror_invalid_option_modifier;
|
||||
extern const struct AspellErrorInfo * const aerror_cant_describe_filter;
|
||||
extern const struct AspellErrorInfo * const aerror_filter_mode_file;
|
||||
extern const struct AspellErrorInfo * const aerror_mode_option_name;
|
||||
extern const struct AspellErrorInfo * const aerror_no_filter_to_option;
|
||||
extern const struct AspellErrorInfo * const aerror_bad_mode_key;
|
||||
extern const struct AspellErrorInfo * const aerror_expect_mode_key;
|
||||
extern const struct AspellErrorInfo * const aerror_mode_version_requirement;
|
||||
extern const struct AspellErrorInfo * const aerror_confusing_mode_version;
|
||||
extern const struct AspellErrorInfo * const aerror_bad_mode_version;
|
||||
extern const struct AspellErrorInfo * const aerror_missing_magic_expression;
|
||||
extern const struct AspellErrorInfo * const aerror_empty_file_ext;
|
||||
extern const struct AspellErrorInfo * const aerror_filter_mode_expand;
|
||||
extern const struct AspellErrorInfo * const aerror_unknown_mode;
|
||||
extern const struct AspellErrorInfo * const aerror_mode_extend_expand;
|
||||
extern const struct AspellErrorInfo * const aerror_filter_mode_magic;
|
||||
extern const struct AspellErrorInfo * const aerror_file_magic_pos;
|
||||
extern const struct AspellErrorInfo * const aerror_file_magic_range;
|
||||
extern const struct AspellErrorInfo * const aerror_missing_magic;
|
||||
extern const struct AspellErrorInfo * const aerror_bad_magic;
|
||||
extern const struct AspellErrorInfo * const aerror_expression;
|
||||
extern const struct AspellErrorInfo * const aerror_invalid_expression;
|
||||
|
||||
|
||||
/******************************* speller *******************************/
|
||||
|
||||
|
||||
typedef struct AspellSpeller AspellSpeller;
|
||||
|
||||
|
||||
struct AspellCanHaveError * new_aspell_speller(struct AspellConfig * config);
|
||||
|
||||
struct AspellSpeller * to_aspell_speller(struct AspellCanHaveError * obj);
|
||||
|
||||
void delete_aspell_speller(struct AspellSpeller * ths);
|
||||
|
||||
unsigned int aspell_speller_error_number(const struct AspellSpeller * ths);
|
||||
|
||||
const char * aspell_speller_error_message(const struct AspellSpeller * ths);
|
||||
|
||||
const struct AspellError * aspell_speller_error(const struct AspellSpeller * ths);
|
||||
|
||||
struct AspellConfig * aspell_speller_config(struct AspellSpeller * ths);
|
||||
|
||||
/* Returns 0 if it is not in the dictionary,
|
||||
* 1 if it is, or -1 on error. */
|
||||
int aspell_speller_check(struct AspellSpeller * ths, const char * word, int word_size);
|
||||
|
||||
/* Add this word to your own personal word list. */
|
||||
int aspell_speller_add_to_personal(struct AspellSpeller * ths, const char * word, int word_size);
|
||||
|
||||
/* Add this word to the current spelling session. */
|
||||
int aspell_speller_add_to_session(struct AspellSpeller * ths, const char * word, int word_size);
|
||||
|
||||
/* This is your own personal word list file plus
|
||||
* any extra words added during this session to
|
||||
* your own personal word list. */
|
||||
const struct AspellWordList * aspell_speller_personal_word_list(struct AspellSpeller * ths);
|
||||
|
||||
/* This is a list of words added to this session
|
||||
* that are not in the main word list or in your
|
||||
* own personal list but are considered valid for
|
||||
* this spelling session. */
|
||||
const struct AspellWordList * aspell_speller_session_word_list(struct AspellSpeller * ths);
|
||||
|
||||
/* This is the main list of words used during this
|
||||
* spelling session. */
|
||||
const struct AspellWordList * aspell_speller_main_word_list(struct AspellSpeller * ths);
|
||||
|
||||
int aspell_speller_save_all_word_lists(struct AspellSpeller * ths);
|
||||
|
||||
int aspell_speller_clear_session(struct AspellSpeller * ths);
|
||||
|
||||
/* Return NULL on error.
|
||||
* The word list returned by suggest is only
|
||||
* valid until the next call to suggest. */
|
||||
const struct AspellWordList * aspell_speller_suggest(struct AspellSpeller * ths, const char * word, int word_size);
|
||||
|
||||
int aspell_speller_store_replacement(struct AspellSpeller * ths, const char * mis, int mis_size, const char * cor, int cor_size);
|
||||
|
||||
|
||||
|
||||
/******************************** filter ********************************/
|
||||
|
||||
|
||||
typedef struct AspellFilter AspellFilter;
|
||||
|
||||
|
||||
void delete_aspell_filter(struct AspellFilter * ths);
|
||||
|
||||
unsigned int aspell_filter_error_number(const struct AspellFilter * ths);
|
||||
|
||||
const char * aspell_filter_error_message(const struct AspellFilter * ths);
|
||||
|
||||
const struct AspellError * aspell_filter_error(const struct AspellFilter * ths);
|
||||
|
||||
struct AspellFilter * to_aspell_filter(struct AspellCanHaveError * obj);
|
||||
|
||||
|
||||
|
||||
/*************************** document checker ***************************/
|
||||
|
||||
|
||||
struct AspellToken {
|
||||
|
||||
unsigned int offset;
|
||||
|
||||
unsigned int len;
|
||||
|
||||
};
|
||||
|
||||
|
||||
typedef struct AspellToken AspellToken;
|
||||
|
||||
|
||||
typedef struct AspellDocumentChecker AspellDocumentChecker;
|
||||
|
||||
|
||||
void delete_aspell_document_checker(struct AspellDocumentChecker * ths);
|
||||
|
||||
unsigned int aspell_document_checker_error_number(const struct AspellDocumentChecker * ths);
|
||||
|
||||
const char * aspell_document_checker_error_message(const struct AspellDocumentChecker * ths);
|
||||
|
||||
const struct AspellError * aspell_document_checker_error(const struct AspellDocumentChecker * ths);
|
||||
|
||||
/* Creates a new document checker.
|
||||
* The speller class is expected to last until
|
||||
* this class is destroyed.
|
||||
* If config is given it will be used to override
|
||||
* any relevent options set by this speller class.
|
||||
* The config class is not once this function is done.
|
||||
* If filter is given then it will take ownership of
|
||||
* the filter class and use it to do the filtering.
|
||||
* You are expected to free the checker when done. */
|
||||
struct AspellCanHaveError * new_aspell_document_checker(struct AspellSpeller * speller);
|
||||
|
||||
struct AspellDocumentChecker * to_aspell_document_checker(struct AspellCanHaveError * obj);
|
||||
|
||||
/* Reset the internal state of the filter.
|
||||
* Should be called whenever a new document is
|
||||
* being filtered. */
|
||||
void aspell_document_checker_reset(struct AspellDocumentChecker * ths);
|
||||
|
||||
/* Process a string.
|
||||
* The string passed in should only be split on
|
||||
* white space characters. Furthermore, between
|
||||
* calls to reset, each string should be passed
|
||||
* in exactly once and in the order they appeared
|
||||
* in the document. Passing in strings out of
|
||||
* order, skipping strings or passing them in
|
||||
* more than once may lead to undefined results. */
|
||||
void aspell_document_checker_process(struct AspellDocumentChecker * ths, const char * str, int size);
|
||||
|
||||
/* Returns the next misspelled word in the
|
||||
* processed string. If there are no more
|
||||
* misspelled words, then token.word will be
|
||||
* NULL and token.size will be 0 */
|
||||
struct AspellToken aspell_document_checker_next_misspelling(struct AspellDocumentChecker * ths);
|
||||
|
||||
/* Returns the underlying filter class. */
|
||||
struct AspellFilter * aspell_document_checker_filter(struct AspellDocumentChecker * ths);
|
||||
|
||||
|
||||
|
||||
/****************************** word list ******************************/
|
||||
|
||||
|
||||
typedef struct AspellWordList AspellWordList;
|
||||
|
||||
|
||||
int aspell_word_list_empty(const struct AspellWordList * ths);
|
||||
|
||||
unsigned int aspell_word_list_size(const struct AspellWordList * ths);
|
||||
|
||||
struct AspellStringEnumeration * aspell_word_list_elements(const struct AspellWordList * ths);
|
||||
|
||||
|
||||
|
||||
/************************** string enumeration **************************/
|
||||
|
||||
|
||||
typedef struct AspellStringEnumeration AspellStringEnumeration;
|
||||
|
||||
|
||||
void delete_aspell_string_enumeration(struct AspellStringEnumeration * ths);
|
||||
|
||||
struct AspellStringEnumeration * aspell_string_enumeration_clone(const struct AspellStringEnumeration * ths);
|
||||
|
||||
void aspell_string_enumeration_assign(struct AspellStringEnumeration * ths, const struct AspellStringEnumeration * other);
|
||||
|
||||
int aspell_string_enumeration_at_end(const struct AspellStringEnumeration * ths);
|
||||
|
||||
const char * aspell_string_enumeration_next(struct AspellStringEnumeration * ths);
|
||||
|
||||
|
||||
|
||||
/********************************* info *********************************/
|
||||
|
||||
|
||||
struct AspellModuleInfo {
|
||||
|
||||
const char * name;
|
||||
|
||||
double order_num;
|
||||
|
||||
const char * lib_dir;
|
||||
|
||||
struct AspellStringList * dict_dirs;
|
||||
|
||||
struct AspellStringList * dict_exts;
|
||||
|
||||
};
|
||||
|
||||
|
||||
typedef struct AspellModuleInfo AspellModuleInfo;
|
||||
|
||||
|
||||
struct AspellDictInfo {
|
||||
|
||||
/* The Name to identify this dictionary by. */
|
||||
const char * name;
|
||||
|
||||
/* The language code to identify this dictionary.
|
||||
* A two letter UPPER-CASE ISO 639 language code
|
||||
* and an optional two letter ISO 3166 country
|
||||
* code after a dash or underscore. */
|
||||
const char * code;
|
||||
|
||||
/* Any extra information to distinguish this
|
||||
* variety of dictionary from other dictionaries
|
||||
* which may have the same language and size. */
|
||||
const char * jargon;
|
||||
|
||||
int size;
|
||||
|
||||
/* A two char digit code describing the size of
|
||||
* the dictionary: 10=tiny, 20=really small,
|
||||
* 30=small, 40=med-small, 50=med, 60=med-large,
|
||||
* 70=large, 80=huge, 90=insane. Please check
|
||||
* the README in aspell-lang-200?????.tar.bz2 or
|
||||
* see SCOWL (http://wordlist.sourceforge.net)
|
||||
* for an example of how these sizes are used. */
|
||||
const char * size_str;
|
||||
|
||||
struct AspellModuleInfo * module;
|
||||
|
||||
};
|
||||
|
||||
|
||||
typedef struct AspellDictInfo AspellDictInfo;
|
||||
|
||||
|
||||
typedef struct AspellModuleInfoList AspellModuleInfoList;
|
||||
|
||||
|
||||
struct AspellModuleInfoList * get_aspell_module_info_list(struct AspellConfig * config);
|
||||
|
||||
int aspell_module_info_list_empty(const struct AspellModuleInfoList * ths);
|
||||
|
||||
unsigned int aspell_module_info_list_size(const struct AspellModuleInfoList * ths);
|
||||
|
||||
struct AspellModuleInfoEnumeration * aspell_module_info_list_elements(const struct AspellModuleInfoList * ths);
|
||||
|
||||
|
||||
|
||||
typedef struct AspellDictInfoList AspellDictInfoList;
|
||||
|
||||
|
||||
struct AspellDictInfoList * get_aspell_dict_info_list(struct AspellConfig * config);
|
||||
|
||||
int aspell_dict_info_list_empty(const struct AspellDictInfoList * ths);
|
||||
|
||||
unsigned int aspell_dict_info_list_size(const struct AspellDictInfoList * ths);
|
||||
|
||||
struct AspellDictInfoEnumeration * aspell_dict_info_list_elements(const struct AspellDictInfoList * ths);
|
||||
|
||||
|
||||
|
||||
typedef struct AspellModuleInfoEnumeration AspellModuleInfoEnumeration;
|
||||
|
||||
|
||||
int aspell_module_info_enumeration_at_end(const struct AspellModuleInfoEnumeration * ths);
|
||||
|
||||
const struct AspellModuleInfo * aspell_module_info_enumeration_next(struct AspellModuleInfoEnumeration * ths);
|
||||
|
||||
void delete_aspell_module_info_enumeration(struct AspellModuleInfoEnumeration * ths);
|
||||
|
||||
struct AspellModuleInfoEnumeration * aspell_module_info_enumeration_clone(const struct AspellModuleInfoEnumeration * ths);
|
||||
|
||||
void aspell_module_info_enumeration_assign(struct AspellModuleInfoEnumeration * ths, const struct AspellModuleInfoEnumeration * other);
|
||||
|
||||
|
||||
|
||||
typedef struct AspellDictInfoEnumeration AspellDictInfoEnumeration;
|
||||
|
||||
|
||||
int aspell_dict_info_enumeration_at_end(const struct AspellDictInfoEnumeration * ths);
|
||||
|
||||
const struct AspellDictInfo * aspell_dict_info_enumeration_next(struct AspellDictInfoEnumeration * ths);
|
||||
|
||||
void delete_aspell_dict_info_enumeration(struct AspellDictInfoEnumeration * ths);
|
||||
|
||||
struct AspellDictInfoEnumeration * aspell_dict_info_enumeration_clone(const struct AspellDictInfoEnumeration * ths);
|
||||
|
||||
void aspell_dict_info_enumeration_assign(struct AspellDictInfoEnumeration * ths, const struct AspellDictInfoEnumeration * other);
|
||||
|
||||
|
||||
|
||||
/***************************** string list *****************************/
|
||||
|
||||
|
||||
typedef struct AspellStringList AspellStringList;
|
||||
|
||||
|
||||
struct AspellStringList * new_aspell_string_list();
|
||||
|
||||
int aspell_string_list_empty(const struct AspellStringList * ths);
|
||||
|
||||
unsigned int aspell_string_list_size(const struct AspellStringList * ths);
|
||||
|
||||
struct AspellStringEnumeration * aspell_string_list_elements(const struct AspellStringList * ths);
|
||||
|
||||
int aspell_string_list_add(struct AspellStringList * ths, const char * to_add);
|
||||
|
||||
int aspell_string_list_remove(struct AspellStringList * ths, const char * to_rem);
|
||||
|
||||
void aspell_string_list_clear(struct AspellStringList * ths);
|
||||
|
||||
struct AspellMutableContainer * aspell_string_list_to_mutable_container(struct AspellStringList * ths);
|
||||
|
||||
void delete_aspell_string_list(struct AspellStringList * ths);
|
||||
|
||||
struct AspellStringList * aspell_string_list_clone(const struct AspellStringList * ths);
|
||||
|
||||
void aspell_string_list_assign(struct AspellStringList * ths, const struct AspellStringList * other);
|
||||
|
||||
|
||||
|
||||
/****************************** string map ******************************/
|
||||
|
||||
|
||||
typedef struct AspellStringMap AspellStringMap;
|
||||
|
||||
|
||||
struct AspellStringMap * new_aspell_string_map();
|
||||
|
||||
int aspell_string_map_add(struct AspellStringMap * ths, const char * to_add);
|
||||
|
||||
int aspell_string_map_remove(struct AspellStringMap * ths, const char * to_rem);
|
||||
|
||||
void aspell_string_map_clear(struct AspellStringMap * ths);
|
||||
|
||||
struct AspellMutableContainer * aspell_string_map_to_mutable_container(struct AspellStringMap * ths);
|
||||
|
||||
void delete_aspell_string_map(struct AspellStringMap * ths);
|
||||
|
||||
struct AspellStringMap * aspell_string_map_clone(const struct AspellStringMap * ths);
|
||||
|
||||
void aspell_string_map_assign(struct AspellStringMap * ths, const struct AspellStringMap * other);
|
||||
|
||||
int aspell_string_map_empty(const struct AspellStringMap * ths);
|
||||
|
||||
unsigned int aspell_string_map_size(const struct AspellStringMap * ths);
|
||||
|
||||
struct AspellStringPairEnumeration * aspell_string_map_elements(const struct AspellStringMap * ths);
|
||||
|
||||
/* Insert a new element.
|
||||
* Will NOT overwrite an existing entry.
|
||||
* Returns FALSE if the element already exists. */
|
||||
int aspell_string_map_insert(struct AspellStringMap * ths, const char * key, const char * value);
|
||||
|
||||
/* Insert a new element.
|
||||
* Will overwrite an existing entry.
|
||||
* Always returns TRUE. */
|
||||
int aspell_string_map_replace(struct AspellStringMap * ths, const char * key, const char * value);
|
||||
|
||||
/* Looks up an element and returns the value.
|
||||
* Returns NULL if the element does not exist.
|
||||
* Returns an empty string if the element exists
|
||||
* but has a NULL value. */
|
||||
const char * aspell_string_map_lookup(const struct AspellStringMap * ths, const char * key);
|
||||
|
||||
|
||||
|
||||
/***************************** string pair *****************************/
|
||||
|
||||
|
||||
struct AspellStringPair {
|
||||
|
||||
const char * first;
|
||||
|
||||
const char * second;
|
||||
|
||||
};
|
||||
|
||||
|
||||
typedef struct AspellStringPair AspellStringPair;
|
||||
|
||||
|
||||
/*********************** string pair enumeration ***********************/
|
||||
|
||||
|
||||
typedef struct AspellStringPairEnumeration AspellStringPairEnumeration;
|
||||
|
||||
|
||||
int aspell_string_pair_enumeration_at_end(const struct AspellStringPairEnumeration * ths);
|
||||
|
||||
struct AspellStringPair aspell_string_pair_enumeration_next(struct AspellStringPairEnumeration * ths);
|
||||
|
||||
void delete_aspell_string_pair_enumeration(struct AspellStringPairEnumeration * ths);
|
||||
|
||||
struct AspellStringPairEnumeration * aspell_string_pair_enumeration_clone(const struct AspellStringPairEnumeration * ths);
|
||||
|
||||
void aspell_string_pair_enumeration_assign(struct AspellStringPairEnumeration * ths, const struct AspellStringPairEnumeration * other);
|
||||
|
||||
|
||||
|
||||
/******************************** cache ********************************/
|
||||
|
||||
|
||||
/* Reset the global cache(s) so that cache queries will
|
||||
* create a new object. If existing objects are still in
|
||||
* use they are not deleted. If which is NULL then all
|
||||
* caches will be reset. Current caches are "encode",
|
||||
* "decode", "dictionary", "language", and "keyboard". */
|
||||
int aspell_reset_cache(const char * which);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* ASPELL_ASPELL__H */
|
596
src/aspell/rclaspell.cpp
Normal file
596
src/aspell/rclaspell.cpp
Normal file
|
@ -0,0 +1,596 @@
|
|||
#ifndef TEST_RCLASPELL
|
||||
/* Copyright (C) 2006 J.F.Dockes
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the
|
||||
* Free Software Foundation, Inc.,
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "autoconfig.h"
|
||||
#endif
|
||||
|
||||
#ifdef RCL_USE_ASPELL
|
||||
|
||||
#include <unistd.h>
|
||||
#include <dlfcn.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include ASPELL_INCLUDE
|
||||
|
||||
#include "pathut.h"
|
||||
#include "execmd.h"
|
||||
#include "rclaspell.h"
|
||||
#include "debuglog.h"
|
||||
#include "unacpp.h"
|
||||
#include "ptmutex.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
// Just a place where we keep the Aspell library entry points together
|
||||
class AspellApi {
|
||||
public:
|
||||
struct AspellConfig *(*new_aspell_config)();
|
||||
int (*aspell_config_replace)(struct AspellConfig *, const char * key,
|
||||
const char * value);
|
||||
struct AspellCanHaveError *(*new_aspell_speller)(struct AspellConfig *);
|
||||
void (*delete_aspell_config)(struct AspellConfig *);
|
||||
void (*delete_aspell_can_have_error)(struct AspellCanHaveError *);
|
||||
struct AspellSpeller * (*to_aspell_speller)(struct AspellCanHaveError *);
|
||||
struct AspellConfig * (*aspell_speller_config)(struct AspellSpeller *);
|
||||
const struct AspellWordList * (*aspell_speller_suggest)
|
||||
(struct AspellSpeller *, const char *, int);
|
||||
int (*aspell_speller_check)(struct AspellSpeller *, const char *, int);
|
||||
struct AspellStringEnumeration * (*aspell_word_list_elements)
|
||||
(const struct AspellWordList * ths);
|
||||
const char * (*aspell_string_enumeration_next)
|
||||
(struct AspellStringEnumeration * ths);
|
||||
void (*delete_aspell_string_enumeration)(struct AspellStringEnumeration *);
|
||||
const struct AspellError *(*aspell_error)
|
||||
(const struct AspellCanHaveError *);
|
||||
const char *(*aspell_error_message)(const struct AspellCanHaveError *);
|
||||
const char *(*aspell_speller_error_message)(const struct AspellSpeller *);
|
||||
void (*delete_aspell_speller)(struct AspellSpeller *);
|
||||
|
||||
};
|
||||
static AspellApi aapi;
|
||||
static PTMutexInit o_aapi_mutex;
|
||||
|
||||
#define NMTOPTR(NM, TP) \
|
||||
if ((aapi.NM = TP dlsym(m_data->m_handle, #NM)) == 0) { \
|
||||
badnames += #NM + string(" "); \
|
||||
}
|
||||
|
||||
static const char *aspell_lib_suffixes[] = {
|
||||
".so",
|
||||
".so.15",
|
||||
".so.16"
|
||||
};
|
||||
static const unsigned int nlibsuffs = sizeof(aspell_lib_suffixes) / sizeof(char *);
|
||||
|
||||
// Stuff that we don't wish to see in the .h (possible sysdeps, etc.)
|
||||
class AspellData {
|
||||
public:
|
||||
AspellData()
|
||||
: m_handle(0), m_speller(0)
|
||||
{}
|
||||
~AspellData() {
|
||||
LOGDEB2(("~AspellData\n"));
|
||||
if (m_handle) {
|
||||
dlclose(m_handle);
|
||||
m_handle = 0;
|
||||
}
|
||||
if (m_speller) {
|
||||
// Dumps core if I do this??
|
||||
//aapi.delete_aspell_speller(m_speller);
|
||||
m_speller = 0;
|
||||
LOGDEB2(("~AspellData: speller done\n"));
|
||||
}
|
||||
}
|
||||
|
||||
void *m_handle;
|
||||
string m_exec;
|
||||
AspellSpeller *m_speller;
|
||||
};
|
||||
|
||||
Aspell::Aspell(RclConfig *cnf)
|
||||
: m_config(cnf), m_data(0)
|
||||
{
|
||||
}
|
||||
|
||||
Aspell::~Aspell()
|
||||
{
|
||||
deleteZ(m_data);
|
||||
}
|
||||
|
||||
bool Aspell::init(string &reason)
|
||||
{
|
||||
PTMutexLocker locker(o_aapi_mutex);
|
||||
deleteZ(m_data);
|
||||
|
||||
// Language: we get this from the configuration, else from the NLS
|
||||
// environment. The aspell language names used for selecting language
|
||||
// definition files (used to create dictionaries) are like en, fr
|
||||
if (!m_config->getConfParam("aspellLanguage", m_lang) || m_lang.empty()) {
|
||||
string lang = "en";
|
||||
const char *cp;
|
||||
if ((cp = getenv("LC_ALL")))
|
||||
lang = cp;
|
||||
else if ((cp = getenv("LANG")))
|
||||
lang = cp;
|
||||
if (!lang.compare("C"))
|
||||
lang = "en";
|
||||
m_lang = lang.substr(0, lang.find_first_of("_"));
|
||||
}
|
||||
|
||||
m_data = new AspellData;
|
||||
|
||||
const char *aspell_prog_from_env = getenv("ASPELL_PROG");
|
||||
if (aspell_prog_from_env && access(aspell_prog_from_env, X_OK) == 0) {
|
||||
m_data->m_exec = aspell_prog_from_env;
|
||||
#ifdef ASPELL_PROG
|
||||
} else if (access(ASPELL_PROG, X_OK) == 0) {
|
||||
m_data->m_exec = ASPELL_PROG;
|
||||
#endif // ASPELL_PROG
|
||||
} else {
|
||||
ExecCmd::which("aspell", m_data->m_exec);
|
||||
}
|
||||
|
||||
if (m_data->m_exec.empty()) {
|
||||
reason = "aspell program not found or not executable";
|
||||
deleteZ(m_data);
|
||||
return false;
|
||||
}
|
||||
|
||||
reason = "Could not open shared library ";
|
||||
string libbase("libaspell");
|
||||
string lib;
|
||||
for (unsigned int i = 0; i < nlibsuffs; i++) {
|
||||
lib = libbase + aspell_lib_suffixes[i];
|
||||
reason += string("[") + lib + "] ";
|
||||
if ((m_data->m_handle = dlopen(lib.c_str(), RTLD_LAZY)) != 0) {
|
||||
reason.erase();
|
||||
goto found;
|
||||
}
|
||||
}
|
||||
|
||||
found:
|
||||
if (m_data->m_handle == 0) {
|
||||
reason += string(" : ") + dlerror();
|
||||
deleteZ(m_data);
|
||||
return false;
|
||||
}
|
||||
|
||||
string badnames;
|
||||
NMTOPTR(new_aspell_config, (struct AspellConfig *(*)()));
|
||||
NMTOPTR(aspell_config_replace, (int (*)(struct AspellConfig *,
|
||||
const char *, const char *)));
|
||||
NMTOPTR(new_aspell_speller,
|
||||
(struct AspellCanHaveError *(*)(struct AspellConfig *)));
|
||||
NMTOPTR(delete_aspell_config,
|
||||
(void (*)(struct AspellConfig *)));
|
||||
NMTOPTR(delete_aspell_can_have_error,
|
||||
(void (*)(struct AspellCanHaveError *)));
|
||||
NMTOPTR(to_aspell_speller,
|
||||
(struct AspellSpeller *(*)(struct AspellCanHaveError *)));
|
||||
NMTOPTR(aspell_speller_config,
|
||||
(struct AspellConfig *(*)(struct AspellSpeller *)));
|
||||
NMTOPTR(aspell_speller_suggest,
|
||||
(const struct AspellWordList *(*)(struct AspellSpeller *,
|
||||
const char *, int)));
|
||||
NMTOPTR(aspell_speller_check,
|
||||
(int (*)(struct AspellSpeller *, const char *, int)));
|
||||
NMTOPTR(aspell_word_list_elements,
|
||||
(struct AspellStringEnumeration *(*)
|
||||
(const struct AspellWordList *)));
|
||||
NMTOPTR(aspell_string_enumeration_next,
|
||||
(const char * (*)(struct AspellStringEnumeration *)));
|
||||
NMTOPTR(delete_aspell_string_enumeration,
|
||||
(void (*)(struct AspellStringEnumeration *)));
|
||||
NMTOPTR(aspell_error,
|
||||
(const struct AspellError*(*)(const struct AspellCanHaveError *)));
|
||||
NMTOPTR(aspell_error_message,
|
||||
(const char *(*)(const struct AspellCanHaveError *)));
|
||||
NMTOPTR(aspell_speller_error_message,
|
||||
(const char *(*)(const struct AspellSpeller *)));
|
||||
NMTOPTR(delete_aspell_speller, (void (*)(struct AspellSpeller *)));
|
||||
|
||||
if (!badnames.empty()) {
|
||||
reason = string("Aspell::init: symbols not found:") + badnames;
|
||||
deleteZ(m_data);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Aspell::ok() const
|
||||
{
|
||||
return m_data != 0 && m_data->m_handle != 0;
|
||||
}
|
||||
|
||||
string Aspell::dicPath()
|
||||
{
|
||||
string ccdir;
|
||||
m_config->getConfParam("aspellDicDir", ccdir);
|
||||
if (ccdir.empty()) {
|
||||
ccdir = m_config->getConfDir();
|
||||
} else {
|
||||
ccdir = path_tildexpand(ccdir);
|
||||
// If not an absolute path, compute relative to config dir
|
||||
if (!path_isabsolute(ccdir))
|
||||
ccdir = path_cat(m_config->getConfDir(), ccdir);
|
||||
}
|
||||
|
||||
return path_cat(ccdir, string("aspdict.") + m_lang + string(".rws"));
|
||||
}
|
||||
|
||||
|
||||
// The data source for the create dictionary aspell command. We walk
|
||||
// the term list, filtering out things that are probably not words.
|
||||
// Note that the manual for the current version (0.60) of aspell
|
||||
// states that utf-8 is not well supported, so that we should maybe
|
||||
// also filter all 8bit chars.
|
||||
class AspExecPv : public ExecCmdProvide {
|
||||
public:
|
||||
string *m_input; // pointer to string used as input buffer to command
|
||||
Rcl::TermIter *m_tit;
|
||||
Rcl::Db &m_db;
|
||||
AspExecPv(string *i, Rcl::TermIter *tit, Rcl::Db &db)
|
||||
: m_input(i), m_tit(tit), m_db(db)
|
||||
{}
|
||||
void newData() {
|
||||
while (m_db.termWalkNext(m_tit, *m_input)) {
|
||||
LOGDEB2(("Aspell::buildDict: term: [%s]\n", m_input->c_str()));
|
||||
if (!Rcl::Db::isSpellingCandidate(*m_input)) {
|
||||
LOGDEB2(("Aspell::buildDict: SKIP\n"));
|
||||
continue;
|
||||
}
|
||||
if (!o_index_stripchars) {
|
||||
string lower;
|
||||
if (!unacmaybefold(*m_input, lower, "UTF-8", UNACOP_FOLD))
|
||||
continue;
|
||||
m_input->swap(lower);
|
||||
}
|
||||
// Got a non-empty sort-of appropriate term, let's send it to
|
||||
// aspell
|
||||
LOGDEB2(("Apell::buildDict: SEND\n"));
|
||||
m_input->append("\n");
|
||||
return;
|
||||
}
|
||||
// End of data. Tell so. Exec will close cmd.
|
||||
m_input->erase();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
bool Aspell::buildDict(Rcl::Db &db, string &reason)
|
||||
{
|
||||
if (!ok())
|
||||
return false;
|
||||
|
||||
string addCreateParam;
|
||||
m_config->getConfParam("aspellAddCreateParam", addCreateParam);
|
||||
|
||||
// We create the dictionary by executing the aspell command:
|
||||
// aspell --lang=[lang] create master [dictApath]
|
||||
string cmdstring(m_data->m_exec);
|
||||
ExecCmd aspell;
|
||||
vector<string> args;
|
||||
args.push_back(string("--lang=")+ m_lang);
|
||||
cmdstring += string(" ") + string("--lang=") + m_lang;
|
||||
args.push_back("--encoding=utf-8");
|
||||
cmdstring += string(" ") + "--encoding=utf-8";
|
||||
if (!addCreateParam.empty()) {
|
||||
args.push_back(addCreateParam);
|
||||
cmdstring += string(" ") + addCreateParam;
|
||||
}
|
||||
args.push_back("create");
|
||||
cmdstring += string(" ") + "create";
|
||||
args.push_back("master");
|
||||
cmdstring += string(" ") + "master";
|
||||
args.push_back(dicPath());
|
||||
cmdstring += string(" ") + dicPath();
|
||||
|
||||
// Have to disable stderr, as numerous messages about bad strings are
|
||||
// printed. We'd like to keep errors about missing databases though, so
|
||||
// make it configurable for diags
|
||||
bool keepStderr = false;
|
||||
m_config->getConfParam("aspellKeepStderr", &keepStderr);
|
||||
if (!keepStderr)
|
||||
aspell.setStderr("/dev/null");
|
||||
|
||||
Rcl::TermIter *tit = db.termWalkOpen();
|
||||
if (tit == 0) {
|
||||
reason = "termWalkOpen failed\n";
|
||||
return false;
|
||||
}
|
||||
string termbuf;
|
||||
AspExecPv pv(&termbuf, tit, db);
|
||||
aspell.setProvide(&pv);
|
||||
|
||||
if (aspell.doexec(m_data->m_exec, args, &termbuf)) {
|
||||
ExecCmd cmd;
|
||||
args.clear();
|
||||
args.push_back("dicts");
|
||||
string dicts;
|
||||
bool hasdict = false;
|
||||
if (cmd.doexec(m_data->m_exec, args, 0, &dicts)) {
|
||||
vector<string> vdicts;
|
||||
stringToTokens(dicts, vdicts, "\n\r\t ");
|
||||
if (find(vdicts.begin(), vdicts.end(), m_lang) != vdicts.end()) {
|
||||
hasdict = true;
|
||||
}
|
||||
}
|
||||
if (hasdict)
|
||||
reason = string(
|
||||
"\naspell dictionary creation command [") +
|
||||
cmdstring + string("] failed. Reason unknown.\n"
|
||||
"Try to set aspellKeepStderr = 1 in recoll.conf, and execute \n"
|
||||
"the indexing command in a terminal to see the aspell "
|
||||
"diagnostic output.\n");
|
||||
else
|
||||
reason = string("aspell dictionary creation command failed:\n") +
|
||||
cmdstring + "\n"
|
||||
"One possible reason might be missing language "
|
||||
"data files for lang = " + m_lang +
|
||||
". Maybe try to execute the command by hand for a better diag.";
|
||||
return false;
|
||||
}
|
||||
db.termWalkClose(tit);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool Aspell::make_speller(string& reason)
|
||||
{
|
||||
if (!ok())
|
||||
return false;
|
||||
if (m_data->m_speller != 0)
|
||||
return true;
|
||||
|
||||
AspellCanHaveError *ret;
|
||||
|
||||
AspellConfig *config = aapi.new_aspell_config();
|
||||
aapi.aspell_config_replace(config, "lang", m_lang.c_str());
|
||||
aapi.aspell_config_replace(config, "encoding", "utf-8");
|
||||
aapi.aspell_config_replace(config, "master", dicPath().c_str());
|
||||
aapi.aspell_config_replace(config, "sug-mode", "fast");
|
||||
// aapi.aspell_config_replace(config, "sug-edit-dist", "2");
|
||||
ret = aapi.new_aspell_speller(config);
|
||||
aapi.delete_aspell_config(config);
|
||||
|
||||
if (aapi.aspell_error(ret) != 0) {
|
||||
reason = aapi.aspell_error_message(ret);
|
||||
aapi.delete_aspell_can_have_error(ret);
|
||||
return false;
|
||||
}
|
||||
m_data->m_speller = aapi.to_aspell_speller(ret);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Aspell::check(const string &iterm, string& reason)
|
||||
{
|
||||
LOGDEB2(("Aspell::check [%s]\n", iterm.c_str()));
|
||||
string mterm(iterm);
|
||||
|
||||
if (!ok() || !make_speller(reason))
|
||||
return false;
|
||||
if (iterm.empty())
|
||||
return true; //??
|
||||
|
||||
if (!o_index_stripchars) {
|
||||
string lower;
|
||||
if (!unacmaybefold(mterm, lower, "UTF-8", UNACOP_FOLD)) {
|
||||
LOGERR(("Aspell::check : cant lowercase input\n"));
|
||||
return false;
|
||||
}
|
||||
mterm.swap(lower);
|
||||
}
|
||||
|
||||
int ret = aapi.aspell_speller_check(m_data->m_speller,
|
||||
mterm.c_str(), mterm.length());
|
||||
reason.clear();
|
||||
switch (ret) {
|
||||
case 0: return false;
|
||||
case 1: return true;
|
||||
default:
|
||||
case -1:
|
||||
reason.append("Aspell error: ");
|
||||
reason.append(aapi.aspell_speller_error_message(m_data->m_speller));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
bool Aspell::suggest(Rcl::Db &db, const string &_term,
|
||||
list<string>& suggestions, string& reason)
|
||||
{
|
||||
if (!ok() || !make_speller(reason))
|
||||
return false;
|
||||
string mterm(_term);
|
||||
if (mterm.empty())
|
||||
return true; //??
|
||||
|
||||
if (!o_index_stripchars) {
|
||||
string lower;
|
||||
if (!unacmaybefold(mterm, lower, "UTF-8", UNACOP_FOLD)) {
|
||||
LOGERR(("Aspell::check : cant lowercase input\n"));
|
||||
return false;
|
||||
}
|
||||
mterm.swap(lower);
|
||||
}
|
||||
|
||||
AspellCanHaveError *ret;
|
||||
|
||||
const AspellWordList *wl =
|
||||
aapi.aspell_speller_suggest(m_data->m_speller,
|
||||
mterm.c_str(), mterm.length());
|
||||
if (wl == 0) {
|
||||
reason = aapi.aspell_speller_error_message(m_data->m_speller);
|
||||
return false;
|
||||
}
|
||||
AspellStringEnumeration *els = aapi.aspell_word_list_elements(wl);
|
||||
const char *word;
|
||||
while ((word = aapi.aspell_string_enumeration_next(els)) != 0) {
|
||||
// Check that the word exists in the index (we don't want
|
||||
// aspell computed stuff, only exact terms from the
|
||||
// dictionary). We used to also check that it stems
|
||||
// differently from the base word but this is complicated
|
||||
// (stemming on/off + language), so we now leave this to the
|
||||
// caller.
|
||||
if (db.termExists(word))
|
||||
suggestions.push_back(word);
|
||||
}
|
||||
aapi.delete_aspell_string_enumeration(els);
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif // RCL_USE_ASPELL
|
||||
|
||||
#else // TEST_RCLASPELL test driver ->
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "autoconfig.h"
|
||||
#endif
|
||||
|
||||
#ifdef RCL_USE_ASPELL
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
#include "rclinit.h"
|
||||
#include "rclconfig.h"
|
||||
#include "rcldb.h"
|
||||
#include "rclaspell.h"
|
||||
|
||||
static char *thisprog;
|
||||
RclConfig *rclconfig;
|
||||
|
||||
static char usage [] =
|
||||
" -b : build dictionary\n"
|
||||
" -s <term>: suggestions for term\n"
|
||||
" -c <term>: check term\n"
|
||||
"\n"
|
||||
;
|
||||
static void
|
||||
Usage(void)
|
||||
{
|
||||
fprintf(stderr, "%s: usage:\n%s", thisprog, usage);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
static int op_flags;
|
||||
#define OPT_MOINS 0x1
|
||||
#define OPT_s 0x2
|
||||
#define OPT_b 0x4
|
||||
#define OPT_c 0x8
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
string word;
|
||||
|
||||
thisprog = argv[0];
|
||||
argc--; argv++;
|
||||
|
||||
while (argc > 0 && **argv == '-') {
|
||||
(*argv)++;
|
||||
if (!(**argv))
|
||||
/* Cas du "adb - core" */
|
||||
Usage();
|
||||
while (**argv)
|
||||
switch (*(*argv)++) {
|
||||
case 'b': op_flags |= OPT_b; break;
|
||||
case 'c': op_flags |= OPT_c; if (argc < 2) Usage();
|
||||
word = *(++argv);
|
||||
argc--;
|
||||
goto b1;
|
||||
case 's': op_flags |= OPT_s; if (argc < 2) Usage();
|
||||
word = *(++argv);
|
||||
argc--;
|
||||
goto b1;
|
||||
default: Usage(); break;
|
||||
}
|
||||
b1: argc--; argv++;
|
||||
}
|
||||
|
||||
if (argc != 0 || op_flags == 0)
|
||||
Usage();
|
||||
|
||||
string reason;
|
||||
rclconfig = recollinit(0, 0, reason);
|
||||
if (!rclconfig || !rclconfig->ok()) {
|
||||
fprintf(stderr, "Configuration problem: %s\n", reason.c_str());
|
||||
exit(1);
|
||||
}
|
||||
|
||||
string dbdir = rclconfig->getDbDir();
|
||||
if (dbdir.empty()) {
|
||||
fprintf(stderr, "No db directory in configuration");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
Rcl::Db rcldb(rclconfig);
|
||||
|
||||
if (!rcldb.open(Rcl::Db::DbRO, 0)) {
|
||||
fprintf(stderr, "Could not open database in %s\n", dbdir.c_str());
|
||||
exit(1);
|
||||
}
|
||||
|
||||
Aspell aspell(rclconfig);
|
||||
|
||||
if (!aspell.init(reason)) {
|
||||
cerr << "Init failed: " << reason << endl;
|
||||
exit(1);
|
||||
}
|
||||
if (op_flags & OPT_b) {
|
||||
if (!aspell.buildDict(rcldb, reason)) {
|
||||
cerr << "buildDict failed: " << reason << endl;
|
||||
exit(1);
|
||||
}
|
||||
} else if (op_flags & OPT_c) {
|
||||
bool ret = aspell.check(word, reason);
|
||||
if (!ret && reason.size()) {
|
||||
cerr << "Aspell error: " << reason << endl;
|
||||
return 1;
|
||||
}
|
||||
cout << word;
|
||||
if (ret) {
|
||||
cout << " is in dictionary" << endl;
|
||||
} else {
|
||||
cout << " not in dictionary" << endl;
|
||||
}
|
||||
} else {
|
||||
list<string> suggs;
|
||||
if (!aspell.suggest(rcldb, word, suggs, reason)) {
|
||||
cerr << "suggest failed: " << reason << endl;
|
||||
exit(1);
|
||||
}
|
||||
cout << "Suggestions for " << word << ":" << endl;
|
||||
for (list<string>::iterator it = suggs.begin();
|
||||
it != suggs.end(); it++) {
|
||||
cout << *it << endl;
|
||||
}
|
||||
}
|
||||
exit(0);
|
||||
}
|
||||
#else
|
||||
int main(int argc, char **argv)
|
||||
{return 1;}
|
||||
#endif // RCL_USE_ASPELL
|
||||
|
||||
#endif // TEST_RCLASPELL test driver
|
79
src/aspell/rclaspell.h
Normal file
79
src/aspell/rclaspell.h
Normal file
|
@ -0,0 +1,79 @@
|
|||
/* Copyright (C) 2006 J.F.Dockes
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the
|
||||
* Free Software Foundation, Inc.,
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
#ifndef _RCLASPELL_H_INCLUDED_
|
||||
#define _RCLASPELL_H_INCLUDED_
|
||||
|
||||
/* autoconfig.h must be included before this file */
|
||||
#ifdef RCL_USE_ASPELL
|
||||
|
||||
/**
|
||||
* Aspell speller interface class.
|
||||
*
|
||||
* Aspell is used to let the user find about spelling variations that may
|
||||
* exist in the document set for a given word.
|
||||
* A specific aspell dictionary is created out of all the terms in the
|
||||
* xapian index, and we then use it to expand a term to spelling neighbours.
|
||||
* We use the aspell C api for term expansion, but have
|
||||
* to execute the program to create dictionaries.
|
||||
*/
|
||||
|
||||
#include <string>
|
||||
#include <list>
|
||||
|
||||
#include "rclconfig.h"
|
||||
#include "rcldb.h"
|
||||
|
||||
class AspellData;
|
||||
|
||||
class Aspell {
|
||||
public:
|
||||
Aspell(RclConfig *cnf);
|
||||
~Aspell();
|
||||
|
||||
/** Check health */
|
||||
bool ok() const;
|
||||
|
||||
/** Find the aspell command and shared library, init function pointers */
|
||||
bool init(std::string &reason);
|
||||
|
||||
/** Build dictionary out of index term list. This is done at the end
|
||||
* of an indexing pass. */
|
||||
bool buildDict(Rcl::Db &db, std::string &reason);
|
||||
|
||||
/** Check that word is in dictionary. Note that this would mean
|
||||
* that the EXACT word is: aspell just does a lookup, no
|
||||
* grammatical, case or diacritics magic of any kind
|
||||
*
|
||||
* @return true if word in dic, false if not. reason.size() -> error
|
||||
*/
|
||||
bool check(const std::string& term, std::string& reason);
|
||||
|
||||
/** Return a list of possible expansions for a given word */
|
||||
bool suggest(Rcl::Db &db, const std::string& term,
|
||||
std::list<std::string> &suggestions, std::string &reason);
|
||||
|
||||
private:
|
||||
std::string dicPath();
|
||||
RclConfig *m_config;
|
||||
std::string m_lang;
|
||||
AspellData *m_data;
|
||||
|
||||
bool make_speller(std::string& reason);
|
||||
};
|
||||
|
||||
#endif /* RCL_USE_ASPELL */
|
||||
#endif /* _RCLASPELL_H_INCLUDED_ */
|
4
src/autogen.sh
Executable file
4
src/autogen.sh
Executable file
|
@ -0,0 +1,4 @@
|
|||
aclocal
|
||||
libtoolize
|
||||
automake --add-missing
|
||||
autoconf
|
3
src/bincimapmime/00README.recoll
Normal file
3
src/bincimapmime/00README.recoll
Normal file
|
@ -0,0 +1,3 @@
|
|||
Most of the code in this directory was taken from the Binc IMAP project
|
||||
(http://www.bincimap.org/), version 1.3.3
|
||||
|
45
src/bincimapmime/AUTHORS
Normal file
45
src/bincimapmime/AUTHORS
Normal file
|
@ -0,0 +1,45 @@
|
|||
The following parties have participated in writing code or otherwise
|
||||
contributed to the Binc IMAP project:
|
||||
|
||||
Author:
|
||||
Andreas Aardal Hanssen <andreas-binc@bincimap.org>
|
||||
|
||||
Several users have been very helpful with bug reports and suggestions, and
|
||||
the author is very grateful for their contributions.
|
||||
|
||||
Some users have also gone to the extra effort of debugging the cause of a
|
||||
bug, or have found a way of implementing a feature, and have either provided
|
||||
a very good description of what is needed, or they have actually provided a
|
||||
patch that has been added to Binc IMAP.
|
||||
|
||||
While adding extra value to the discussion around the discovery of a bug or
|
||||
the evaluation of a new feature, these contributors also take some load of
|
||||
the author's back, so they deserve extra thanks.
|
||||
|
||||
In this list are also included people who have contributed with mirrors and
|
||||
translations of the web pages.
|
||||
|
||||
Henry Baragar <Henry.Baragar (a) Instantiated.Ca>
|
||||
Jürgen Botz <jurgen (a) botz.org>
|
||||
Charlie Brady <charlieb (a) e-smith.com>
|
||||
Caskey Dickson <caskey (a) technocage.com>
|
||||
Ketil Froyn <ketil (a) froyn.name>
|
||||
Gary Gordon <gv-mail (a) mygirlfriday.info>
|
||||
Marek Gutkowski <marek (a) moveo.pl>
|
||||
Daniel James <daniel_james (a) eml.cc>
|
||||
Zak Johnson <zakj (a) nox.cx>
|
||||
Sergei Kolobov <sergei (a) kolobov.com>
|
||||
Rafal Kupka <kupson (a) kupson.fdns.net>
|
||||
Eivind Kvedalen <bincimap (a) eivind.kvedalen.name>
|
||||
HIROSHIMA Naoki <naokih (a) iron-horse.org>
|
||||
Greger Stolt Nilsen <greger (a) psychoproject.net>
|
||||
John Starks <jstarks (a) starksnet.net>
|
||||
Peter Stuge <stuge-binc (a) cdy.org>
|
||||
Gerrit Pape <pape (a) smarden.org>
|
||||
Jeremy Rossi <jeremy (a) jeremyrossi.com>
|
||||
Dale Woolridge <dale-contrib-bincimap (a) woolridge.org>
|
||||
|
||||
If you have contributed to the Binc IMAP project but are not listed here
|
||||
(this happens quite often), please send a mail to andreas-binc@bincimap.org
|
||||
and I'll add you to the list.
|
||||
|
356
src/bincimapmime/COPYING
Normal file
356
src/bincimapmime/COPYING
Normal file
|
@ -0,0 +1,356 @@
|
|||
This software is released under the GPL. Find a full copy of the GNU
|
||||
General Public License below.
|
||||
|
||||
In addition, as a special exception, Andreas Aardal Hanssen, author of
|
||||
Binc IMAP, gives permission to link the code of this program with the
|
||||
OpenSSL library (or with modified versions of OpenSSL that use the
|
||||
same license as OpenSSL, listed in the included COPYING.OpenSSL file),
|
||||
and distribute linked combinations including the two.
|
||||
|
||||
You must obey the GNU General Public License in all respects for all
|
||||
of the code used other than OpenSSL. If you modify this file, you may
|
||||
extend this exception to your version of the file, but you are not
|
||||
obligated to do so. If you do not wish to do so, delete this exception
|
||||
statement from your version.
|
||||
|
||||
---------------------------------------------------------------------
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Library General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) year name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Library General
|
||||
Public License instead of this License.
|
11
src/bincimapmime/Makefile
Normal file
11
src/bincimapmime/Makefile
Normal file
|
@ -0,0 +1,11 @@
|
|||
PROGS = trbinc
|
||||
all: $(PROGS)
|
||||
|
||||
TRBINCOBJS = trbinc.o
|
||||
trbinc: trbinc.o
|
||||
$(CXX) -o trbinc trbinc.o $(LIBRECOLL)
|
||||
|
||||
trbinc.o: trbinc.cc
|
||||
$(CXX) $(ALL_CXXFLAGS) -c -o trbinc.o trbinc.cc
|
||||
|
||||
include ../utils/utmkdefs.mk
|
0
src/bincimapmime/config.h
Normal file
0
src/bincimapmime/config.h
Normal file
129
src/bincimapmime/convert.cc
Normal file
129
src/bincimapmime/convert.cc
Normal file
|
@ -0,0 +1,129 @@
|
|||
/* -*- mode:c++;c-basic-offset:2 -*- */
|
||||
/* --------------------------------------------------------------------
|
||||
* Filename:
|
||||
* convert.cc
|
||||
*
|
||||
* Description:
|
||||
* Implementation of miscellaneous convertion functions.
|
||||
* --------------------------------------------------------------------
|
||||
* Copyright 2002-2005 Andreas Aardal Hanssen
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
|
||||
* --------------------------------------------------------------------
|
||||
*/
|
||||
#include "convert.h"
|
||||
#include <string>
|
||||
|
||||
#ifndef NO_NAMESPACES
|
||||
using namespace ::std;
|
||||
using namespace Binc;
|
||||
#endif /* NO_NAMESPACES */
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
BincStream::BincStream(void)
|
||||
{
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
BincStream::~BincStream(void)
|
||||
{
|
||||
clear();
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
string BincStream::popString(std::string::size_type size)
|
||||
{
|
||||
if (size > nstr.length())
|
||||
size = nstr.length();
|
||||
string tmp = nstr.substr(0, size);
|
||||
nstr = nstr.substr(size);
|
||||
return tmp;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
char BincStream::popChar(void)
|
||||
{
|
||||
if (nstr.length() == 0)
|
||||
return '\0';
|
||||
|
||||
char c = nstr[0];
|
||||
nstr = nstr.substr(1);
|
||||
return c;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
void BincStream::unpopChar(char c)
|
||||
{
|
||||
nstr = c + nstr;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
void BincStream::unpopStr(const string &s)
|
||||
{
|
||||
nstr = s + nstr;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
const string &BincStream::str(void) const
|
||||
{
|
||||
return nstr;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
void BincStream::clear(void)
|
||||
{
|
||||
nstr.clear();
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
unsigned int BincStream::getSize(void) const
|
||||
{
|
||||
return (unsigned int) nstr.length();
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
BincStream &BincStream::operator << (std::ostream&(*)(std::ostream&))
|
||||
{
|
||||
nstr += "\r\n";
|
||||
return *this;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
BincStream &BincStream::operator << (const string &t)
|
||||
{
|
||||
nstr += t;
|
||||
return *this;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
BincStream &BincStream::operator << (int t)
|
||||
{
|
||||
nstr += toString(t);
|
||||
return *this;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
BincStream &BincStream::operator << (unsigned int t)
|
||||
{
|
||||
nstr += toString(t);
|
||||
return *this;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
BincStream &BincStream::operator << (char t)
|
||||
{
|
||||
nstr += t;
|
||||
return *this;
|
||||
}
|
316
src/bincimapmime/convert.h
Normal file
316
src/bincimapmime/convert.h
Normal file
|
@ -0,0 +1,316 @@
|
|||
/* -*- mode:c++;c-basic-offset:2 -*- */
|
||||
/* --------------------------------------------------------------------
|
||||
* Filename:
|
||||
* src/util/convert.h
|
||||
*
|
||||
* Description:
|
||||
* Declaration of miscellaneous convertion functions.
|
||||
* --------------------------------------------------------------------
|
||||
* Copyright 2002-2005 Andreas Aardal Hanssen
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
|
||||
* --------------------------------------------------------------------
|
||||
*/
|
||||
#ifndef convert_h_included
|
||||
#define convert_h_included
|
||||
#include <stddef.h>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <iomanip>
|
||||
#include <iostream>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
|
||||
namespace Binc {
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline std::string toString(int i_in)
|
||||
{
|
||||
char intbuf[16];
|
||||
snprintf(intbuf, sizeof(intbuf), "%d", i_in);
|
||||
return std::string(intbuf);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline std::string toString(unsigned int i_in)
|
||||
{
|
||||
char intbuf[16];
|
||||
snprintf(intbuf, sizeof(intbuf), "%u", i_in);
|
||||
return std::string(intbuf);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline std::string toString(unsigned long i_in)
|
||||
{
|
||||
char longbuf[40];
|
||||
snprintf(longbuf, sizeof(longbuf), "%lu", i_in);
|
||||
return std::string(longbuf);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline std::string toString(const char *i_in)
|
||||
{
|
||||
return std::string(i_in);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline int atoi(const std::string &s_in)
|
||||
{
|
||||
return ::atoi(s_in.c_str());
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline std::string toHex(const std::string &s)
|
||||
{
|
||||
const char hexchars[] = "0123456789abcdef";
|
||||
std::string tmp;
|
||||
for (std::string::const_iterator i = s.begin(); i != s.end(); ++i) {
|
||||
unsigned char c = (unsigned char)*i;
|
||||
tmp += hexchars[((c & 0xf0) >> 4)];
|
||||
tmp += hexchars[c & 0x0f];
|
||||
}
|
||||
|
||||
return tmp;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline std::string fromHex(const std::string &s)
|
||||
{
|
||||
const char hexchars[] = "0123456789abcdef";
|
||||
std::string tmp;
|
||||
for (std::string::const_iterator i = s.begin();
|
||||
i != s.end() && i + 1 != s.end(); i += 2) {
|
||||
ptrdiff_t n;
|
||||
unsigned char c = *i;
|
||||
unsigned char d = *(i + 1);
|
||||
|
||||
const char *t;
|
||||
if ((t = strchr(hexchars, c)) == 0)
|
||||
return "out of range";
|
||||
n = (t - hexchars) << 4;
|
||||
|
||||
|
||||
if ((t = strchr(hexchars, d)) == 0)
|
||||
return "out of range";
|
||||
n += (t - hexchars);
|
||||
|
||||
if (n >= 0 && n <= 255)
|
||||
tmp += (char) n;
|
||||
else
|
||||
return "out of range";
|
||||
}
|
||||
|
||||
return tmp;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline std::string toImapString(const std::string &s_in)
|
||||
{
|
||||
for (std::string::const_iterator i = s_in.begin(); i != s_in.end(); ++i) {
|
||||
unsigned char c = (unsigned char)*i;
|
||||
if (c <= 31 || c >= 127 || c == '\"' || c == '\\')
|
||||
return "{" + toString((unsigned long)s_in.length()) + "}\r\n" + s_in;
|
||||
}
|
||||
|
||||
return "\"" + s_in + "\"";
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline void uppercase(std::string &input)
|
||||
{
|
||||
for (std::string::iterator i = input.begin(); i != input.end(); ++i)
|
||||
*i = toupper(*i);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline void lowercase(std::string &input)
|
||||
{
|
||||
for (std::string::iterator i = input.begin(); i != input.end(); ++i)
|
||||
*i = tolower(*i);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline void chomp(std::string &s_in, const std::string &chars = " \t\r\n")
|
||||
{
|
||||
std::string::size_type n = s_in.length();
|
||||
while (n > 1 && chars.find(s_in[n - 1]) != std::string::npos)
|
||||
s_in.resize(n-- - 1);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline void trim(std::string &s_in, const std::string &chars = " \t\r\n")
|
||||
{
|
||||
while (s_in != "" && chars.find(s_in[0]) != std::string::npos)
|
||||
s_in = s_in.substr(1);
|
||||
chomp(s_in, chars);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline const std::string unfold(const std::string &a,
|
||||
bool removecomment = true)
|
||||
{
|
||||
std::string tmp;
|
||||
bool incomment = false;
|
||||
bool inquotes = false;
|
||||
for (std::string::const_iterator i = a.begin(); i != a.end(); ++i) {
|
||||
unsigned char c = (unsigned char)*i;
|
||||
if (!inquotes && removecomment) {
|
||||
if (c == '(') {
|
||||
incomment = true;
|
||||
tmp += " ";
|
||||
} else if (c == ')') {
|
||||
incomment = false;
|
||||
} else if (c != 0x0a && c != 0x0d) {
|
||||
tmp += *i;
|
||||
}
|
||||
} else if (c != 0x0a && c != 0x0d) {
|
||||
tmp += *i;
|
||||
}
|
||||
|
||||
if (!incomment) {
|
||||
if (*i == '\"')
|
||||
inquotes = !inquotes;
|
||||
}
|
||||
}
|
||||
|
||||
trim(tmp);
|
||||
return tmp;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline void split(const std::string &s_in, const std::string &delim,
|
||||
std::vector<std::string> &dest, bool skipempty = true)
|
||||
{
|
||||
std::string token;
|
||||
for (std::string::const_iterator i = s_in.begin(); i != s_in.end(); ++i) {
|
||||
if (delim.find(*i) != std::string::npos) {
|
||||
if (!skipempty || token != "")
|
||||
dest.push_back(token);
|
||||
token.clear();
|
||||
} else
|
||||
token += *i;
|
||||
}
|
||||
|
||||
if (token != "")
|
||||
dest.push_back(token);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline void splitAddr(const std::string &s_in,
|
||||
std::vector<std::string> &dest, bool skipempty = true)
|
||||
{
|
||||
static const std::string delim = ",";
|
||||
std::string token;
|
||||
bool inquote = false;
|
||||
for (std::string::const_iterator i = s_in.begin(); i != s_in.end(); ++i) {
|
||||
if (inquote && *i == '\"') inquote = false;
|
||||
else if (!inquote && *i == '\"') inquote = true;
|
||||
|
||||
if (!inquote && delim.find(*i) != std::string::npos) {
|
||||
if (!skipempty || token != "")
|
||||
dest.push_back(token);
|
||||
token.clear();
|
||||
} else
|
||||
token += *i;
|
||||
}
|
||||
if (token != "")
|
||||
dest.push_back(token);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline std::string toCanonMailbox(const std::string &s_in)
|
||||
{
|
||||
if (s_in.find("..") != std::string::npos) return std::string();
|
||||
|
||||
if (s_in.length() >= 5) {
|
||||
std::string a = s_in.substr(0, 5);
|
||||
uppercase(a);
|
||||
return a == "INBOX" ?
|
||||
a + (s_in.length() > 5 ? s_in.substr(5) : std::string()) : s_in;
|
||||
}
|
||||
|
||||
return s_in;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
inline std::string toRegex(const std::string &s_in, char delimiter)
|
||||
{
|
||||
std::string regex = "^";
|
||||
for (std::string::const_iterator i = s_in.begin(); i != s_in.end(); ++i) {
|
||||
if (*i == '.' || *i == '[' || *i == ']' || *i == '{' || *i == '}' ||
|
||||
*i == '(' || *i == ')' || *i == '^' || *i == '$' || *i == '?' ||
|
||||
*i == '+' || *i == '\\') {
|
||||
regex += "\\";
|
||||
regex += *i;
|
||||
} else if (*i == '*')
|
||||
regex += ".*?";
|
||||
else if (*i == '%') {
|
||||
regex += "(\\";
|
||||
regex += delimiter;
|
||||
regex += "){0,1}";
|
||||
regex += "[^\\";
|
||||
regex += delimiter;
|
||||
regex += "]*?";
|
||||
} else regex += *i;
|
||||
}
|
||||
|
||||
if (regex[regex.length() - 1] == '?')
|
||||
regex[regex.length() - 1] = '$';
|
||||
else
|
||||
regex += "$";
|
||||
|
||||
return regex;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
class BincStream {
|
||||
private:
|
||||
std::string nstr;
|
||||
|
||||
public:
|
||||
|
||||
//--
|
||||
BincStream &operator << (std::ostream&(*)(std::ostream&));
|
||||
BincStream &operator << (const std::string &t);
|
||||
BincStream &operator << (unsigned int t);
|
||||
BincStream &operator << (int t);
|
||||
BincStream &operator << (char t);
|
||||
|
||||
//--
|
||||
std::string popString(std::string::size_type size);
|
||||
|
||||
//--
|
||||
char popChar(void);
|
||||
void unpopChar(char c);
|
||||
void unpopStr(const std::string &s);
|
||||
|
||||
//--
|
||||
const std::string &str(void) const;
|
||||
|
||||
//--
|
||||
unsigned int getSize(void) const;
|
||||
|
||||
//--
|
||||
void clear(void);
|
||||
|
||||
//--
|
||||
BincStream(void);
|
||||
~BincStream(void);
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
222
src/bincimapmime/mime-inputsource.h
Normal file
222
src/bincimapmime/mime-inputsource.h
Normal file
|
@ -0,0 +1,222 @@
|
|||
/* -*- mode:c++;c-basic-offset:2 -*- */
|
||||
/* --------------------------------------------------------------------
|
||||
* Filename:
|
||||
* src/mime-inputsource.h
|
||||
*
|
||||
* Description:
|
||||
* The base class of the MIME input source
|
||||
* --------------------------------------------------------------------
|
||||
* Copyright 2002-2005 Andreas Aardal Hanssen
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
|
||||
* --------------------------------------------------------------------
|
||||
*/
|
||||
#ifndef mime_inputsource_h_included
|
||||
#define mime_inputsource_h_included
|
||||
#include "autoconfig.h"
|
||||
// Data source for MIME parser
|
||||
|
||||
// Note about large files: we might want to change the unsigned int
|
||||
// used for offsets into an off_t for intellectual satisfaction, but
|
||||
// in the context of recoll, we could only get into trouble if a
|
||||
// *single message* exceeded 2GB, which seems rather unlikely. When
|
||||
// parsing a mailbox files, we read each message in memory and use the
|
||||
// stream input source (from a memory buffer, no file offsets). When
|
||||
// parsing a raw message file, it's only one message.
|
||||
|
||||
#include <string.h>
|
||||
#include "safeunistd.h"
|
||||
|
||||
#include <iostream>
|
||||
|
||||
namespace Binc {
|
||||
|
||||
class MimeInputSource {
|
||||
public:
|
||||
// Note that we do NOT take ownership of fd, won't close it on delete
|
||||
inline MimeInputSource(int fd, unsigned int start = 0);
|
||||
virtual inline ~MimeInputSource(void);
|
||||
|
||||
virtual inline ssize_t fillRaw(char *raw, size_t nbytes);
|
||||
virtual inline void reset(void);
|
||||
|
||||
virtual inline bool fillInputBuffer(void);
|
||||
inline void seek(unsigned int offset);
|
||||
inline bool getChar(char *c);
|
||||
inline void ungetChar(void);
|
||||
inline int getFileDescriptor(void) const;
|
||||
|
||||
inline unsigned int getOffset(void) const;
|
||||
|
||||
private:
|
||||
int fd;
|
||||
char data[16384];
|
||||
unsigned int offset;
|
||||
unsigned int tail;
|
||||
unsigned int head;
|
||||
unsigned int start;
|
||||
char lastChar;
|
||||
};
|
||||
|
||||
inline MimeInputSource::MimeInputSource(int fd, unsigned int start)
|
||||
{
|
||||
this->fd = fd;
|
||||
this->start = start;
|
||||
offset = 0;
|
||||
tail = 0;
|
||||
head = 0;
|
||||
lastChar = '\0';
|
||||
memset(data, '\0', sizeof(data));
|
||||
|
||||
seek(start);
|
||||
}
|
||||
|
||||
inline MimeInputSource::~MimeInputSource(void)
|
||||
{
|
||||
}
|
||||
|
||||
inline ssize_t MimeInputSource::fillRaw(char *raw, size_t nbytes)
|
||||
{
|
||||
return read(fd, raw, nbytes);
|
||||
}
|
||||
|
||||
inline bool MimeInputSource::fillInputBuffer(void)
|
||||
{
|
||||
char raw[4096];
|
||||
ssize_t nbytes = fillRaw(raw, 4096);
|
||||
if (nbytes <= 0) {
|
||||
// FIXME: If ferror(crlffile) we should log this.
|
||||
return false;
|
||||
}
|
||||
|
||||
for (ssize_t i = 0; i < nbytes; ++i) {
|
||||
const char c = raw[i];
|
||||
if (c == '\r') {
|
||||
if (lastChar == '\r') {
|
||||
data[tail++ & (0x4000-1)] = '\r';
|
||||
data[tail++ & (0x4000-1)] = '\n';
|
||||
}
|
||||
} else if (c == '\n') {
|
||||
data[tail++ & (0x4000-1)] = '\r';
|
||||
data[tail++ & (0x4000-1)] = '\n';
|
||||
} else {
|
||||
if (lastChar == '\r') {
|
||||
data[tail++ & (0x4000-1)] = '\r';
|
||||
data[tail++ & (0x4000-1)] = '\n';
|
||||
}
|
||||
|
||||
data[tail++ & (0x4000-1)] = c;
|
||||
}
|
||||
|
||||
lastChar = c;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
inline void MimeInputSource::reset(void)
|
||||
{
|
||||
offset = head = tail = 0;
|
||||
lastChar = '\0';
|
||||
|
||||
if (fd != -1)
|
||||
lseek(fd, 0, SEEK_SET);
|
||||
}
|
||||
|
||||
inline void MimeInputSource::seek(unsigned int seekToOffset)
|
||||
{
|
||||
if (offset > seekToOffset)
|
||||
reset();
|
||||
|
||||
char c;
|
||||
int n = 0;
|
||||
while (seekToOffset > offset) {
|
||||
if (!getChar(&c))
|
||||
break;
|
||||
++n;
|
||||
}
|
||||
}
|
||||
|
||||
inline bool MimeInputSource::getChar(char *c)
|
||||
{
|
||||
if (head == tail && !fillInputBuffer())
|
||||
return false;
|
||||
|
||||
*c = data[head++ & (0x4000-1)];
|
||||
++offset;
|
||||
return true;
|
||||
}
|
||||
|
||||
inline void MimeInputSource::ungetChar()
|
||||
{
|
||||
--head;
|
||||
--offset;
|
||||
}
|
||||
|
||||
inline int MimeInputSource::getFileDescriptor(void) const
|
||||
{
|
||||
return fd;
|
||||
}
|
||||
|
||||
inline unsigned int MimeInputSource::getOffset(void) const
|
||||
{
|
||||
return offset;
|
||||
}
|
||||
|
||||
///////////////////////////////////
|
||||
class MimeInputSourceStream : public MimeInputSource {
|
||||
public:
|
||||
inline MimeInputSourceStream(istream& s, unsigned int start = 0);
|
||||
virtual inline ssize_t fillRaw(char *raw, size_t nb);
|
||||
virtual inline void reset(void);
|
||||
private:
|
||||
istream& s;
|
||||
};
|
||||
|
||||
inline MimeInputSourceStream::MimeInputSourceStream(istream& si,
|
||||
unsigned int start)
|
||||
: MimeInputSource(-1, start), s(si)
|
||||
{
|
||||
}
|
||||
|
||||
inline ssize_t MimeInputSourceStream::fillRaw(char *raw, size_t nb)
|
||||
{
|
||||
// Why can't streams tell how many characters were actually read
|
||||
// when hitting eof ?
|
||||
std::streampos st = s.tellg();
|
||||
s.seekg(0, ios::end);
|
||||
std::streampos lst = s.tellg();
|
||||
s.seekg(st);
|
||||
size_t nbytes = size_t(lst - st);
|
||||
if (nbytes > nb) {
|
||||
nbytes = nb;
|
||||
}
|
||||
if (nbytes <= 0) {
|
||||
return (ssize_t)-1;
|
||||
}
|
||||
|
||||
s.read(raw, nbytes);
|
||||
return static_cast<ssize_t>(nbytes);
|
||||
}
|
||||
|
||||
inline void MimeInputSourceStream::reset(void)
|
||||
{
|
||||
MimeInputSource::reset();
|
||||
s.seekg(0);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
625
src/bincimapmime/mime-parsefull.cc
Normal file
625
src/bincimapmime/mime-parsefull.cc
Normal file
|
@ -0,0 +1,625 @@
|
|||
/* -*- mode:c++;c-basic-offset:2 -*- */
|
||||
/* --------------------------------------------------------------------
|
||||
* Filename:
|
||||
* mime-parsefull.cc
|
||||
*
|
||||
* Description:
|
||||
* Implementation of main mime parser components
|
||||
* --------------------------------------------------------------------
|
||||
* Copyright 2002-2005 Andreas Aardal Hanssen
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
|
||||
* --------------------------------------------------------------------
|
||||
*/
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
#include <exception>
|
||||
#include <iostream>
|
||||
|
||||
#ifndef NO_NAMESPACES
|
||||
using namespace ::std;
|
||||
#endif /* NO_NAMESPACES */
|
||||
|
||||
#include "mime.h"
|
||||
#include "mime-utils.h"
|
||||
#include "mime-inputsource.h"
|
||||
#include "convert.h"
|
||||
|
||||
// #define MPF
|
||||
#ifdef MPF
|
||||
#define MPFDEB(X) fprintf X
|
||||
#else
|
||||
#define MPFDEB(X)
|
||||
#endif
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
void Binc::MimeDocument::parseFull(int fd)
|
||||
{
|
||||
if (allIsParsed)
|
||||
return;
|
||||
|
||||
allIsParsed = true;
|
||||
|
||||
delete doc_mimeSource;
|
||||
doc_mimeSource = new MimeInputSource(fd);
|
||||
|
||||
headerstartoffsetcrlf = 0;
|
||||
headerlength = 0;
|
||||
bodystartoffsetcrlf = 0;
|
||||
bodylength = 0;
|
||||
size = 0;
|
||||
messagerfc822 = false;
|
||||
multipart = false;
|
||||
|
||||
int bsize = 0;
|
||||
string bound;
|
||||
doParseFull(doc_mimeSource, bound, bsize);
|
||||
|
||||
// eat any trailing junk to get the correct size
|
||||
char c;
|
||||
while (doc_mimeSource->getChar(&c));
|
||||
|
||||
size = doc_mimeSource->getOffset();
|
||||
}
|
||||
|
||||
void Binc::MimeDocument::parseFull(istream& s)
|
||||
{
|
||||
if (allIsParsed)
|
||||
return;
|
||||
|
||||
allIsParsed = true;
|
||||
|
||||
delete doc_mimeSource;
|
||||
doc_mimeSource = new MimeInputSourceStream(s);
|
||||
|
||||
headerstartoffsetcrlf = 0;
|
||||
headerlength = 0;
|
||||
bodystartoffsetcrlf = 0;
|
||||
bodylength = 0;
|
||||
size = 0;
|
||||
messagerfc822 = false;
|
||||
multipart = false;
|
||||
|
||||
int bsize = 0;
|
||||
string bound;
|
||||
doParseFull(doc_mimeSource, bound, bsize);
|
||||
|
||||
// eat any trailing junk to get the correct size
|
||||
char c;
|
||||
while (doc_mimeSource->getChar(&c));
|
||||
|
||||
size = doc_mimeSource->getOffset();
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
bool Binc::MimePart::parseOneHeaderLine(Binc::Header *header,
|
||||
unsigned int *nlines)
|
||||
{
|
||||
using namespace ::Binc;
|
||||
char c;
|
||||
bool eof = false;
|
||||
char cqueue[4];
|
||||
string name;
|
||||
string content;
|
||||
|
||||
while (mimeSource->getChar(&c)) {
|
||||
// If we encounter a \r before we got to the first ':', then
|
||||
// rewind back to the start of the line and assume we're at the
|
||||
// start of the body.
|
||||
if (c == '\r') {
|
||||
for (int i = 0; i < (int) name.length() + 1; ++i)
|
||||
mimeSource->ungetChar();
|
||||
return false;
|
||||
}
|
||||
|
||||
// A colon marks the end of the header name
|
||||
if (c == ':') break;
|
||||
|
||||
// Otherwise add to the header name
|
||||
name += c;
|
||||
}
|
||||
|
||||
cqueue[0] = '\0';
|
||||
cqueue[1] = '\0';
|
||||
cqueue[2] = '\0';
|
||||
cqueue[3] = '\0';
|
||||
|
||||
// Read until the end of the header.
|
||||
bool endOfHeaders = false;
|
||||
while (!endOfHeaders) {
|
||||
if (!mimeSource->getChar(&c)) {
|
||||
eof = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if (c == '\n') ++*nlines;
|
||||
|
||||
for (int i = 0; i < 3; ++i)
|
||||
cqueue[i] = cqueue[i + 1];
|
||||
cqueue[3] = c;
|
||||
|
||||
if (strncmp(cqueue, "\r\n\r\n", 4) == 0) {
|
||||
endOfHeaders = true;
|
||||
break;
|
||||
}
|
||||
|
||||
// If the last character was a newline, and the first now is not
|
||||
// whitespace, then rewind one character and store the current
|
||||
// key,value pair.
|
||||
if (cqueue[2] == '\n' && c != ' ' && c != '\t') {
|
||||
if (content.length() > 2)
|
||||
content.resize(content.length() - 2);
|
||||
|
||||
trim(content);
|
||||
header->add(name, content);
|
||||
|
||||
if (c != '\r') {
|
||||
mimeSource->ungetChar();
|
||||
if (c == '\n') --*nlines;
|
||||
return true;
|
||||
}
|
||||
|
||||
mimeSource->getChar(&c);
|
||||
return false;
|
||||
}
|
||||
|
||||
content += c;
|
||||
}
|
||||
|
||||
if (name != "") {
|
||||
if (content.length() > 2)
|
||||
content.resize(content.length() - 2);
|
||||
header->add(name, content);
|
||||
}
|
||||
|
||||
return !(eof || endOfHeaders);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
void Binc::MimePart::parseHeader(Binc::Header *header, unsigned int *nlines)
|
||||
{
|
||||
while (parseOneHeaderLine(header, nlines))
|
||||
{ }
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
void Binc::MimePart::analyzeHeader(Binc::Header *header, bool *multipart,
|
||||
bool *messagerfc822, string *subtype,
|
||||
string *boundary)
|
||||
{
|
||||
using namespace ::Binc;
|
||||
|
||||
// Do simple parsing of headers to determine the
|
||||
// type of message (multipart,messagerfc822 etc)
|
||||
HeaderItem ctype;
|
||||
if (header->getFirstHeader("content-type", ctype)) {
|
||||
vector<string> types;
|
||||
split(ctype.getValue(), ";", types);
|
||||
|
||||
if (types.size() > 0) {
|
||||
// first element should describe content type
|
||||
string tmp = types[0];
|
||||
trim(tmp);
|
||||
vector<string> v;
|
||||
split(tmp, "/", v);
|
||||
string key, value;
|
||||
|
||||
key = (v.size() > 0) ? v[0] : "text";
|
||||
value = (v.size() > 1) ? v[1] : "plain";
|
||||
lowercase(key);
|
||||
|
||||
if (key == "multipart") {
|
||||
*multipart = true;
|
||||
lowercase(value);
|
||||
*subtype = value;
|
||||
} else if (key == "message") {
|
||||
lowercase(value);
|
||||
if (value == "rfc822")
|
||||
*messagerfc822 = true;
|
||||
}
|
||||
}
|
||||
|
||||
for (vector<string>::const_iterator i = types.begin();
|
||||
i != types.end(); ++i) {
|
||||
string element = *i;
|
||||
trim(element);
|
||||
|
||||
if (element.find("=") != string::npos) {
|
||||
string::size_type pos = element.find('=');
|
||||
string key = element.substr(0, pos);
|
||||
string value = element.substr(pos + 1);
|
||||
|
||||
lowercase(key);
|
||||
trim(key);
|
||||
|
||||
if (key == "boundary") {
|
||||
trim(value, " \"");
|
||||
*boundary = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Binc::MimePart::parseMessageRFC822(vector<Binc::MimePart> *members,
|
||||
bool *foundendofpart,
|
||||
unsigned int *bodylength,
|
||||
unsigned int *nbodylines,
|
||||
const string &toboundary)
|
||||
{
|
||||
using namespace ::Binc;
|
||||
|
||||
// message rfc822 means a completely enclosed mime document. we
|
||||
// call the parser recursively, and pass on the boundary string
|
||||
// that we got. when parse() finds this boundary, it returns 0. if
|
||||
// it finds the end boundary (boundary + "--"), it returns != 0.
|
||||
MimePart m;
|
||||
|
||||
unsigned int bodystartoffsetcrlf = mimeSource->getOffset();
|
||||
|
||||
// parsefull returns the number of bytes that need to be removed
|
||||
// from the body because of the terminating boundary string.
|
||||
int bsize = 0;
|
||||
if (m.doParseFull(mimeSource, toboundary, bsize))
|
||||
*foundendofpart = true;
|
||||
|
||||
// make sure bodylength doesn't overflow
|
||||
*bodylength = mimeSource->getOffset();
|
||||
if (*bodylength >= bodystartoffsetcrlf) {
|
||||
*bodylength -= bodystartoffsetcrlf;
|
||||
if (*bodylength >= (unsigned int) bsize) {
|
||||
*bodylength -= (unsigned int) bsize;
|
||||
} else {
|
||||
*bodylength = 0;
|
||||
}
|
||||
} else {
|
||||
*bodylength = 0;
|
||||
}
|
||||
|
||||
*nbodylines += m.getNofLines();
|
||||
|
||||
members->push_back(m);
|
||||
}
|
||||
|
||||
bool Binc::MimePart::skipUntilBoundary(const string &delimiter,
|
||||
unsigned int *nlines, bool *eof)
|
||||
{
|
||||
string::size_type endpos = delimiter.length();
|
||||
char *delimiterqueue = 0;
|
||||
string::size_type delimiterpos = 0;
|
||||
const char *delimiterStr = delimiter.c_str();
|
||||
if (delimiter != "") {
|
||||
delimiterqueue = new char[endpos];
|
||||
memset(delimiterqueue, 0, endpos);
|
||||
}
|
||||
|
||||
// first, skip to the first delimiter string. Anything between the
|
||||
// header and the first delimiter string is simply ignored (it's
|
||||
// usually a text message intended for non-mime clients)
|
||||
char c;
|
||||
|
||||
bool foundBoundary = false;
|
||||
for (;;) {
|
||||
if (!mimeSource->getChar(&c)) {
|
||||
*eof = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if (c == '\n')
|
||||
++*nlines;
|
||||
|
||||
// if there is no delimiter, we just read until the end of the
|
||||
// file.
|
||||
if (!delimiterqueue)
|
||||
continue;
|
||||
|
||||
delimiterqueue[delimiterpos++] = c;
|
||||
if (delimiterpos == endpos)
|
||||
delimiterpos = 0;
|
||||
|
||||
if (compareStringToQueue(delimiterStr, delimiterqueue,
|
||||
delimiterpos, int(endpos))) {
|
||||
foundBoundary = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
delete [] delimiterqueue;
|
||||
delimiterqueue = 0;
|
||||
|
||||
return foundBoundary;
|
||||
}
|
||||
|
||||
// JFD: Things we do after finding a boundary (something like CRLF--somestring)
|
||||
// Need to see if this is a final one (with an additional -- at the end),
|
||||
// and need to check if it is immediately followed by another boundary
|
||||
// (in this case, we give up our final CRLF in its favour)
|
||||
inline void Binc::MimePart::postBoundaryProcessing(bool *eof,
|
||||
unsigned int *nlines,
|
||||
int *boundarysize,
|
||||
bool *foundendofpart)
|
||||
{
|
||||
// Read two more characters. This may be CRLF, it may be "--" and
|
||||
// it may be any other two characters.
|
||||
char a = '\0';
|
||||
if (!mimeSource->getChar(&a))
|
||||
*eof = true;
|
||||
if (a == '\n')
|
||||
++*nlines;
|
||||
|
||||
char b = '\0';
|
||||
if (!mimeSource->getChar(&b))
|
||||
*eof = true;
|
||||
if (b == '\n')
|
||||
++*nlines;
|
||||
|
||||
// If eof, we're done here
|
||||
if (*eof)
|
||||
return;
|
||||
|
||||
// If we find two dashes after the boundary, then this is the end
|
||||
// of boundary marker, and we need to get 2 more chars
|
||||
if (a == '-' && b == '-') {
|
||||
*foundendofpart = true;
|
||||
*boundarysize += 2;
|
||||
|
||||
if (!mimeSource->getChar(&a))
|
||||
*eof = true;
|
||||
if (a == '\n')
|
||||
++*nlines;
|
||||
|
||||
if (!mimeSource->getChar(&b))
|
||||
*eof = true;
|
||||
if (b == '\n')
|
||||
++*nlines;
|
||||
}
|
||||
|
||||
// If the boundary is followed by CRLF, we need to handle the
|
||||
// special case where another boundary line follows
|
||||
// immediately. In this case we consider the CRLF to be part of
|
||||
// the NEXT boundary.
|
||||
if (a == '\r' && b == '\n') {
|
||||
// Get 2 more
|
||||
if (!mimeSource->getChar(&a) || !mimeSource->getChar(&b)) {
|
||||
*eof = true;
|
||||
} else if (a == '-' && b == '-') {
|
||||
MPFDEB((stderr, "BINC: consecutive delimiters, giving up CRLF\n"));
|
||||
mimeSource->ungetChar();
|
||||
mimeSource->ungetChar();
|
||||
mimeSource->ungetChar();
|
||||
mimeSource->ungetChar();
|
||||
} else {
|
||||
// We unget the 2 chars, and keep our crlf (increasing our own size)
|
||||
MPFDEB((stderr, "BINC: keeping my CRLF\n"));
|
||||
mimeSource->ungetChar();
|
||||
mimeSource->ungetChar();
|
||||
*boundarysize += 2;
|
||||
}
|
||||
|
||||
} else {
|
||||
// Boundary string not followed by CRLF, don't read more and let
|
||||
// others skip the rest. Note that this is allowed but quite uncommon
|
||||
mimeSource->ungetChar();
|
||||
mimeSource->ungetChar();
|
||||
}
|
||||
}
|
||||
|
||||
void Binc::MimePart::parseMultipart(const string &boundary,
|
||||
const string &toboundary,
|
||||
bool *eof,
|
||||
unsigned int *nlines,
|
||||
int *boundarysize,
|
||||
bool *foundendofpart,
|
||||
unsigned int *bodylength,
|
||||
vector<Binc::MimePart> *members)
|
||||
{
|
||||
MPFDEB((stderr, "BINC: ParseMultipart: boundary [%s], toboundary[%s]\n",
|
||||
boundary.c_str(),
|
||||
toboundary.c_str()));
|
||||
using namespace ::Binc;
|
||||
unsigned int bodystartoffsetcrlf = mimeSource->getOffset();
|
||||
|
||||
// multipart parsing starts with skipping to the first
|
||||
// boundary. then we call parse() for all parts. the last parse()
|
||||
// command will return a code indicating that it found the last
|
||||
// boundary of this multipart. Note that the first boundary does
|
||||
// not have to start with CRLF.
|
||||
string delimiter = "--" + boundary;
|
||||
|
||||
skipUntilBoundary(delimiter, nlines, eof);
|
||||
|
||||
if (!eof)
|
||||
*boundarysize = int(delimiter.size());
|
||||
|
||||
postBoundaryProcessing(eof, nlines, boundarysize, foundendofpart);
|
||||
|
||||
// read all mime parts.
|
||||
if (!*foundendofpart && !*eof) {
|
||||
bool quit = false;
|
||||
do {
|
||||
MimePart m;
|
||||
|
||||
// If parseFull returns != 0, then it encountered the multipart's
|
||||
// final boundary.
|
||||
int bsize = 0;
|
||||
if (m.doParseFull(mimeSource, boundary, bsize)) {
|
||||
quit = true;
|
||||
*boundarysize = bsize;
|
||||
}
|
||||
|
||||
members->push_back(m);
|
||||
|
||||
} while (!quit);
|
||||
}
|
||||
|
||||
if (!*foundendofpart && !*eof) {
|
||||
// multipart parsing starts with skipping to the first
|
||||
// boundary. then we call parse() for all parts. the last parse()
|
||||
// command will return a code indicating that it found the last
|
||||
// boundary of this multipart. Note that the first boundary does
|
||||
// not have to start with CRLF.
|
||||
string delimiter = "\r\n--" + toboundary;
|
||||
skipUntilBoundary(delimiter, nlines, eof);
|
||||
|
||||
if (!*eof)
|
||||
*boundarysize = int(delimiter.size());
|
||||
|
||||
postBoundaryProcessing(eof, nlines, boundarysize, foundendofpart);
|
||||
}
|
||||
|
||||
// make sure bodylength doesn't overflow
|
||||
*bodylength = mimeSource->getOffset();
|
||||
if (*bodylength >= bodystartoffsetcrlf) {
|
||||
*bodylength -= bodystartoffsetcrlf;
|
||||
if (*bodylength >= (unsigned int) *boundarysize) {
|
||||
*bodylength -= (unsigned int) *boundarysize;
|
||||
} else {
|
||||
*bodylength = 0;
|
||||
}
|
||||
} else {
|
||||
*bodylength = 0;
|
||||
}
|
||||
MPFDEB((stderr, "BINC: ParseMultipart return\n"));
|
||||
}
|
||||
|
||||
void Binc::MimePart::parseSinglePart(const string &toboundary,
|
||||
int *boundarysize,
|
||||
unsigned int *nbodylines,
|
||||
unsigned int *nlines,
|
||||
bool *eof, bool *foundendofpart,
|
||||
unsigned int *bodylength)
|
||||
{
|
||||
MPFDEB((stderr, "BINC: parseSinglePart, boundary [%s]\n",
|
||||
toboundary.c_str()));
|
||||
using namespace ::Binc;
|
||||
unsigned int bodystartoffsetcrlf = mimeSource->getOffset();
|
||||
|
||||
// If toboundary is empty, then we read until the end of the
|
||||
// file. Otherwise we will read until we encounter toboundary.
|
||||
string _toboundary;
|
||||
if (toboundary != "") {
|
||||
_toboundary = "\r\n--";
|
||||
_toboundary += toboundary;
|
||||
}
|
||||
|
||||
// if (skipUntilBoundary(_toboundary, nlines, eof))
|
||||
// *boundarysize = _toboundary.length();
|
||||
|
||||
char *boundaryqueue = 0;
|
||||
size_t endpos = _toboundary.length();
|
||||
if (toboundary != "") {
|
||||
boundaryqueue = new char[endpos];
|
||||
memset(boundaryqueue, 0, endpos);
|
||||
}
|
||||
|
||||
*boundarysize = 0;
|
||||
|
||||
const char *_toboundaryStr = _toboundary.c_str();
|
||||
string line;
|
||||
bool toboundaryIsEmpty = (toboundary == "");
|
||||
char c;
|
||||
string::size_type boundarypos = 0;
|
||||
while (mimeSource->getChar(&c)) {
|
||||
if (c == '\n') { ++*nbodylines; ++*nlines; }
|
||||
|
||||
if (toboundaryIsEmpty)
|
||||
continue;
|
||||
|
||||
// find boundary
|
||||
boundaryqueue[boundarypos++] = c;
|
||||
if (boundarypos == endpos)
|
||||
boundarypos = 0;
|
||||
|
||||
if (compareStringToQueue(_toboundaryStr, boundaryqueue,
|
||||
boundarypos, int(endpos))) {
|
||||
*boundarysize = static_cast<int>(_toboundary.length());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
delete [] boundaryqueue;
|
||||
|
||||
if (toboundary != "") {
|
||||
postBoundaryProcessing(eof, nlines, boundarysize, foundendofpart);
|
||||
} else {
|
||||
// Recoll: in the case of a multipart body with a null
|
||||
// boundary (probably illegal but wtf), eof was not set and
|
||||
// multipart went into a loop until bad alloc.
|
||||
*eof = true;
|
||||
}
|
||||
|
||||
// make sure bodylength doesn't overflow
|
||||
*bodylength = mimeSource->getOffset();
|
||||
if (*bodylength >= bodystartoffsetcrlf) {
|
||||
*bodylength -= bodystartoffsetcrlf;
|
||||
if (*bodylength >= (unsigned int) *boundarysize) {
|
||||
*bodylength -= (unsigned int) *boundarysize;
|
||||
} else {
|
||||
*bodylength = 0;
|
||||
}
|
||||
} else {
|
||||
*bodylength = 0;
|
||||
}
|
||||
MPFDEB((stderr, "BINC: parseSimple ret: bodylength %d, boundarysize %d\n",
|
||||
*bodylength, *boundarysize));
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
int Binc::MimePart::doParseFull(MimeInputSource *ms, const string &toboundary,
|
||||
int &boundarysize)
|
||||
{
|
||||
MPFDEB((stderr, "BINC: doParsefull, toboundary[%s]\n", toboundary.c_str()));
|
||||
mimeSource = ms;
|
||||
headerstartoffsetcrlf = mimeSource->getOffset();
|
||||
|
||||
// Parse the header of this mime part.
|
||||
parseHeader(&h, &nlines);
|
||||
|
||||
// Headerlength includes the seperating CRLF. Body starts after the
|
||||
// CRLF.
|
||||
headerlength = mimeSource->getOffset() - headerstartoffsetcrlf;
|
||||
bodystartoffsetcrlf = mimeSource->getOffset();
|
||||
MPFDEB((stderr, "BINC: doParsefull, bodystartoffsetcrlf %d\n", bodystartoffsetcrlf));
|
||||
bodylength = 0;
|
||||
|
||||
// Determine the type of mime part by looking at fields in the
|
||||
// header.
|
||||
analyzeHeader(&h, &multipart, &messagerfc822, &subtype, &boundary);
|
||||
|
||||
bool eof = false;
|
||||
bool foundendofpart = false;
|
||||
|
||||
if (messagerfc822) {
|
||||
parseMessageRFC822(&members, &foundendofpart, &bodylength,
|
||||
&nbodylines, toboundary);
|
||||
|
||||
} else if (multipart) {
|
||||
parseMultipart(boundary, toboundary, &eof, &nlines, &boundarysize,
|
||||
&foundendofpart, &bodylength,
|
||||
&members);
|
||||
} else {
|
||||
parseSinglePart(toboundary, &boundarysize, &nbodylines, &nlines,
|
||||
&eof, &foundendofpart, &bodylength);
|
||||
}
|
||||
|
||||
MPFDEB((stderr, "BINC: doParsefull ret, toboundary[%s]\n", toboundary.c_str()));
|
||||
return (eof || foundendofpart) ? 1 : 0;
|
||||
}
|
189
src/bincimapmime/mime-parseonlyheader.cc
Normal file
189
src/bincimapmime/mime-parseonlyheader.cc
Normal file
|
@ -0,0 +1,189 @@
|
|||
/* -*- mode:c++;c-basic-offset:2 -*- */
|
||||
/* --------------------------------------------------------------------
|
||||
* Filename:
|
||||
* mime-parseonlyheader.cc
|
||||
*
|
||||
* Description:
|
||||
* Implementation of main mime parser components
|
||||
* --------------------------------------------------------------------
|
||||
* Copyright 2002-2005 Andreas Aardal Hanssen
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
|
||||
* --------------------------------------------------------------------
|
||||
*/
|
||||
#include "mime.h"
|
||||
#include "mime-utils.h"
|
||||
#include "mime-inputsource.h"
|
||||
#include "convert.h"
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
#include <exception>
|
||||
#include <iostream>
|
||||
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
|
||||
#ifndef NO_NAMESPACES
|
||||
using namespace ::std;
|
||||
#endif /* NO_NAMESPACES */
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
void Binc::MimeDocument::parseOnlyHeader(int fd)
|
||||
{
|
||||
if (allIsParsed || headerIsParsed)
|
||||
return;
|
||||
|
||||
headerIsParsed = true;
|
||||
|
||||
delete doc_mimeSource;
|
||||
doc_mimeSource = new MimeInputSource(fd);
|
||||
|
||||
headerstartoffsetcrlf = 0;
|
||||
headerlength = 0;
|
||||
bodystartoffsetcrlf = 0;
|
||||
bodylength = 0;
|
||||
messagerfc822 = false;
|
||||
multipart = false;
|
||||
|
||||
nlines = 0;
|
||||
nbodylines = 0;
|
||||
|
||||
doParseOnlyHeader(doc_mimeSource, "");
|
||||
}
|
||||
|
||||
void Binc::MimeDocument::parseOnlyHeader(istream& s)
|
||||
{
|
||||
if (allIsParsed || headerIsParsed)
|
||||
return;
|
||||
|
||||
headerIsParsed = true;
|
||||
|
||||
delete doc_mimeSource;
|
||||
doc_mimeSource = new MimeInputSourceStream(s);
|
||||
|
||||
headerstartoffsetcrlf = 0;
|
||||
headerlength = 0;
|
||||
bodystartoffsetcrlf = 0;
|
||||
bodylength = 0;
|
||||
messagerfc822 = false;
|
||||
multipart = false;
|
||||
|
||||
nlines = 0;
|
||||
nbodylines = 0;
|
||||
|
||||
doParseOnlyHeader(doc_mimeSource, "");
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
int Binc::MimePart::doParseOnlyHeader(MimeInputSource *ms,
|
||||
const string &toboundary)
|
||||
{
|
||||
mimeSource = ms;
|
||||
string name;
|
||||
string content;
|
||||
char cqueue[4];
|
||||
memset(cqueue, 0, sizeof(cqueue));
|
||||
|
||||
headerstartoffsetcrlf = mimeSource->getOffset();
|
||||
|
||||
bool quit = false;
|
||||
char c = '\0';
|
||||
|
||||
while (!quit) {
|
||||
// read name
|
||||
while (1) {
|
||||
if (!mimeSource->getChar(&c)) {
|
||||
quit = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if (c == '\n') ++nlines;
|
||||
if (c == ':') break;
|
||||
if (c == '\n') {
|
||||
for (int i = int(name.length()) - 1; i >= 0; --i)
|
||||
mimeSource->ungetChar();
|
||||
|
||||
quit = true;
|
||||
name.clear();
|
||||
break;
|
||||
}
|
||||
|
||||
name += c;
|
||||
|
||||
if (name.length() == 2 && name.substr(0, 2) == "\r\n") {
|
||||
name.clear();
|
||||
quit = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (name.length() == 1 && name[0] == '\r') {
|
||||
name.clear();
|
||||
break;
|
||||
}
|
||||
|
||||
if (quit) break;
|
||||
|
||||
while (!quit) {
|
||||
if (!mimeSource->getChar(&c)) {
|
||||
quit = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if (c == '\n') ++nlines;
|
||||
|
||||
for (int i = 0; i < 3; ++i)
|
||||
cqueue[i] = cqueue[i + 1];
|
||||
cqueue[3] = c;
|
||||
|
||||
if (strncmp(cqueue, "\r\n\r\n", 4) == 0) {
|
||||
quit = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if (cqueue[2] == '\n') {
|
||||
|
||||
// guess the mime rfc says what can not appear on the beginning
|
||||
// of a line.
|
||||
if (!isspace(cqueue[3])) {
|
||||
if (content.length() > 2)
|
||||
content.resize(content.length() - 2);
|
||||
|
||||
trim(content);
|
||||
h.add(name, content);
|
||||
|
||||
name = c;
|
||||
content.clear();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
content += c;
|
||||
}
|
||||
}
|
||||
|
||||
if (name != "") {
|
||||
if (content.length() > 2)
|
||||
content.resize(content.length() - 2);
|
||||
h.add(name, content);
|
||||
}
|
||||
|
||||
headerlength = mimeSource->getOffset() - headerstartoffsetcrlf;
|
||||
|
||||
return 1;
|
||||
}
|
52
src/bincimapmime/mime-printbody.cc
Normal file
52
src/bincimapmime/mime-printbody.cc
Normal file
|
@ -0,0 +1,52 @@
|
|||
/* -*- mode:c++;c-basic-offset:2 -*- */
|
||||
/* --------------------------------------------------------------------
|
||||
* Filename:
|
||||
* mime-printbody.cc
|
||||
*
|
||||
* Description:
|
||||
* Implementation of main mime parser components
|
||||
* --------------------------------------------------------------------
|
||||
* Copyright 2002-2005 Andreas Aardal Hanssen
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
|
||||
* --------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#include "mime.h"
|
||||
#include "mime-utils.h"
|
||||
#include "mime-inputsource.h"
|
||||
|
||||
#include <string>
|
||||
|
||||
using namespace ::std;
|
||||
|
||||
void Binc::MimePart::getBody(string &s,
|
||||
unsigned int startoffset,
|
||||
unsigned int length) const
|
||||
{
|
||||
mimeSource->reset();
|
||||
mimeSource->seek(bodystartoffsetcrlf + startoffset);
|
||||
s.reserve(length);
|
||||
if (startoffset + length > bodylength)
|
||||
length = bodylength - startoffset;
|
||||
|
||||
char c = '\0';
|
||||
for (unsigned int i = 0; i < length; ++i) {
|
||||
if (!mimeSource->getChar(&c))
|
||||
break;
|
||||
|
||||
s += (char)c;
|
||||
}
|
||||
}
|
50
src/bincimapmime/mime-utils.h
Normal file
50
src/bincimapmime/mime-utils.h
Normal file
|
@ -0,0 +1,50 @@
|
|||
/* -*- mode:c++;c-basic-offset:2 -*- */
|
||||
/* --------------------------------------------------------------------
|
||||
* Filename:
|
||||
* mime.cc
|
||||
*
|
||||
* Description:
|
||||
* Implementation of main mime parser components
|
||||
* --------------------------------------------------------------------
|
||||
* Copyright 2002-2005 Andreas Aardal Hanssen
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
|
||||
* --------------------------------------------------------------------
|
||||
*/
|
||||
#ifndef mime_utils_h_included
|
||||
#define mime_utils_h_included
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
|
||||
#ifndef NO_NAMESPACES
|
||||
using namespace ::std;
|
||||
#endif /* NO_NAMESPACES */
|
||||
|
||||
inline bool compareStringToQueue(const char *s_in, char *bqueue,
|
||||
int pos, int size)
|
||||
{
|
||||
for (int i = 0; i < size; ++i) {
|
||||
if (s_in[i] != bqueue[pos])
|
||||
return false;
|
||||
if (++pos == size)
|
||||
pos = 0;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif
|
164
src/bincimapmime/mime.cc
Normal file
164
src/bincimapmime/mime.cc
Normal file
|
@ -0,0 +1,164 @@
|
|||
/* -*- mode:c++;c-basic-offset:2 -*- */
|
||||
/* --------------------------------------------------------------------
|
||||
* Filename:
|
||||
* mime.cc
|
||||
*
|
||||
* Description:
|
||||
* Implementation of main mime parser components
|
||||
* --------------------------------------------------------------------
|
||||
* Copyright 2002-2005 Andreas Aardal Hanssen
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
|
||||
* --------------------------------------------------------------------
|
||||
*/
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
#include <exception>
|
||||
#include <iostream>
|
||||
#ifndef NO_NAMESPACES
|
||||
using namespace ::std;
|
||||
#endif /* NO_NAMESPACES */
|
||||
|
||||
|
||||
#include "mime.h"
|
||||
#include "convert.h"
|
||||
#include "mime-inputsource.h"
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
Binc::MimeDocument::MimeDocument(void)
|
||||
{
|
||||
allIsParsed = false;
|
||||
headerIsParsed = false;
|
||||
doc_mimeSource = 0;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
Binc::MimeDocument::~MimeDocument(void)
|
||||
{
|
||||
delete doc_mimeSource;
|
||||
doc_mimeSource = 0;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
void Binc::MimeDocument::clear(void)
|
||||
{
|
||||
members.clear();
|
||||
h.clear();
|
||||
headerIsParsed = false;
|
||||
allIsParsed = false;
|
||||
delete doc_mimeSource;
|
||||
doc_mimeSource = 0;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
void Binc::MimePart::clear(void)
|
||||
{
|
||||
members.clear();
|
||||
h.clear();
|
||||
mimeSource = 0;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
Binc::MimePart::MimePart(void)
|
||||
{
|
||||
size = 0;
|
||||
messagerfc822 = false;
|
||||
multipart = false;
|
||||
|
||||
nlines = 0;
|
||||
nbodylines = 0;
|
||||
mimeSource = 0;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
Binc::MimePart::~MimePart(void)
|
||||
{
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
Binc::HeaderItem::HeaderItem(void)
|
||||
{
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
Binc::HeaderItem::HeaderItem(const string &key, const string &value)
|
||||
{
|
||||
this->key = key;
|
||||
this->value = value;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
Binc::Header::Header(void)
|
||||
{
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
Binc::Header::~Header(void)
|
||||
{
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
bool Binc::Header::getFirstHeader(const string &key, HeaderItem &dest) const
|
||||
{
|
||||
string k = key;
|
||||
lowercase(k);
|
||||
|
||||
for (vector<HeaderItem>::const_iterator i = content.begin();
|
||||
i != content.end(); ++i) {
|
||||
string tmp = (*i).getKey();
|
||||
lowercase(tmp);
|
||||
|
||||
if (tmp == k) {
|
||||
dest = *i;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
bool Binc::Header::getAllHeaders(const string &key, vector<HeaderItem> &dest) const
|
||||
{
|
||||
string k = key;
|
||||
lowercase(k);
|
||||
|
||||
for (vector<HeaderItem>::const_iterator i = content.begin();
|
||||
i != content.end(); ++i) {
|
||||
string tmp = (*i).getKey();
|
||||
lowercase(tmp);
|
||||
if (tmp == k)
|
||||
dest.push_back(*i);
|
||||
}
|
||||
|
||||
return (dest.size() != 0);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
void Binc::Header::clear(void)
|
||||
{
|
||||
content.clear();
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
void Binc::Header::add(const string &key, const string &value)
|
||||
{
|
||||
content.push_back(HeaderItem(key, value));
|
||||
}
|
187
src/bincimapmime/mime.h
Normal file
187
src/bincimapmime/mime.h
Normal file
|
@ -0,0 +1,187 @@
|
|||
/* -*- mode:c++;c-basic-offset:2 -*- */
|
||||
/* --------------------------------------------------------------------
|
||||
* Filename:
|
||||
* src/parsers/mime/mime.h
|
||||
*
|
||||
* Description:
|
||||
* Declaration of main mime parser components
|
||||
* --------------------------------------------------------------------
|
||||
* Copyright 2002-2005 Andreas Aardal Hanssen
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
|
||||
* --------------------------------------------------------------------
|
||||
*/
|
||||
#ifndef mime_h_included
|
||||
#define mime_h_included
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
#include <stdio.h>
|
||||
|
||||
namespace Binc {
|
||||
|
||||
class MimeInputSource;
|
||||
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
class HeaderItem {
|
||||
private:
|
||||
mutable std::string key;
|
||||
mutable std::string value;
|
||||
|
||||
public:
|
||||
inline const std::string &getKey(void) const { return key; }
|
||||
inline const std::string &getValue(void) const { return value; }
|
||||
|
||||
//--
|
||||
HeaderItem(void);
|
||||
HeaderItem(const std::string &key, const std::string &value);
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
class Header {
|
||||
private:
|
||||
mutable std::vector<HeaderItem> content;
|
||||
|
||||
public:
|
||||
bool getFirstHeader(const std::string &key, HeaderItem &dest) const;
|
||||
bool getAllHeaders(const std::string &key, std::vector<HeaderItem> &dest) const;
|
||||
void add(const std::string &name, const std::string &content);
|
||||
void clear(void);
|
||||
|
||||
//--
|
||||
Header(void);
|
||||
~Header(void);
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
class IODevice;
|
||||
class MimeDocument;
|
||||
class MimePart {
|
||||
protected:
|
||||
public:
|
||||
mutable bool multipart;
|
||||
mutable bool messagerfc822;
|
||||
mutable std::string subtype;
|
||||
mutable std::string boundary;
|
||||
|
||||
mutable unsigned int headerstartoffsetcrlf;
|
||||
mutable unsigned int headerlength;
|
||||
|
||||
mutable unsigned int bodystartoffsetcrlf;
|
||||
mutable unsigned int bodylength;
|
||||
mutable unsigned int nlines;
|
||||
mutable unsigned int nbodylines;
|
||||
mutable unsigned int size;
|
||||
|
||||
public:
|
||||
enum FetchType {
|
||||
FetchBody,
|
||||
FetchHeader,
|
||||
FetchMime
|
||||
};
|
||||
|
||||
mutable Header h;
|
||||
|
||||
mutable std::vector<MimePart> members;
|
||||
|
||||
inline const std::string &getSubType(void) const { return subtype; }
|
||||
inline bool isMultipart(void) const { return multipart; }
|
||||
inline bool isMessageRFC822(void) const { return messagerfc822; }
|
||||
inline unsigned int getSize(void) const { return bodylength; }
|
||||
inline unsigned int getNofLines(void) const { return nlines; }
|
||||
inline unsigned int getNofBodyLines(void) const { return nbodylines; }
|
||||
inline unsigned int getBodyLength(void) const { return bodylength; }
|
||||
inline unsigned int getBodyStartOffset(void) const { return bodystartoffsetcrlf; }
|
||||
|
||||
void printBody(Binc::IODevice &output, unsigned int startoffset, unsigned int length) const;
|
||||
void getBody(std::string& s, unsigned int startoffset, unsigned int length) const;
|
||||
virtual void clear(void);
|
||||
|
||||
virtual int doParseOnlyHeader(MimeInputSource *ms,
|
||||
const std::string &toboundary);
|
||||
virtual int doParseFull(MimeInputSource *ms,
|
||||
const std::string &toboundary, int &boundarysize);
|
||||
|
||||
MimePart(void);
|
||||
virtual ~MimePart(void);
|
||||
|
||||
private:
|
||||
MimeInputSource *mimeSource;
|
||||
|
||||
bool parseOneHeaderLine(Binc::Header *header, unsigned int *nlines);
|
||||
|
||||
bool skipUntilBoundary(const std::string &delimiter,
|
||||
unsigned int *nlines, bool *eof);
|
||||
inline void postBoundaryProcessing(bool *eof,
|
||||
unsigned int *nlines,
|
||||
int *boundarysize,
|
||||
bool *foundendofpart);
|
||||
void parseMultipart(const std::string &boundary,
|
||||
const std::string &toboundary,
|
||||
bool *eof,
|
||||
unsigned int *nlines,
|
||||
int *boundarysize,
|
||||
bool *foundendofpart,
|
||||
unsigned int *bodylength,
|
||||
std::vector<Binc::MimePart> *members);
|
||||
void parseSinglePart(const std::string &toboundary,
|
||||
int *boundarysize,
|
||||
unsigned int *nbodylines,
|
||||
unsigned int *nlines,
|
||||
bool *eof, bool *foundendofpart,
|
||||
unsigned int *bodylength);
|
||||
void parseHeader(Binc::Header *header, unsigned int *nlines);
|
||||
void analyzeHeader(Binc::Header *header, bool *multipart,
|
||||
bool *messagerfc822, std::string *subtype,
|
||||
std::string *boundary);
|
||||
void parseMessageRFC822(std::vector<Binc::MimePart> *members,
|
||||
bool *foundendofpart,
|
||||
unsigned int *bodylength,
|
||||
unsigned int *nbodylines,
|
||||
const std::string &toboundary);
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
class MimeDocument : public MimePart {
|
||||
public:
|
||||
MimeDocument(void);
|
||||
~MimeDocument(void);
|
||||
|
||||
void parseOnlyHeader(int fd);
|
||||
void parseFull(int fd);
|
||||
void parseOnlyHeader(std::istream& s);
|
||||
void parseFull(std::istream& s);
|
||||
|
||||
void clear(void);
|
||||
|
||||
bool isHeaderParsed(void) const
|
||||
{
|
||||
return headerIsParsed;
|
||||
}
|
||||
bool isAllParsed(void) const
|
||||
{
|
||||
return allIsParsed;
|
||||
}
|
||||
|
||||
private:
|
||||
bool headerIsParsed;
|
||||
bool allIsParsed;
|
||||
MimeInputSource *doc_mimeSource;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
#endif
|
126
src/bincimapmime/trbinc.cc
Normal file
126
src/bincimapmime/trbinc.cc
Normal file
|
@ -0,0 +1,126 @@
|
|||
/* Copyright (C) 2006 J.F.Dockes
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the
|
||||
* Free Software Foundation, Inc.,
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <errno.h>
|
||||
#include "safefcntl.h"
|
||||
#include "safeunistd.h"
|
||||
#include <string.h>
|
||||
|
||||
#include <sstream>
|
||||
|
||||
#ifndef NO_NAMESPACES
|
||||
using namespace std;
|
||||
#endif /* NO_NAMESPACES */
|
||||
|
||||
#include "mime.h"
|
||||
|
||||
static char *thisprog;
|
||||
|
||||
static char usage [] =
|
||||
"trbinc <mboxfile> \n\n"
|
||||
;
|
||||
static void
|
||||
Usage(void)
|
||||
{
|
||||
fprintf(stderr, "%s: usage:\n%s", thisprog, usage);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
static int op_flags;
|
||||
#define OPT_MOINS 0x1
|
||||
#define OPT_s 0x2
|
||||
#define OPT_b 0x4
|
||||
|
||||
#define DEFCOUNT 10
|
||||
|
||||
const char *hnames[] = {"Subject", "Content-type"};
|
||||
int nh = sizeof(hnames) / sizeof(char *);
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
int count = DEFCOUNT;
|
||||
|
||||
thisprog = argv[0];
|
||||
argc--; argv++;
|
||||
|
||||
while (argc > 0 && **argv == '-') {
|
||||
(*argv)++;
|
||||
if (!(**argv))
|
||||
/* Cas du "adb - core" */
|
||||
Usage();
|
||||
while (**argv)
|
||||
switch (*(*argv)++) {
|
||||
case 's': op_flags |= OPT_s; break;
|
||||
case 'b': op_flags |= OPT_b; if (argc < 2) Usage();
|
||||
if ((sscanf(*(++argv), "%d", &count)) != 1)
|
||||
Usage();
|
||||
argc--;
|
||||
goto b1;
|
||||
default: Usage(); break;
|
||||
}
|
||||
b1: argc--; argv++;
|
||||
}
|
||||
|
||||
if (argc != 1)
|
||||
Usage();
|
||||
|
||||
char *mfile = *argv++;argc--;
|
||||
int fd;
|
||||
if ((fd = open(mfile, 0)) < 0) {
|
||||
perror("Opening");
|
||||
exit(1);
|
||||
}
|
||||
Binc::MimeDocument doc;
|
||||
|
||||
#if 0
|
||||
doc.parseFull(fd);
|
||||
#else
|
||||
char *cp;
|
||||
int size = lseek(fd, 0, SEEK_END);
|
||||
lseek(fd, 0, 0);
|
||||
fprintf(stderr, "Size: %d\n", size);
|
||||
cp = (char *)malloc(size);
|
||||
if (cp==0) {
|
||||
fprintf(stderr, "Malloc %d failed\n", size);
|
||||
exit(1);
|
||||
}
|
||||
int n;
|
||||
if ((n=read(fd, cp, size)) != size) {
|
||||
fprintf(stderr, "Read failed: requested %d, got %d\n", size, n);
|
||||
exit(1);
|
||||
}
|
||||
std::stringstream s(string(cp, size), ios::in);
|
||||
doc.parseFull(s);
|
||||
#endif
|
||||
|
||||
if (!doc.isHeaderParsed() && !doc.isAllParsed()) {
|
||||
fprintf(stderr, "Parse error\n");
|
||||
exit(1);
|
||||
}
|
||||
close(fd);
|
||||
Binc::HeaderItem hi;
|
||||
for (int i = 0; i < nh ; i++) {
|
||||
if (!doc.h.getFirstHeader(hnames[i], hi)) {
|
||||
fprintf(stderr, "No %s\n", hnames[i]);
|
||||
exit(1);
|
||||
}
|
||||
printf("%s: %s\n", hnames[i], hi.getValue().c_str());
|
||||
}
|
||||
exit(0);
|
||||
}
|
33
src/common/Makefile
Normal file
33
src/common/Makefile
Normal file
|
@ -0,0 +1,33 @@
|
|||
|
||||
PROGS = unacpp textsplit rclconfig syngroups
|
||||
|
||||
all: $(PROGS)
|
||||
|
||||
UNACPP_OBJS= trunacpp.o
|
||||
unacpp : $(UNACPP_OBJS)
|
||||
$(CXX) $(ALL_CXXFLAGS) -o unacpp $(UNACPP_OBJS) $(LIBRECOLL)
|
||||
trunacpp.o : unacpp.cpp unacpp.h
|
||||
$(CXX) $(ALL_CXXFLAGS) -DTEST_UNACPP -c -o trunacpp.o unacpp.cpp
|
||||
|
||||
TEXTSPLIT_OBJS= trtextsplit.o
|
||||
textsplit : $(TEXTSPLIT_OBJS)
|
||||
$(CXX) $(ALL_CXXFLAGS) -o textsplit $(TEXTSPLIT_OBJS) $(LIBRECOLL)
|
||||
trtextsplit.o : textsplit.cpp
|
||||
$(CXX) $(ALL_CXXFLAGS) -DTEST_TEXTSPLIT -c -o trtextsplit.o \
|
||||
textsplit.cpp
|
||||
|
||||
RCLCONFIG_OBJS= trrclconfig.o
|
||||
rclconfig : $(RCLCONFIG_OBJS)
|
||||
$(CXX) $(ALL_CXXFLAGS) -o rclconfig $(RCLCONFIG_OBJS) $(LIBRECOLL)
|
||||
trrclconfig.o : rclconfig.cpp
|
||||
$(CXX) $(ALL_CXXFLAGS) -DTEST_RCLCONFIG -c -o trrclconfig.o \
|
||||
rclconfig.cpp
|
||||
|
||||
SYNGROUPS_OBJS= trsyngroups.o
|
||||
syngroups : $(SYNGROUPS_OBJS)
|
||||
$(CXX) $(ALL_CXXFLAGS) -o syngroups $(SYNGROUPS_OBJS) $(LIBRECOLL)
|
||||
trsyngroups.o : syngroups.cpp
|
||||
$(CXX) $(ALL_CXXFLAGS) -DTEST_SYNGROUPS -c -o trsyngroups.o \
|
||||
syngroups.cpp
|
||||
|
||||
include ../utils/utmkdefs.mk
|
186
src/common/autoconfig-win.h
Normal file
186
src/common/autoconfig-win.h
Normal file
|
@ -0,0 +1,186 @@
|
|||
/* Manually edited version of autoconfig.h for windows. Many things are
|
||||
overriden in the c++ code by ifdefs _WIN32 anyway */
|
||||
#ifndef _AUTOCONFIG_H_INCLUDED
|
||||
#define _AUTOCONFIG_H_INCLUDED
|
||||
/* Define if building universal (internal helper macro) */
|
||||
/* #undef AC_APPLE_UNIVERSAL_BUILD */
|
||||
|
||||
/* Path to the aspell api include file */
|
||||
/* #undef ASPELL_INCLUDE "aspell-local.h" */
|
||||
|
||||
/* Path to the aspell program */
|
||||
/* #define ASPELL_PROG "/usr/bin/aspell" */
|
||||
|
||||
/* No X11 session monitoring support */
|
||||
#define DISABLE_X11MON
|
||||
|
||||
/* Path to the fam api include file */
|
||||
/* #undef FAM_INCLUDE */
|
||||
|
||||
/* Path to the file program */
|
||||
#define FILE_PROG "/usr/bin/file"
|
||||
|
||||
/* "Have C++0x" */
|
||||
#define HAVE_CXX0X_UNORDERED 1
|
||||
|
||||
/* Define to 1 if you have the <dlfcn.h> header file. */
|
||||
#define HAVE_DLFCN_H 1
|
||||
|
||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||
#define HAVE_INTTYPES_H 1
|
||||
|
||||
/* Define to 1 if you have the `dl' library (-ldl). */
|
||||
#define HAVE_LIBDL 1
|
||||
|
||||
/* Define to 1 if you have the `pthread' library (-lpthread). */
|
||||
#define HAVE_LIBPTHREAD 1
|
||||
|
||||
/* Define to 1 if you have the `z' library (-lz). */
|
||||
#define HAVE_LIBZ 1
|
||||
|
||||
/* Define to 1 if you have the <memory.h> header file. */
|
||||
#define HAVE_MEMORY_H 1
|
||||
|
||||
/* Define to 1 if you have the `mkdtemp' function. */
|
||||
/* #undef HAVE_MKDTEMP */
|
||||
|
||||
/* Define to 1 if you have the `posix_spawn,' function. */
|
||||
/* #undef HAVE_POSIX_SPAWN_ */
|
||||
|
||||
/* Define to 1 if you have the `setrlimit' function. */
|
||||
#define HAVE_SETRLIMIT 1
|
||||
|
||||
/* Has std::shared_ptr */
|
||||
#define HAVE_SHARED_PTR_STD
|
||||
|
||||
/* Has std::tr1::shared_ptr */
|
||||
/* #undef HAVE_SHARED_PTR_TR1 */
|
||||
|
||||
/* Define to 1 if you have the <spawn.h> header file. */
|
||||
#define HAVE_SPAWN_H 1
|
||||
|
||||
/* Define to 1 if you have the <stdint.h> header file. */
|
||||
#define HAVE_STDINT_H 1
|
||||
|
||||
/* Define to 1 if you have the <stdlib.h> header file. */
|
||||
#define HAVE_STDLIB_H 1
|
||||
|
||||
/* Define to 1 if you have the <strings.h> header file. */
|
||||
#define HAVE_STRINGS_H 1
|
||||
|
||||
/* Define to 1 if you have the <string.h> header file. */
|
||||
#define HAVE_STRING_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/mount.h> header file. */
|
||||
/* #undef HAVE_SYS_MOUNT_H */
|
||||
|
||||
/* Define to 1 if you have the <sys/param.h,> header file. */
|
||||
/* #undef HAVE_SYS_PARAM_H_ */
|
||||
|
||||
/* Define to 1 if you have the <sys/statfs.h> header file. */
|
||||
/* #undef HAVE_SYS_STATFS_H */
|
||||
|
||||
/* Define to 1 if you have the <sys/statvfs.h> header file. */
|
||||
/* #undef HAVE_SYS_STATVFS_H */
|
||||
|
||||
/* Define to 1 if you have the <sys/stat.h> header file. */
|
||||
#define HAVE_SYS_STAT_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/types.h> header file. */
|
||||
#define HAVE_SYS_TYPES_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/vfs.h> header file. */
|
||||
/* #undef HAVE_SYS_VFS_H */
|
||||
|
||||
/* "Have tr1" */
|
||||
/* #undef HAVE_TR1_UNORDERED */
|
||||
|
||||
/* Define to 1 if you have the <unistd.h> header file. */
|
||||
/* #undef HAVE_UNISTD_H */
|
||||
|
||||
/* Use multiple threads for indexing */
|
||||
#define IDX_THREADS 1
|
||||
|
||||
/* Define to the sub-directory in which libtool stores uninstalled libraries.
|
||||
*/
|
||||
#define LT_OBJDIR ".libs/"
|
||||
|
||||
/* Define to the address where bug reports for this package should be sent. */
|
||||
#define PACKAGE_BUGREPORT ""
|
||||
|
||||
/* Define to the full name of this package. */
|
||||
#define PACKAGE_NAME "Recoll"
|
||||
|
||||
/* Define to the full name and version of this package. */
|
||||
#define PACKAGE_STRING "Recoll 1.22.0"
|
||||
|
||||
/* Define to the one symbol short name of this package. */
|
||||
#define PACKAGE_TARNAME "recoll"
|
||||
|
||||
/* Define to the home page for this package. */
|
||||
#define PACKAGE_URL ""
|
||||
|
||||
/* Define to the version of this package. */
|
||||
#define PACKAGE_VERSION "1.22.0"
|
||||
|
||||
/* putenv parameter is const */
|
||||
/* #undef PUTENV_ARG_CONST */
|
||||
|
||||
/* iconv parameter 2 is const char** */
|
||||
#define RCL_ICONV_INBUF_CONST 1
|
||||
|
||||
/* Real time monitoring option */
|
||||
#undef RCL_MONITOR
|
||||
|
||||
/* Split camelCase words */
|
||||
/* #undef RCL_SPLIT_CAMELCASE */
|
||||
|
||||
/* Compile the aspell interface */
|
||||
/* #undef RCL_USE_ASPELL */
|
||||
|
||||
/* Compile the fam interface */
|
||||
/* #undef RCL_USE_FAM */
|
||||
|
||||
/* Compile the inotify interface */
|
||||
#define RCL_USE_INOTIFY 1
|
||||
|
||||
/* Define to 1 if you have the ANSI C header files. */
|
||||
#define STDC_HEADERS 1
|
||||
|
||||
/* Use posix_spawn() */
|
||||
/* #undef USE_POSIX_SPAWN */
|
||||
|
||||
/* Enable using the system's 'file' command to id mime if we fail internally
|
||||
*/
|
||||
/* #undef USE_SYSTEM_FILE_COMMAND */
|
||||
|
||||
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
|
||||
significant byte first (like Motorola and SPARC, unlike Intel). */
|
||||
#if defined AC_APPLE_UNIVERSAL_BUILD
|
||||
# if defined __BIG_ENDIAN__
|
||||
# define WORDS_BIGENDIAN 1
|
||||
# endif
|
||||
#else
|
||||
# ifndef WORDS_BIGENDIAN
|
||||
/* # undef WORDS_BIGENDIAN */
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Define to 1 if the X Window System is missing or not being used. */
|
||||
/* #undef X_DISPLAY_MISSING */
|
||||
|
||||
/* Enable large inode numbers on Mac OS X 10.5. */
|
||||
#ifndef _DARWIN_USE_64_BIT_INODE
|
||||
# define _DARWIN_USE_64_BIT_INODE 1
|
||||
#endif
|
||||
|
||||
/* Number of bits in a file offset, on hosts where this is settable. */
|
||||
/* #undef _FILE_OFFSET_BITS */
|
||||
|
||||
/* Define for large files, on AIX-style hosts. */
|
||||
/* #undef _LARGE_FILES */
|
||||
|
||||
#define DISABLE_WEB_INDEXER
|
||||
|
||||
#include "conf_post.h"
|
||||
#endif // already included
|
181
src/common/autoconfig.h.in
Normal file
181
src/common/autoconfig.h.in
Normal file
|
@ -0,0 +1,181 @@
|
|||
/* common/autoconfig.h.in. Generated from configure.ac by autoheader. */
|
||||
|
||||
/* Define if building universal (internal helper macro) */
|
||||
#undef AC_APPLE_UNIVERSAL_BUILD
|
||||
|
||||
/* Path to the aspell api include file */
|
||||
#undef ASPELL_INCLUDE
|
||||
|
||||
/* Path to the aspell program */
|
||||
#undef ASPELL_PROG
|
||||
|
||||
/* No X11 session monitoring support */
|
||||
#undef DISABLE_X11MON
|
||||
|
||||
/* Path to the fam api include file */
|
||||
#undef FAM_INCLUDE
|
||||
|
||||
/* Path to the file program */
|
||||
#undef FILE_PROG
|
||||
|
||||
/* "Have C++0x" */
|
||||
#undef HAVE_CXX0X_UNORDERED
|
||||
|
||||
/* Define to 1 if you have the <dlfcn.h> header file. */
|
||||
#undef HAVE_DLFCN_H
|
||||
|
||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||
#undef HAVE_INTTYPES_H
|
||||
|
||||
/* Define to 1 if you have the `dl' library (-ldl). */
|
||||
#undef HAVE_LIBDL
|
||||
|
||||
/* Define to 1 if you have the `pthread' library (-lpthread). */
|
||||
#undef HAVE_LIBPTHREAD
|
||||
|
||||
/* Define to 1 if you have the `z' library (-lz). */
|
||||
#undef HAVE_LIBZ
|
||||
|
||||
/* Define to 1 if you have the <memory.h> header file. */
|
||||
#undef HAVE_MEMORY_H
|
||||
|
||||
/* Define to 1 if you have the `mkdtemp' function. */
|
||||
#undef HAVE_MKDTEMP
|
||||
|
||||
/* Define to 1 if you have the `posix_spawn,' function. */
|
||||
#undef HAVE_POSIX_SPAWN_
|
||||
|
||||
/* Define to 1 if you have the `setrlimit' function. */
|
||||
#undef HAVE_SETRLIMIT
|
||||
|
||||
/* Has std::shared_ptr */
|
||||
#undef HAVE_SHARED_PTR_STD
|
||||
|
||||
/* Has std::tr1::shared_ptr */
|
||||
#undef HAVE_SHARED_PTR_TR1
|
||||
|
||||
/* Define to 1 if you have the <spawn.h> header file. */
|
||||
#undef HAVE_SPAWN_H
|
||||
|
||||
/* Define to 1 if you have the <stdint.h> header file. */
|
||||
#undef HAVE_STDINT_H
|
||||
|
||||
/* Define to 1 if you have the <stdlib.h> header file. */
|
||||
#undef HAVE_STDLIB_H
|
||||
|
||||
/* Define to 1 if you have the <strings.h> header file. */
|
||||
#undef HAVE_STRINGS_H
|
||||
|
||||
/* Define to 1 if you have the <string.h> header file. */
|
||||
#undef HAVE_STRING_H
|
||||
|
||||
/* Define to 1 if you have the <sys/mount.h> header file. */
|
||||
#undef HAVE_SYS_MOUNT_H
|
||||
|
||||
/* Define to 1 if you have the <sys/param.h,> header file. */
|
||||
#undef HAVE_SYS_PARAM_H_
|
||||
|
||||
/* Define to 1 if you have the <sys/statfs.h> header file. */
|
||||
#undef HAVE_SYS_STATFS_H
|
||||
|
||||
/* Define to 1 if you have the <sys/statvfs.h> header file. */
|
||||
#undef HAVE_SYS_STATVFS_H
|
||||
|
||||
/* Define to 1 if you have the <sys/stat.h> header file. */
|
||||
#undef HAVE_SYS_STAT_H
|
||||
|
||||
/* Define to 1 if you have the <sys/types.h> header file. */
|
||||
#undef HAVE_SYS_TYPES_H
|
||||
|
||||
/* Define to 1 if you have the <sys/vfs.h> header file. */
|
||||
#undef HAVE_SYS_VFS_H
|
||||
|
||||
/* "Have tr1" */
|
||||
#undef HAVE_TR1_UNORDERED
|
||||
|
||||
/* Define to 1 if you have the <unistd.h> header file. */
|
||||
#undef HAVE_UNISTD_H
|
||||
|
||||
/* Use multiple threads for indexing */
|
||||
#undef IDX_THREADS
|
||||
|
||||
/* Define to the sub-directory in which libtool stores uninstalled libraries.
|
||||
*/
|
||||
#undef LT_OBJDIR
|
||||
|
||||
/* Define to the address where bug reports for this package should be sent. */
|
||||
#undef PACKAGE_BUGREPORT
|
||||
|
||||
/* Define to the full name of this package. */
|
||||
#undef PACKAGE_NAME
|
||||
|
||||
/* Define to the full name and version of this package. */
|
||||
#undef PACKAGE_STRING
|
||||
|
||||
/* Define to the one symbol short name of this package. */
|
||||
#undef PACKAGE_TARNAME
|
||||
|
||||
/* Define to the home page for this package. */
|
||||
#undef PACKAGE_URL
|
||||
|
||||
/* Define to the version of this package. */
|
||||
#undef PACKAGE_VERSION
|
||||
|
||||
/* putenv parameter is const */
|
||||
#undef PUTENV_ARG_CONST
|
||||
|
||||
/* iconv parameter 2 is const char** */
|
||||
#undef RCL_ICONV_INBUF_CONST
|
||||
|
||||
/* Real time monitoring option */
|
||||
#undef RCL_MONITOR
|
||||
|
||||
/* Split camelCase words */
|
||||
#undef RCL_SPLIT_CAMELCASE
|
||||
|
||||
/* Compile the aspell interface */
|
||||
#undef RCL_USE_ASPELL
|
||||
|
||||
/* Compile the fam interface */
|
||||
#undef RCL_USE_FAM
|
||||
|
||||
/* Compile the inotify interface */
|
||||
#undef RCL_USE_INOTIFY
|
||||
|
||||
/* Define to 1 if you have the ANSI C header files. */
|
||||
#undef STDC_HEADERS
|
||||
|
||||
/* Use posix_spawn() */
|
||||
#undef USE_POSIX_SPAWN
|
||||
|
||||
/* Enable using the system's 'file' command to id mime if we fail internally
|
||||
*/
|
||||
#undef USE_SYSTEM_FILE_COMMAND
|
||||
|
||||
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
|
||||
significant byte first (like Motorola and SPARC, unlike Intel). */
|
||||
#if defined AC_APPLE_UNIVERSAL_BUILD
|
||||
# if defined __BIG_ENDIAN__
|
||||
# define WORDS_BIGENDIAN 1
|
||||
# endif
|
||||
#else
|
||||
# ifndef WORDS_BIGENDIAN
|
||||
# undef WORDS_BIGENDIAN
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Define to 1 if the X Window System is missing or not being used. */
|
||||
#undef X_DISPLAY_MISSING
|
||||
|
||||
/* Enable large inode numbers on Mac OS X 10.5. */
|
||||
#ifndef _DARWIN_USE_64_BIT_INODE
|
||||
# define _DARWIN_USE_64_BIT_INODE 1
|
||||
#endif
|
||||
|
||||
/* Number of bits in a file offset, on hosts where this is settable. */
|
||||
#undef _FILE_OFFSET_BITS
|
||||
|
||||
/* Define for large files, on AIX-style hosts. */
|
||||
#undef _LARGE_FILES
|
||||
|
||||
#include "conf_post.h"
|
95
src/common/beaglequeuecache.cpp
Normal file
95
src/common/beaglequeuecache.cpp
Normal file
|
@ -0,0 +1,95 @@
|
|||
/* Copyright (C) 2011 J.F.Dockes
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the
|
||||
* Free Software Foundation, Inc.,
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include "autoconfig.h"
|
||||
|
||||
#include "cstr.h"
|
||||
#include "beaglequeuecache.h"
|
||||
#include "circache.h"
|
||||
#include "debuglog.h"
|
||||
#include "rclconfig.h"
|
||||
#include "pathut.h"
|
||||
#include "rcldoc.h"
|
||||
|
||||
const string cstr_bgc_mimetype("mimetype");
|
||||
|
||||
BeagleQueueCache::BeagleQueueCache(RclConfig *cnf)
|
||||
{
|
||||
string ccdir;
|
||||
cnf->getConfParam("webcachedir", ccdir);
|
||||
if (ccdir.empty())
|
||||
ccdir = "webcache";
|
||||
ccdir = path_tildexpand(ccdir);
|
||||
// If not an absolute path, compute relative to config dir
|
||||
if (!path_isabsolute(ccdir))
|
||||
ccdir = path_cat(cnf->getConfDir(), ccdir);
|
||||
|
||||
int maxmbs = 40;
|
||||
cnf->getConfParam("webcachemaxmbs", &maxmbs);
|
||||
if ((m_cache = new CirCache(ccdir)) == 0) {
|
||||
LOGERR(("BeagleQueueCache: cant create CirCache object\n"));
|
||||
return;
|
||||
}
|
||||
if (!m_cache->create(off_t(maxmbs)*1000*1024, CirCache::CC_CRUNIQUE)) {
|
||||
LOGERR(("BeagleQueueCache: cache file creation failed: %s\n",
|
||||
m_cache->getReason().c_str()));
|
||||
delete m_cache;
|
||||
m_cache = 0;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
BeagleQueueCache::~BeagleQueueCache()
|
||||
{
|
||||
delete m_cache;
|
||||
}
|
||||
|
||||
// Read document from cache. Return the metadata as an Rcl::Doc
|
||||
// @param htt Beagle Hit Type
|
||||
bool BeagleQueueCache::getFromCache(const string& udi, Rcl::Doc &dotdoc,
|
||||
string& data, string *htt)
|
||||
{
|
||||
string dict;
|
||||
|
||||
if (m_cache == 0) {
|
||||
LOGERR(("BeagleQueueCache::getFromCache: cache is null\n"));
|
||||
return false;
|
||||
}
|
||||
if (!m_cache->get(udi, dict, data)) {
|
||||
LOGDEB(("BeagleQueueCache::getFromCache: get failed\n"));
|
||||
return false;
|
||||
}
|
||||
|
||||
ConfSimple cf(dict, 1);
|
||||
|
||||
if (htt)
|
||||
cf.get(Rcl::Doc::keybght, *htt, cstr_null);
|
||||
|
||||
// Build a doc from saved metadata
|
||||
cf.get(cstr_url, dotdoc.url, cstr_null);
|
||||
cf.get(cstr_bgc_mimetype, dotdoc.mimetype, cstr_null);
|
||||
cf.get(cstr_fmtime, dotdoc.fmtime, cstr_null);
|
||||
cf.get(cstr_fbytes, dotdoc.pcbytes, cstr_null);
|
||||
dotdoc.sig.clear();
|
||||
vector<string> names = cf.getNames(cstr_null);
|
||||
for (vector<string>::const_iterator it = names.begin();
|
||||
it != names.end(); it++) {
|
||||
cf.get(*it, dotdoc.meta[*it], cstr_null);
|
||||
}
|
||||
dotdoc.meta[Rcl::Doc::keyudi] = udi;
|
||||
return true;
|
||||
}
|
50
src/common/beaglequeuecache.h
Normal file
50
src/common/beaglequeuecache.h
Normal file
|
@ -0,0 +1,50 @@
|
|||
/* Copyright (C) 2009 J.F.Dockes
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the
|
||||
* Free Software Foundation, Inc.,
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
#ifndef _beaglequeuecache_h_included_
|
||||
#define _beaglequeuecache_h_included_
|
||||
|
||||
#include <string>
|
||||
using std::string;
|
||||
|
||||
class RclConfig;
|
||||
namespace Rcl {
|
||||
class Db;
|
||||
class Doc;
|
||||
}
|
||||
class CirCache;
|
||||
|
||||
/**
|
||||
* Manage the CirCache for the Beagle Queue indexer. Separated from the main
|
||||
* indexer code because it's also used for querying (getting the data for a
|
||||
* preview
|
||||
*/
|
||||
class BeagleQueueCache {
|
||||
public:
|
||||
BeagleQueueCache(RclConfig *config);
|
||||
~BeagleQueueCache();
|
||||
|
||||
bool getFromCache(const string& udi, Rcl::Doc &doc, string& data,
|
||||
string *hittype = 0);
|
||||
// We could write proxies for all the circache ops, but why bother?
|
||||
CirCache *cc() {return m_cache;}
|
||||
|
||||
private:
|
||||
CirCache *m_cache;
|
||||
};
|
||||
extern const string cstr_bgc_mimetype;
|
||||
|
||||
#endif /* _beaglequeuecache_h_included_ */
|
80
src/common/conf_post.h
Normal file
80
src/common/conf_post.h
Normal file
|
@ -0,0 +1,80 @@
|
|||
#ifdef HAVE_CXX0X_UNORDERED
|
||||
# define UNORDERED_MAP_INCLUDE <unordered_map>
|
||||
# define UNORDERED_SET_INCLUDE <unordered_set>
|
||||
# define STD_UNORDERED_MAP std::unordered_map
|
||||
# define STD_UNORDERED_SET std::unordered_set
|
||||
#elif defined(HAVE_TR1_UNORDERED)
|
||||
# define UNORDERED_MAP_INCLUDE <tr1/unordered_map>
|
||||
# define UNORDERED_SET_INCLUDE <tr1/unordered_set>
|
||||
# define STD_UNORDERED_MAP std::tr1::unordered_map
|
||||
# define STD_UNORDERED_SET std::tr1::unordered_set
|
||||
#else
|
||||
# define UNORDERED_MAP_INCLUDE <map>
|
||||
# define UNORDERED_SET_INCLUDE <set>
|
||||
# define STD_UNORDERED_MAP std::map
|
||||
# define STD_UNORDERED_SET std::set
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SHARED_PTR_STD
|
||||
# define MEMORY_INCLUDE <memory>
|
||||
# define STD_SHARED_PTR std::shared_ptr
|
||||
#elif defined(HAVE_SHARED_PTR_TR1)
|
||||
# define MEMORY_INCLUDE <tr1/memory>
|
||||
# define STD_SHARED_PTR std::tr1::shared_ptr
|
||||
#else
|
||||
# define MEMORY_INCLUDE "refcntr.h"
|
||||
# define STD_SHARED_PTR RefCntr
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
#include "safewindows.h"
|
||||
|
||||
#undef RCL_ICONV_INBUF_CONST
|
||||
|
||||
#ifdef _MSC_VER
|
||||
// gmtime is supposedly thread-safe on windows
|
||||
#define gmtime_r(A, B) gmtime(A)
|
||||
#define localtime_r(A,B) localtime(A)
|
||||
typedef int mode_t;
|
||||
#define fseeko _fseeki64
|
||||
#define ftello (off_t)_ftelli64
|
||||
#define ftruncate _chsize_s
|
||||
#define PATH_MAX MAX_PATH
|
||||
#define RCL_ICONV_INBUF_CONST 1
|
||||
#define HAVE_STRUCT_TIMESPEC
|
||||
#define strdup _strdup
|
||||
#define timegm _mkgmtime
|
||||
|
||||
#else // End _MSC_VER -> Gminw
|
||||
|
||||
#define timegm portable_timegm
|
||||
|
||||
#undef RCL_ICONV_INBUF_CONST
|
||||
|
||||
#endif // GMinw only
|
||||
|
||||
typedef int pid_t;
|
||||
inline int readlink(const char *cp, void *buf, int cnt) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
#define MAXPATHLEN PATH_MAX
|
||||
typedef DWORD32 u_int32_t;
|
||||
typedef DWORD64 u_int64_t;
|
||||
typedef unsigned __int8 u_int8_t;
|
||||
typedef int ssize_t;
|
||||
#define strncasecmp _strnicmp
|
||||
#define strcasecmp _stricmp
|
||||
#define chdir _chdir
|
||||
|
||||
#define R_OK 4
|
||||
#define W_OK 2
|
||||
#ifndef X_OK
|
||||
#define X_OK 4
|
||||
#endif
|
||||
#define RECOLL_DATADIR "C:\\recoll\\"
|
||||
#define S_ISLNK(X) false
|
||||
#define lstat stat
|
||||
#endif
|
||||
|
||||
|
6
src/common/cstr.cpp
Normal file
6
src/common/cstr.cpp
Normal file
|
@ -0,0 +1,6 @@
|
|||
|
||||
#include "cstr.h"
|
||||
#define RCLIN_CSTR_CPPFILE
|
||||
#undef _CSTR_H_INCLUDED_
|
||||
#include "cstr.h"
|
||||
|
86
src/common/cstr.h
Normal file
86
src/common/cstr.h
Normal file
|
@ -0,0 +1,86 @@
|
|||
/* Copyright (C) 2011 J.F.Dockes
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the
|
||||
* Free Software Foundation, Inc.,
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef _CSTR_H_INCLUDED_
|
||||
#define _CSTR_H_INCLUDED_
|
||||
|
||||
// recoll mostly uses STL strings. In many places we had automatic
|
||||
// conversion from a C string to an STL one. This costs, and can
|
||||
// become significant if used often.
|
||||
//
|
||||
// This file and the associated .cpp file declares/defines constant
|
||||
// strings used in the program. Strings are candidates for a move here
|
||||
// when they are used in a fast loop or are shared.
|
||||
|
||||
#include <string>
|
||||
using std::string;
|
||||
|
||||
// The following slightly hacky preprocessing directives and the
|
||||
// companion code in the cpp file looks complicated, but it just
|
||||
// ensures that we only have to write the strings once to get the
|
||||
// extern declaration and the definition.
|
||||
#ifdef RCLIN_CSTR_CPPFILE
|
||||
#undef DEF_CSTR
|
||||
#define DEF_CSTR(NM, STR) const string cstr_##NM(STR)
|
||||
#else
|
||||
#define DEF_CSTR(NM, STR) extern const string cstr_##NM
|
||||
#endif
|
||||
|
||||
DEF_CSTR(caption, "caption");
|
||||
DEF_CSTR(colon, ":");
|
||||
DEF_CSTR(dmtime, "dmtime");
|
||||
DEF_CSTR(dquote, "\"");
|
||||
DEF_CSTR(fbytes, "fbytes");
|
||||
DEF_CSTR(fileu, "file://");
|
||||
DEF_CSTR(fmtime, "fmtime");
|
||||
DEF_CSTR(iso_8859_1, "ISO-8859-1");
|
||||
DEF_CSTR(utf8, "UTF-8");
|
||||
DEF_CSTR(cp1252, "CP1252");
|
||||
DEF_CSTR(minwilds, "*?[");
|
||||
DEF_CSTR(newline, "\n");
|
||||
DEF_CSTR(null, "");
|
||||
DEF_CSTR(plus, "+");
|
||||
DEF_CSTR(textplain, "text/plain");
|
||||
DEF_CSTR(url, "url");
|
||||
// Marker for HTML format fields
|
||||
DEF_CSTR(fldhtm, "\007");
|
||||
// Characters that can -begin- a wildcard or regexp expression.
|
||||
DEF_CSTR(wildSpecStChars, "*?[");
|
||||
DEF_CSTR(regSpecStChars, "(.[{");
|
||||
|
||||
// Values used as keys inside Dijon::Filter::metaData[]. This structure is
|
||||
// used to store all data generated by format-translating filters. It is
|
||||
// different from Rcl::Doc for mostly historical reasons. The translation
|
||||
// from Filter to Doc occurs inside internfile.cpp
|
||||
DEF_CSTR(dj_keyds, "description");
|
||||
DEF_CSTR(dj_keyfn, "filename");
|
||||
DEF_CSTR(dj_keymd, "modificationdate");
|
||||
DEF_CSTR(dj_keyorigcharset, "origcharset");
|
||||
DEF_CSTR(dj_keytitle, "title");
|
||||
DEF_CSTR(dj_keyrecipient, "recipient");
|
||||
DEF_CSTR(dj_keymsgid, "msgid");
|
||||
DEF_CSTR(dj_keyabstract, "abstract");
|
||||
DEF_CSTR(dj_keyauthor, "author");
|
||||
DEF_CSTR(dj_keycharset, "charset");
|
||||
DEF_CSTR(dj_keycontent, "content");
|
||||
DEF_CSTR(dj_keyipath, "ipath");
|
||||
DEF_CSTR(dj_keymd5, "md5");
|
||||
DEF_CSTR(dj_keymt, "mimetype");
|
||||
DEF_CSTR(dj_keydocsize, "docsize");
|
||||
DEF_CSTR(dj_keyanc, "rclanc");
|
||||
|
||||
#endif /* _CSTR_H_INCLUDED_ */
|
1684
src/common/rclconfig.cpp
Normal file
1684
src/common/rclconfig.cpp
Normal file
File diff suppressed because it is too large
Load diff
409
src/common/rclconfig.h
Normal file
409
src/common/rclconfig.h
Normal file
|
@ -0,0 +1,409 @@
|
|||
/* Copyright (C) 2004 J.F.Dockes
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the
|
||||
* Free Software Foundation, Inc.,
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
#ifndef _RCLCONFIG_H_INCLUDED_
|
||||
#define _RCLCONFIG_H_INCLUDED_
|
||||
#include "autoconfig.h"
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <set>
|
||||
#include <utility>
|
||||
#include <map>
|
||||
#include UNORDERED_SET_INCLUDE
|
||||
|
||||
using std::string;
|
||||
using std::vector;
|
||||
using std::pair;
|
||||
using std::set;
|
||||
using std::map;
|
||||
|
||||
#include "conftree.h"
|
||||
#include "smallut.h"
|
||||
|
||||
class RclConfig;
|
||||
|
||||
// A small class used for parameters that need to be computed from the
|
||||
// config string, and which can change with the keydir. Minimize work
|
||||
// by using the keydirgen and a saved string to avoid unneeded
|
||||
// recomputations
|
||||
class ParamStale {
|
||||
public:
|
||||
RclConfig *parent;
|
||||
ConfNull *conffile;
|
||||
string paramname;
|
||||
bool active; // Check at init if config defines name at all
|
||||
int savedkeydirgen;
|
||||
string savedvalue;
|
||||
|
||||
ParamStale(RclConfig *rconf, const string& nm);
|
||||
void init(ConfNull *cnf);
|
||||
bool needrecompute();
|
||||
};
|
||||
|
||||
// Hold the description for an external metadata-gathering command
|
||||
struct MDReaper {
|
||||
string fieldname;
|
||||
vector<string> cmdv;
|
||||
};
|
||||
|
||||
// Data associated to a indexed field name:
|
||||
struct FieldTraits {
|
||||
string pfx; // indexing prefix,
|
||||
int wdfinc; // Index time term frequency increment (default 1)
|
||||
double boost; // Query time boost (default 1.0)
|
||||
bool pfxonly; // Suppress prefix-less indexing
|
||||
bool noterms; // Don't add term to highlight data (e.g.: rclbes)
|
||||
FieldTraits()
|
||||
: wdfinc(1), boost(1.0), pfxonly(false), noterms(false)
|
||||
{}
|
||||
};
|
||||
|
||||
class RclConfig {
|
||||
public:
|
||||
|
||||
// Constructor: we normally look for a configuration file, except
|
||||
// if this was specified on the command line and passed through
|
||||
// argcnf
|
||||
RclConfig(const string *argcnf = 0);
|
||||
|
||||
RclConfig(const RclConfig &r)
|
||||
: m_oldstpsuffstate(this, "recoll_noindex"),
|
||||
m_stpsuffstate(this, "noContentSuffixes"),
|
||||
m_skpnstate(this, "skippedNames"),
|
||||
m_rmtstate(this, "indexedmimetypes"),
|
||||
m_xmtstate(this, "excludedmimetypes"),
|
||||
m_mdrstate(this, "metadatacmds") {
|
||||
initFrom(r);
|
||||
}
|
||||
|
||||
~RclConfig() {
|
||||
freeAll();
|
||||
}
|
||||
|
||||
// Return a writable clone of the main config. This belongs to the
|
||||
// caller (must delete it when done)
|
||||
ConfNull *cloneMainConfig();
|
||||
|
||||
/** (re)Read recoll.conf */
|
||||
bool updateMainConfig();
|
||||
|
||||
bool ok() const {return m_ok;}
|
||||
const string &getReason() const {return m_reason;}
|
||||
|
||||
/** Return the directory where this configuration is stored.
|
||||
* This was possibly silently created by the rclconfig
|
||||
* constructor it it is the default one (~/.recoll) and it did
|
||||
* not exist yet. */
|
||||
string getConfDir() const {return m_confdir;}
|
||||
|
||||
/** Check if the config files were modified since we read them */
|
||||
bool sourceChanged() const;
|
||||
|
||||
/** Returns true if this is ~/.recoll */
|
||||
bool isDefaultConfig() const;
|
||||
/** Get the local value for /usr/local/share/recoll/ */
|
||||
const string& getDatadir() const {return m_datadir;}
|
||||
|
||||
/** Set current directory reference, and fetch automatic parameters. */
|
||||
void setKeyDir(const string &dir);
|
||||
string getKeyDir() const {return m_keydir;}
|
||||
|
||||
/** Get generic configuration parameter according to current keydir */
|
||||
bool getConfParam(const string &name, string &value,
|
||||
bool shallow=false) const
|
||||
{
|
||||
if (m_conf == 0)
|
||||
return false;
|
||||
return m_conf->get(name, value, m_keydir, shallow);
|
||||
}
|
||||
/** Variant with autoconversion to int */
|
||||
bool getConfParam(const string &name, int *value, bool shallow=false) const;
|
||||
/** Variant with autoconversion to bool */
|
||||
bool getConfParam(const string &name, bool *value,
|
||||
bool shallow=false) const;
|
||||
/** Variant with conversion to vector<string>
|
||||
* (stringToStrings). Can fail if the string is malformed. */
|
||||
bool getConfParam(const string &name, vector<string> *value,
|
||||
bool shallow=false) const;
|
||||
/** Variant with conversion to vector<int> */
|
||||
bool getConfParam(const string &name, vector<int> *value,
|
||||
bool shallow=false) const;
|
||||
|
||||
enum ThrStage {ThrIntern=0, ThrSplit=1, ThrDbWrite=2};
|
||||
pair<int, int> getThrConf(ThrStage who) const;
|
||||
|
||||
/**
|
||||
* Get list of config names under current sk, with possible
|
||||
* wildcard filtering
|
||||
*/
|
||||
vector<string> getConfNames(const char *pattern = 0) const
|
||||
{
|
||||
return m_conf->getNames(m_keydir, pattern);
|
||||
}
|
||||
|
||||
/** Check if name exists anywhere in config */
|
||||
bool hasNameAnywhere(const string& nm) const
|
||||
{
|
||||
return m_conf? m_conf->hasNameAnywhere(nm) : false;
|
||||
}
|
||||
|
||||
|
||||
/** Get default charset for current keydir (was set during setKeydir)
|
||||
* filenames are handled differently */
|
||||
const string &getDefCharset(bool filename = false) const;
|
||||
|
||||
/** Get list of top directories. This is needed from a number of places
|
||||
* and needs some cleaning-up code. An empty list is always an error, no
|
||||
* need for other status */
|
||||
vector<string> getTopdirs() const;
|
||||
|
||||
string getConfdirPath(const char *varname, const char *dflt) const;
|
||||
/** Get database directory */
|
||||
string getDbDir() const;
|
||||
/** Get stoplist file name */
|
||||
string getStopfile() const;
|
||||
/** Get synonym groups file name */
|
||||
string getSynGroupsFile() const;
|
||||
/** Get indexing pid file name */
|
||||
string getPidfile() const;
|
||||
/** Get indexing status file name */
|
||||
string getIdxStatusFile() const;
|
||||
/** Do path translation according to the ptrans table */
|
||||
void urlrewrite(const string& dbdir, string& url) const;
|
||||
ConfSimple *getPTrans()
|
||||
{
|
||||
return m_ptrans;
|
||||
}
|
||||
/** Get Web Queue directory name */
|
||||
string getWebQueueDir() const;
|
||||
|
||||
/** Get list of skipped file names for current keydir */
|
||||
vector<string>& getSkippedNames();
|
||||
|
||||
/** Get list of skipped paths patterns. Doesn't depend on the keydir */
|
||||
vector<string> getSkippedPaths() const;
|
||||
/** Get list of skipped paths patterns, daemon version (may add some)
|
||||
Doesn't depend on the keydir */
|
||||
vector<string> getDaemSkippedPaths() const;
|
||||
|
||||
/**
|
||||
* mimemap: Check if file name should be ignored because of suffix
|
||||
*
|
||||
* The list of ignored suffixes is initialized on first call, and
|
||||
* not changed for subsequent setKeydirs.
|
||||
*/
|
||||
bool inStopSuffixes(const string& fn);
|
||||
|
||||
/**
|
||||
* Check in mimeconf if input mime type is a compressed one, and
|
||||
* return command to uncompress if it is.
|
||||
*
|
||||
* The returned command has substitutable places for input file name
|
||||
* and temp dir name, and will return output name
|
||||
*/
|
||||
bool getUncompressor(const string &mtpe, vector<string>& cmd) const;
|
||||
|
||||
/** mimemap: compute mimetype */
|
||||
string getMimeTypeFromSuffix(const string &suffix) const;
|
||||
/** mimemap: get a list of all indexable mime types defined */
|
||||
vector<string> getAllMimeTypes() const;
|
||||
/** mimemap: Get appropriate suffix for mime type. This is inefficient */
|
||||
string getSuffixFromMimeType(const string &mt) const;
|
||||
|
||||
/** mimeconf: get input filter for mimetype */
|
||||
string getMimeHandlerDef(const string &mimetype, bool filtertypes=false);
|
||||
|
||||
/** For lines like: "name = some value; attr1 = value1; attr2 = val2"
|
||||
* Separate the value and store the attributes in a ConfSimple
|
||||
* @param whole the raw value. No way to escape a semi-colon in there.
|
||||
*/
|
||||
static bool valueSplitAttributes(const string& whole, string& value,
|
||||
ConfSimple& attrs) ;
|
||||
|
||||
/** Return icon path for mime type and tag */
|
||||
string getMimeIconPath(const string &mt, const string& apptag) const;
|
||||
|
||||
/** mimeconf: get list of file categories */
|
||||
bool getMimeCategories(vector<string>&) const;
|
||||
/** mimeconf: is parameter one of the categories ? */
|
||||
bool isMimeCategory(string&) const;
|
||||
/** mimeconf: get list of mime types for category */
|
||||
bool getMimeCatTypes(const string& cat, vector<string>&) const;
|
||||
|
||||
/** mimeconf: get list of gui filters (doc cats by default */
|
||||
bool getGuiFilterNames(vector<string>&) const;
|
||||
/** mimeconf: get query lang frag for named filter */
|
||||
bool getGuiFilter(const string& filtername, string& frag) const;
|
||||
|
||||
/** fields: get field prefix from field name. Use additional query
|
||||
aliases if isquery is set */
|
||||
bool getFieldTraits(const string& fldname, const FieldTraits **,
|
||||
bool isquery = false) const;
|
||||
|
||||
const set<string>& getStoredFields() const {return m_storedFields;}
|
||||
|
||||
set<string> getIndexedFields() const;
|
||||
|
||||
/** Get canonic name for possible alias */
|
||||
string fieldCanon(const string& fld) const;
|
||||
|
||||
/** Get canonic name for possible alias, including query-only aliases */
|
||||
string fieldQCanon(const string& fld) const;
|
||||
|
||||
/** Get xattr name to field names translations */
|
||||
const map<string, string>& getXattrToField() const {return m_xattrtofld;}
|
||||
|
||||
/** Get value of a parameter inside the "fields" file. Only some filters
|
||||
* use this (ie: mh_mail). The information specific to a given filter
|
||||
* is typically stored in a separate section(ie: [mail])
|
||||
*/
|
||||
vector<string> getFieldSectNames(const string &sk, const char* = 0) const;
|
||||
bool getFieldConfParam(const string &name, const string &sk, string &value)
|
||||
const;
|
||||
|
||||
/** mimeview: get/set external viewer exec string(s) for mimetype(s) */
|
||||
string getMimeViewerDef(const string &mimetype, const string& apptag,
|
||||
bool useall) const;
|
||||
string getMimeViewerAllEx() const;
|
||||
bool setMimeViewerAllEx(const string& allex);
|
||||
bool getMimeViewerDefs(vector<pair<string, string> >&) const;
|
||||
bool setMimeViewerDef(const string& mimetype, const string& cmd);
|
||||
/** Check if mime type is designated as needing no uncompress before view
|
||||
* (if a file of this type is found compressed). Default is true,
|
||||
* exceptions are found in the nouncompforviewmts mimeview list */
|
||||
bool mimeViewerNeedsUncomp(const string &mimetype) const;
|
||||
|
||||
/** Retrieve extra metadata-gathering commands */
|
||||
const vector<MDReaper>& getMDReapers();
|
||||
|
||||
/** Store/retrieve missing helpers description string */
|
||||
bool getMissingHelperDesc(string&) const;
|
||||
void storeMissingHelperDesc(const string &s);
|
||||
|
||||
/** Find exec file for external filter.
|
||||
*
|
||||
* If the input is an absolute path, we just return it. Else We
|
||||
* look in $RECOLL_FILTERSDIR, "filtersdir" from the config file,
|
||||
* $RECOLL_CONFDIR/. If nothing is found, we return the input with
|
||||
* the assumption that this will be used with a PATH-searching
|
||||
* exec.
|
||||
*
|
||||
* @param cmd is normally the command name from the command string
|
||||
* returned by getMimeHandlerDef(), but this could be used for any
|
||||
* command. If cmd begins with a /, we return cmd without
|
||||
* further processing.
|
||||
*/
|
||||
string findFilter(const string& cmd) const;
|
||||
|
||||
/** Thread config init is not done automatically because not all
|
||||
programs need it and it uses debuglog so that it's better to
|
||||
call it after primary init */
|
||||
void initThrConf();
|
||||
|
||||
const string& getOrigCwd()
|
||||
{
|
||||
return o_origcwd;
|
||||
}
|
||||
|
||||
RclConfig& operator=(const RclConfig &r) {
|
||||
if (this != &r) {
|
||||
freeAll();
|
||||
initFrom(r);
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
friend class ParamStale;
|
||||
|
||||
private:
|
||||
int m_ok;
|
||||
string m_reason; // Explanation for bad state
|
||||
string m_confdir; // User directory where the customized files are stored
|
||||
string m_datadir; // Example: /usr/local/share/recoll
|
||||
string m_keydir; // Current directory used for parameter fetches.
|
||||
int m_keydirgen; // To help with knowing when to update computed data.
|
||||
|
||||
vector<string> m_cdirs; // directory stack for the confstacks
|
||||
|
||||
ConfStack<ConfTree> *m_conf; // Parsed configuration files
|
||||
ConfStack<ConfTree> *mimemap; // The files don't change with keydir,
|
||||
ConfStack<ConfSimple> *mimeconf; // but their content may depend on it.
|
||||
ConfStack<ConfSimple> *mimeview; //
|
||||
ConfStack<ConfSimple> *m_fields;
|
||||
ConfSimple *m_ptrans; // Paths translations
|
||||
map<string, FieldTraits> m_fldtotraits; // Field to field params
|
||||
map<string, string> m_aliastocanon;
|
||||
map<string, string> m_aliastoqcanon;
|
||||
set<string> m_storedFields;
|
||||
map<string, string> m_xattrtofld;
|
||||
|
||||
void *m_stopsuffixes;
|
||||
unsigned int m_maxsufflen;
|
||||
ParamStale m_oldstpsuffstate; // Values from user mimemap, now obsolete
|
||||
ParamStale m_stpsuffstate;
|
||||
|
||||
ParamStale m_skpnstate;
|
||||
vector<string> m_skpnlist;
|
||||
|
||||
// Original current working directory. Set once at init before we do any
|
||||
// chdir'ing and used for converting user args to absolute paths.
|
||||
static string o_origcwd;
|
||||
|
||||
// Parameters auto-fetched on setkeydir
|
||||
string m_defcharset;
|
||||
static string o_localecharset;
|
||||
// Limiting set of mime types to be processed. Normally empty.
|
||||
ParamStale m_rmtstate;
|
||||
STD_UNORDERED_SET<string> m_restrictMTypes;
|
||||
// Exclusion set of mime types. Normally empty
|
||||
ParamStale m_xmtstate;
|
||||
STD_UNORDERED_SET<string> m_excludeMTypes;
|
||||
|
||||
vector<pair<int, int> > m_thrConf;
|
||||
|
||||
// Same idea with the metadata-gathering external commands,
|
||||
// (e.g. used to reap tagging info: "tmsu tags %f")
|
||||
ParamStale m_mdrstate;
|
||||
vector<MDReaper> m_mdreapers;
|
||||
|
||||
/** Create initial user configuration */
|
||||
bool initUserConfig();
|
||||
/** Init all ParamStale members */
|
||||
void initParamStale(ConfNull *cnf, ConfNull *mimemap);
|
||||
/** Copy from other */
|
||||
void initFrom(const RclConfig& r);
|
||||
/** Init pointers to 0 */
|
||||
void zeroMe();
|
||||
/** Free data then zero pointers */
|
||||
void freeAll();
|
||||
bool readFieldsConfig(const string& errloc);
|
||||
};
|
||||
|
||||
// This global variable defines if we are running with an index
|
||||
// stripped of accents and case or a raw one. Ideally, it should be
|
||||
// constant, but it needs to be initialized from the configuration, so
|
||||
// there is no way to do this. It never changes after initialization
|
||||
// of course. Changing the value on a given index imposes a
|
||||
// reset. When using multiple indexes, all must have the same value
|
||||
extern bool o_index_stripchars;
|
||||
|
||||
// This global variable defines if we use mtime instead of ctime for
|
||||
// up-to-date tests. This is mostly incompatible with xattr indexing,
|
||||
// in addition to other issues. See recoll.conf comments.
|
||||
extern bool o_uptodate_test_use_mtime;
|
||||
|
||||
#endif /* _RCLCONFIG_H_INCLUDED_ */
|
392
src/common/rclinit.cpp
Normal file
392
src/common/rclinit.cpp
Normal file
|
@ -0,0 +1,392 @@
|
|||
/* Copyright (C) 2004 J.F.Dockes
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the
|
||||
* Free Software Foundation, Inc.,
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
#include "autoconfig.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#ifdef _WIN32
|
||||
#include "safewindows.h"
|
||||
#endif
|
||||
#include <signal.h>
|
||||
#include <locale.h>
|
||||
#include <pthread.h>
|
||||
#include <cstdlib>
|
||||
#if !defined(PUTENV_ARG_CONST)
|
||||
#include <string.h>
|
||||
#endif
|
||||
|
||||
#include "debuglog.h"
|
||||
#include "rclconfig.h"
|
||||
#include "rclinit.h"
|
||||
#include "pathut.h"
|
||||
#include "unac.h"
|
||||
#include "smallut.h"
|
||||
#include "execmd.h"
|
||||
|
||||
static pthread_t mainthread_id;
|
||||
|
||||
// Signal etc. processing. We want to be able to properly close the
|
||||
// index if we are currently writing to it.
|
||||
//
|
||||
// This is active if the sigcleanup parameter to recollinit is set,
|
||||
// which only recollindex does. We arrange for the handler to be
|
||||
// called when process termination is requested either by the system
|
||||
// or a user keyboard intr.
|
||||
//
|
||||
// The recollindex handler just sets a global termination flag (plus
|
||||
// the cancelcheck thing), which are tested in all timeout loops
|
||||
// etc. When the flag is seen, the main thread processing returns, and
|
||||
// recollindex calls exit().
|
||||
//
|
||||
// The other parameter, to recollinit(), cleanup, is set as an
|
||||
// atexit() routine, it does the job of actually signalling the
|
||||
// workers to stop and tidy up. It's automagically called by exit().
|
||||
|
||||
#ifndef _WIN32
|
||||
static void siglogreopen(int)
|
||||
{
|
||||
if (recoll_ismainthread())
|
||||
DebugLog::reopen();
|
||||
}
|
||||
|
||||
// We would like to block SIGCHLD globally, but we can't because
|
||||
// QT uses it. Have to block it inside execmd.cpp
|
||||
static const int catchedSigs[] = {SIGINT, SIGQUIT, SIGTERM, SIGUSR1, SIGUSR2};
|
||||
void initAsyncSigs(void (*sigcleanup)(int))
|
||||
{
|
||||
// We ignore SIGPIPE always. All pieces of code which can write to a pipe
|
||||
// must check write() return values.
|
||||
signal(SIGPIPE, SIG_IGN);
|
||||
|
||||
// Install app signal handler
|
||||
if (sigcleanup) {
|
||||
struct sigaction action;
|
||||
action.sa_handler = sigcleanup;
|
||||
action.sa_flags = 0;
|
||||
sigemptyset(&action.sa_mask);
|
||||
for (unsigned int i = 0; i < sizeof(catchedSigs) / sizeof(int); i++)
|
||||
if (signal(catchedSigs[i], SIG_IGN) != SIG_IGN) {
|
||||
if (sigaction(catchedSigs[i], &action, 0) < 0) {
|
||||
perror("Sigaction failed");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Install log rotate sig handler
|
||||
{
|
||||
struct sigaction action;
|
||||
action.sa_handler = siglogreopen;
|
||||
action.sa_flags = 0;
|
||||
sigemptyset(&action.sa_mask);
|
||||
if (signal(SIGHUP, SIG_IGN) != SIG_IGN) {
|
||||
if (sigaction(SIGHUP, &action, 0) < 0) {
|
||||
perror("Sigaction failed");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
void recoll_exitready()
|
||||
{
|
||||
}
|
||||
|
||||
#else // _WIN32 ->
|
||||
|
||||
// Windows signals etc.
|
||||
//
|
||||
// ^C can be caught by the signal() emulation, but not ^Break
|
||||
// apparently, which is why we use the native approach too
|
||||
//
|
||||
// When a keyboard interrupt occurs, windows creates a thread inside
|
||||
// the process and calls the handler. The process exits when the
|
||||
// handler returns or after at most 10S
|
||||
//
|
||||
// This should also work, with different signals (CTRL_LOGOFF_EVENT,
|
||||
// CTRL_SHUTDOWN_EVENT) when the user exits or the system shuts down).
|
||||
//
|
||||
// Unfortunately, this is not the end of the story. It seems that in
|
||||
// recent Windows version "some kinds" of apps will not reliably
|
||||
// receive the signals. "Some kind" is variably defined, for example a
|
||||
// simple test program works when built with vs 2015, but not
|
||||
// mingw. See the following discussion thread for tentative
|
||||
// explanations, it seems that importing or not from user32.dll is the
|
||||
// determining factor.
|
||||
// https://social.msdn.microsoft.com/Forums/windowsdesktop/en-US/abf09824-4e4c-4f2c-ae1e-5981f06c9c6e/windows-7-console-application-has-no-way-of-trapping-logoffshutdown-event?forum=windowscompatibility
|
||||
// In any case, it appears that the only reliable way to be advised of
|
||||
// system shutdown or user exit is to create an "invisible window" and
|
||||
// process window messages, which we now do.
|
||||
|
||||
static void (*l_sigcleanup)(int);
|
||||
static HANDLE eWorkFinished = INVALID_HANDLE_VALUE;
|
||||
|
||||
static BOOL WINAPI CtrlHandler(DWORD fdwCtrlType)
|
||||
{
|
||||
LOGDEB(("CtrlHandler\n"));
|
||||
if (l_sigcleanup == 0)
|
||||
return FALSE;
|
||||
|
||||
switch(fdwCtrlType) {
|
||||
case CTRL_C_EVENT:
|
||||
case CTRL_CLOSE_EVENT:
|
||||
case CTRL_BREAK_EVENT:
|
||||
case CTRL_LOGOFF_EVENT:
|
||||
case CTRL_SHUTDOWN_EVENT:
|
||||
{
|
||||
l_sigcleanup(SIGINT);
|
||||
LOGDEB0(("CtrlHandler: waiting for exit ready\n"));
|
||||
DWORD res = WaitForSingleObject(eWorkFinished, INFINITE);
|
||||
if (res != WAIT_OBJECT_0) {
|
||||
LOGERR(("CtrlHandler: exit ack wait failed\n"));
|
||||
}
|
||||
LOGDEB0(("CtrlHandler: got exit ready event, exiting\n"));
|
||||
return TRUE;
|
||||
}
|
||||
default:
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
LRESULT CALLBACK MainWndProc(HWND hwnd , UINT msg , WPARAM wParam,
|
||||
LPARAM lParam)
|
||||
{
|
||||
switch (msg) {
|
||||
case WM_QUERYENDSESSION:
|
||||
case WM_ENDSESSION:
|
||||
case WM_DESTROY:
|
||||
case WM_CLOSE:
|
||||
{
|
||||
l_sigcleanup(SIGINT);
|
||||
LOGDEB(("MainWndProc: got end message, waiting for work finished\n"));
|
||||
DWORD res = WaitForSingleObject(eWorkFinished, INFINITE);
|
||||
if (res != WAIT_OBJECT_0) {
|
||||
LOGERR(("MainWndProc: exit ack wait failed\n"));
|
||||
}
|
||||
LOGDEB(("MainWindowProc: got exit ready event, exiting\n"));
|
||||
return TRUE;
|
||||
}
|
||||
default:
|
||||
return DefWindowProc(hwnd, msg, wParam, lParam);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool CreateInvisibleWindow()
|
||||
{
|
||||
HWND hwnd;
|
||||
WNDCLASS wc = {0};
|
||||
|
||||
wc.lpfnWndProc = (WNDPROC)MainWndProc;
|
||||
wc.hInstance = GetModuleHandle(NULL);
|
||||
wc.hIcon = LoadIcon(GetModuleHandle(NULL), "TestWClass");
|
||||
wc.lpszClassName = "TestWClass";
|
||||
RegisterClass(&wc);
|
||||
|
||||
hwnd =
|
||||
CreateWindowEx(0, "TestWClass", "TestWClass", WS_OVERLAPPEDWINDOW,
|
||||
CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
|
||||
CW_USEDEFAULT, (HWND) NULL, (HMENU) NULL,
|
||||
GetModuleHandle(NULL), (LPVOID) NULL);
|
||||
if (!hwnd) {
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
DWORD WINAPI RunInvisibleWindowThread(LPVOID lpParam)
|
||||
{
|
||||
MSG msg;
|
||||
CreateInvisibleWindow();
|
||||
while (GetMessage(&msg, (HWND) NULL , 0 , 0)) {
|
||||
TranslateMessage(&msg);
|
||||
DispatchMessage(&msg);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const int catchedSigs[] = {SIGINT, SIGTERM};
|
||||
void initAsyncSigs(void (*sigcleanup)(int))
|
||||
{
|
||||
DWORD tid;
|
||||
// Install app signal handler
|
||||
if (sigcleanup) {
|
||||
l_sigcleanup = sigcleanup;
|
||||
for (unsigned int i = 0; i < sizeof(catchedSigs) / sizeof(int); i++) {
|
||||
if (signal(catchedSigs[i], SIG_IGN) != SIG_IGN) {
|
||||
signal(catchedSigs[i], sigcleanup);
|
||||
}
|
||||
}
|
||||
}
|
||||
HANDLE hInvisiblethread =
|
||||
CreateThread(NULL, 0, RunInvisibleWindowThread, NULL, 0, &tid);
|
||||
SetConsoleCtrlHandler((PHANDLER_ROUTINE)CtrlHandler, TRUE);
|
||||
eWorkFinished = CreateEvent(NULL, TRUE, FALSE, NULL);
|
||||
if (eWorkFinished == INVALID_HANDLE_VALUE) {
|
||||
LOGERR(("initAsyncSigs: error creating exitready event\n"));
|
||||
}
|
||||
}
|
||||
void recoll_exitready()
|
||||
{
|
||||
LOGDEB(("recoll_exitready()\n"));
|
||||
if (!SetEvent(eWorkFinished)) {
|
||||
LOGERR(("recoll_exitready: SetEvent failed\n"));
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
RclConfig *recollinit(RclInitFlags flags,
|
||||
void (*cleanup)(void), void (*sigcleanup)(int),
|
||||
string &reason, const string *argcnf)
|
||||
{
|
||||
if (cleanup)
|
||||
atexit(cleanup);
|
||||
|
||||
// Make sure the locale is set. This is only for converting file names
|
||||
// to utf8 for indexing.
|
||||
setlocale(LC_CTYPE, "");
|
||||
|
||||
DebugLog::getdbl()->setloglevel(DEBDEB1);
|
||||
DebugLog::setfilename("stderr");
|
||||
if (getenv("RECOLL_LOGDATE"))
|
||||
DebugLog::getdbl()->logdate(1);
|
||||
|
||||
initAsyncSigs(sigcleanup);
|
||||
|
||||
RclConfig *config = new RclConfig(argcnf);
|
||||
if (!config || !config->ok()) {
|
||||
reason = "Configuration could not be built:\n";
|
||||
if (config)
|
||||
reason += config->getReason();
|
||||
else
|
||||
reason += "Out of memory ?";
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Retrieve the log file name and level. Daemon and batch indexing
|
||||
// processes may use specific values, else fall back on common
|
||||
// ones.
|
||||
string logfilename, loglevel;
|
||||
if (flags & RCLINIT_DAEMON) {
|
||||
config->getConfParam(string("daemlogfilename"), logfilename);
|
||||
config->getConfParam(string("daemloglevel"), loglevel);
|
||||
}
|
||||
if ((flags & RCLINIT_IDX) && logfilename.empty())
|
||||
config->getConfParam(string("idxlogfilename"), logfilename);
|
||||
if ((flags & RCLINIT_IDX) && loglevel.empty())
|
||||
config->getConfParam(string("idxloglevel"), loglevel);
|
||||
|
||||
if (logfilename.empty())
|
||||
config->getConfParam(string("logfilename"), logfilename);
|
||||
if (loglevel.empty())
|
||||
config->getConfParam(string("loglevel"), loglevel);
|
||||
|
||||
// Initialize logging
|
||||
if (!logfilename.empty()) {
|
||||
logfilename = path_tildexpand(logfilename);
|
||||
// If not an absolute path or , compute relative to config dir
|
||||
if (!path_isabsolute(logfilename) &&
|
||||
!DebugLog::DebugLog::isspecialname(logfilename.c_str())) {
|
||||
logfilename = path_cat(config->getConfDir(), logfilename);
|
||||
}
|
||||
DebugLog::setfilename(logfilename.c_str());
|
||||
}
|
||||
if (!loglevel.empty()) {
|
||||
int lev = atoi(loglevel.c_str());
|
||||
DebugLog::getdbl()->setloglevel(lev);
|
||||
}
|
||||
|
||||
// Make sure the locale charset is initialized (so that multiple
|
||||
// threads don't try to do it at once).
|
||||
config->getDefCharset();
|
||||
|
||||
mainthread_id = pthread_self();
|
||||
|
||||
// Init unac locking
|
||||
unac_init_mt();
|
||||
// Init smallut and pathut static values
|
||||
pathut_init_mt();
|
||||
smallut_init_mt();
|
||||
// Init execmd.h static PATH and PATHELT splitting
|
||||
{string bogus;
|
||||
ExecCmd::which("nosuchcmd", bogus);
|
||||
}
|
||||
|
||||
// Init Unac translation exceptions
|
||||
string unacex;
|
||||
if (config->getConfParam("unac_except_trans", unacex) && !unacex.empty())
|
||||
unac_set_except_translations(unacex.c_str());
|
||||
|
||||
#ifndef IDX_THREADS
|
||||
ExecCmd::useVfork(true);
|
||||
#else
|
||||
// Keep threads init behind log init, but make sure it's done before
|
||||
// we do the vfork choice ! The latter is not used any more actually,
|
||||
// we always use vfork except if forbidden by config.
|
||||
config->initThrConf();
|
||||
|
||||
bool novfork;
|
||||
config->getConfParam("novfork", &novfork);
|
||||
if (novfork) {
|
||||
LOGDEB0(("rclinit: will use fork() for starting commands\n"));
|
||||
ExecCmd::useVfork(false);
|
||||
} else {
|
||||
LOGDEB0(("rclinit: will use vfork() for starting commands\n"));
|
||||
ExecCmd::useVfork(true);
|
||||
}
|
||||
#endif
|
||||
|
||||
int flushmb;
|
||||
if (config->getConfParam("idxflushmb", &flushmb) && flushmb > 0) {
|
||||
LOGDEB1(("rclinit: idxflushmb=%d, set XAPIAN_FLUSH_THRESHOLD to 10E6\n",
|
||||
flushmb));
|
||||
static const char *cp = "XAPIAN_FLUSH_THRESHOLD=1000000";
|
||||
#ifdef PUTENV_ARG_CONST
|
||||
::putenv(cp);
|
||||
#else
|
||||
::putenv(strdup(cp));
|
||||
#endif
|
||||
}
|
||||
|
||||
return config;
|
||||
}
|
||||
|
||||
// Signals are handled by the main thread. All others should call this
|
||||
// routine to block possible signals
|
||||
void recoll_threadinit()
|
||||
{
|
||||
#ifndef _WIN32
|
||||
sigset_t sset;
|
||||
sigemptyset(&sset);
|
||||
|
||||
for (unsigned int i = 0; i < sizeof(catchedSigs) / sizeof(int); i++)
|
||||
sigaddset(&sset, catchedSigs[i]);
|
||||
sigaddset(&sset, SIGHUP);
|
||||
pthread_sigmask(SIG_BLOCK, &sset, 0);
|
||||
#else
|
||||
// Not sure that this is needed at all or correct under windows.
|
||||
for (unsigned int i = 0; i < sizeof(catchedSigs) / sizeof(int); i++) {
|
||||
if (signal(catchedSigs[i], SIG_IGN) != SIG_IGN) {
|
||||
signal(catchedSigs[i], SIG_IGN);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
bool recoll_ismainthread()
|
||||
{
|
||||
return pthread_equal(pthread_self(), mainthread_id);
|
||||
}
|
||||
|
||||
|
66
src/common/rclinit.h
Normal file
66
src/common/rclinit.h
Normal file
|
@ -0,0 +1,66 @@
|
|||
/* Copyright (C) 2004 J.F.Dockes
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the
|
||||
* Free Software Foundation, Inc.,
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
#ifndef _RCLINIT_H_INCLUDED_
|
||||
#define _RCLINIT_H_INCLUDED_
|
||||
|
||||
#include <string>
|
||||
#ifndef NO_NAMESPACES
|
||||
using std::string;
|
||||
#endif
|
||||
|
||||
class RclConfig;
|
||||
/**
|
||||
* Initialize by reading configuration, opening log file, etc.
|
||||
*
|
||||
* This must be called from the main thread before starting any others. It sets
|
||||
* up the global signal handling. other threads must call recoll_threadinit()
|
||||
* when starting.
|
||||
*
|
||||
* @param flags misc modifiers. These are currently only used to customize
|
||||
* the log file and verbosity.
|
||||
* @param cleanup function to call before exiting (atexit)
|
||||
* @param sigcleanup function to call on terminal signal (INT/HUP...) This
|
||||
* should typically set a flag which tells the program (recoll,
|
||||
* recollindex etc.. to exit as soon as possible (after closing the db,
|
||||
* etc.). cleanup will then be called by exit().
|
||||
* @param reason in case of error: output string explaining things
|
||||
* @param argcnf Configuration directory name from the command line (overriding
|
||||
* default and environment
|
||||
* @return the parsed configuration.
|
||||
*/
|
||||
enum RclInitFlags {RCLINIT_NONE=0, RCLINIT_DAEMON=1, RCLINIT_IDX=2};
|
||||
extern RclConfig *recollinit(RclInitFlags flags,
|
||||
void (*cleanup)(void), void (*sigcleanup)(int),
|
||||
string &reason, const string *argcnf = 0);
|
||||
inline RclConfig *recollinit(void (*cleanup)(void), void (*sigcleanup)(int),
|
||||
string &reason, const string *argcnf = 0) {
|
||||
return recollinit(RCLINIT_NONE, cleanup, sigcleanup, reason, argcnf);
|
||||
}
|
||||
|
||||
// Threads need to call this to block signals.
|
||||
// The main thread handles all signals.
|
||||
extern void recoll_threadinit();
|
||||
|
||||
// Check if main thread
|
||||
extern bool recoll_ismainthread();
|
||||
|
||||
// Should be called while exiting asap when critical cleanup (db
|
||||
// close) has been performed. Only useful for the indexer (writes to
|
||||
// the db), and only actually does something on Windows.
|
||||
extern void recoll_exitready();
|
||||
|
||||
#endif /* _RCLINIT_H_INCLUDED_ */
|
1
src/common/rclversion.h.in
Normal file
1
src/common/rclversion.h.in
Normal file
|
@ -0,0 +1 @@
|
|||
static const char *rclversionstr = "@RCLVERSION@";
|
254
src/common/syngroups.cpp
Normal file
254
src/common/syngroups.cpp
Normal file
|
@ -0,0 +1,254 @@
|
|||
/* Copyright (C) 2014 J.F.Dockes
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the
|
||||
* Free Software Foundation, Inc.,
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
#ifndef TEST_SYNGROUPS
|
||||
#include "autoconfig.h"
|
||||
|
||||
#include "syngroups.h"
|
||||
|
||||
#include "debuglog.h"
|
||||
#include "smallut.h"
|
||||
|
||||
#include <errno.h>
|
||||
#include UNORDERED_MAP_INCLUDE
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
#include <cstring>
|
||||
|
||||
using namespace std;
|
||||
|
||||
// Note that we are storing each term twice. I don't think that the
|
||||
// size could possibly be a serious issue, but if it was, we could
|
||||
// reduce the storage a bit by storing (short hash)-> vector<int>
|
||||
// correspondances in the direct map, and then checking all the
|
||||
// resulting groups for the input word.
|
||||
//
|
||||
// As it is, a word can only index one group (the last it is found
|
||||
// in). It can be part of several groups though (appear in
|
||||
// expansions). I really don't know what we should do with multiple
|
||||
// groups anyway
|
||||
class SynGroups::Internal {
|
||||
public:
|
||||
Internal() : ok(false) {
|
||||
}
|
||||
bool ok;
|
||||
// Term to group num
|
||||
STD_UNORDERED_MAP<string, unsigned int> terms;
|
||||
// Group num to group
|
||||
vector<vector<string> > groups;
|
||||
};
|
||||
|
||||
bool SynGroups::ok()
|
||||
{
|
||||
return m && m->ok;
|
||||
}
|
||||
|
||||
SynGroups::~SynGroups()
|
||||
{
|
||||
delete m;
|
||||
}
|
||||
|
||||
SynGroups::SynGroups()
|
||||
: m(new Internal)
|
||||
{
|
||||
}
|
||||
|
||||
bool SynGroups::setfile(const string& fn)
|
||||
{
|
||||
LOGDEB(("SynGroups::setfile(%s)\n", fn.c_str()));
|
||||
if (!m) {
|
||||
m = new Internal;
|
||||
if (!m) {
|
||||
LOGERR(("SynGroups:setfile:: new Internal failed: no mem ?\n"));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (fn.empty()) {
|
||||
delete m;
|
||||
m = 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
ifstream input;
|
||||
input.open(fn.c_str(), ios::in);
|
||||
if (!input.is_open()) {
|
||||
LOGERR(("SynGroups:setfile:: could not open %s errno %d\n",
|
||||
fn.c_str(), errno));
|
||||
return false;
|
||||
}
|
||||
|
||||
string cline;
|
||||
bool appending = false;
|
||||
string line;
|
||||
bool eof = false;
|
||||
int lnum = 0;
|
||||
|
||||
for (;;) {
|
||||
cline.clear();
|
||||
getline(input, cline);
|
||||
if (!input.good()) {
|
||||
if (input.bad()) {
|
||||
LOGERR(("Syngroup::setfile(%s):Parse: input.bad()\n",
|
||||
fn.c_str()));
|
||||
return false;
|
||||
}
|
||||
// Must be eof ? But maybe we have a partial line which
|
||||
// must be processed. This happens if the last line before
|
||||
// eof ends with a backslash, or there is no final \n
|
||||
eof = true;
|
||||
}
|
||||
lnum++;
|
||||
|
||||
{
|
||||
string::size_type pos = cline.find_last_not_of("\n\r");
|
||||
if (pos == string::npos) {
|
||||
cline.clear();
|
||||
} else if (pos != cline.length()-1) {
|
||||
cline.erase(pos+1);
|
||||
}
|
||||
}
|
||||
|
||||
if (appending)
|
||||
line += cline;
|
||||
else
|
||||
line = cline;
|
||||
|
||||
// Note that we trim whitespace before checking for backslash-eol
|
||||
// This avoids invisible whitespace problems.
|
||||
trimstring(line);
|
||||
if (line.empty() || line.at(0) == '#') {
|
||||
if (eof)
|
||||
break;
|
||||
continue;
|
||||
}
|
||||
if (line[line.length() - 1] == '\\') {
|
||||
line.erase(line.length() - 1);
|
||||
appending = true;
|
||||
continue;
|
||||
}
|
||||
appending = false;
|
||||
|
||||
vector<string> words;
|
||||
if (!stringToStrings(line, words)) {
|
||||
LOGERR(("SynGroups:setfile: %s: bad line %d: %s\n",
|
||||
fn.c_str(), lnum, line.c_str()));
|
||||
continue;
|
||||
}
|
||||
|
||||
if (words.empty())
|
||||
continue;
|
||||
if (words.size() == 1) {
|
||||
LOGERR(("Syngroup::setfile(%s):single term group at line %d ??\n",
|
||||
fn.c_str(), lnum));
|
||||
continue;
|
||||
}
|
||||
|
||||
m->groups.push_back(words);
|
||||
for (vector<string>::const_iterator it = words.begin();
|
||||
it != words.end(); it++) {
|
||||
m->terms[*it] = m->groups.size()-1;
|
||||
}
|
||||
LOGDEB1(("SynGroups::setfile: group: [%s]\n",
|
||||
stringsToString(m->groups.back()).c_str()));
|
||||
}
|
||||
m->ok = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
vector<string> SynGroups::getgroup(const string& term)
|
||||
{
|
||||
vector<string> ret;
|
||||
if (!ok())
|
||||
return ret;
|
||||
|
||||
STD_UNORDERED_MAP<string, unsigned int>::const_iterator it1 =
|
||||
m->terms.find(term);
|
||||
if (it1 == m->terms.end()) {
|
||||
LOGDEB1(("SynGroups::getgroup: [%s] not found in direct map\n",
|
||||
term.c_str()));
|
||||
return ret;
|
||||
}
|
||||
|
||||
unsigned int idx = it1->second;
|
||||
if (idx >= m->groups.size()) {
|
||||
LOGERR(("SynGroups::getgroup: line index higher than line count !\n"));
|
||||
return ret;
|
||||
}
|
||||
return m->groups[idx];
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#include "syngroups.h"
|
||||
#include "debuglog.h"
|
||||
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
#include <cstdlib>
|
||||
#include <cstdio>
|
||||
|
||||
using namespace std;
|
||||
|
||||
static char *thisprog;
|
||||
|
||||
static char usage [] =
|
||||
"syngroups <synfilename> <word>\n"
|
||||
" \n\n"
|
||||
;
|
||||
static void Usage(void)
|
||||
{
|
||||
fprintf(stderr, "%s: usage:\n%s", thisprog, usage);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
static int op_flags;
|
||||
#define OPT_MOINS 0x1
|
||||
#define OPT_s 0x2
|
||||
#define OPT_b 0x4
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
thisprog = argv[0];
|
||||
argc--; argv++;
|
||||
|
||||
if (argc != 2) {
|
||||
Usage();
|
||||
}
|
||||
string fn = *argv++;argc--;
|
||||
string word = *argv++;argc--;
|
||||
|
||||
DebugLog::getdbl()->setloglevel(DEBDEB1);
|
||||
DebugLog::setfilename("stderr");
|
||||
SynGroups syns;
|
||||
syns.setfile(fn);
|
||||
if (!syns.ok()) {
|
||||
cerr << "Initialization failed\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
vector<string> group = syns.getgroup(word);
|
||||
cout << group.size() << " terms in group\n";
|
||||
for (vector<string>::const_iterator it = group.begin();
|
||||
it != group.end(); it++) {
|
||||
cout << "[" << *it << "] ";
|
||||
}
|
||||
cout << endl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
41
src/common/syngroups.h
Normal file
41
src/common/syngroups.h
Normal file
|
@ -0,0 +1,41 @@
|
|||
/* Copyright (C) 2015 J.F.Dockes
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the
|
||||
* Free Software Foundation, Inc.,
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef _SYNGROUPS_H_INCLUDED_
|
||||
#define _SYNGROUPS_H_INCLUDED_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
// Manage synonym groups. This is very different from stemming and
|
||||
// case/diac expansion because there is no reference form: all terms
|
||||
// in a group are equivalent.
|
||||
class SynGroups {
|
||||
public:
|
||||
SynGroups();
|
||||
~SynGroups();
|
||||
bool setfile(const std::string& fname);
|
||||
std::vector<std::string> getgroup(const std::string& term);
|
||||
bool ok();
|
||||
private:
|
||||
class Internal;
|
||||
Internal *m;
|
||||
SynGroups(const SynGroups&);
|
||||
SynGroups& operator=(const SynGroups&);
|
||||
};
|
||||
|
||||
#endif /* _SYNGROUPS_H_INCLUDED_ */
|
1240
src/common/textsplit.cpp
Normal file
1240
src/common/textsplit.cpp
Normal file
File diff suppressed because it is too large
Load diff
225
src/common/textsplit.h
Normal file
225
src/common/textsplit.h
Normal file
|
@ -0,0 +1,225 @@
|
|||
/* Copyright (C) 2004 J.F.Dockes
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the
|
||||
* Free Software Foundation, Inc.,
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
#ifndef _TEXTSPLIT_H_INCLUDED_
|
||||
#define _TEXTSPLIT_H_INCLUDED_
|
||||
|
||||
#include <math.h>
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
class Utf8Iter;
|
||||
|
||||
/**
|
||||
* Split text into words.
|
||||
* See comments at top of .cpp for more explanations.
|
||||
* This uses a callback function. It could be done with an iterator instead,
|
||||
* but 'ts much simpler this way...
|
||||
*/
|
||||
class TextSplit {
|
||||
public:
|
||||
// Should we activate special processing of Chinese characters ? This
|
||||
// needs a little more cpu, so it can be turned off globally. This is set
|
||||
// by rclconfig, changing it means reindexing
|
||||
static bool o_processCJK;
|
||||
static unsigned int o_CJKNgramLen;
|
||||
static const unsigned int o_CJKMaxNgramLen = 5;
|
||||
static void cjkProcessing(bool onoff, unsigned int ngramlen = 2)
|
||||
{
|
||||
o_processCJK = onoff;
|
||||
o_CJKNgramLen = ngramlen <= o_CJKMaxNgramLen ?
|
||||
ngramlen : o_CJKMaxNgramLen;
|
||||
}
|
||||
|
||||
// Are we indexing numbers ? Set by rclconfig. Change needs reindex
|
||||
static bool o_noNumbers;
|
||||
static void noNumbers()
|
||||
{
|
||||
o_noNumbers = true;
|
||||
}
|
||||
|
||||
// Given [co-worker] as input, do we also generate [coworker] ?
|
||||
// Set by rclconfig
|
||||
static bool o_deHyphenate;
|
||||
static void deHyphenate(bool on) {
|
||||
o_deHyphenate = on;
|
||||
}
|
||||
|
||||
enum Flags {
|
||||
// Default: will return spans and words (a_b, a, b)
|
||||
TXTS_NONE = 0,
|
||||
// Only return maximum spans (a@b.com, not a, b, or com)
|
||||
TXTS_ONLYSPANS = 1,
|
||||
// Special: Only return atomic words (a, b, com). This is not
|
||||
// used for indexing, but for position computation during
|
||||
// abstract generation,
|
||||
TXTS_NOSPANS = 2,
|
||||
// Handle wildcards as letters. This is used with ONLYSPANS
|
||||
// for parsing a user query (never alone).
|
||||
TXTS_KEEPWILD = 4
|
||||
};
|
||||
|
||||
TextSplit(Flags flags = Flags(TXTS_NONE))
|
||||
: m_flags(flags), m_maxWordLength(40), m_prevpos(-1)
|
||||
{
|
||||
}
|
||||
virtual ~TextSplit() {}
|
||||
|
||||
/** Split text, emit words and positions. */
|
||||
virtual bool text_to_words(const std::string &in);
|
||||
|
||||
/** Process one output word: to be implemented by the actual user class */
|
||||
virtual bool takeword(const std::string& term,
|
||||
int pos, // term pos
|
||||
int bts, // byte offset of first char in term
|
||||
int bte // byte offset of first char after term
|
||||
) = 0;
|
||||
|
||||
/** Called when we encounter formfeed \f 0x0c. Override to use the event.
|
||||
* Mostly or exclusively used with pdftoxx output. Other filters mostly
|
||||
* just don't know about pages. */
|
||||
virtual void newpage(int /*pos*/)
|
||||
{
|
||||
}
|
||||
|
||||
// Static utility functions:
|
||||
|
||||
/** Count words in string, as the splitter would generate them */
|
||||
static int countWords(const std::string &in, Flags flgs = TXTS_ONLYSPANS);
|
||||
|
||||
/** Check if this is visibly not a single block of text */
|
||||
static bool hasVisibleWhite(const std::string &in);
|
||||
|
||||
/** Split text span into strings, at white space, allowing for substrings
|
||||
* quoted with " . Escaping with \ works as usual inside the quoted areas.
|
||||
* This has to be kept separate from smallut.cpp's stringsToStrings, which
|
||||
* basically works only if whitespace is ascii, and which processes
|
||||
* non-utf-8 input (iso-8859 config files work ok). This hopefully
|
||||
* handles all Unicode whitespace, but needs correct utf-8 input
|
||||
*/
|
||||
static bool stringToStrings(const std::string &s, std::vector<std::string> &tokens);
|
||||
|
||||
/** Is char CJK ? */
|
||||
static bool isCJK(int c);
|
||||
|
||||
/** Statistics about word length (average and dispersion) can
|
||||
* detect bad data like undecoded base64 or other mis-identified
|
||||
* pieces of data taken as text. In practise, this keeps some junk out
|
||||
* of the index, but does not decrease the index size much, and is
|
||||
* probably not worth the trouble in general. Code kept because it
|
||||
* probably can be useful in special cases. Base64 data does has
|
||||
* word separators in it (+/) and is characterised by high average
|
||||
* word length (>10, often close to 20) and high word length
|
||||
* dispersion (avg/sigma > 0.8). In my tests, most natural
|
||||
* language text has average word lengths around 5-8 and avg/sigma
|
||||
* < 0.7
|
||||
*/
|
||||
#ifdef TEXTSPLIT_STATS
|
||||
class Stats {
|
||||
public:
|
||||
Stats()
|
||||
{
|
||||
reset();
|
||||
}
|
||||
void reset()
|
||||
{
|
||||
count = 0;
|
||||
totlen = 0;
|
||||
sigma_acc = 0;
|
||||
}
|
||||
void newsamp(unsigned int len)
|
||||
{
|
||||
++count;
|
||||
totlen += len;
|
||||
double avglen = double(totlen) / double(count);
|
||||
sigma_acc += (avglen - len) * (avglen - len);
|
||||
}
|
||||
struct Values {
|
||||
int count;
|
||||
double avglen;
|
||||
double sigma;
|
||||
};
|
||||
Values get()
|
||||
{
|
||||
Values v;
|
||||
v.count = count;
|
||||
v.avglen = double(totlen) / double(count);
|
||||
v.sigma = sqrt(sigma_acc / count);
|
||||
return v;
|
||||
}
|
||||
private:
|
||||
int count;
|
||||
int totlen;
|
||||
double sigma_acc;
|
||||
};
|
||||
|
||||
Stats::Values getStats()
|
||||
{
|
||||
return m_stats.get();
|
||||
}
|
||||
void resetStats()
|
||||
{
|
||||
m_stats.reset();
|
||||
}
|
||||
#endif // TEXTSPLIT_STATS
|
||||
|
||||
private:
|
||||
Flags m_flags;
|
||||
int m_maxWordLength;
|
||||
|
||||
// Current span. Might be jf.dockes@wanadoo.f
|
||||
std::string m_span;
|
||||
|
||||
std::vector <std::pair<int, int> > m_words_in_span;
|
||||
|
||||
// Current word: no punctuation at all in there. Byte offset
|
||||
// relative to the current span and byte length
|
||||
int m_wordStart;
|
||||
unsigned int m_wordLen;
|
||||
|
||||
// Currently inside number
|
||||
bool m_inNumber;
|
||||
|
||||
// Term position of current word and span
|
||||
int m_wordpos;
|
||||
int m_spanpos;
|
||||
|
||||
// It may happen that our cleanup would result in emitting the
|
||||
// same term twice. We try to avoid this
|
||||
int m_prevpos;
|
||||
int m_prevlen;
|
||||
|
||||
#ifdef TEXTSPLIT_STATS
|
||||
// Stats counters. These are processed in TextSplit rather than by a
|
||||
// TermProc so that we can take very long words (not emitted) into
|
||||
// account.
|
||||
Stats m_stats;
|
||||
#endif
|
||||
// Word length in characters. Declared but not updated if !TEXTSPLIT_STATS
|
||||
unsigned int m_wordChars;
|
||||
|
||||
// This processes cjk text:
|
||||
bool cjk_to_words(Utf8Iter *it, unsigned int *cp);
|
||||
|
||||
bool emitterm(bool isspan, std::string &term, int pos, size_t bs,size_t be);
|
||||
bool doemit(bool spanerase, size_t bp);
|
||||
void discardspan();
|
||||
bool span_is_acronym(std::string *acronym);
|
||||
bool words_from_span(size_t bp);
|
||||
};
|
||||
|
||||
#endif /* _TEXTSPLIT_H_INCLUDED_ */
|
249
src/common/unacpp.cpp
Normal file
249
src/common/unacpp.cpp
Normal file
|
@ -0,0 +1,249 @@
|
|||
/* Copyright (C) 2004 J.F.Dockes
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the
|
||||
* Free Software Foundation, Inc.,
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef TEST_UNACPP
|
||||
#include <stdio.h>
|
||||
#include <cstdlib>
|
||||
#include <errno.h>
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "unacpp.h"
|
||||
#include "unac.h"
|
||||
#include "debuglog.h"
|
||||
#include "utf8iter.h"
|
||||
|
||||
bool unacmaybefold(const string &in, string &out,
|
||||
const char *encoding, UnacOp what)
|
||||
{
|
||||
char *cout = 0;
|
||||
size_t out_len;
|
||||
int status = -1;
|
||||
|
||||
switch (what) {
|
||||
case UNACOP_UNAC:
|
||||
status = unac_string(encoding, in.c_str(), in.length(),
|
||||
&cout, &out_len);
|
||||
break;
|
||||
case UNACOP_UNACFOLD:
|
||||
status = unacfold_string(encoding, in.c_str(), in.length(),
|
||||
&cout, &out_len);
|
||||
break;
|
||||
case UNACOP_FOLD:
|
||||
status = fold_string(encoding, in.c_str(), in.length(),
|
||||
&cout, &out_len);
|
||||
break;
|
||||
}
|
||||
|
||||
if (status < 0) {
|
||||
if (cout)
|
||||
free(cout);
|
||||
char cerrno[20];
|
||||
sprintf(cerrno, "%d", errno);
|
||||
out = string("unac_string failed, errno : ") + cerrno;
|
||||
return false;
|
||||
}
|
||||
out.assign(cout, out_len);
|
||||
if (cout)
|
||||
free(cout);
|
||||
return true;
|
||||
}
|
||||
|
||||
// Functions to determine upper-case or accented status could be implemented
|
||||
// hugely more efficiently inside the unac c code, but there only used for
|
||||
// testing user-entered terms, so we don't really care.
|
||||
bool unaciscapital(const string& in)
|
||||
{
|
||||
LOGDEB2(("unaciscapital: [%s]\n", in.c_str()));
|
||||
if (in.empty())
|
||||
return false;
|
||||
Utf8Iter it(in);
|
||||
string shorter;
|
||||
it.appendchartostring(shorter);
|
||||
|
||||
string lower;
|
||||
if (!unacmaybefold(shorter, lower, "UTF-8", UNACOP_FOLD)) {
|
||||
LOGINFO(("unaciscapital: unac/fold failed for [%s]\n", in.c_str()));
|
||||
return false;
|
||||
}
|
||||
Utf8Iter it1(lower);
|
||||
if (*it != *it1)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
bool unachasuppercase(const string& in)
|
||||
{
|
||||
LOGDEB2(("unachasuppercase: [%s]\n", in.c_str()));
|
||||
if (in.empty())
|
||||
return false;
|
||||
|
||||
string lower;
|
||||
if (!unacmaybefold(in, lower, "UTF-8", UNACOP_FOLD)) {
|
||||
LOGINFO(("unachasuppercase: unac/fold failed for [%s]\n", in.c_str()));
|
||||
return false;
|
||||
}
|
||||
if (lower != in)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
bool unachasaccents(const string& in)
|
||||
{
|
||||
LOGDEB2(("unachasaccents: [%s]\n", in.c_str()));
|
||||
if (in.empty())
|
||||
return false;
|
||||
|
||||
string noac;
|
||||
if (!unacmaybefold(in, noac, "UTF-8", UNACOP_UNAC)) {
|
||||
LOGINFO(("unachasaccents: unac/unac failed for [%s]\n", in.c_str()));
|
||||
return false;
|
||||
}
|
||||
if (noac != in)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
#else // not testing
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <iostream>
|
||||
|
||||
using namespace std;
|
||||
|
||||
#include "unacpp.h"
|
||||
#include "readfile.h"
|
||||
#include "rclinit.h"
|
||||
|
||||
static char *thisprog;
|
||||
|
||||
static char usage [] = "\n"
|
||||
"[-c|-C] <encoding> <infile> <outfile>\n"
|
||||
" Default : unaccent\n"
|
||||
" -c : unaccent and casefold\n"
|
||||
" -C : casefold only\n"
|
||||
"-t <string> test string as capitalized, upper-case anywhere, accents\n"
|
||||
" the parameter is supposedly utf-8 so this can only work in an utf-8\n"
|
||||
" locale\n"
|
||||
"\n";
|
||||
;
|
||||
|
||||
static void
|
||||
Usage(void)
|
||||
{
|
||||
fprintf(stderr, "%s: usage: %s\n", thisprog, usage);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
static int op_flags;
|
||||
#define OPT_c 0x2
|
||||
#define OPT_C 0x4
|
||||
#define OPT_t 0x8
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
UnacOp op = UNACOP_UNAC;
|
||||
|
||||
thisprog = argv[0];
|
||||
argc--; argv++;
|
||||
|
||||
while (argc > 0 && **argv == '-') {
|
||||
(*argv)++;
|
||||
if (!(**argv))
|
||||
/* Cas du "adb - core" */
|
||||
Usage();
|
||||
while (**argv)
|
||||
switch (*(*argv)++) {
|
||||
case 'c': op_flags |= OPT_c; break;
|
||||
case 'C': op_flags |= OPT_C; break;
|
||||
case 't': op_flags |= OPT_t; break;
|
||||
default: Usage(); break;
|
||||
}
|
||||
argc--; argv++;
|
||||
}
|
||||
|
||||
if (op_flags & OPT_t) {
|
||||
if (argc != 1)
|
||||
Usage();
|
||||
string in = *argv++;argc--;
|
||||
bool capital, upper, accent;
|
||||
capital = unaciscapital(in);
|
||||
upper = unachasuppercase(in);
|
||||
accent = unachasaccents(in);
|
||||
cout << "[" << in << "] : " <<
|
||||
"capitalized: " << (capital ? "Yes. " : "No. ") <<
|
||||
"has uppercase: " << (upper ? "Yes. " : "No. ") <<
|
||||
"has accents: " << (accent ? "Yes. " : "No. ") <<
|
||||
endl;
|
||||
return 0;
|
||||
} else {
|
||||
if (argc != 3)
|
||||
Usage();
|
||||
if (op_flags & OPT_c) {
|
||||
op = UNACOP_UNACFOLD;
|
||||
} else if (op_flags & OPT_C) {
|
||||
op = UNACOP_FOLD;
|
||||
}
|
||||
|
||||
const char *encoding = *argv++; argc--;
|
||||
string ifn = *argv++; argc--;
|
||||
if (!ifn.compare("stdin"))
|
||||
ifn.clear();
|
||||
const char *ofn = *argv++; argc--;
|
||||
|
||||
string reason;
|
||||
(void)recollinit(RCLINIT_NONE, 0, 0, reason, 0);
|
||||
|
||||
string odata;
|
||||
if (!file_to_string(ifn, odata)) {
|
||||
cerr << "file_to_string " << ifn << " : " << odata << endl;
|
||||
return 1;
|
||||
}
|
||||
string ndata;
|
||||
if (!unacmaybefold(odata, ndata, encoding, op)) {
|
||||
cerr << "unac: " << ndata << endl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
int fd;
|
||||
if (strcmp(ofn, "stdout")) {
|
||||
fd = open(ofn, O_CREAT|O_EXCL|O_WRONLY, 0666);
|
||||
} else {
|
||||
fd = 1;
|
||||
}
|
||||
if (fd < 0) {
|
||||
cerr << "Open/Create " << ofn << " failed: " << strerror(errno)
|
||||
<< endl;
|
||||
return 1;
|
||||
}
|
||||
if (write(fd, ndata.c_str(), ndata.length()) != (int)ndata.length()) {
|
||||
cerr << "Write(2) failed: " << strerror(errno) << endl;
|
||||
return 1;
|
||||
}
|
||||
close(fd);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
40
src/common/unacpp.h
Normal file
40
src/common/unacpp.h
Normal file
|
@ -0,0 +1,40 @@
|
|||
/* Copyright (C) 2004 J.F.Dockes
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the
|
||||
* Free Software Foundation, Inc.,
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
#ifndef _UNACPP_H_INCLUDED_
|
||||
#define _UNACPP_H_INCLUDED_
|
||||
|
||||
#include <string>
|
||||
|
||||
#ifndef NO_NAMESPACES
|
||||
using std::string;
|
||||
#endif /* NO_NAMESPACES */
|
||||
|
||||
// A small stringified wrapper for unac.c
|
||||
enum UnacOp {UNACOP_UNAC = 1, UNACOP_FOLD = 2, UNACOP_UNACFOLD = 3};
|
||||
extern bool unacmaybefold(const string& in, string& out,
|
||||
const char *encoding, UnacOp what);
|
||||
|
||||
// Utility function to determine if string begins with capital
|
||||
extern bool unaciscapital(const string& in);
|
||||
// Utility function to determine if string has upper-case anywhere
|
||||
extern bool unachasuppercase(const string& in);
|
||||
// Utility function to determine if any character is accented. This
|
||||
// approprialey ignores the characters from unac_except_chars which
|
||||
// are really separate letters
|
||||
extern bool unachasaccents(const string& in);
|
||||
|
||||
#endif /* _UNACPP_H_INCLUDED_ */
|
202
src/common/uproplist.h
Normal file
202
src/common/uproplist.h
Normal file
|
@ -0,0 +1,202 @@
|
|||
/* Copyright (C) 2004 J.F.Dockes
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the
|
||||
* Free Software Foundation, Inc.,
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
#ifndef _PROPLIST_H_INCLUDED_
|
||||
#define _PROPLIST_H_INCLUDED_
|
||||
|
||||
|
||||
/**
|
||||
* A subset of Unicode chars that we consider word breaks when we
|
||||
* split text in words.
|
||||
*
|
||||
* This is used as a quick fix to the ascii-based code, and is not correct.
|
||||
* the correct way would be to do what http://www.unicode.org/reports/tr29/
|
||||
* says.
|
||||
*/
|
||||
|
||||
// Punctuation chararacters blocks array. Each block is defined by a
|
||||
// starting and ending code point (both included). MUST BE SORTED.
|
||||
static const unsigned unipuncblocks[] = {
|
||||
// Start of latin-1 supplement block, up to capital A grave
|
||||
0x0080, 0x00BF,
|
||||
// General punctuation
|
||||
0x2000, 0x206F,
|
||||
// Superscripts and subscripts
|
||||
0x2070, 0x209F,
|
||||
// Currency symbols
|
||||
0x20A0, 0x20CF,
|
||||
// Letterlike symbols
|
||||
0x2100, 0x214f,
|
||||
// Number forms
|
||||
0x2150, 0x218F,
|
||||
// Arrows
|
||||
0x2190, 0x21FF,
|
||||
// Mathematical Operators
|
||||
0x2200, 0x22FF,
|
||||
// Miscellaneous Technical
|
||||
0x2300, 0x23FF,
|
||||
// Control Pictures
|
||||
0x2400, 0x243F,
|
||||
// Optical Character Recognition
|
||||
0x2440, 0x245F,
|
||||
// Enclosed Alphanumerics
|
||||
0x2460, 0x24FF,
|
||||
// Box Drawing
|
||||
0x2500, 0x257F,
|
||||
// Block Elements
|
||||
0x2580, 0x259F,
|
||||
// Geometric Shapes
|
||||
0x25A0, 0x25FF,
|
||||
// Miscellaneous Symbols
|
||||
0x2600, 0x26FF,
|
||||
// Dingbats
|
||||
0x2700, 0x27BF,
|
||||
// Miscellaneous Mathematical Symbols-A
|
||||
0x27C0, 0x27EF,
|
||||
// Supplemental Arrows-A
|
||||
0x27F0, 0x27FF,
|
||||
// Supplemental Arrows-B
|
||||
0x2900, 0x297F,
|
||||
// Miscellaneous Mathematical Symbols-B
|
||||
0x2980, 0x29FF,
|
||||
// Supplemental Mathematical Operators
|
||||
0x2A00, 0x2AFF,
|
||||
// Miscellaneous Symbols and Arrows
|
||||
0x2B00, 0x2BFF,
|
||||
};
|
||||
|
||||
// Other punctuation characters list. Not all punctuation is in a
|
||||
// separate block some is found in the middle of alphanumeric codes.
|
||||
static const unsigned int unipunc[] = {
|
||||
0x00D7, /* MULTIPLICATION SIGN */
|
||||
0x00F7, /* DIVISION SIGN */
|
||||
0x037E, /* GREEK QUESTION MARK */
|
||||
0x0387, /* GREEK ANO TELEIA */
|
||||
0x055C, /* ARMENIAN EXCLAMATION MARK */
|
||||
0x055E, /* ARMENIAN QUESTION MARK */
|
||||
0x0589, /* ARMENIAN FULL STOP */
|
||||
0x058A, /* ARMENIAN HYPHEN */
|
||||
0x05C3, /* HEBREW PUNCTUATION SOF PASUQ */
|
||||
0x060C, /* ARABIC COMMA */
|
||||
0x061B, /* ARABIC SEMICOLON */
|
||||
0x061F, /* ARABIC QUESTION MARK */
|
||||
0x06D4, /* ARABIC FULL STOP */
|
||||
0x0964, /* DEVANAGARI DANDA */
|
||||
0x0965, /* DEVANAGARI DOUBLE DANDA */
|
||||
0x166E, /* CANADIAN SYLLABICS FULL STOP */
|
||||
0x1680, /* OGHAM SPACE MARK */
|
||||
0x16EB, /* RUNIC SINGLE PUNCTUATION */
|
||||
0x16EC, /* RUNIC MULTIPLE PUNCTUATION */
|
||||
0x16ED, /* RUNIC CROSS PUNCTUATION */
|
||||
0x1803, /* MONGOLIAN FULL STOP */
|
||||
0x1806, /* MONGOLIAN TODO SOFT HYPHEN */
|
||||
0x1809, /* MONGOLIAN MANCHU FULL STOP */
|
||||
0x180E, /* MONGOLIAN VOWEL SEPARATOR */
|
||||
0x2E2E, /* REVERSED QUESTION MARK;Po;0;ON;;;;;N;;;;; */
|
||||
0x3000, /* IDEOGRAPHIC SPACE*/
|
||||
0x3002, /* IDEOGRAPHIC FULL STOP*/
|
||||
0x300C, /* LEFT CORNER BRACKET*/
|
||||
0x300D, /* RIGHT CORNER BRACKET*/
|
||||
0x300E, /* LEFT WHITE CORNER BRACKET*/
|
||||
0x300F, /* RIGHT WHITE CORNER BRACKET*/
|
||||
0x301C, /* WAVE DASH*/
|
||||
0x301D, /* REVERSED DOUBLE PRIME QUOTATION MARK*/
|
||||
0x301E, /* LOW DOUBLE PRIME QUOTATION MARK*/
|
||||
0x3030, /* WAVY DASH*/
|
||||
0x30FB, /* KATAKANA MIDDLE DOT*/
|
||||
0xC2B6, /* PILCROW SIGN;So;0;ON;;;;;N;PARAGRAPH SIGN;;;; */
|
||||
0xC3B7, /* DIVISION SIGN;Sm;0;ON;;;;;N;;;;; */
|
||||
0xFE31, /* PRESENTATION FORM FOR VERTICAL EM DASH*/
|
||||
0xFE32, /* PRESENTATION FORM FOR VERTICAL EN DASH*/
|
||||
0xFE41, /* PRESENTATION FORM FOR VERTICAL LEFT CORNER BRACKET*/
|
||||
0xFE42, /* PRESENTATION FORM FOR VERTICAL RIGHT CORNER BRACKET*/
|
||||
0xFE43, /* PRESENTATION FORM FOR VERTICAL LEFT WHITE CORNER BRACKET*/
|
||||
0xFE44, /* PRESENTATION FORM FOR VERTICAL RIGHT WHITE CORNER BRACKET*/
|
||||
0xFE50, /* [3] SMALL COMMA..SMALL FULL STOP*/
|
||||
0xFE51, /* [3] SMALL COMMA..SMALL FULL STOP*/
|
||||
0xFE52, /* STOP*/
|
||||
0xFE52, /* [3] SMALL COMMA..SMALL FULL STOP*/
|
||||
0xFE54, /* [4] SMALL SEMICOLON..SMALL EXCLAMATION MARK*/
|
||||
0xFE55, /* [4] SMALL SEMICOLON..SMALL EXCLAMATION MARK*/
|
||||
0xFE56, /* [4] SMALL SEMICOLON..SMALL EXCLAMATION MARK*/
|
||||
0xFE57, /* [4] SMALL SEMICOLON..SMALL EXCLAMATION MARK*/
|
||||
0xFE58, /* SMALL EM DASH */
|
||||
0xFE63, /* SMALL HYPHEN-MINUS */
|
||||
0xFF01, /* FULLWIDTH EXCLAMATION MARK */
|
||||
0xFF02, /* FULLWIDTH QUOTATION MARK */
|
||||
0xFF03, /* FULLWIDTH NUMBER SIGN */
|
||||
0xFF04, /* FULLWIDTH DOLLAR SIGN */
|
||||
0xFF05, /* FULLWIDTH PERCENT SIGN */
|
||||
0xFF06, /* FULLWIDTH AMPERSAND */
|
||||
0xFF07, /* FULLWIDTH APOSTROPHE */
|
||||
0xFF08, /* FULLWIDTH LEFT PARENTHESIS */
|
||||
0xFF09, /* FULLWIDTH RIGHT PARENTHESIS */
|
||||
0xFF0A, /* FULLWIDTH ASTERISK */
|
||||
0xFF0B, /* FULLWIDTH PLUS SIGN */
|
||||
0xFF0C, /* FULLWIDTH COMMA */
|
||||
0xFF0D, /* FULLWIDTH HYPHEN-MINUS */
|
||||
0xFF0E, /* FULLWIDTH FULL STOP */
|
||||
0xFF0F, /* FULLWIDTH SOLIDUS */
|
||||
0xFF1A, /* [2] FULLWIDTH COLON..FULLWIDTH SEMICOLON*/
|
||||
0xFF1B, /* [2] FULLWIDTH COLON..FULLWIDTH SEMICOLON*/
|
||||
0xFF1F, /* FULLWIDTH QUESTION MARK*/
|
||||
0xFF61, /* HALFWIDTH IDEOGRAPHIC FULL STOP*/
|
||||
0xFF62, /* HALFWIDTH LEFT CORNER BRACKET*/
|
||||
0xFF63, /* HALFWIDTH RIGHT CORNER BRACKET*/
|
||||
0xFF64, /* HALFWIDTH IDEOGRAPHIC COMMA*/
|
||||
0xFF65, /* HALFWIDTH KATAKANA MIDDLE DOT*/
|
||||
};
|
||||
|
||||
// Characters that should just be discarded. Some of these are in the
|
||||
// above blocks, but this array is tested first, so it's not worth
|
||||
// breaking the blocks
|
||||
static const unsigned int uniskip[] = {
|
||||
0x00AD, /* SOFT HYPHEN */
|
||||
0x034F, /* COMBINING GRAPHEME JOINER */
|
||||
0x2027, /* HYPHENATION POINT */
|
||||
0x200C, /* ZERO WIDTH NON-JOINER */
|
||||
0x200D, /* ZERO WIDTH JOINER */
|
||||
0x2060, /* WORD JOINER . Actually this should not be ignored but used to
|
||||
* prevent a word break... */
|
||||
};
|
||||
|
||||
/* Things that would visibly break a block of text, rendering obvious the need
|
||||
* of quotation if a phrase search is wanted */
|
||||
static const unsigned int avsbwht[] = {
|
||||
0x0009, /* CHARACTER TABULATION */
|
||||
0x000A, /* LINE FEED */
|
||||
0x000D, /* CARRIAGE RETURN */
|
||||
0x0020, /* SPACE;Zs;0;WS */
|
||||
0x00A0, /* NO-BREAK SPACE;Zs;0;CS */
|
||||
0x1680, /* OGHAM SPACE MARK;Zs;0;WS */
|
||||
0x180E, /* MONGOLIAN VOWEL SEPARATOR;Zs;0;WS */
|
||||
0x2000, /* EN QUAD;Zs;0;WS */
|
||||
0x2001, /* EM QUAD;Zs;0;WS */
|
||||
0x2002, /* EN SPACE;Zs;0;WS */
|
||||
0x2003, /* EM SPACE;Zs;0;WS */
|
||||
0x2004, /* THREE-PER-EM SPACE;Zs;0;WS */
|
||||
0x2005, /* FOUR-PER-EM SPACE;Zs;0;WS */
|
||||
0x2006, /* SIX-PER-EM SPACE;Zs;0;WS */
|
||||
0x2007, /* FIGURE SPACE;Zs;0;WS */
|
||||
0x2008, /* PUNCTUATION SPACE;Zs;0;WS */
|
||||
0x2009, /* THIN SPACE;Zs;0;WS */
|
||||
0x200A, /* HAIR SPACE;Zs;0;WS */
|
||||
0x202F, /* NARROW NO-BREAK SPACE;Zs;0;CS */
|
||||
0x205F, /* MEDIUM MATHEMATICAL SPACE;Zs;0;WS */
|
||||
0x3000, /* IDEOGRAPHIC SPACE;Zs;0;WS */
|
||||
};
|
||||
|
||||
#endif // _PROPLIST_H_INCLUDED_
|
569
src/configure.ac
Normal file
569
src/configure.ac
Normal file
|
@ -0,0 +1,569 @@
|
|||
AC_INIT([Recoll], m4_esyscmd_s(cat VERSION))
|
||||
AC_CONFIG_HEADERS([common/autoconfig.h])
|
||||
AH_BOTTOM([#include "conf_post.h"])
|
||||
AC_PREREQ(2.53)
|
||||
AC_CONFIG_SRCDIR(index/recollindex.cpp)
|
||||
|
||||
AM_INIT_AUTOMAKE([1.10 no-define subdir-objects foreign])
|
||||
AC_DISABLE_STATIC
|
||||
LT_INIT
|
||||
AC_CONFIG_MACRO_DIR([m4])
|
||||
|
||||
AC_PROG_CXX
|
||||
if test C$CXX = C ; then
|
||||
AC_MSG_ERROR([C++ compiler needed. Please install one (ie: gnu g++)])
|
||||
fi
|
||||
|
||||
AC_PROG_YACC
|
||||
|
||||
AC_PROG_LIBTOOL
|
||||
AC_C_BIGENDIAN
|
||||
|
||||
AC_SYS_LARGEFILE
|
||||
|
||||
# OpenBSD needs sys/param.h for mount.h to compile
|
||||
AC_CHECK_HEADERS([sys/param.h, spawn.h])
|
||||
|
||||
AC_CHECK_FUNCS([posix_spawn, setrlimit])
|
||||
|
||||
if test "x$ac_cv_func_posix_spawn" = xyes; then :
|
||||
AC_ARG_ENABLE(posix_spawn,
|
||||
AC_HELP_STRING([--enable-posix_spawn],
|
||||
[Enable the use of posix_spawn().]),
|
||||
posixSpawnEnabled=$enableval, posixSpawnEnabled=no)
|
||||
fi
|
||||
if test X$posixSpawnEnabled = Xyes ; then
|
||||
AC_DEFINE(USE_POSIX_SPAWN, 1, [Use posix_spawn()])
|
||||
fi
|
||||
|
||||
# Check for where to find unordered_map etc.
|
||||
AC_LANG_PUSH([C++])
|
||||
AC_CHECK_HEADER(tr1/unordered_map,[AC_DEFINE([HAVE_TR1_UNORDERED],
|
||||
[],["Have tr1"])],[])
|
||||
AC_CHECK_HEADER(unordered_map,[AC_DEFINE([HAVE_CXX0X_UNORDERED],
|
||||
[],["Have C++0x"])],[])
|
||||
AC_TRY_COMPILE([
|
||||
#include <memory>
|
||||
],[
|
||||
std::shared_ptr<int> ptr;
|
||||
], rcl_shared_ptr_std="1", rcl_shared_ptr_std="0")
|
||||
AC_TRY_COMPILE([
|
||||
#include <tr1/memory>
|
||||
],[
|
||||
std::tr1::shared_ptr<int> ptr;
|
||||
], rcl_shared_ptr_tr1="1", rcl_shared_ptr_tr1="0")
|
||||
if test X$rcl_shared_ptr_std = X1; then
|
||||
AC_DEFINE(HAVE_SHARED_PTR_STD, [], [Has std::shared_ptr])
|
||||
elif test X$rcl_shared_ptr_tr1 = X1; then
|
||||
AC_DEFINE(HAVE_SHARED_PTR_TR1, [], [Has std::tr1::shared_ptr])
|
||||
fi
|
||||
AC_LANG_POP([C++])
|
||||
|
||||
AC_CHECK_HEADERS([sys/mount.h sys/statfs.h sys/statvfs.h sys/vfs.h], [], [],
|
||||
[#ifdef HAVE_SYS_PARAM_H
|
||||
# include <sys/param.h>
|
||||
#endif
|
||||
])
|
||||
|
||||
# Use specific 'file' command ? (Useful on solaris to specify
|
||||
# /usr/local/bin/file instead of the system's which doesn't understand '-i'
|
||||
AC_ARG_WITH(file-command,
|
||||
AC_HELP_STRING([--with-file-command],
|
||||
[Specify version of 'file' command (ie: --with-file-command=/usr/local/bin/file)]),
|
||||
withFileCommand=$withval, withFileCommand=file)
|
||||
case $withFileCommand in
|
||||
file)
|
||||
AC_PATH_PROG(fileProg, file);;
|
||||
*)
|
||||
fileProg=$withFileCommand;;
|
||||
esac
|
||||
|
||||
if test ! -x "$fileProg"; then
|
||||
AC_MSG_ERROR([$fileProg does not exist or is not executable])
|
||||
fi
|
||||
AC_DEFINE_UNQUOTED(FILE_PROG, "$fileProg", [Path to the file program])
|
||||
|
||||
# Can't use Solaris standard 'file' command, it doesn't support -i
|
||||
if test X$sys != XSunOS -o X$fileProg != X/usr/bin/file; then
|
||||
AC_DEFINE(USE_SYSTEM_FILE_COMMAND, 1, [Enable using the system's 'file' command to id mime if we fail internally])
|
||||
fi
|
||||
|
||||
|
||||
# Use aspell to provide spelling expansions ?
|
||||
# The default is yes. If we do find an aspell installation, we use it. Else
|
||||
# we do compile the aspell module using an internal copy of aspell.h
|
||||
# Only --with-aspell=no will completely disable aspell support
|
||||
AC_ARG_WITH(aspell,
|
||||
AC_HELP_STRING([--without-aspell],
|
||||
[Disable use of aspell spelling package to provide term expansion to other spellings]),
|
||||
withAspell=$withval, withAspell=yes)
|
||||
case $withAspell in
|
||||
no);;
|
||||
yes)
|
||||
AC_PATH_PROG(aspellProg, aspell)
|
||||
;;
|
||||
*) # The argument should be the path to the aspell program
|
||||
aspellProg=$withAspell
|
||||
;;
|
||||
esac
|
||||
|
||||
if test X$withAspell != Xno ; then
|
||||
AC_DEFINE(RCL_USE_ASPELL, 1, [Compile the aspell interface])
|
||||
if test X$aspellProg != X ; then
|
||||
aspellBase=`dirname $aspellProg`
|
||||
aspellBase=`dirname $aspellBase`
|
||||
AC_DEFINE_UNQUOTED(ASPELL_PROG, "$aspellProg",
|
||||
[Path to the aspell program])
|
||||
if test -f $aspellBase/include/aspell.h ; then
|
||||
AC_DEFINE_UNQUOTED(ASPELL_INCLUDE, "$aspellBase/include/aspell.h",
|
||||
[Path to the aspell api include file])
|
||||
else
|
||||
AC_MSG_NOTICE([aspell support enabled but aspell package not found. Compiling with internal aspell interface file])
|
||||
AC_DEFINE(ASPELL_INCLUDE, ["aspell-local.h"])
|
||||
fi
|
||||
else
|
||||
# aspell support enabled but no aspell install yet
|
||||
AC_MSG_NOTICE([aspell support enabled but aspell package not found. Compiling with internal aspell interface file])
|
||||
AC_DEFINE(ASPELL_INCLUDE, ["aspell-local.h"])
|
||||
fi
|
||||
fi
|
||||
|
||||
if test -f /usr/include/sys/inotify.h -o -f /usr/include/linux/inotify.h; then
|
||||
inot_default=yes
|
||||
else
|
||||
inot_default=no
|
||||
fi
|
||||
|
||||
# Real time monitoring with inotify
|
||||
AC_ARG_WITH(inotify,
|
||||
AC_HELP_STRING([--with-inotify],
|
||||
[Use inotify for almost real time indexing of modified files (the default
|
||||
is yes on Linux).]),
|
||||
withInotify=$withval, withInotify=$inot_default)
|
||||
|
||||
if test X$withInotify != Xno ; then
|
||||
AC_MSG_NOTICE([enabled support for inotify monitoring])
|
||||
AC_DEFINE(RCL_MONITOR, 1, [Real time monitoring option])
|
||||
AC_DEFINE(RCL_USE_INOTIFY, 1, [Compile the inotify interface])
|
||||
else
|
||||
AC_MSG_NOTICE([inotify not found, inotify monitoring disabled])
|
||||
fi
|
||||
|
||||
# Real time monitoring with FAM
|
||||
AC_ARG_WITH(fam,
|
||||
AC_HELP_STRING([--with-fam],
|
||||
[Use File Alteration Monitor for almost real time indexing of modified files. Give the fam/gamin library as argument (ie: /usr/lib/libfam.so) if configure does not find the right one.]),
|
||||
withFam=$withval, withFam=yes)
|
||||
|
||||
if test X$withFam != Xno -a X$withInotify != Xno ; then
|
||||
AC_MSG_NOTICE([FAM support enabled but inotify support also enabled. Disabling FAM support and using inotify])
|
||||
withFam=no
|
||||
fi
|
||||
|
||||
famLib=""
|
||||
case $withFam in
|
||||
no);;
|
||||
yes)
|
||||
for dir in /usr/local/lib ${libdir};do
|
||||
if test -f $dir/libfam.so ; then famLib=$dir/libfam.so;break;fi
|
||||
done
|
||||
if test X$famLib = X ; then
|
||||
AC_MSG_NOTICE([FAM library not found, disabling FAM and real time indexing support])
|
||||
withFam=no
|
||||
fi
|
||||
;;
|
||||
*) # The argument should be the path to the fam library
|
||||
famLib=$withFam
|
||||
;;
|
||||
esac
|
||||
|
||||
if test X$withFam != Xno ; then
|
||||
AC_DEFINE(RCL_MONITOR, 1, [Real time monitoring option])
|
||||
AC_DEFINE(RCL_USE_FAM, 1, [Compile the fam interface])
|
||||
if test X$famLib != X ; then
|
||||
famLibDir=`dirname $famLib`
|
||||
famBase=`dirname $famLibDir`
|
||||
famBLib=`basename $famLib .so | sed -e s/lib//`
|
||||
if test ! -f $famBase/include/fam.h ; then
|
||||
AC_MSG_ERROR([fam.h not found in $famBase/include. Specify --with-fam=no to disable fam support])
|
||||
fi
|
||||
LIBFAM="-L$famLibDir -l$famBLib"
|
||||
AC_MSG_NOTICE([fam library directive: $LIBFAM])
|
||||
AC_DEFINE_UNQUOTED(FAM_INCLUDE, "$famBase/include/fam.h",
|
||||
[Path to the fam api include file])
|
||||
else
|
||||
AC_MSG_ERROR([fam library not found])
|
||||
fi
|
||||
fi
|
||||
|
||||
# Enable use of threads in the indexing pipeline.
|
||||
# This is disabled by default as we usually care little about indexing
|
||||
# absolute performance (more about impact on usability and total
|
||||
# resources used).
|
||||
AC_ARG_ENABLE(idxthreads,
|
||||
AC_HELP_STRING([--disable-idxthreads],
|
||||
[Disable multithread indexing.]),
|
||||
idxthreadsEnabled=$enableval, idxthreadsEnabled=yes)
|
||||
AM_CONDITIONAL(NOTHREADS, [test X$idxthreadsEnabled = Xno])
|
||||
if test X$idxthreadsEnabled = Xyes ; then
|
||||
AC_DEFINE(IDX_THREADS, 1, [Use multiple threads for indexing])
|
||||
fi
|
||||
|
||||
# Enable CamelCase word splitting. This is optional because it causes
|
||||
# problems with phrases: with camelcase enabled, "MySQL manual"
|
||||
# will be matched by "MySQL manual" and "my sql manual" but not
|
||||
# "mysql manual" (which would need increased slack as manual is now at pos
|
||||
# 2 instead of 1
|
||||
AC_ARG_ENABLE(camelcase,
|
||||
AC_HELP_STRING([--enable-camelcase],
|
||||
[Enable splitting camelCase words. This is not enabled by default as
|
||||
this makes phrase matches more difficult: you need to use matching
|
||||
case in the phrase query to get a match. Ie querying for
|
||||
"MySQL manual" and "my sql manual" are the same, but not the same as
|
||||
"mysql manual" (in phrases only and you could raise the phrase slack to
|
||||
get a match).]),
|
||||
camelcaseEnabled=$enableval, camelcaseEnabled=no)
|
||||
if test X$camelcaseEnabled = Xyes ; then
|
||||
AC_DEFINE(RCL_SPLIT_CAMELCASE, 1, [Split camelCase words])
|
||||
fi
|
||||
|
||||
# Disable building the python module.
|
||||
if test X$sys != XDarwin ; then
|
||||
AC_ARG_ENABLE(python-module,
|
||||
AC_HELP_STRING([--disable-python-module],
|
||||
[Do not build the Python module.]),
|
||||
pythonEnabled=$enableval, pythonEnabled=yes)
|
||||
else
|
||||
pythonEnabled=no
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL(MAKEPYTHON, [test X$pythonEnabled = Xyes])
|
||||
|
||||
|
||||
AC_CHECK_FUNCS(mkdtemp)
|
||||
AC_CHECK_LIB([pthread], [pthread_create], [], [])
|
||||
AC_CHECK_LIB([dl], [dlopen], [], [])
|
||||
AC_CHECK_LIB([z], [zlibVersion], [], [])
|
||||
|
||||
##### Look for iconv. This can exist in either libc (ie: Linux, solaris) or
|
||||
##### libiconv. We'd need a --with-libiconv= option
|
||||
AC_LANG(C++)
|
||||
LIBICONV=""
|
||||
S_LIBS=$LIBS
|
||||
S_CPPFLAGS=$CPPFLAGS
|
||||
for dir in ${libdir} /opt/local/lib /usr/local/lib;do
|
||||
CPPFLAGS="$S_CPPFLAGS -I$dir/../include"
|
||||
|
||||
LIBS="$S_LIBS -L$dir"
|
||||
AC_TRY_LINK([#include <stdlib.h>
|
||||
#include <iconv.h>],
|
||||
[iconv_t cd = iconv_open("","");
|
||||
iconv(cd,NULL,NULL,NULL,NULL);
|
||||
iconv_close(cd);],
|
||||
LIBICONV="-L$dir";INCICONV=-I$dir/../include)
|
||||
if test A"$LIBICONV" != A ; then
|
||||
break
|
||||
fi
|
||||
|
||||
LIBS="$S_LIBS -L$dir -liconv"
|
||||
AC_TRY_LINK([#include <stdlib.h>
|
||||
#include <iconv.h>],
|
||||
[iconv_t cd = iconv_open("","");
|
||||
iconv(cd,NULL,NULL,NULL,NULL);
|
||||
iconv_close(cd);],
|
||||
LIBICONV="-L$dir -liconv";INCICONV=-I$dir/../include)
|
||||
if test A"$LIBICONV" != A ; then
|
||||
break
|
||||
fi
|
||||
|
||||
done
|
||||
|
||||
LIBS=$S_LIBS
|
||||
CPPFLAGS=$S_CPPFLAGS
|
||||
|
||||
if test A"$LIBICONV" = A ; then
|
||||
AC_MSG_ERROR([Cannot find iconv_open anywhere. Please install iconv])
|
||||
exit 1
|
||||
fi
|
||||
#echo LIBICONV $LIBICONV
|
||||
#echo INCICONV $INCICONV
|
||||
|
||||
CPPFLAGS="$CPPFLAGS $INCICONV"
|
||||
AC_MSG_CHECKING(for type of inbuf parameter to iconv)
|
||||
AC_TRY_COMPILE([
|
||||
#include <stddef.h>
|
||||
#include <iconv.h>
|
||||
],[
|
||||
iconv(0,(const char **)0,(size_t *)0,(char **)0,(size_t *)0);
|
||||
], rcl_iconv_inbuf_const="1", rcl_iconv_inbuf_const="0")
|
||||
if test X$rcl_iconv_inbuf_const = X1 ; then
|
||||
AC_DEFINE(RCL_ICONV_INBUF_CONST, 1, [iconv parameter 2 is const char**])
|
||||
fi
|
||||
|
||||
|
||||
############# Putenv
|
||||
AC_MSG_CHECKING(for type of string parameter to putenv)
|
||||
AC_TRY_COMPILE([
|
||||
#include <stdlib.h>
|
||||
],[
|
||||
putenv((const char *)0);
|
||||
], rcl_putenv_string_const="1", rcl_putenv_string_const="0")
|
||||
if test X$rcl_putenv_string_const = X1 ; then
|
||||
AC_DEFINE(PUTENV_ARG_CONST, 1, [putenv parameter is const])
|
||||
fi
|
||||
|
||||
|
||||
#### Look for Xapian. Done in a strange way to work around autoconf
|
||||
# cache
|
||||
XAPIAN_CONFIG=no
|
||||
if test "$XAPIAN_CONFIG" = "no"; then
|
||||
AC_PATH_PROG(XAPIAN_CONFIG0, [xapian-config], no)
|
||||
XAPIAN_CONFIG=$XAPIAN_CONFIG0
|
||||
fi
|
||||
if test "$XAPIAN_CONFIG" = "no"; then
|
||||
AC_PATH_PROG(XAPIAN_CONFIG1, [xapian-config-1.3], no)
|
||||
XAPIAN_CONFIG=$XAPIAN_CONFIG1
|
||||
fi
|
||||
if test "$XAPIAN_CONFIG" = "no"; then
|
||||
AC_PATH_PROG(XAPIAN_CONFIG2, [xapian-config-1.1], no)
|
||||
XAPIAN_CONFIG=$XAPIAN_CONFIG2
|
||||
fi
|
||||
|
||||
if test "$XAPIAN_CONFIG" = "no" ; then
|
||||
AC_MSG_ERROR([Cannot find xapian-config command in $PATH. Is
|
||||
xapian-core installed ?])
|
||||
exit 1
|
||||
fi
|
||||
LIBXAPIAN=`$XAPIAN_CONFIG --libs`
|
||||
# The --static thing fails with older Xapians. Happily enough they don't
|
||||
# need it either (because there are no needed libraries (no uuid and we
|
||||
# deal explicitely with libz)
|
||||
LIBXAPIANSTATICEXTRA=`$XAPIAN_CONFIG --static --libs 2> /dev/null`
|
||||
# Workaround for problem in xapian-config in some versions: wrongly lists
|
||||
# libstdc++.la in the lib list
|
||||
for i in $LIBXAPIAN ; do
|
||||
case $i in
|
||||
*stdc++*|-lm|-lgcc_s|-lc);;
|
||||
*) tmpxaplib="$tmpxaplib $i";;
|
||||
esac
|
||||
done
|
||||
LIBXAPIAN=$tmpxaplib
|
||||
LIBXAPIANDIR=`$XAPIAN_CONFIG --libs | awk '{print $1}'`
|
||||
case A"$LIBXAPIANDIR" in
|
||||
A-L*) LIBXAPIANDIR=`echo $LIBXAPIANDIR | sed -e 's/-L//'`;;
|
||||
*) LIBXAPIANDIR="";;
|
||||
esac
|
||||
XAPIANCXXFLAGS=`$XAPIAN_CONFIG --cxxflags`
|
||||
|
||||
#echo XAPIAN_CONFIG: $XAPIAN_CONFIG
|
||||
#echo LIBXAPIAN: $LIBXAPIAN
|
||||
#echo LIBXAPIANDIR: $LIBXAPIANDIR
|
||||
#echo LIBXAPIANSTATICEXTRA: $LIBXAPIANSTATICEXTRA
|
||||
#echo XAPIANCXXFLAGS: $XAPIANCXXFLAGS
|
||||
|
||||
AC_ARG_ENABLE(xadump,
|
||||
AC_HELP_STRING([--enable-xadump],
|
||||
[Enable building the xadump low level Xapian access program.]),
|
||||
enableXADUMP=$enableval, enableXADUMP="no")
|
||||
AM_CONDITIONAL(MAKEXADUMP, [test X$enableXADUMP = Xyes])
|
||||
|
||||
AC_ARG_ENABLE(userdoc,
|
||||
AC_HELP_STRING([--disable-userdoc],
|
||||
[Disable building the user manual. (Avoids the need for docbook xml/xsl files and TeX tools.]),
|
||||
enableUserdoc=$enableval, enableUserdoc="yes")
|
||||
AM_CONDITIONAL(MAKEUSERDOC, [test X$enableUserdoc = Xyes])
|
||||
|
||||
|
||||
|
||||
#### QT
|
||||
# The way qt and its tools (qmake especially) are installed is very
|
||||
# different between systems (and maybe qt versions)
|
||||
#
|
||||
# In general we need QTDIR to be set, because it is used inside the
|
||||
# qmake-generated makefiles. But there are exceptions: ie on debian3.1 (at
|
||||
# least on the sourceforge compile farm), QTDIR is not needed because qmake
|
||||
# generates hard paths (and is installed in /usr/bin). We don't want to
|
||||
# force the user to set QTDIR if it is not needed.
|
||||
#
|
||||
# The logic is then to first look for qmake, possibly using QTDIR if it is
|
||||
# set.
|
||||
#
|
||||
# If QTDIR is not set, we then generate a bogus qt project and check if
|
||||
# QTDIR is needed in the Makefile, in which case we complain.
|
||||
#
|
||||
# QMAKESPEC: on most Linux system, there is a 'default' link inside the
|
||||
# mkspecs directory, so that QMAKESPEC is not needed.
|
||||
# If QMAKESPEC is not set and needed, the qmake test at the previous test
|
||||
# will have failed, and we tell the user to check his environment.
|
||||
#
|
||||
AC_ARG_ENABLE(qtgui,
|
||||
AC_HELP_STRING([--disable-qtgui],
|
||||
[Disable the QT-based graphical user interface.]),
|
||||
enableQT=$enableval, enableQT="yes")
|
||||
AM_CONDITIONAL(MAKEQT, [test X$enableQT = Xyes])
|
||||
|
||||
AC_ARG_ENABLE(recollq,
|
||||
AC_HELP_STRING([--enable-recollq],
|
||||
[Enable building the recollq command line query tool (recoll -t without
|
||||
need for Qt). This is done by default if --disable-qtgui is set but this
|
||||
option enables forcing it.]),
|
||||
enableRECOLLQ=$enableval, enableRECOLLQ="no")
|
||||
if test X"$enableRECOLLQ" != X ; then
|
||||
AM_CONDITIONAL(MAKECMDLINE, [test X$enableRECOLLQ = Xyes])
|
||||
else
|
||||
AM_CONDITIONAL(MAKECMDLINE, [test X$enableQT = Xno])
|
||||
fi
|
||||
|
||||
|
||||
if test X$enableQT = Xyes ; then
|
||||
|
||||
if test X$QTDIR != X ; then
|
||||
PATH=$PATH:$QTDIR/bin
|
||||
export PATH
|
||||
fi
|
||||
|
||||
if test X$QMAKE = X ; then
|
||||
QMAKE=qmake
|
||||
fi
|
||||
case $QMAKE in
|
||||
*/*) QMAKEPATH=$QMAKE;;
|
||||
*) AC_PATH_PROG([QMAKEPATH], $QMAKE, NOTFOUND);;
|
||||
esac
|
||||
|
||||
if test X$QMAKEPATH = XNOTFOUND ; then
|
||||
AC_MSG_ERROR([Cannot find the qmake program. Maybe you need to install
|
||||
qt development files and tools and/or set the QTDIR environment variable?])
|
||||
fi
|
||||
QMAKE=$QMAKEPATH
|
||||
|
||||
# MAC OS X: we don't support this (the native search tool is more than
|
||||
# good enough), but we make things work just enough so that the program can
|
||||
# be compiled and roughly installed (not as a .app, but to /usr/local),
|
||||
# basically to enable using a Macbook for development
|
||||
if test X$sys = XDarwin ; then
|
||||
# The default is xcode
|
||||
QMAKE="${QMAKE} -spec macx-g++"
|
||||
fi
|
||||
|
||||
# Check Qt version
|
||||
qmakevers="`${QMAKE} --version 2>&1`"
|
||||
#echo "qmake version: $qmakevers"
|
||||
v4=`expr "$qmakevers" : '.*Qt[ ][ ]*version[ ][ ]*4.*'`
|
||||
v5=`expr "$qmakevers" : '.*Qt[ ][ ]*version[ ][ ]*5.*'`
|
||||
if test X$v4 = X0 -a X$v5 = X0; then
|
||||
AC_MSG_ERROR([qmake seems to be using Qt version 3 which is not supported any more])
|
||||
else
|
||||
if test X$v4 != X0 ; then
|
||||
AC_MSG_NOTICE([using qt version 4 user interface])
|
||||
else
|
||||
AC_MSG_NOTICE([using qt version 5 user interface])
|
||||
fi
|
||||
QTGUI=qtgui
|
||||
fi
|
||||
|
||||
|
||||
##### Using Qt webkit for reslist display? Else Qt textbrowser
|
||||
AC_ARG_ENABLE(webkit,
|
||||
AC_HELP_STRING([--disable-webkit],
|
||||
[Disable use of qt-webkit (only meaningful if qtgui is enabled).]),
|
||||
enableWebkit=$enableval, enableWebkit="yes")
|
||||
|
||||
if test "$enableWebkit" = "yes" ; then
|
||||
QMAKE_ENABLE_WEBKIT=""
|
||||
QMAKE_DISABLE_WEBKIT="#"
|
||||
else
|
||||
QMAKE_ENABLE_WEBKIT="#"
|
||||
QMAKE_DISABLE_WEBKIT=""
|
||||
fi
|
||||
|
||||
##### Using QZeitGeist lib ? Default no for now
|
||||
AC_ARG_WITH(qzeitgeist,
|
||||
AC_HELP_STRING([--with-qzeitgeist],
|
||||
[Enable the use of the qzeitgeist library to send zeitgeist events.]),
|
||||
withQZeitgeist=$withval, withQZeitgeist="no")
|
||||
|
||||
case "$withQZeitgeist" in
|
||||
no) LIBQZEITGEIST=;;
|
||||
yes) LIBQZEITGEIST=-lqzeitgeist;;
|
||||
*) LIBQZEITGEIST=$withQZeitgeist;;
|
||||
esac
|
||||
|
||||
if test "$withQZeitgeist" != "no" ; then
|
||||
QMAKE_ENABLE_ZEITGEIST=""
|
||||
QMAKE_DISABLE_ZEITGEIST="#"
|
||||
else
|
||||
QMAKE_ENABLE_ZEITGEIST="#"
|
||||
QMAKE_DISABLE_ZEITGEIST=""
|
||||
fi
|
||||
|
||||
AC_CONFIG_FILES($QTGUI/recoll.pro)
|
||||
|
||||
##################### End QT stuff
|
||||
fi
|
||||
|
||||
|
||||
### X11: this is needed for the session monitoring code (in recollindex -m)
|
||||
AC_ARG_ENABLE(x11mon,
|
||||
AC_HELP_STRING([--disable-x11mon],
|
||||
[Disable recollindex support for X11 session monitoring.]),
|
||||
enableX11mon=$enableval, enableX11mon="yes")
|
||||
|
||||
if test X$withInotify = Xno -a X$withFam = Xno ; then
|
||||
enableX11mon=no
|
||||
fi
|
||||
|
||||
if test "$enableX11mon" = "yes" ; then
|
||||
AC_PATH_XTRA
|
||||
X_LIBX11=-lX11
|
||||
else
|
||||
AC_DEFINE(DISABLE_X11MON, 1, [No X11 session monitoring support])
|
||||
X_LIBX11=""
|
||||
fi
|
||||
#echo X_CFLAGS "'$X_CFLAGS'" X_PRE_LIBS "'$X_PRE_LIBS'" X_LIBS \
|
||||
# "'$X_LIBS'" X_LIBX11 "'$X_LIBX11'" X_EXTRA_LIBS "'$X_EXTRA_LIBS'"
|
||||
|
||||
# For communicating the value of RECOLL_DATADIR to non-make-based
|
||||
# subpackages like python-recoll, we have to expand prefix in here, because
|
||||
# things like "datadir = ${prefix}/share" (which is what we'd get by
|
||||
# expanding @datadir@) don't mean a thing in Python... I guess we could
|
||||
# have a piece of shell-script text to be substituted into and executed by
|
||||
# setup.py for getting the value of pkgdatadir, but really...
|
||||
m_prefix=$prefix
|
||||
test "X$m_prefix" = "XNONE" && m_prefix=/usr/local
|
||||
m_datadir=${m_prefix}/share
|
||||
RECOLL_DATADIR=${m_datadir}/recoll
|
||||
|
||||
RCLVERSION=$PACKAGE_VERSION
|
||||
RCLLIBVERSION=$RCLVERSION
|
||||
|
||||
AC_SUBST(RECOLL_DATADIR)
|
||||
AC_SUBST(X_CFLAGS)
|
||||
AC_SUBST(X_PRE_LIBS)
|
||||
AC_SUBST(X_LIBS)
|
||||
AC_SUBST(X_LIBX11)
|
||||
AC_SUBST(X_EXTRA_LIBS)
|
||||
AC_SUBST(INCICONV)
|
||||
AC_SUBST(LIBICONV)
|
||||
AC_SUBST(LIBXAPIAN)
|
||||
AC_SUBST(LIBXAPIANDIR)
|
||||
AC_SUBST(LIBXAPIANSTATICEXTRA)
|
||||
AC_SUBST(LIBFAM)
|
||||
AC_SUBST(QMAKE)
|
||||
AC_SUBST(QTGUI)
|
||||
AC_SUBST(XAPIANCXXFLAGS)
|
||||
AC_SUBST(QMAKE_ENABLE_WEBKIT)
|
||||
AC_SUBST(QMAKE_DISABLE_WEBKIT)
|
||||
AC_SUBST(QMAKE_ENABLE_ZEITGEIST)
|
||||
AC_SUBST(QMAKE_DISABLE_ZEITGEIST)
|
||||
AC_SUBST(LIBQZEITGEIST)
|
||||
AC_SUBST(RCLVERSION)
|
||||
AC_SUBST(RCLLIBVERSION)
|
||||
|
||||
# All object files depend on localdefs which has the cc flags. Avoid
|
||||
# changing it unless necessary
|
||||
AC_CONFIG_FILES(Makefile)
|
||||
AC_CONFIG_FILES(common/rclversion.h)
|
||||
AC_CONFIG_FILES(python/recoll/setup.py)
|
||||
AC_CONFIG_FILES(python/recoll/Makefile)
|
||||
|
||||
AC_OUTPUT
|
66
src/desktop/hotrecoll.py
Executable file
66
src/desktop/hotrecoll.py
Executable file
|
@ -0,0 +1,66 @@
|
|||
#!/usr/bin/python
|
||||
#
|
||||
# This script should be linked to a keyboard shortcut. Under gnome,
|
||||
# you can do this from the main preferences menu, or directly execute
|
||||
# "gnome-keybinding-properties"
|
||||
#
|
||||
# Make the script executable. Install it somewhere in the executable
|
||||
# path ("echo $PATH" to check what's in there), and then just enter
|
||||
# its name as the action to perform, or copy it anywhere and copy the
|
||||
# full path as the action.
|
||||
|
||||
import gtk
|
||||
import wnck
|
||||
import os
|
||||
import sys
|
||||
from optparse import OptionParser
|
||||
|
||||
def main():
|
||||
parser = OptionParser()
|
||||
parser.add_option("-m", "--move-away", action="store_true", default=False,
|
||||
dest="clear_workspace",
|
||||
help="iconify to other workspace to avoid crowding panel")
|
||||
(options, args) = parser.parse_args()
|
||||
|
||||
screen = wnck.screen_get_default()
|
||||
while gtk.events_pending():
|
||||
gtk.main_iteration()
|
||||
|
||||
recollMain = ""
|
||||
recollwins = [];
|
||||
for window in screen.get_windows():
|
||||
if window.get_class_group().get_name() == "Recoll":
|
||||
if window.get_name() == "Recoll":
|
||||
recollMain = window
|
||||
recollwins.append(window)
|
||||
|
||||
if not recollMain:
|
||||
os.system("recoll&")
|
||||
sys.exit(0)
|
||||
|
||||
# Check the main window state, and either activate or minimize all
|
||||
# recoll windows.
|
||||
workspace = screen.get_active_workspace()
|
||||
if not recollMain.is_visible_on_workspace(workspace):
|
||||
for win in recollwins:
|
||||
win.move_to_workspace(workspace)
|
||||
if win != recollMain:
|
||||
win.unminimize(gtk.get_current_event_time())
|
||||
recollMain.activate(gtk.get_current_event_time())
|
||||
else:
|
||||
otherworkspace = None
|
||||
if options.clear_workspace:
|
||||
# We try to minimize to another workspace
|
||||
wkspcs = screen.get_workspaces()
|
||||
for wkspc in wkspcs:
|
||||
if wkspc.get_number() != workspace.get_number():
|
||||
otherworkspace = wkspc
|
||||
break
|
||||
for win in recollwins:
|
||||
if otherworkspace:
|
||||
win.move_to_workspace(otherworkspace)
|
||||
win.minimize()
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
10
src/desktop/recoll-searchgui.desktop
Normal file
10
src/desktop/recoll-searchgui.desktop
Normal file
|
@ -0,0 +1,10 @@
|
|||
[Desktop Entry]
|
||||
Categories=Utility;Filesystem;Database;
|
||||
Comment=Find documents by specifying search terms
|
||||
Exec=recoll
|
||||
GenericName=Local Text Search
|
||||
Icon=recoll
|
||||
Name=Recoll
|
||||
Terminal=false
|
||||
Type=Application
|
||||
Keywords=Search;Full Text;
|
24
src/desktop/recoll.appdata.xml
Normal file
24
src/desktop/recoll.appdata.xml
Normal file
|
@ -0,0 +1,24 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Copyright 2014 Jean-Francois Dockes <jfd@recoll.org> -->
|
||||
<application>
|
||||
<id type="desktop">recoll.desktop</id>
|
||||
<metadata_license>CC0-1.0</metadata_license>
|
||||
<project_license>GPL-2.0+</project_license>
|
||||
<name>Recoll</name>
|
||||
<summary>Find documents by specifying search terms</summary>
|
||||
<description>
|
||||
<p>Recoll finds keywords inside documents text as well as file names.</p>
|
||||
<ul>
|
||||
<li>It can search most document formats.</li>
|
||||
<li>It can reach any storage place: files, archive members, email
|
||||
attachments, transparently handling decompression.</li>
|
||||
<li>One click will open the document inside a native editor or
|
||||
display an even quicker text preview.</li>
|
||||
</ul>
|
||||
</description>
|
||||
<screenshots>
|
||||
<screenshot type="default">http://www.recoll.org/files/recoll-mainwin-h-1248x702.png</screenshot>
|
||||
</screenshots>
|
||||
<url type="homepage">http://www.recoll.org/</url>
|
||||
<updatecontact>contact@recoll.org</updatecontact>
|
||||
</application>
|
BIN
src/desktop/recoll.ico
Normal file
BIN
src/desktop/recoll.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 13 KiB |
BIN
src/desktop/recoll.png
Normal file
BIN
src/desktop/recoll.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 457 B |
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue