factored out filter script common code
This commit is contained in:
parent
c3ad4341dc
commit
2f75b9acb0
@ -1,5 +1,5 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# @(#$Id: rcldjvu,v 1.3 2007-01-30 11:36:02 dockes Exp $ (C) 2005 J.F.Dockes
|
# @(#$Id: rcldjvu,v 1.4 2007-02-06 15:08:22 dockes Exp $ (C) 2005 J.F.Dockes
|
||||||
|
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
@ -30,16 +30,27 @@
|
|||||||
LANG=C ; export LANG
|
LANG=C ; export LANG
|
||||||
LC_ALL=C ; export LC_ALL
|
LC_ALL=C ; export LC_ALL
|
||||||
progname="rcldjvu"
|
progname="rcldjvu"
|
||||||
|
filetype=dejavu
|
||||||
|
|
||||||
# show help message
|
|
||||||
if test $# -ne 1 -o "$1" = "--help"
|
|
||||||
then
|
|
||||||
printf 'Convert a djvu file to HTML text for recoll indexation.\n'
|
|
||||||
printf 'Usage: %s [infile]\n' "$progname"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
infile="$1"
|
|
||||||
|
#RECFILTCOMMONCODE
|
||||||
|
##############################################################################
|
||||||
|
# !! Leave the previous line unmodified!! Code imported from the
|
||||||
|
# recfiltcommon file
|
||||||
|
|
||||||
|
# Utility code common to all shell filters. This could be sourced at run
|
||||||
|
# time, but it's slightly more efficient to include the code in the
|
||||||
|
# filters at build time (with a sed script).
|
||||||
|
|
||||||
|
# Describe error in a way that can be interpreted by our caller
|
||||||
|
senderror()
|
||||||
|
{
|
||||||
|
echo RECFILTERROR $*
|
||||||
|
# Also alert on stderr just in case
|
||||||
|
echo ":2:$progname::: $*" 1>&2
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
iscmd()
|
iscmd()
|
||||||
{
|
{
|
||||||
@ -53,6 +64,7 @@ iscmd()
|
|||||||
return 1 ;;
|
return 1 ;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
checkcmds()
|
checkcmds()
|
||||||
{
|
{
|
||||||
for cmd in $*;do
|
for cmd in $*;do
|
||||||
@ -60,11 +72,31 @@ checkcmds()
|
|||||||
then
|
then
|
||||||
a=1
|
a=1
|
||||||
else
|
else
|
||||||
echo $cmd not found 1>&2
|
senderror HELPERNOTFOUND $cmd
|
||||||
exit 1
|
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# show help message
|
||||||
|
if test $# -ne 1 -o "$1" = "--help"
|
||||||
|
then
|
||||||
|
echo "Convert a $filetype file to HTML text for Recoll indexing."
|
||||||
|
echo "Usage: $progname [infile]"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
infile="$1"
|
||||||
|
|
||||||
|
# check the input file existence (may be '-' for stdin)
|
||||||
|
if test "X$infile" != X- -a ! -f "$infile"
|
||||||
|
then
|
||||||
|
senderror INPUTNOSUCHFILE "$infile"
|
||||||
|
fi
|
||||||
|
|
||||||
|
##############################################################################
|
||||||
|
# !! Leave the following line unmodified !
|
||||||
|
#ENDRECFILTCOMMONCODE
|
||||||
|
|
||||||
checkcmds djvutxt djvused awk
|
checkcmds djvutxt djvused awk
|
||||||
|
|
||||||
# check the input file existence
|
# check the input file existence
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# @(#$Id: rcldoc,v 1.6 2007-01-30 11:36:02 dockes Exp $ (C) 2004 J.F.Dockes
|
# @(#$Id: rcldoc,v 1.7 2007-02-06 15:08:22 dockes Exp $ (C) 2004 J.F.Dockes
|
||||||
# Parts taken from Estraier:
|
# Parts taken from Estraier:
|
||||||
#================================================================
|
#================================================================
|
||||||
# Estraier: a personal full-text search system
|
# Estraier: a personal full-text search system
|
||||||
@ -20,20 +20,32 @@
|
|||||||
LANG=C ; export LANG
|
LANG=C ; export LANG
|
||||||
LC_ALL=C ; export LC_ALL
|
LC_ALL=C ; export LC_ALL
|
||||||
progname="rcldoc"
|
progname="rcldoc"
|
||||||
|
filetype=ms-word
|
||||||
|
|
||||||
decoder="antiword -t -i 1 -m UTF-8"
|
decoder="antiword -t -i 1 -m UTF-8"
|
||||||
# Not ready to use this for now (it outputs html, so the code below has to
|
# Not ready to use this for now (it outputs html, so the code below has to
|
||||||
# be simplified.)
|
# be simplified.)
|
||||||
#decoder="wvWare -1 -c UTF-8"
|
#decoder="wvWare -1 -c UTF-8"
|
||||||
|
|
||||||
# show help message
|
|
||||||
if test $# -ne 1 -o "$1" = "--help"
|
|
||||||
then
|
|
||||||
printf 'Convert a word file to unformatted HTML text.\n'
|
|
||||||
printf 'Usage: %s [infile]\n' "$progname"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
infile="$1"
|
|
||||||
|
#RECFILTCOMMONCODE
|
||||||
|
##############################################################################
|
||||||
|
# !! Leave the previous line unmodified!! Code imported from the
|
||||||
|
# recfiltcommon file
|
||||||
|
|
||||||
|
# Utility code common to all shell filters. This could be sourced at run
|
||||||
|
# time, but it's slightly more efficient to include the code in the
|
||||||
|
# filters at build time (with a sed script).
|
||||||
|
|
||||||
|
# Describe error in a way that can be interpreted by our caller
|
||||||
|
senderror()
|
||||||
|
{
|
||||||
|
echo RECFILTERROR $*
|
||||||
|
# Also alert on stderr just in case
|
||||||
|
echo ":2:$progname::: $*" 1>&2
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
iscmd()
|
iscmd()
|
||||||
{
|
{
|
||||||
@ -47,6 +59,7 @@ iscmd()
|
|||||||
return 1 ;;
|
return 1 ;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
checkcmds()
|
checkcmds()
|
||||||
{
|
{
|
||||||
for cmd in $*;do
|
for cmd in $*;do
|
||||||
@ -54,20 +67,33 @@ checkcmds()
|
|||||||
then
|
then
|
||||||
a=1
|
a=1
|
||||||
else
|
else
|
||||||
echo $cmd not found 1>&2
|
senderror HELPERNOTFOUND $cmd
|
||||||
exit 1
|
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
checkcmds awk antiword iconv
|
|
||||||
|
|
||||||
# check the input file existence
|
# show help message
|
||||||
if test ! -f "$infile"
|
if test $# -ne 1 -o "$1" = "--help"
|
||||||
then
|
then
|
||||||
printf '%s: %s: no such file\n' "$progname" "$infile"
|
echo "Convert a $filetype file to HTML text for Recoll indexing."
|
||||||
|
echo "Usage: $progname [infile]"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
infile="$1"
|
||||||
|
|
||||||
|
# check the input file existence (may be '-' for stdin)
|
||||||
|
if test "X$infile" != X- -a ! -f "$infile"
|
||||||
|
then
|
||||||
|
senderror INPUTNOSUCHFILE "$infile"
|
||||||
|
fi
|
||||||
|
|
||||||
|
##############################################################################
|
||||||
|
# !! Leave the following line unmodified !
|
||||||
|
#ENDRECFILTCOMMONCODE
|
||||||
|
|
||||||
|
checkcmds awk antiword iconv
|
||||||
|
|
||||||
# output the result
|
# output the result
|
||||||
# The strange 'BEGIN' setup is to prevent 'file' from thinking this file
|
# The strange 'BEGIN' setup is to prevent 'file' from thinking this file
|
||||||
# is an awk program
|
# is an awk program
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# @(#$Id: rcldvi,v 1.3 2007-01-30 11:36:02 dockes Exp $ (C) 2006 J.F.Dockes
|
# @(#$Id: rcldvi,v 1.4 2007-02-06 15:08:22 dockes Exp $ (C) 2006 J.F.Dockes
|
||||||
|
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
@ -22,20 +22,32 @@
|
|||||||
# or using catdvi. dvitops has given better results during tests, and is
|
# or using catdvi. dvitops has given better results during tests, and is
|
||||||
# chosen first if available, but the dvitops/rclps combination is much
|
# chosen first if available, but the dvitops/rclps combination is much
|
||||||
# slower than catdvi
|
# slower than catdvi
|
||||||
|
# set variables
|
||||||
|
LANG=C ; export LANG
|
||||||
|
LC_ALL=C ; export LC_ALL
|
||||||
|
progname="rcldvi"
|
||||||
|
filetype=dvi
|
||||||
|
|
||||||
|
|
||||||
# Show help message
|
|
||||||
if test $# -ne 1 -o "$1" = "--help"
|
|
||||||
then
|
|
||||||
printf 'Convert a dvi file to unformatted HTML text for recoll indexation.\n'
|
|
||||||
printf 'Usage: %s [infile]\n' "$progname"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Find rclps. Note: this only works because we are always executed with a
|
|
||||||
# full path
|
#RECFILTCOMMONCODE
|
||||||
infile="$1"
|
##############################################################################
|
||||||
rclps=`dirname $0`/rclps
|
# !! Leave the previous line unmodified!! Code imported from the
|
||||||
|
# recfiltcommon file
|
||||||
|
|
||||||
|
# Utility code common to all shell filters. This could be sourced at run
|
||||||
|
# time, but it's slightly more efficient to include the code in the
|
||||||
|
# filters at build time (with a sed script).
|
||||||
|
|
||||||
|
# Describe error in a way that can be interpreted by our caller
|
||||||
|
senderror()
|
||||||
|
{
|
||||||
|
echo RECFILTERROR $*
|
||||||
|
# Also alert on stderr just in case
|
||||||
|
echo ":2:$progname::: $*" 1>&2
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
iscmd()
|
iscmd()
|
||||||
{
|
{
|
||||||
@ -50,24 +62,51 @@ iscmd()
|
|||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
|
checkcmds()
|
||||||
|
{
|
||||||
|
for cmd in $*;do
|
||||||
|
if iscmd $cmd
|
||||||
|
then
|
||||||
|
a=1
|
||||||
|
else
|
||||||
|
senderror HELPERNOTFOUND $cmd
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
# show help message
|
||||||
|
if test $# -ne 1 -o "$1" = "--help"
|
||||||
|
then
|
||||||
|
echo "Convert a $filetype file to HTML text for Recoll indexing."
|
||||||
|
echo "Usage: $progname [infile]"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
infile="$1"
|
||||||
|
|
||||||
|
# check the input file existence (may be '-' for stdin)
|
||||||
|
if test "X$infile" != X- -a ! -f "$infile"
|
||||||
|
then
|
||||||
|
senderror INPUTNOSUCHFILE "$infile"
|
||||||
|
fi
|
||||||
|
|
||||||
|
##############################################################################
|
||||||
|
# !! Leave the following line unmodified !
|
||||||
|
#ENDRECFILTCOMMONCODE
|
||||||
|
|
||||||
|
# Find rclps. Note: this only works because we are always executed with a
|
||||||
|
# full path
|
||||||
|
rclps=`dirname $0`/rclps
|
||||||
|
|
||||||
decoder=""
|
decoder=""
|
||||||
if iscmd dvips -a iscmd pstotext ; then
|
if iscmd dvips -a iscmd pstotext ; then
|
||||||
decoder=dvips
|
decoder=dvips
|
||||||
else
|
elsif iscmd catdvi
|
||||||
decoder=catdvi
|
decoder=catdvi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test X$decoder = X ; then
|
if test X$decoder = X ; then
|
||||||
echo "$progname: did not find either catdvi or dvips." 1>&2
|
senderror NOTFOUND dvips catdvi
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
# check the input file existence
|
|
||||||
if test ! -f "$infile"
|
|
||||||
then
|
|
||||||
printf '%s: %s: no such file\n' "$progname" "$infile"
|
|
||||||
exit 1
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test X$decoder = Xdvips ; then
|
if test X$decoder = Xdvips ; then
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# @(#$Id: rclgaim,v 1.2 2005-11-21 14:32:53 dockes Exp $ (C) 2004 J.F.Dockes
|
# @(#$Id: rclgaim,v 1.3 2007-02-06 15:08:22 dockes Exp $ (C) 2004 J.F.Dockes
|
||||||
# Parts taken from Estraier:
|
# Parts taken from Estraier:
|
||||||
#================================================================
|
#================================================================
|
||||||
# Estraier: a personal full-text search system
|
# Estraier: a personal full-text search system
|
||||||
@ -15,18 +15,28 @@
|
|||||||
# set variables
|
# set variables
|
||||||
LANG=C ; export LANG
|
LANG=C ; export LANG
|
||||||
LC_ALL=C ; export LC_ALL
|
LC_ALL=C ; export LC_ALL
|
||||||
progname="rclsoff"
|
progname="rclgaim"
|
||||||
|
filetype="gaim log"
|
||||||
|
|
||||||
|
|
||||||
# show help message
|
|
||||||
if test $# -ne 1 -o "$1" = "--help"
|
|
||||||
then
|
|
||||||
printf 'Convert a gaim log to unformatted HTML text for Recoll.\n'
|
|
||||||
printf 'Usage: %s [infile]\n' "$progname"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
infile="$1"
|
#RECFILTCOMMONCODE
|
||||||
|
##############################################################################
|
||||||
|
# !! Leave the previous line unmodified!! Code imported from the
|
||||||
|
# recfiltcommon file
|
||||||
|
|
||||||
|
# Utility code common to all shell filters. This could be sourced at run
|
||||||
|
# time, but it's slightly more efficient to include the code in the
|
||||||
|
# filters at build time (with a sed script).
|
||||||
|
|
||||||
|
# Describe error in a way that can be interpreted by our caller
|
||||||
|
senderror()
|
||||||
|
{
|
||||||
|
echo RECFILTERROR $*
|
||||||
|
# Also alert on stderr just in case
|
||||||
|
echo ":2:$progname::: $*" 1>&2
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
iscmd()
|
iscmd()
|
||||||
{
|
{
|
||||||
@ -48,21 +58,33 @@ checkcmds()
|
|||||||
then
|
then
|
||||||
a=1
|
a=1
|
||||||
else
|
else
|
||||||
echo $cmd not found 1>&2
|
senderror HELPERNOTFOUND $cmd
|
||||||
exit 1
|
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
checkcmds awk iconv
|
# show help message
|
||||||
|
if test $# -ne 1 -o "$1" = "--help"
|
||||||
# check the input file existence
|
|
||||||
if test ! -f "$infile"
|
|
||||||
then
|
then
|
||||||
printf '%s: %s: no such file\n' "$progname" "$infile"
|
echo "Convert a $filetype file to HTML text for Recoll indexing."
|
||||||
|
echo "Usage: $progname [infile]"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
infile="$1"
|
||||||
|
|
||||||
|
# check the input file existence (may be '-' for stdin)
|
||||||
|
if test "X$infile" != X- -a ! -f "$infile"
|
||||||
|
then
|
||||||
|
senderror INPUTNOSUCHFILE "$infile"
|
||||||
|
fi
|
||||||
|
|
||||||
|
##############################################################################
|
||||||
|
# !! Leave the following line unmodified !
|
||||||
|
#ENDRECFILTCOMMONCODE
|
||||||
|
|
||||||
|
checkcmds awk iconv
|
||||||
|
|
||||||
awk '
|
awk '
|
||||||
# First line: parse from, to , output html header
|
# First line: parse from, to , output html header
|
||||||
NR == 1 {
|
NR == 1 {
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# @(#$Id: rcllyx,v 1.4 2007-01-23 07:23:12 dockes Exp $ (C) 2004 J.F.Dockes
|
# @(#$Id: rcllyx,v 1.5 2007-02-06 15:08:22 dockes Exp $ (C) 2004 J.F.Dockes
|
||||||
# There may still be code from Estraier in here:
|
# There may still be code from Estraier in here:
|
||||||
#================================================================
|
#================================================================
|
||||||
# Estraier: a personal full-text search system
|
# Estraier: a personal full-text search system
|
||||||
@ -29,23 +29,27 @@
|
|||||||
LANG=C ; export LANG
|
LANG=C ; export LANG
|
||||||
LC_ALL=C ; export LC_ALL
|
LC_ALL=C ; export LC_ALL
|
||||||
progname="rcllyx"
|
progname="rcllyx"
|
||||||
|
filetype=lyx
|
||||||
|
|
||||||
# show help message
|
|
||||||
if test $# -ne 1 -o "$1" = "--help"
|
|
||||||
then
|
|
||||||
printf 'Extract lyx text as basic HTML.\n'
|
|
||||||
printf 'Usage: %s [infile]\n' "$progname"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
infile="$1"
|
|
||||||
|
|
||||||
# check the input file existence
|
#RECFILTCOMMONCODE
|
||||||
if test ! -f "$infile"
|
##############################################################################
|
||||||
then
|
# !! Leave the previous line unmodified!! Code imported from the
|
||||||
printf '%s: %s: no such file\n' "$progname" "$infile"
|
# recfiltcommon file
|
||||||
exit 1
|
|
||||||
fi
|
# Utility code common to all shell filters. This could be sourced at run
|
||||||
|
# time, but it's slightly more efficient to include the code in the
|
||||||
|
# filters at build time (with a sed script).
|
||||||
|
|
||||||
|
# Describe error in a way that can be interpreted by our caller
|
||||||
|
senderror()
|
||||||
|
{
|
||||||
|
echo RECFILTERROR $*
|
||||||
|
# Also alert on stderr just in case
|
||||||
|
echo ":2:$progname::: $*" 1>&2
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
iscmd()
|
iscmd()
|
||||||
{
|
{
|
||||||
@ -59,6 +63,7 @@ iscmd()
|
|||||||
return 1 ;;
|
return 1 ;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
checkcmds()
|
checkcmds()
|
||||||
{
|
{
|
||||||
for cmd in $*;do
|
for cmd in $*;do
|
||||||
@ -66,12 +71,31 @@ checkcmds()
|
|||||||
then
|
then
|
||||||
a=1
|
a=1
|
||||||
else
|
else
|
||||||
echo $cmd not found 1>&2
|
senderror HELPERNOTFOUND $cmd
|
||||||
exit 1
|
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# show help message
|
||||||
|
if test $# -ne 1 -o "$1" = "--help"
|
||||||
|
then
|
||||||
|
echo "Convert a $filetype file to HTML text for Recoll indexing."
|
||||||
|
echo "Usage: $progname [infile]"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
infile="$1"
|
||||||
|
|
||||||
|
# check the input file existence (may be '-' for stdin)
|
||||||
|
if test "X$infile" != X- -a ! -f "$infile"
|
||||||
|
then
|
||||||
|
senderror INPUTNOSUCHFILE "$infile"
|
||||||
|
fi
|
||||||
|
|
||||||
|
##############################################################################
|
||||||
|
# !! Leave the following line unmodified !
|
||||||
|
#ENDRECFILTCOMMONCODE
|
||||||
|
|
||||||
checkcmds lyx iconv
|
checkcmds lyx iconv
|
||||||
|
|
||||||
# We need a temporary directory
|
# We need a temporary directory
|
||||||
|
|||||||
111
src/filters/rclman
Executable file
111
src/filters/rclman
Executable file
@ -0,0 +1,111 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# @(#$Id: rclman,v 1.1 2007-02-06 15:08:22 dockes Exp $ (C) 2004 J.F.Dockes
|
||||||
|
# Parts taken from Estraier:
|
||||||
|
#================================================================
|
||||||
|
# Estraier: a personal full-text search system
|
||||||
|
# Copyright (C) 2003-2004 Mikio Hirabayashi
|
||||||
|
#================================================================
|
||||||
|
#================================================================
|
||||||
|
# rclman
|
||||||
|
# Process a manual page with groff and output html
|
||||||
|
# We'd like to use -Thtml, but this doesn't seem to be always available.
|
||||||
|
# So we use -Tutf8 and postprocess this to remove the ^H overstriking
|
||||||
|
#
|
||||||
|
#================================================================
|
||||||
|
|
||||||
|
|
||||||
|
# set variables
|
||||||
|
LANG=C ; export LANG
|
||||||
|
LC_ALL=C ; export LC_ALL
|
||||||
|
progname="rclman"
|
||||||
|
filetype=man
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#RECFILTCOMMONCODE
|
||||||
|
##############################################################################
|
||||||
|
# !! Leave the previous line unmodified!! Code imported from the
|
||||||
|
# recfiltcommon file
|
||||||
|
|
||||||
|
# Utility code common to all shell filters. This could be sourced at run
|
||||||
|
# time, but it's slightly more efficient to include the code in the
|
||||||
|
# filters at build time (with a sed script).
|
||||||
|
|
||||||
|
# Describe error in a way that can be interpreted by our caller
|
||||||
|
senderror()
|
||||||
|
{
|
||||||
|
echo RECFILTERROR $*
|
||||||
|
# Also alert on stderr just in case
|
||||||
|
echo ":2:$progname::: $*" 1>&2
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
iscmd()
|
||||||
|
{
|
||||||
|
cmd=$1
|
||||||
|
case $cmd in
|
||||||
|
*/*)
|
||||||
|
if test -x $cmd ; then return 0; else return 1; fi ;;
|
||||||
|
*)
|
||||||
|
oldifs=$IFS; IFS=":"; set -- $PATH; IFS=$oldifs
|
||||||
|
for d in $*;do test -x $d/$cmd && return 0;done
|
||||||
|
return 1 ;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
checkcmds()
|
||||||
|
{
|
||||||
|
for cmd in $*;do
|
||||||
|
if iscmd $cmd
|
||||||
|
then
|
||||||
|
a=1
|
||||||
|
else
|
||||||
|
senderror HELPERNOTFOUND $cmd
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
# show help message
|
||||||
|
if test $# -ne 1 -o "$1" = "--help"
|
||||||
|
then
|
||||||
|
echo "Convert a $filetype file to HTML text for Recoll indexing."
|
||||||
|
echo "Usage: $progname [infile]"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
infile="$1"
|
||||||
|
|
||||||
|
# check the input file existence (may be '-' for stdin)
|
||||||
|
if test "X$infile" != X- -a ! -f "$infile"
|
||||||
|
then
|
||||||
|
senderror INPUTNOSUCHFILE "$infile"
|
||||||
|
fi
|
||||||
|
|
||||||
|
##############################################################################
|
||||||
|
# !! Leave the following line unmodified !
|
||||||
|
#ENDRECFILTCOMMONCODE
|
||||||
|
|
||||||
|
checkcmds groff sed awk iconv
|
||||||
|
|
||||||
|
# The strange 'BEGIN' setup is to prevent 'file' from thinking this file
|
||||||
|
# is an awk program
|
||||||
|
groff -man -Tutf8 < "$infile" | sed -e 's/.//g' -e 's/.//g' |\
|
||||||
|
awk 'BEGIN'\
|
||||||
|
' {
|
||||||
|
print "<html><head><title></title>"
|
||||||
|
print "<meta http-equiv=\"Content-Type\" content=\"text/html;charset=UTF-8\">"
|
||||||
|
print "</head>\n<body>\n<p>"
|
||||||
|
}
|
||||||
|
{
|
||||||
|
gsub(/&/, "\\&", $0)
|
||||||
|
gsub(/</, "\\<", $0)
|
||||||
|
gsub(/>/, "\\>", $0)
|
||||||
|
|
||||||
|
print $0 "<br>"
|
||||||
|
}
|
||||||
|
END {
|
||||||
|
print "</p></body></html>"
|
||||||
|
}' | iconv -f UTF-8 -t UTF-8 -c -s
|
||||||
|
|
||||||
|
# exit normally
|
||||||
|
exit 0
|
||||||
@ -1,5 +1,5 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# @(#$Id: rclmedia,v 1.2 2006-04-04 16:03:28 dockes Exp $ (C) 2004 J.F.Dockes
|
# @(#$Id: rclmedia,v 1.3 2007-02-06 15:08:22 dockes Exp $ (C) 2004 J.F.Dockes
|
||||||
#================================================================
|
#================================================================
|
||||||
# rclmedia
|
# rclmedia
|
||||||
# Handle media files for recoll. This currently returns an empty
|
# Handle media files for recoll. This currently returns an empty
|
||||||
@ -9,17 +9,27 @@
|
|||||||
# set variables
|
# set variables
|
||||||
LANG=C ; export LANG
|
LANG=C ; export LANG
|
||||||
LC_ALL=C ; export LC_ALL
|
LC_ALL=C ; export LC_ALL
|
||||||
progname="rclsoff"
|
progname="rclmedia"
|
||||||
|
filetype=media
|
||||||
|
|
||||||
# show help message
|
|
||||||
if test $# -ne 1 -o "$1" = "--help"
|
|
||||||
then
|
|
||||||
printf 'Process a media file for recoll indexation.\n'
|
|
||||||
printf 'Usage: %s [infile]\n' "$progname"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
infile="$1"
|
#RECFILTCOMMONCODE
|
||||||
|
##############################################################################
|
||||||
|
# !! Leave the previous line unmodified!! Code imported from the
|
||||||
|
# recfiltcommon file
|
||||||
|
|
||||||
|
# Utility code common to all shell filters. This could be sourced at run
|
||||||
|
# time, but it's slightly more efficient to include the code in the
|
||||||
|
# filters at build time (with a sed script).
|
||||||
|
|
||||||
|
# Describe error in a way that can be interpreted by our caller
|
||||||
|
senderror()
|
||||||
|
{
|
||||||
|
echo RECFILTERROR $*
|
||||||
|
# Also alert on stderr just in case
|
||||||
|
echo ":2:$progname::: $*" 1>&2
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
iscmd()
|
iscmd()
|
||||||
{
|
{
|
||||||
@ -33,25 +43,39 @@ iscmd()
|
|||||||
return 1 ;;
|
return 1 ;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
checkcmds()
|
checkcmds()
|
||||||
{
|
{
|
||||||
cmdsok=0
|
|
||||||
for cmd in $*;do
|
for cmd in $*;do
|
||||||
if iscmd $cmd
|
if iscmd $cmd
|
||||||
then
|
then
|
||||||
cmdsok=1
|
a=1
|
||||||
else
|
else
|
||||||
cmdsok=0
|
senderror HELPERNOTFOUND $cmd
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
# check the input file existence
|
# show help message
|
||||||
if test ! -f "$infile"
|
if test $# -ne 1 -o "$1" = "--help"
|
||||||
then
|
then
|
||||||
printf '%s: %s: no such file\n' "$progname" "$infile"
|
echo "Convert a $filetype file to HTML text for Recoll indexing."
|
||||||
|
echo "Usage: $progname [infile]"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
infile="$1"
|
||||||
|
|
||||||
|
# check the input file existence (may be '-' for stdin)
|
||||||
|
if test "X$infile" != X- -a ! -f "$infile"
|
||||||
|
then
|
||||||
|
senderror INPUTNOSUCHFILE "$infile"
|
||||||
|
fi
|
||||||
|
|
||||||
|
##############################################################################
|
||||||
|
# !! Leave the following line unmodified !
|
||||||
|
#ENDRECFILTCOMMONCODE
|
||||||
|
|
||||||
checkcmds id3info
|
checkcmds id3info
|
||||||
|
|
||||||
# output the result
|
# output the result
|
||||||
@ -60,11 +84,11 @@ echo '<html><head>'
|
|||||||
echo '<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">'
|
echo '<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">'
|
||||||
echo '</head><body>'
|
echo '</head><body>'
|
||||||
echo '<pre>'
|
echo '<pre>'
|
||||||
if test X$cmdsok = X1 ; then
|
|
||||||
id3info "$infile" | \
|
id3info "$infile" | \
|
||||||
sed -e 's/</</g' -e 's/&/&/g' -e 's/===.*://' | \
|
sed -e 's/</</g' -e 's/&/&/g' -e 's/===.*://' | \
|
||||||
grep -v 'Tag information for'
|
grep -v 'Tag information for'
|
||||||
fi
|
|
||||||
echo '</pre>'
|
echo '</pre>'
|
||||||
echo '</body></html>'
|
echo '</body></html>'
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# @(#$Id: rclpdf,v 1.7 2007-01-30 11:36:02 dockes Exp $ (C) 2004 J.F.Dockes
|
# @(#$Id: rclpdf,v 1.8 2007-02-06 15:08:22 dockes Exp $ (C) 2004 J.F.Dockes
|
||||||
# This is copied almost verbatim from Estraier:
|
# This is copied almost verbatim from Estraier:
|
||||||
#================================================================
|
#================================================================
|
||||||
# Estraier: a personal full-text search system
|
# Estraier: a personal full-text search system
|
||||||
@ -31,23 +31,27 @@ optionraw=-raw
|
|||||||
LANG=C ; export LANG
|
LANG=C ; export LANG
|
||||||
LC_ALL=C ; export LC_ALL
|
LC_ALL=C ; export LC_ALL
|
||||||
progname="rclpdf"
|
progname="rclpdf"
|
||||||
|
filetype=pdf
|
||||||
|
|
||||||
# show help message
|
|
||||||
if test $# -ne 1 -o "$1" = "--help"
|
|
||||||
then
|
|
||||||
printf 'Strip a file of PDF and extract its text as HTML.\n'
|
|
||||||
printf 'Usage: %s [infile]\n' "$progname"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
infile="$1"
|
|
||||||
|
|
||||||
# check the input file existence
|
#RECFILTCOMMONCODE
|
||||||
if test ! -f "$infile"
|
##############################################################################
|
||||||
then
|
# !! Leave the previous line unmodified!! Code imported from the
|
||||||
printf '%s: %s: no such file\n' "$progname" "$infile"
|
# recfiltcommon file
|
||||||
exit 1
|
|
||||||
fi
|
# Utility code common to all shell filters. This could be sourced at run
|
||||||
|
# time, but it's slightly more efficient to include the code in the
|
||||||
|
# filters at build time (with a sed script).
|
||||||
|
|
||||||
|
# Describe error in a way that can be interpreted by our caller
|
||||||
|
senderror()
|
||||||
|
{
|
||||||
|
echo RECFILTERROR $*
|
||||||
|
# Also alert on stderr just in case
|
||||||
|
echo ":2:$progname::: $*" 1>&2
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
iscmd()
|
iscmd()
|
||||||
{
|
{
|
||||||
@ -61,6 +65,7 @@ iscmd()
|
|||||||
return 1 ;;
|
return 1 ;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
checkcmds()
|
checkcmds()
|
||||||
{
|
{
|
||||||
for cmd in $*;do
|
for cmd in $*;do
|
||||||
@ -68,11 +73,31 @@ checkcmds()
|
|||||||
then
|
then
|
||||||
a=1
|
a=1
|
||||||
else
|
else
|
||||||
echo $cmd not found 1>&2
|
senderror HELPERNOTFOUND $cmd
|
||||||
exit 1
|
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# show help message
|
||||||
|
if test $# -ne 1 -o "$1" = "--help"
|
||||||
|
then
|
||||||
|
echo "Convert a $filetype file to HTML text for Recoll indexing."
|
||||||
|
echo "Usage: $progname [infile]"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
infile="$1"
|
||||||
|
|
||||||
|
# check the input file existence (may be '-' for stdin)
|
||||||
|
if test "X$infile" != X- -a ! -f "$infile"
|
||||||
|
then
|
||||||
|
senderror INPUTNOSUCHFILE "$infile"
|
||||||
|
fi
|
||||||
|
|
||||||
|
##############################################################################
|
||||||
|
# !! Leave the following line unmodified !
|
||||||
|
#ENDRECFILTCOMMONCODE
|
||||||
|
|
||||||
checkcmds pdftotext iconv awk
|
checkcmds pdftotext iconv awk
|
||||||
|
|
||||||
# Run pdftotext and fix the result (add a charset tag and fix the html escaping
|
# Run pdftotext and fix the result (add a charset tag and fix the html escaping
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# @(#$Id: rclppt,v 1.1 2006-09-05 09:52:23 dockes Exp $ (C) 2004 J.F.Dockes
|
# @(#$Id: rclppt,v 1.2 2007-02-06 15:08:22 dockes Exp $ (C) 2004 J.F.Dockes
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
# the Free Software Foundation; either version 2 of the License, or
|
# the Free Software Foundation; either version 2 of the License, or
|
||||||
@ -27,17 +27,28 @@
|
|||||||
# set variables
|
# set variables
|
||||||
LANG=C ; export LANG
|
LANG=C ; export LANG
|
||||||
LC_ALL=C ; export LC_ALL
|
LC_ALL=C ; export LC_ALL
|
||||||
progname="rclsoff"
|
progname="rclppt"
|
||||||
|
filetype=powerpoint
|
||||||
|
|
||||||
# show help message
|
|
||||||
if test $# -ne 1 -o "$1" = "--help"
|
|
||||||
then
|
|
||||||
printf 'Process a powerpoint file for recoll indexation.\n'
|
|
||||||
printf 'Usage: %s [infile]\n' "$progname"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
infile="$1"
|
|
||||||
|
#RECFILTCOMMONCODE
|
||||||
|
##############################################################################
|
||||||
|
# !! Leave the previous line unmodified!! Code imported from the
|
||||||
|
# recfiltcommon file
|
||||||
|
|
||||||
|
# Utility code common to all shell filters. This could be sourced at run
|
||||||
|
# time, but it's slightly more efficient to include the code in the
|
||||||
|
# filters at build time (with a sed script).
|
||||||
|
|
||||||
|
# Describe error in a way that can be interpreted by our caller
|
||||||
|
senderror()
|
||||||
|
{
|
||||||
|
echo RECFILTERROR $*
|
||||||
|
# Also alert on stderr just in case
|
||||||
|
echo ":2:$progname::: $*" 1>&2
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
iscmd()
|
iscmd()
|
||||||
{
|
{
|
||||||
@ -51,25 +62,39 @@ iscmd()
|
|||||||
return 1 ;;
|
return 1 ;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
checkcmds()
|
checkcmds()
|
||||||
{
|
{
|
||||||
cmdsok=0
|
|
||||||
for cmd in $*;do
|
for cmd in $*;do
|
||||||
if iscmd $cmd
|
if iscmd $cmd
|
||||||
then
|
then
|
||||||
cmdsok=1
|
a=1
|
||||||
else
|
else
|
||||||
cmdsok=0
|
senderror HELPERNOTFOUND $cmd
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
# check the input file existence
|
# show help message
|
||||||
if test ! -f "$infile"
|
if test $# -ne 1 -o "$1" = "--help"
|
||||||
then
|
then
|
||||||
printf '%s: %s: no such file\n' "$progname" "$infile"
|
echo "Convert a $filetype file to HTML text for Recoll indexing."
|
||||||
|
echo "Usage: $progname [infile]"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
infile="$1"
|
||||||
|
|
||||||
|
# check the input file existence (may be '-' for stdin)
|
||||||
|
if test "X$infile" != X- -a ! -f "$infile"
|
||||||
|
then
|
||||||
|
senderror INPUTNOSUCHFILE "$infile"
|
||||||
|
fi
|
||||||
|
|
||||||
|
##############################################################################
|
||||||
|
# !! Leave the following line unmodified !
|
||||||
|
#ENDRECFILTCOMMONCODE
|
||||||
|
|
||||||
checkcmds catppt
|
checkcmds catppt
|
||||||
if test X$cmdsok = X0 ; then
|
if test X$cmdsok = X0 ; then
|
||||||
printf "Catppt not found"
|
printf "Catppt not found"
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# @(#$Id: rclps,v 1.8 2007-01-30 11:36:02 dockes Exp $ (C) 2004 J.F.Dockes
|
# @(#$Id: rclps,v 1.9 2007-02-06 15:08:23 dockes Exp $ (C) 2004 J.F.Dockes
|
||||||
# Parts taken from Estraier:
|
# Parts taken from Estraier:
|
||||||
#================================================================
|
#================================================================
|
||||||
# Estraier: a personal full-text search system
|
# Estraier: a personal full-text search system
|
||||||
@ -24,21 +24,28 @@ LC_ALL=C ; export LC_ALL
|
|||||||
progname="rclps"
|
progname="rclps"
|
||||||
decoder=pstotext
|
decoder=pstotext
|
||||||
#decoder=ps2ascii
|
#decoder=ps2ascii
|
||||||
|
filetype=postscript
|
||||||
|
|
||||||
# show help message
|
|
||||||
if test $# -ne 1 -o "$1" = "--help"
|
|
||||||
then
|
|
||||||
printf 'Convert a postscript file to unformatted HTML text.\n'
|
|
||||||
printf 'Usage: %s [infile]\n' "$progname"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
infile="$1"
|
|
||||||
if test "X$infile" = X- ; then
|
|
||||||
cmd=$decoder
|
#RECFILTCOMMONCODE
|
||||||
else
|
##############################################################################
|
||||||
cmd="$decoder $1"
|
# !! Leave the previous line unmodified!! Code imported from the
|
||||||
fi
|
# recfiltcommon file
|
||||||
|
|
||||||
|
# Utility code common to all shell filters. This could be sourced at run
|
||||||
|
# time, but it's slightly more efficient to include the code in the
|
||||||
|
# filters at build time (with a sed script).
|
||||||
|
|
||||||
|
# Describe error in a way that can be interpreted by our caller
|
||||||
|
senderror()
|
||||||
|
{
|
||||||
|
echo RECFILTERROR $*
|
||||||
|
# Also alert on stderr just in case
|
||||||
|
echo ":2:$progname::: $*" 1>&2
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
iscmd()
|
iscmd()
|
||||||
{
|
{
|
||||||
@ -52,6 +59,7 @@ iscmd()
|
|||||||
return 1 ;;
|
return 1 ;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
checkcmds()
|
checkcmds()
|
||||||
{
|
{
|
||||||
for cmd in $*;do
|
for cmd in $*;do
|
||||||
@ -59,20 +67,33 @@ checkcmds()
|
|||||||
then
|
then
|
||||||
a=1
|
a=1
|
||||||
else
|
else
|
||||||
echo $cmd not found 1>&2
|
senderror HELPERNOTFOUND $cmd
|
||||||
exit 1
|
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
checkcmds $decoder iconv awk
|
|
||||||
|
|
||||||
# check the input file existence
|
# show help message
|
||||||
if test "X$infile" != X- -a ! -f "$infile"
|
if test $# -ne 1 -o "$1" = "--help"
|
||||||
then
|
then
|
||||||
printf '%s: %s: no such file\n' "$progname" "$infile"
|
echo "Convert a $filetype file to HTML text for Recoll indexing."
|
||||||
|
echo "Usage: $progname [infile]"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
infile="$1"
|
||||||
|
|
||||||
|
# check the input file existence (may be '-' for stdin)
|
||||||
|
if test "X$infile" != X- -a ! -f "$infile"
|
||||||
|
then
|
||||||
|
senderror INPUTNOSUCHFILE "$infile"
|
||||||
|
fi
|
||||||
|
|
||||||
|
##############################################################################
|
||||||
|
# !! Leave the following line unmodified !
|
||||||
|
#ENDRECFILTCOMMONCODE
|
||||||
|
|
||||||
|
checkcmds $decoder iconv awk
|
||||||
|
|
||||||
# output the result
|
# output the result
|
||||||
# The strange 'BEGIN' setup is to prevent 'file' from thinking this file
|
# The strange 'BEGIN' setup is to prevent 'file' from thinking this file
|
||||||
# is an awk program
|
# is an awk program
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# @(#$Id: rclrtf,v 1.3 2007-01-30 11:36:02 dockes Exp $ (C) 2004 J.F.Dockes
|
# @(#$Id: rclrtf,v 1.4 2007-02-06 15:08:23 dockes Exp $ (C) 2004 J.F.Dockes
|
||||||
# Some inspiration from estraier
|
# Some inspiration from estraier
|
||||||
#================================================================
|
#================================================================
|
||||||
# rclrtf
|
# rclrtf
|
||||||
@ -7,28 +7,31 @@
|
|||||||
# http://www.gnu.org/software/unrtf/unrtf.html
|
# http://www.gnu.org/software/unrtf/unrtf.html
|
||||||
#================================================================
|
#================================================================
|
||||||
|
|
||||||
|
|
||||||
# set variables
|
# set variables
|
||||||
LANG=C ; export LANG
|
LANG=C ; export LANG
|
||||||
LC_ALL=C ; export LC_ALL
|
LC_ALL=C ; export LC_ALL
|
||||||
progname="rclrtl"
|
progname="rclrtl"
|
||||||
|
filetype=rtf
|
||||||
|
|
||||||
# show help message
|
|
||||||
if test $# -ne 1 -o "$1" = "--help"
|
|
||||||
then
|
|
||||||
printf 'Convert RTF to HTML for Recoll input.\n'
|
|
||||||
printf 'Usage: %s [infile]\n' "$progname"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
infile="$1"
|
|
||||||
|
|
||||||
# check the input file existence
|
#RECFILTCOMMONCODE
|
||||||
if test ! -f "$infile"
|
##############################################################################
|
||||||
then
|
# !! Leave the previous line unmodified!! Code imported from the
|
||||||
printf '%s: %s: no such file\n' "$progname" "$infile"
|
# recfiltcommon file
|
||||||
exit 1
|
|
||||||
fi
|
# Utility code common to all shell filters. This could be sourced at run
|
||||||
|
# time, but it's slightly more efficient to include the code in the
|
||||||
|
# filters at build time (with a sed script).
|
||||||
|
|
||||||
|
# Describe error in a way that can be interpreted by our caller
|
||||||
|
senderror()
|
||||||
|
{
|
||||||
|
echo RECFILTERROR $*
|
||||||
|
# Also alert on stderr just in case
|
||||||
|
echo ":2:$progname::: $*" 1>&2
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
iscmd()
|
iscmd()
|
||||||
{
|
{
|
||||||
@ -42,6 +45,7 @@ iscmd()
|
|||||||
return 1 ;;
|
return 1 ;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
checkcmds()
|
checkcmds()
|
||||||
{
|
{
|
||||||
for cmd in $*;do
|
for cmd in $*;do
|
||||||
@ -49,11 +53,31 @@ checkcmds()
|
|||||||
then
|
then
|
||||||
a=1
|
a=1
|
||||||
else
|
else
|
||||||
echo $cmd not found 1>&2
|
senderror HELPERNOTFOUND $cmd
|
||||||
exit 1
|
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# show help message
|
||||||
|
if test $# -ne 1 -o "$1" = "--help"
|
||||||
|
then
|
||||||
|
echo "Convert a $filetype file to HTML text for Recoll indexing."
|
||||||
|
echo "Usage: $progname [infile]"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
infile="$1"
|
||||||
|
|
||||||
|
# check the input file existence (may be '-' for stdin)
|
||||||
|
if test "X$infile" != X- -a ! -f "$infile"
|
||||||
|
then
|
||||||
|
senderror INPUTNOSUCHFILE "$infile"
|
||||||
|
fi
|
||||||
|
|
||||||
|
##############################################################################
|
||||||
|
# !! Leave the following line unmodified !
|
||||||
|
#ENDRECFILTCOMMONCODE
|
||||||
|
|
||||||
checkcmds awk unrtf
|
checkcmds awk unrtf
|
||||||
|
|
||||||
# output the result
|
# output the result
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# @(#$Id: rclscribus,v 1.2 2007-01-24 11:15:56 dockes Exp $ (C) 2004 J.F.Dockes
|
# @(#$Id: rclscribus,v 1.3 2007-02-06 15:08:23 dockes Exp $ (C) 2004 J.F.Dockes
|
||||||
# There may still be code from Estraier in here:
|
# There may still be code from Estraier in here:
|
||||||
#================================================================
|
#================================================================
|
||||||
# Estraier: a personal full-text search system
|
# Estraier: a personal full-text search system
|
||||||
@ -18,23 +18,27 @@
|
|||||||
LANG=C ; export LANG
|
LANG=C ; export LANG
|
||||||
LC_ALL=C ; export LC_ALL
|
LC_ALL=C ; export LC_ALL
|
||||||
progname="rclscribus"
|
progname="rclscribus"
|
||||||
|
filetype=Scribus
|
||||||
|
|
||||||
# show help message
|
|
||||||
if test $# -ne 1 -o "$1" = "--help"
|
|
||||||
then
|
|
||||||
printf 'Extract scribus text as basic HTML.\n'
|
|
||||||
printf 'Usage: %s [infile]\n' "$progname"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
infile="$1"
|
|
||||||
|
|
||||||
# check the input file existence
|
#RECFILTCOMMONCODE
|
||||||
if test ! -f "$infile"
|
##############################################################################
|
||||||
then
|
# !! Leave the previous line unmodified!! Code imported from the
|
||||||
printf '%s: %s: no such file\n' "$progname" "$infile"
|
# recfiltcommon file
|
||||||
exit 1
|
|
||||||
fi
|
# Utility code common to all shell filters. This could be sourced at run
|
||||||
|
# time, but it's slightly more efficient to include the code in the
|
||||||
|
# filters at build time (with a sed script).
|
||||||
|
|
||||||
|
# Describe error in a way that can be interpreted by our caller
|
||||||
|
senderror()
|
||||||
|
{
|
||||||
|
echo RECFILTERROR $*
|
||||||
|
# Also alert on stderr just in case
|
||||||
|
echo ":2:$progname::: $*" 1>&2
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
iscmd()
|
iscmd()
|
||||||
{
|
{
|
||||||
@ -48,6 +52,7 @@ iscmd()
|
|||||||
return 1 ;;
|
return 1 ;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
checkcmds()
|
checkcmds()
|
||||||
{
|
{
|
||||||
for cmd in $*;do
|
for cmd in $*;do
|
||||||
@ -55,11 +60,31 @@ checkcmds()
|
|||||||
then
|
then
|
||||||
a=1
|
a=1
|
||||||
else
|
else
|
||||||
echo $cmd not found 1>&2
|
senderror HELPERNOTFOUND $cmd
|
||||||
exit 1
|
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# show help message
|
||||||
|
if test $# -ne 1 -o "$1" = "--help"
|
||||||
|
then
|
||||||
|
echo "Convert a $filetype file to HTML text for Recoll indexing."
|
||||||
|
echo "Usage: $progname [infile]"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
infile="$1"
|
||||||
|
|
||||||
|
# check the input file existence (may be '-' for stdin)
|
||||||
|
if test "X$infile" != X- -a ! -f "$infile"
|
||||||
|
then
|
||||||
|
senderror INPUTNOSUCHFILE "$infile"
|
||||||
|
fi
|
||||||
|
|
||||||
|
##############################################################################
|
||||||
|
# !! Leave the following line unmodified !
|
||||||
|
#ENDRECFILTCOMMONCODE
|
||||||
|
|
||||||
checkcmds grep awk sed
|
checkcmds grep awk sed
|
||||||
|
|
||||||
# A small sed program to join lines where they are broken inside an
|
# A small sed program to join lines where they are broken inside an
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# @(#$Id: rclsoff,v 1.8 2007-01-30 11:36:02 dockes Exp $ (C) 2004 J.F.Dockes
|
# @(#$Id: rclsoff,v 1.9 2007-02-06 15:08:23 dockes Exp $ (C) 2004 J.F.Dockes
|
||||||
# Parts taken from Estraier:
|
# Parts taken from Estraier:
|
||||||
#================================================================
|
#================================================================
|
||||||
# Estraier: a personal full-text search system
|
# Estraier: a personal full-text search system
|
||||||
@ -11,22 +11,32 @@
|
|||||||
#
|
#
|
||||||
#================================================================
|
#================================================================
|
||||||
|
|
||||||
|
|
||||||
# set variables
|
# set variables
|
||||||
LANG=C ; export LANG
|
LANG=C ; export LANG
|
||||||
LC_ALL=C ; export LC_ALL
|
LC_ALL=C ; export LC_ALL
|
||||||
progname="rclsoff"
|
progname="rclsoff"
|
||||||
|
filetype=openoffice
|
||||||
|
|
||||||
|
|
||||||
# show help message
|
|
||||||
if test $# -ne 1 -o "$1" = "--help"
|
|
||||||
then
|
|
||||||
printf 'Convert an openoffice file to unformatted HTML text.\n'
|
|
||||||
printf 'Usage: %s [infile]\n' "$progname"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
infile="$1"
|
|
||||||
|
#RECFILTCOMMONCODE
|
||||||
|
##############################################################################
|
||||||
|
# !! Leave the previous line unmodified!! Code imported from the
|
||||||
|
# recfiltcommon file
|
||||||
|
|
||||||
|
# Utility code common to all shell filters. This could be sourced at run
|
||||||
|
# time, but it's slightly more efficient to include the code in the
|
||||||
|
# filters at build time (with a sed script).
|
||||||
|
|
||||||
|
# Describe error in a way that can be interpreted by our caller
|
||||||
|
senderror()
|
||||||
|
{
|
||||||
|
echo RECFILTERROR $*
|
||||||
|
# Also alert on stderr just in case
|
||||||
|
echo ":2:$progname::: $*" 1>&2
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
iscmd()
|
iscmd()
|
||||||
{
|
{
|
||||||
@ -40,6 +50,7 @@ iscmd()
|
|||||||
return 1 ;;
|
return 1 ;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
checkcmds()
|
checkcmds()
|
||||||
{
|
{
|
||||||
for cmd in $*;do
|
for cmd in $*;do
|
||||||
@ -47,11 +58,31 @@ checkcmds()
|
|||||||
then
|
then
|
||||||
a=1
|
a=1
|
||||||
else
|
else
|
||||||
echo $cmd not found 1>&2
|
senderror HELPERNOTFOUND $cmd
|
||||||
exit 1
|
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# show help message
|
||||||
|
if test $# -ne 1 -o "$1" = "--help"
|
||||||
|
then
|
||||||
|
echo "Convert a $filetype file to HTML text for Recoll indexing."
|
||||||
|
echo "Usage: $progname [infile]"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
infile="$1"
|
||||||
|
|
||||||
|
# check the input file existence (may be '-' for stdin)
|
||||||
|
if test "X$infile" != X- -a ! -f "$infile"
|
||||||
|
then
|
||||||
|
senderror INPUTNOSUCHFILE "$infile"
|
||||||
|
fi
|
||||||
|
|
||||||
|
##############################################################################
|
||||||
|
# !! Leave the following line unmodified !
|
||||||
|
#ENDRECFILTCOMMONCODE
|
||||||
|
|
||||||
checkcmds awk iconv unzip
|
checkcmds awk iconv unzip
|
||||||
|
|
||||||
# check the input file existence
|
# check the input file existence
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# @(#$Id: rclxls,v 1.2 2006-11-20 15:28:30 dockes Exp $ (C) 2004 J.F.Dockes
|
# @(#$Id: rclxls,v 1.3 2007-02-06 15:08:23 dockes Exp $ (C) 2004 J.F.Dockes
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
# the Free Software Foundation; either version 2 of the License, or
|
# the Free Software Foundation; either version 2 of the License, or
|
||||||
@ -29,16 +29,27 @@
|
|||||||
LANG=C ; export LANG
|
LANG=C ; export LANG
|
||||||
LC_ALL=C ; export LC_ALL
|
LC_ALL=C ; export LC_ALL
|
||||||
progname="rclxls"
|
progname="rclxls"
|
||||||
|
filetype=excel
|
||||||
|
|
||||||
# show help message
|
|
||||||
if test $# -ne 1 -o "$1" = "--help"
|
|
||||||
then
|
|
||||||
printf 'Process an excel file for recoll indexation.\n'
|
|
||||||
printf 'Usage: %s [infile]\n' "$progname"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
infile="$1"
|
|
||||||
|
#RECFILTCOMMONCODE
|
||||||
|
##############################################################################
|
||||||
|
# !! Leave the previous line unmodified!! Code imported from the
|
||||||
|
# recfiltcommon file
|
||||||
|
|
||||||
|
# Utility code common to all shell filters. This could be sourced at run
|
||||||
|
# time, but it's slightly more efficient to include the code in the
|
||||||
|
# filters at build time (with a sed script).
|
||||||
|
|
||||||
|
# Describe error in a way that can be interpreted by our caller
|
||||||
|
senderror()
|
||||||
|
{
|
||||||
|
echo RECFILTERROR $*
|
||||||
|
# Also alert on stderr just in case
|
||||||
|
echo ":2:$progname::: $*" 1>&2
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
iscmd()
|
iscmd()
|
||||||
{
|
{
|
||||||
@ -52,19 +63,39 @@ iscmd()
|
|||||||
return 1 ;;
|
return 1 ;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
checkcmds()
|
checkcmds()
|
||||||
{
|
{
|
||||||
cmdsok=0
|
|
||||||
for cmd in $*;do
|
for cmd in $*;do
|
||||||
if iscmd $cmd
|
if iscmd $cmd
|
||||||
then
|
then
|
||||||
cmdsok=1
|
a=1
|
||||||
else
|
else
|
||||||
cmdsok=0
|
senderror HELPERNOTFOUND $cmd
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# show help message
|
||||||
|
if test $# -ne 1 -o "$1" = "--help"
|
||||||
|
then
|
||||||
|
echo "Convert a $filetype file to HTML text for Recoll indexing."
|
||||||
|
echo "Usage: $progname [infile]"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
infile="$1"
|
||||||
|
|
||||||
|
# check the input file existence (may be '-' for stdin)
|
||||||
|
if test "X$infile" != X- -a ! -f "$infile"
|
||||||
|
then
|
||||||
|
senderror INPUTNOSUCHFILE "$infile"
|
||||||
|
fi
|
||||||
|
|
||||||
|
##############################################################################
|
||||||
|
# !! Leave the following line unmodified !
|
||||||
|
#ENDRECFILTCOMMONCODE
|
||||||
|
|
||||||
# check the input file existence
|
# check the input file existence
|
||||||
if test ! -f "$infile"
|
if test ! -f "$infile"
|
||||||
then
|
then
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user