$ make install
If you want to package as normal user to another root:
- $ rm -rf %buildroot
- $ ruby setup.rb install --prefix=%buildroot
+ $ ruby_archdir=`ruby -rrbconfig -e "puts Config::CONFIG['sitearchdir']"`
+ $ libdir=`ruby -rrbconfig -e "puts Config::CONFIG['sitelibdir']"`
+ $ rm -rf ${buildroot}
+ $ ruby setup.rb install --prefix=${buildroot}
$ cd ext
- $ make install DESTDIR=%buildroot libdir=%buildroot%{_libdir} archdir=%buildroot%ruby_archdir
-
- ruby_archdir being the result of: ruby -rrbconfig -e "puts Config::CONFIG['sitearchdir']"
+ $ make install DESTDIR=${buildroot} libdir=${buildroot}${libdir} archdir=${buildroot}${ruby_archdir}
Note: it will install things in traditional directories plus
-ruby_archdir and ruby_libdir, the latter one being the result of
-ruby -rrbconfig -e "puts Config::CONFIG['sitelibdir']"
-
+ruby_archdir and ruby_libdir.
+Change FPATH in ${buildroot}/local/lib/site_ruby/1.8/booh/config.rb to suit your $buildroot
Find icons for you menu system in the icons/ subdir.
--- /dev/null
+#! /usr/bin/ruby
+#
+# * BOOH *
+#
+# A.k.a 'Best web-album Of the world, Or your money back, Humerus'.
+#
+# The acronyn sucks, however this is a tribute to Dragon Ball by
+# Akira Toriyama, where the last enemy beaten by heroes of Dragon
+# Ball is named "Boo". But there was already a free software project
+# called Boo, so this one will be it "Booh". Or whatever.
+#
+#
+# Copyright (c) 2004-2006 Guillaume Cottenceau <http://zarb.org/~gc/resource/gc_mail.png>
+# Copyright (c) 2007 Stephane Fillod
+#
+# This software may be freely redistributed under the terms of the GNU
+# public license version 2.
+#
+# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+# 'album' structure:
+# "captions.txt"
+# <directory><tab><title>
+# <picfilename><tab><title><tab><texte>
+# <directory>".captions.txt"
+# <picfilename><tab><title><tab><texte>
+# <directory>/<picfilename>".txt"
+# <free text>
+#
+# Since Booh requires UTF-8, you may need to convert caption files:
+# $ recode ISO-8859-1..UTF-8 captions.txt
+#
+
+require 'getoptlong'
+require 'gettext'
+include GetText
+require 'rexml/document'
+include REXML
+
+require 'booh/booh-lib'
+include Booh
+
+#- options
+$options = [
+ [ '--help', '-h', GetoptLong::NO_ARGUMENT, _("Get help message") ],
+
+ [ '--config', '-C', GetoptLong::REQUIRED_ARGUMENT, _("File containing config listing images and videos within directories with captions") ],
+
+ [ '--verbose-level', '-v', GetoptLong::REQUIRED_ARGUMENT, _("Set max verbosity level (0: errors, 1: warnings, 2: important messages, 3: other messages)") ],
+]
+
+#- default values for some globals
+$switches = []
+$stdout.sync = true
+
+def usage
+ puts _("Usage: %s [OPTION]...") % File.basename($0)
+ $options.each { |ary|
+ printf " %3s, %-15s %s\n", ary[1], ary[0], ary[3]
+ }
+end
+
+def handle_options
+ parser = GetoptLong.new
+ parser.set_options(*$options.collect { |ary| ary[0..2] })
+ begin
+ parser.each_option do |name, arg|
+ case name
+ when '--help'
+ usage
+ exit(0)
+
+ when '--config'
+ if File.readable?(arg)
+ $xmldoc = REXML::Document.new File.new(arg)
+ $conffile = arg
+ else
+ die_ _('Config file does not exist or is unreadable.')
+ end
+
+ when '--verbose-level'
+ $verbose_level = arg.to_i
+
+ end
+ end
+ rescue
+ puts $!
+ usage
+ exit(1)
+ end
+
+ if !$xmldoc
+ die_ _("Missing --config parameter.")
+ end
+
+ $source = $xmldoc.root.attributes['source']
+ $dest = $xmldoc.root.attributes['destination']
+end
+
+def utf8_and_entities(string)
+ return utf8(string).gsub('à', 'à').
+ gsub('ç', 'ç').
+ gsub('ô', 'ô').
+ gsub('é', 'é').
+ gsub('ê', 'ê').
+ gsub('è', 'è').
+ gsub('È', 'È').
+ gsub('î', 'î').
+ gsub('<', '<').
+ gsub('>', '>').
+ gsub('ù', 'ù').
+ gsub('"', '"')
+end
+
+def parse_album_captionstxt(filepath)
+ begin
+ contents = File.open(filepath).readlines
+ out = {}
+ out[:legends] = {}
+ for line in contents
+ if line =~ /^(.*)\t(.*)\t(.*)/
+ out[:legends][$1] = $2 + "\n" + $3
+ elsif line =~ /^(.*)\t(.*)/
+ out[:legends][$1] = $2
+ end
+ end
+ return out
+ rescue
+ return nil
+ end
+end
+
+def walk_source_dir
+
+ `find #{$source} -type d`.sort.each { |dir|
+ dir.chomp!
+ msg 2, _("Handling %s from config list...") % dir
+
+ if !infos = parse_album_captionstxt("#{dir}/captions.txt")
+ next
+ end
+
+ #- place xml document on proper node
+ xmldir = $xmldoc.elements["//dir[@path='#{utf8(dir)}']"]
+
+ #if infos.has_key?(:title)
+ # type = find_subalbum_info_type(xmldir)
+ # xmldir.add_attribute("#{type}-caption", utf8_and_entities(infos[:title]))
+ #end
+
+ xmldir.elements.each { |element|
+ if %w(image video).include?(element.name)
+ if infos[:legends].has_key?(element.attributes['filename'])
+ element.add_attribute('caption', utf8_and_entities(infos[:legends][element.attributes['filename']]))
+ end
+ end
+ }
+ }
+end
+
+
+handle_options
+
+walk_source_dir
+
+ios = File.open("#{$conffile}.merged", "w")
+$xmldoc.write(ios, 0)
+ios.close
--- /dev/null
+.\" 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
+.\"
+
+.TH BOOH 15 "September 2007" "BOOH" "The booh web-album"
+
+.SH NAME
+album2booh \- a configuration converter from album
+albums to booh albums
+
+.SH SYNOPSIS
+\fBalbum2booh\fR [\fIOPTION\fR]...
+
+.SH DESCRIPTION
+\fBalbum2booh\fR is a configuration converter. It should be
+used by people desiring to convert web-albums done with Dave's
+MarginalHacks album, to web-albums handled by booh. Is is
+especially useful to automatically migrate the comments on
+the pictures.
+
+.SH OPTIONS
+.TP
+.BR -h , \ --help
+show command-line options summary
+.TP
+\fB-C \fIFILENAME\fR, \fB--config \fIFILENAME\fR
+Set the config file of booh's album (hence, the booh album MUST
+already exist)
+.TP
+\fB-v \fINUM\fR, \fB--verbose-level \fINUM\fR
+Set max verbosity level (0: errors, 1: warnings, 2: important messages, 3: other messages)
+
+.SH AUTHOR
+Written by Guillaume Cottenceau and Stephane Fillod.
+.br
+Visit official homepage: http://booh.org/
+
+.SH SEE ALSO
+.BR booh-backend(1)
+
+.SH COPYRIGHT
+Copyright \(co 2005-2007 Guillaume Cottenceau.
+Copyright \(co 2007 Stéphane Fillod.
+.br
+This is Free Software; this software is licensed under the GPL version 2, as published by the Free Software Foundation.
+There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.