titopoquito |
06-28-2007 08:01 AM |
EDIT: The following patch enables OGG and FLAC audio file indexing in recoll when used with the recoll build script from http://www.slackbuild.org
---
What I still missed from recoll is the ability to index flac and ogg audio files. I created a patch for that, which I want to give you below if you want flac and ogg support. These changes are not on Slackbuild.org because the submission part is disabled at the moment. I testet it and it seems okay, but please report if you encounter any problems with that. Oh, and of course it requires that you the Slackware's flac and vorbis-tools package installed :)
If you have untarred the Slackbuild "recoll.tar.gz" from Slackbuild, go to that folder. Save the code below as a file and apply it:
Code:
patch -p0 < /path/to/where/you/saved/this/file
now the patch itself:
Code:
--- recoll.SlackBuild.withoutflac 2007-06-28 14:54:27.491524250 +0200
+++ recoll.SlackBuild 2007-06-28 20:07:49.856360750 +0200
@@ -49,6 +49,11 @@
chown -R root:root .
chmod -R u+w,go+r-w,a-s .
+# If you do NOT want a patch that enables flac and ogg audio file indexing comment out the
+# next line. Note: requires "metaflac" and "ogginfo", found in the stock Slackware flac and
+# vorbis-tools package.
+patch -p0 < $CWD/patch.flac+ogg
+
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
./configure \
--- patch.flac+ogg.nul 2007-06-28 20:09:11.921489500 +0200
+++ patch.flac+ogg 2007-06-28 19:56:03.288203000 +0200
@@ -0,0 +1,263 @@
+--- sampleconf/mimeconf 2007-02-06 19:01:16.000000000 +0100
++++ sampleconf/mimeconf.flac 2007-06-28 19:33:30.066579750 +0200
+@@ -26,6 +26,7 @@
+ # have a look at the scripts.
+ [index]
+ application/msword = exec rcldoc
++application/ogg = exec rclogg
+ application/pdf = exec rclpdf
+ application/postscript = exec rclps
+ application/vnd.ms-powerpoint = exec rclppt
+@@ -41,6 +42,7 @@
+ application/vnd.sun.xml.writer.global = exec rclsoff
+ application/vnd.sun.xml.writer.template = exec rclsoff
+ application/x-dvi = exec rcldvi
++application/x-flac = exec rclflac
+ application/x-lyx = exec rcllyx
+ application/x-scribus = exec rclscribus
+ audio/mpeg = exec rclmedia
+@@ -57,6 +59,7 @@
+ # Icons to be used in the result list if required by gui config
+ [icons]
+ application/msword = wordprocessing
++application/ogg = sownd
+ application/pdf = pdf
+ application/postscript = postscript
+ application/vnd.ms-excel = spreadsheet
+@@ -70,6 +73,7 @@
+ application/vnd.sun.xml.writer = wordprocessing
+ application/vnd.sun.xml.writer.global = wordprocessing
+ application/vnd.sun.xml.writer.template = wordprocessing
++application/x-flac = sownd
+ application/x-fsdirectory = folder
+ application/x-dvi = document
+ audio/mpeg = sownd
+@@ -108,6 +112,8 @@
+ application/vnd.sun.xml.impress.template
+
+ media = audio/mpeg \
++ application/ogg \
++ application/x-flac \
+ image/jpeg \
+ image/png \
+
+--- sampleconf/mimemap 2007-02-06 19:01:16.000000000 +0100
++++ sampleconf/mimemap.flac 2007-06-28 19:33:30.066579750 +0200
+@@ -62,6 +62,8 @@
+ .rtf = text/rtf
+
+ .mp3 = audio/mpeg
++.flac = application/x-flac
++.ogg = application/ogg
+ .png = image/png
+ .jpg = image/jpeg
+
+--- sampleconf/mimeview 2007-02-14 11:10:43.000000000 +0100
++++ sampleconf/mimeview.flac 2007-06-28 19:54:07.452963750 +0200
+@@ -9,6 +9,7 @@
+ application/x-all = xdg-open %f
+
+ application/msword = openoffice %f
++application/ogg = xmms %f
+ application/pdf = xpdf %f
+ application/postscript = gv %f
+ application/vnd.ms-excel = openoffice %f
+@@ -25,6 +26,7 @@
+ application/vnd.sun.xml.writer.template = openoffice %f
+ application/x-fsdirectory = rox %f
+ application/x-dvi = xdvi %f
++application/x-flac = xmms %f
+ application/x-lyx = lyx %f
+ application/x-scribus = scribus %f
+ audio/mpeg = xmms %f
+--- filters/rclflac.nul 2007-06-28 13:38:54.966033500 +0200
++++ filters/rclflac 2007-06-28 19:39:29.093017500 +0200
+@@ -0,0 +1,93 @@
++#!/bin/sh
++# @(#$Id: rclflac,v 0.1 2007/06/27 19:39:00 dockes Exp $ (C) 2007 J.F.Dockes
++#================================================================
++# rclflac
++# Handle flac audio files for recoll.
++#================================================================
++# set variables
++LANG=C ; export LANG
++LC_ALL=C ; export LC_ALL
++progname="rclflac"
++filetype=media
++
++
++#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 metaflac
++
++# output the result
++echo '<html><head>'
++#echo '<title>' "$title" '</title>'
++echo '<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">'
++echo '</head><body>'
++echo '<pre>'
++
++metaflac --list "$infile" | \
++ grep 'comment\[' | sed -e 's/</</g' -e 's/&/&/g' -e 's/ *comment\[.*\]: .*=//'
++
++echo '</pre>'
++echo '</body></html>'
++
++# exit normally
++exit 0
+--- filters/rclogg.nul 2007-06-28 19:33:55.980199250 +0200
++++ filters/rclogg 2007-06-28 19:54:50.323643000 +0200
+@@ -0,0 +1,92 @@
++#!/bin/sh
++# @(#$Id: rclogg,v 0.1 2007/06/27 19:39:50 dockes Exp $ (C) 2007 J.F.Dockes
++#================================================================
++# rclogg
++# Handle ogg audio files for recoll.
++#================================================================
++# set variables
++LANG=C ; export LANG
++LC_ALL=C ; export LC_ALL
++progname="rclogg"
++filetype=media
++
++
++#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 ogginfo
++
++# output the result
++echo '<html><head>'
++#echo '<title>' "$title" '</title>'
++echo '<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">'
++echo '</head><body>'
++echo '<pre>'
++
++ogginfo "$infile" | \
++ sed -e "1,/^User comments/d" | grep -v Warning | sed "s/^ *.*=//"
++echo '</pre>'
++echo '</body></html>'
++
++# exit normally
++exit 0
|