diff --git a/configure.ac b/configure.ac index d54dcce21..ed28c8b03 100644 --- a/configure.ac +++ b/configure.ac @@ -1,662 +1,663 @@ ## $Id$ ## This file is part of CDS Invenio. ## Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 CERN. ## ## CDS Invenio 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. ## ## CDS Invenio 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 CDS Invenio; if not, write to the Free Software Foundation, Inc., ## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. ## This is CDS Invenio main configure.ac file. If you change this ## file, then please run "autoreconf" to regenerate the "configure" ## script. ## Initialize autoconf and automake: -AC_INIT(cds-invenio, 0.93.50.20080313, cds.support@cern.ch) -AM_INIT_AUTOMAKE(cds-invenio, 0.93.50.20080313) +AC_INIT(cds-invenio, 0.93.50.20080318, cds.support@cern.ch) +AM_INIT_AUTOMAKE(cds-invenio, 0.93.50.20080318) ## By default we shall install into /opt/cds-invenio. (Do not use ## AC_PREFIX_DEFAULT for this, because it would not work well with ## the localstatedir hack below.) test "${prefix}" = NONE && prefix=/opt/cds-invenio ## Check for install: AC_PROG_INSTALL ## Check for gettext support: AM_GNU_GETTEXT(external) AM_GNU_GETTEXT_VERSION(0.14.4) ## Check for MySQL client: AC_MSG_CHECKING(for mysql) AC_ARG_WITH(mysql, AC_HELP_STRING([--with-mysql], [path to a specific MySQL binary (optional)]), MYSQL=${withval}) if test -n "$MYSQL"; then AC_MSG_RESULT($MYSQL) else AC_PATH_PROG(MYSQL, mysql) if test -z "$MYSQL"; then AC_MSG_ERROR([ MySQL command-line client was not found in your PATH. Please install it first. Available from .]) fi fi ## Check for Python: AC_MSG_CHECKING(for python) AC_ARG_WITH(python, AC_HELP_STRING([--with-python], [path to a specific Python binary (optional)]), PYTHON=${withval}) if test -n "$PYTHON"; then AC_MSG_RESULT($PYTHON) else AC_PATH_PROG(PYTHON, python) if test -z "$PYTHON"; then AC_MSG_ERROR([ Python was not found in your PATH. Please either install it in your PATH or specify --with-python configure option. Python is available from .]) fi fi ## Check for Python version and modules: AC_MSG_CHECKING(for required Python modules) $PYTHON ${srcdir}/configure-tests.py if test $? -ne 0; then AC_MSG_ERROR([Please fix the above Python problem before continuing.]) fi AC_MSG_RESULT(found) ## Check for PHP: AC_PATH_PROG(PHP, php) ## Check for Acrobat Reader: AC_PATH_PROG(ACROREAD, acroread) if test -z "$ACROREAD"; then AC_MSG_WARN([ Acrobat Reader was not found in your PATH. It is used in the WebSubmit module for automatic conversion of submitted documents. You can continue without it but you will miss some CDS Invenio functionality. We recommend you to install it first and to rerun the configure script. Acrobat Reader is available from .]) fi ## Check for gzip: AC_PATH_PROG(GZIP, gzip) if test -z "$GZIP"; then AC_MSG_WARN([ Gzip was not found in your PATH. It is used in the WebSubmit module to compress the data submitted in an archive. You can continue without it but you will miss some CDS Invenio functionality. We recommend you to install it first and to rerun the configure script. Gzip is available from .]) fi ## Check for gunzip: AC_PATH_PROG(GUNZIP, gunzip) if test -z "$GUNZIP"; then AC_MSG_WARN([ Gunzip was not found in your PATH. It is used in the WebSubmit module to correctly deal with submitted compressed files. You can continue without it but you will miss some CDS Invenio functionality. We recommend you to install it first and to rerun the configure script. Gunzip is available from .]) fi ## Check for tar: AC_PATH_PROG(TAR, tar) if test -z "$TAR"; then AC_MSG_WARN([ Tar was not found in your PATH. It is used in the WebSubmit module to pack the submitted data into an archive. You can continue without it but you will miss some CDS Invenio functionality. We recommend you to install it first and to rerun the configure script. Tar is available from .]) fi ## Check for ps2pdf: AC_PATH_PROG(PS2PDF, ps2pdf) if test -z "$PS2PDF"; then AC_MSG_WARN([ ps2pdf was not found in your PATH. It is used in the WebSubmit module to convert submitted PostScripts into PDF. You can continue without it but you will miss some CDS Invenio functionality. We recommend you to install it first and to rerun the configure script. ps2pdf is available from .]) fi ## Check for pdftotext: AC_PATH_PROG(PDFTOTEXT, pdftotext) if test -z "$PDFTOTEXT"; then AC_MSG_WARN([ pdftotext was not found in your PATH. It is used for the fulltext indexation of PDF files. You can continue without it but you may miss fulltext searching capability of CDS Invenio. We recomend you to install it first and to rerun the configure script. pdftotext is available from . ]) fi ## Check for pdftk: AC_PATH_PROG(PDFTK, pdftk) if test -z "$PDFTK"; then AC_MSG_WARN([ pdftk was not found in your PATH. It is used for the fulltext file stamping. You can continue without it but you may miss this feature of CDS Invenio. We recomend you to install it first and to rerun the configure script. pdftk is available from . ]) fi ## Check for pdf2ps: AC_PATH_PROG(PDF2PS, pdf2ps) if test -z "$PDF2PS"; then AC_MSG_WARN([ pdf2ps was not found in your PATH. It is used in the WebSubmit module to convert submitted PDFs into PostScript. You can continue without it but you will miss some CDS Invenio functionality. We recommend you to install it first and to rerun the configure script. pdf2ps is available from .]) fi ## Check for pstotext: AC_PATH_PROG(PSTOTEXT, pstotext) if test -z "$PSTOTEXT"; then AC_MSG_WARN([ pstotext was not found in your PATH. It is used for the fulltext indexation of PDF and PostScript files. You can continue without it but you may miss fulltext searching capability of CDS Invenio. We recomend you to install it first and to rerun the configure script. pstotext is available from . ]) fi ## Check for ps2ascii: AC_PATH_PROG(PSTOASCII, ps2ascii) if test -z "$PSTOASCII"; then AC_MSG_WARN([ ps2ascii was not found in your PATH. It is used for the fulltext indexation of PostScript files. You can continue without it but you may miss fulltext searching capability of CDS Invenio. We recomend you to install it first and to rerun the configure script. ps2ascii is available from . ]) fi ## Check for antiword: AC_PATH_PROG(ANTIWORD, antiword) if test -z "$ANTIWORD"; then AC_MSG_WARN([ antiword was not found in your PATH. It is used for the fulltext indexation of Microsoft Word files. You can continue without it but you may miss fulltext searching capability of CDS Invenio. We recomend you to install it first and to rerun the configure script. antiword is available from . ]) fi ## Check for catdoc: AC_PATH_PROG(CATDOC, catdoc) if test -z "$CATDOC"; then AC_MSG_WARN([ catdoc was not found in your PATH. It is used for the fulltext indexation of Microsoft Word files. You can continue without it but you may miss fulltext searching capability of CDS Invenio. We recomend you to install it first and to rerun the configure script. catdoc is available from . ]) fi ## Check for wvText: AC_PATH_PROG(WVTEXT, wvText) if test -z "$WVTEXT"; then AC_MSG_WARN([ wvText was not found in your PATH. It is used for the fulltext indexation of Microsoft Word files. You can continue without it but you may miss fulltext searching capability of CDS Invenio. We recomend you to install it first and to rerun the configure script. wvText is available from . ]) fi ## Check for ppthtml: AC_PATH_PROG(PPTHTML, ppthtml) if test -z "$PPTHTML"; then AC_MSG_WARN([ ppthtml was found in your PATH. It is used for the fulltext indexation of Microsoft PowerPoint files. You can continue without it but you may miss fulltext searching capability of CDS Invenio. We recomend you to install it first and to rerun the configure script. ppthtml is available from . ]) fi ## Check for xlhtml: AC_PATH_PROG(XLHTML, xlhtml) if test -z "$XLHTML"; then AC_MSG_WARN([ xlhtml was found in your PATH. It is used for the fulltext indexation of Microsoft Excel files. You can continue without it but you may miss fulltext searching capability of CDS Invenio. We recomend you to install it first and to rerun the configure script. xlhtml is available from . ]) fi ## Check for html2text: AC_PATH_PROG(HTMLTOTEXT, html2text) if test -z "$HTMLTOTEXT"; then AC_MSG_WARN([ html2text was found in your PATH. It is used for the fulltext indexation of Microsoft PowerPoint and Excel files. You can continue without it but you may miss fulltext searching capability of CDS Invenio. We recomend you to install it first and to rerun the configure script. html2text is available from . ]) fi ## Check for Giftext: AC_PATH_PROG(GIFTEXT, giftext) if test -z "$GIFTEXT"; then AC_MSG_WARN([ Giftext was not found in your PATH. It is used in the WebSubmit module to create an icon from a submitted picture. You can continue without it but you will miss some CDS Invenio functionality. We recommend you to install it first and to rerun the configure script. Giftext is available from .]) fi ## Check for file: AC_PATH_PROG(FILE, file) if test -z "$FILE"; then AC_MSG_WARN([ File was not found in your PATH. It is used in the WebSubmit module to check the validity of the submitted files. You can continue without it but you will miss some CDS Invenio functionality. We recommend you to install it first and to rerun the configure script. File is available from .]) fi ## Check for convert: AC_PATH_PROG(CONVERT, convert) if test -z "$CONVERT"; then AC_MSG_WARN([ Convert was not found in your PATH. It is used in the WebSubmit module to create an icon from a submitted picture. You can continue without it but you will miss some CDS Invenio functionality. We recommend you to install it first and to rerun the configure script. Convert is available from .]) fi ## Check for CLISP: AC_MSG_CHECKING(for clisp) AC_ARG_WITH(clisp, AC_HELP_STRING([--with-clisp], [path to a specific CLISP binary (optional)]), CLISP=${withval}) if test -n "$CLISP"; then AC_MSG_RESULT($CLISP) else AC_PATH_PROG(CLISP, clisp) if test -z "$CLISP"; then AC_MSG_WARN([ GNU CLISP was not found in your PATH. It is used by the WebStat module to produce statistics about CDS Invenio usage. (Alternatively, SBCL or CMUCL can be used instead of CLISP.) You can continue without it but you will miss this feature. We recommend you to install it first (if you don't have neither CMUCL nor SBCL) and to rerun the configure script. GNU CLISP is available from .]) fi fi ## Check for CMUCL: AC_MSG_CHECKING(for cmucl) AC_ARG_WITH(cmucl, AC_HELP_STRING([--with-cmucl], [path to a specific CMUCL binary (optional)]), CMUCL=${withval}) if test -n "$CMUCL"; then AC_MSG_RESULT($CMUCL) else AC_PATH_PROG(CMUCL, cmucl) if test -z "$CMUCL"; then AC_MSG_CHECKING(for lisp) # CMUCL can also be installed under `lisp' exec name AC_PATH_PROG(CMUCL, lisp) fi if test -z "$CMUCL"; then AC_MSG_WARN([ CMUCL was not found in your PATH. It is used by the WebStat module to produce statistics about CDS Invenio usage. (Alternatively, CLISP or SBCL can be used instead of CMUCL.) You can continue without it but you will miss this feature. We recommend you to install it first (if you don't have neither CLISP nor SBCL) and to rerun the configure script. CMUCL is available from .]) fi fi ## Check for SBCL: AC_MSG_CHECKING(for sbcl) AC_ARG_WITH(sbcl, AC_HELP_STRING([--with-sbcl], [path to a specific SBCL binary (optional)]), SBCL=${withval}) if test -n "$SBCL"; then AC_MSG_RESULT($SBCL) else AC_PATH_PROG(SBCL, sbcl) if test -z "$SBCL"; then AC_MSG_WARN([ SBCL was not found in your PATH. It is used by the WebStat module to produce statistics about CDS Invenio usage. (Alternatively, CLISP or CMUCL can be used instead of SBCL.) You can continue without it but you will miss this feature. We recommend you to install it first (if you don't have neither CLISP nor CMUCL) and to rerun the configure script. SBCL is available from .]) fi fi ## Check for gnuplot: AC_PATH_PROG(GNUPLOT, gnuplot) if test -z "$GNUPLOT"; then AC_MSG_WARN([ Gnuplot was not found in your PATH. It is used by the BibRank module to produce graphs about download and citation history. You can continue without it but you will miss these graphs. We recommend you to install it first and to rerun the configure script. Gnuplot is available from .]) fi ## Substitute variables: AC_SUBST(VERSION) AC_SUBST(MYSQL) AC_SUBST(PHP) AC_SUBST(PYTHON) AC_SUBST(CLIDIR) AC_SUBST(PDFTOTEXT) AC_SUBST(PDFTK) AC_SUBST(PDF2PS) AC_SUBST(PSTOTEXT) AC_SUBST(PSTOASCII) AC_SUBST(ANTIWORD) AC_SUBST(CATDOC) AC_SUBST(WVTEXT) AC_SUBST(PPTHTML) AC_SUBST(XLHTML) AC_SUBST(HTMLTOTEXT) AC_SUBST(localstatedir, `eval echo "${localstatedir}"`) AC_SUBST(CACHEDIR) AC_SUBST(CLISP) AC_SUBST(CMUCL) AC_SUBST(SBCL) AC_SUBST(GNUPLOT) AC_SUBST(DJPEG) AC_SUBST(CONVERT) AC_SUBST(GIFTEXT) AC_SUBST(JPEGSIZE) AC_SUBST(PNMSCALE) AC_SUBST(PPMQUANT) AC_SUBST(PPMTOGIF) AC_SUBST(GIFINTER) AC_SUBST(GIFRSIZE) ## Define output files: AC_CONFIG_FILES([config.nice \ Makefile \ po/Makefile.in \ config/Makefile \ config/invenio-autotools.conf \ modules/Makefile \ modules/bibconvert/Makefile \ modules/bibconvert/bin/Makefile \ modules/bibconvert/bin/bibconvert \ modules/bibconvert/doc/Makefile \ modules/bibconvert/doc/admin/Makefile \ modules/bibconvert/doc/hacking/Makefile \ modules/bibconvert/etc/Makefile \ modules/bibconvert/lib/Makefile \ modules/bibmatch/Makefile \ modules/bibmatch/bin/Makefile \ modules/bibmatch/bin/bibmatch \ modules/bibmatch/doc/Makefile \ modules/bibmatch/doc/admin/Makefile \ modules/bibmatch/etc/Makefile \ modules/bibmatch/lib/Makefile \ modules/bibedit/Makefile \ modules/bibedit/bin/Makefile \ modules/bibedit/bin/refextract \ modules/bibedit/bin/xmlmarclint \ modules/bibedit/bin/xmlmarc2textmarc \ + modules/bibedit/bin/bibedit \ modules/bibedit/doc/Makefile \ modules/bibedit/doc/admin/Makefile \ modules/bibedit/doc/hacking/Makefile \ modules/bibedit/etc/Makefile \ modules/bibedit/lib/Makefile \ modules/bibedit/web/Makefile \ modules/bibedit/web/admin/Makefile \ modules/bibformat/Makefile \ modules/bibformat/bin/Makefile \ modules/bibformat/bin/bibreformat \ modules/bibformat/doc/Makefile \ modules/bibformat/doc/admin/Makefile \ modules/bibformat/doc/hacking/Makefile \ modules/bibformat/etc/Makefile \ modules/bibformat/etc/output_formats/Makefile \ modules/bibformat/etc/format_templates/Makefile \ modules/bibformat/lib/Makefile \ modules/bibformat/lib/elements/Makefile \ modules/bibformat/web/Makefile \ modules/bibformat/web/admin/Makefile \ modules/bibharvest/Makefile \ modules/bibharvest/bin/Makefile \ modules/bibharvest/bin/bibharvest \ modules/bibharvest/bin/oaiharvest \ modules/bibharvest/bin/oaiarchive \ modules/bibharvest/doc/Makefile \ modules/bibharvest/doc/admin/Makefile \ modules/bibharvest/doc/hacking/Makefile \ modules/bibharvest/lib/Makefile \ modules/bibharvest/web/Makefile \ modules/bibharvest/web/admin/Makefile \ modules/bibclassify/Makefile \ modules/bibclassify/bin/Makefile \ modules/bibclassify/bin/bibclassify \ modules/bibclassify/bin/bibclassifyd \ modules/bibclassify/doc/Makefile \ modules/bibclassify/doc/admin/Makefile \ modules/bibclassify/doc/hacking/Makefile \ modules/bibclassify/etc/Makefile modules/bibclassify/lib/Makefile modules/bibindex/Makefile \ modules/bibindex/bin/Makefile \ modules/bibindex/bin/bibindex \ modules/bibindex/bin/bibstat \ modules/bibindex/doc/Makefile \ modules/bibindex/doc/admin/Makefile \ modules/bibindex/doc/hacking/Makefile \ modules/bibindex/lib/Makefile \ modules/bibindex/web/Makefile \ modules/bibindex/web/admin/Makefile \ modules/bibrank/Makefile \ modules/bibrank/bin/Makefile \ modules/bibrank/bin/bibrank \ modules/bibrank/bin/bibrankgkb \ modules/bibrank/doc/Makefile \ modules/bibrank/doc/admin/Makefile \ modules/bibrank/doc/hacking/Makefile \ modules/bibrank/etc/Makefile \ modules/bibrank/etc/bibrankgkb.cfg \ modules/bibrank/etc/demo_jif.cfg \ modules/bibrank/etc/template_single_tag_rank_method.cfg \ modules/bibrank/lib/Makefile \ modules/bibrank/web/Makefile \ modules/bibrank/web/admin/Makefile \ modules/bibsched/Makefile \ modules/bibsched/bin/Makefile \ modules/bibsched/bin/bibsched \ modules/bibsched/bin/bibtaskex \ modules/bibsched/doc/Makefile \ modules/bibsched/doc/admin/Makefile \ modules/bibsched/doc/hacking/Makefile \ modules/bibsched/lib/Makefile \ modules/bibupload/Makefile \ modules/bibupload/bin/Makefile \ modules/bibupload/bin/bibupload \ modules/bibupload/doc/Makefile \ modules/bibupload/doc/admin/Makefile \ modules/bibupload/doc/hacking/Makefile \ modules/bibupload/lib/Makefile \ modules/elmsubmit/Makefile \ modules/elmsubmit/bin/Makefile \ modules/elmsubmit/bin/elmsubmit \ modules/elmsubmit/doc/Makefile \ modules/elmsubmit/doc/admin/Makefile \ modules/elmsubmit/doc/hacking/Makefile \ modules/elmsubmit/etc/Makefile \ modules/elmsubmit/etc/elmsubmit.cfg \ modules/elmsubmit/lib/Makefile \ modules/miscutil/Makefile \ modules/miscutil/bin/Makefile \ modules/miscutil/bin/dbexec \ modules/miscutil/bin/testsuite \ modules/miscutil/bin/regressiontestsuite \ modules/miscutil/bin/inveniocfg \ modules/miscutil/lib/Makefile \ modules/miscutil/demo/Makefile \ modules/miscutil/sql/Makefile \ modules/miscutil/web/Makefile \ modules/miscutil/doc/Makefile \ modules/miscutil/doc/hacking/Makefile \ modules/webaccess/Makefile \ modules/webaccess/bin/Makefile \ modules/webaccess/bin/authaction \ modules/webaccess/bin/webaccessadmin \ modules/webaccess/doc/Makefile \ modules/webaccess/doc/admin/Makefile \ modules/webaccess/doc/hacking/Makefile \ modules/webaccess/lib/Makefile \ modules/webaccess/web/Makefile \ modules/webaccess/web/admin/Makefile \ modules/webalert/Makefile \ modules/webalert/bin/Makefile \ modules/webalert/bin/alertengine \ modules/webalert/doc/Makefile \ modules/webalert/doc/admin/Makefile \ modules/webalert/doc/hacking/Makefile \ modules/webalert/lib/Makefile \ modules/webalert/web/Makefile \ modules/webhelp/Makefile \ modules/webhelp/web/Makefile \ modules/webhelp/web/hacking/Makefile \ modules/webhelp/web/admin/Makefile \ modules/webhelp/web/admin/howto/Makefile \ modules/websearch/Makefile \ modules/websearch/bin/Makefile \ modules/websearch/bin/webcoll \ modules/websearch/doc/Makefile \ modules/websearch/doc/admin/Makefile \ modules/websearch/doc/hacking/Makefile \ modules/websearch/lib/Makefile \ modules/websearch/web/Makefile \ modules/websearch/web/admin/Makefile \ modules/websession/Makefile \ modules/websession/bin/Makefile \ modules/websession/bin/inveniogc \ modules/websession/doc/Makefile \ modules/websession/doc/admin/Makefile \ modules/websession/doc/hacking/Makefile \ modules/websession/lib/Makefile \ modules/websession/web/Makefile \ modules/webstat/Makefile \ modules/webstat/bin/Makefile \ modules/webstat/bin/webstat \ modules/webstat/bin/webstatadmin \ modules/webstat/doc/Makefile \ modules/webstat/doc/admin/Makefile \ modules/webstat/doc/hacking/Makefile \ modules/webstat/etc/Makefile \ modules/webstat/lib/Makefile \ modules/webstyle/Makefile \ modules/webstyle/bin/Makefile \ modules/webstyle/bin/webdoc \ modules/webstyle/css/Makefile \ modules/webstyle/doc/Makefile \ modules/webstyle/etc/Makefile \ modules/webstyle/doc/admin/Makefile \ modules/webstyle/doc/hacking/Makefile \ modules/webstyle/img/Makefile \ modules/webstyle/lib/Makefile \ modules/webcomment/Makefile \ modules/webcomment/doc/Makefile \ modules/webcomment/doc/admin/Makefile \ modules/webcomment/doc/hacking/Makefile \ modules/webcomment/lib/Makefile \ modules/webcomment/web/Makefile \ modules/webcomment/web/admin/Makefile \ modules/webbasket/Makefile \ modules/webbasket/doc/Makefile \ modules/webbasket/doc/admin/Makefile \ modules/webbasket/doc/hacking/Makefile \ modules/webbasket/lib/Makefile \ modules/webbasket/web/Makefile \ modules/webjournal/Makefile \ modules/webjournal/doc/Makefile \ modules/webjournal/doc/admin/Makefile \ modules/webjournal/doc/hacking/Makefile \ modules/webjournal/lib/Makefile \ modules/webjournal/lib/widgets/Makefile \ modules/webmessage/Makefile \ modules/webmessage/bin/Makefile \ modules/webmessage/bin/webmessageadmin \ modules/webmessage/doc/Makefile \ modules/webmessage/doc/admin/Makefile \ modules/webmessage/doc/hacking/Makefile \ modules/webmessage/lib/Makefile \ modules/webmessage/web/Makefile \ modules/websubmit/Makefile \ modules/websubmit/bin/Makefile \ modules/websubmit/bin/thumbmaker \ modules/websubmit/etc/Makefile \ modules/websubmit/doc/Makefile \ modules/websubmit/doc/admin/Makefile \ modules/websubmit/doc/hacking/Makefile \ modules/websubmit/lib/Makefile \ modules/websubmit/lib/functions/Makefile \ modules/websubmit/web/Makefile \ modules/websubmit/web/admin/Makefile \ ]) ## Finally, write output files: AC_OUTPUT ## Write help: AC_MSG_RESULT([****************************************************************************]) AC_MSG_RESULT([** Your CDS Invenio installation is now ready for building. **]) AC_MSG_RESULT([** You have entered the following parameters: **]) AC_MSG_RESULT([** - CDS Invenio main install directory: ${prefix}]) AC_MSG_RESULT([** - Python executable: $PYTHON]) AC_MSG_RESULT([** - MySQL client executable: $MYSQL]) AC_MSG_RESULT([** - CLISP executable: $CLISP]) AC_MSG_RESULT([** - CMUCL executable: $CMUCL]) AC_MSG_RESULT([** - SBCL executable: $SBCL]) AC_MSG_RESULT([** Here are the steps to continue the building process: **]) AC_MSG_RESULT([** 1) Type 'make' to build your CDS Invenio system. **]) AC_MSG_RESULT([** 2) Type 'make install' to install your CDS Invenio system. **]) AC_MSG_RESULT([** After that you can start customizing your installation as documented **]) AC_MSG_RESULT([** in the INSTALL file (i.e. edit invenio.conf, run inveniocfg, etc). **]) AC_MSG_RESULT([** Good luck, and thanks for choosing CDS Invenio. **]) AC_MSG_RESULT([** -- CDS Development Group **]) AC_MSG_RESULT([****************************************************************************]) ## end of file diff --git a/modules/bibedit/bin/.cvsignore b/modules/bibedit/bin/.cvsignore index 1a095fb06..271e0ed9c 100644 --- a/modules/bibedit/bin/.cvsignore +++ b/modules/bibedit/bin/.cvsignore @@ -1,8 +1,9 @@ Makefile Makefile.in z_* *.O *~ xmlmarclint refextract xmlmarc2textmarc +bibedit diff --git a/modules/bibedit/bin/Makefile.am b/modules/bibedit/bin/Makefile.am index 6014445e0..4dbbf1b68 100644 --- a/modules/bibedit/bin/Makefile.am +++ b/modules/bibedit/bin/Makefile.am @@ -1,24 +1,24 @@ ## $Id$ ## This file is part of CDS Invenio. ## Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 CERN. ## ## CDS Invenio 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. ## ## CDS Invenio 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 CDS Invenio; if not, write to the Free Software Foundation, Inc., ## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -bin_SCRIPTS = refextract xmlmarclint xmlmarc2textmarc +bin_SCRIPTS = refextract xmlmarclint xmlmarc2textmarc bibedit -EXTRA_DIST = refextract.in xmlmarclint.in xmlmarc2textmarc.in +EXTRA_DIST = refextract.in xmlmarclint.in xmlmarc2textmarc.in bibedit.in CLEANFILES = *~ *.tmp diff --git a/modules/bibedit/bin/Makefile.am b/modules/bibedit/bin/bibedit.in similarity index 76% copy from modules/bibedit/bin/Makefile.am copy to modules/bibedit/bin/bibedit.in index 6014445e0..99679e4b6 100644 --- a/modules/bibedit/bin/Makefile.am +++ b/modules/bibedit/bin/bibedit.in @@ -1,24 +1,35 @@ +#!@PYTHON@ +## ## $Id$ - +## ## This file is part of CDS Invenio. ## Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 CERN. ## ## CDS Invenio 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. ## ## CDS Invenio 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. +## General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with CDS Invenio; if not, write to the Free Software Foundation, Inc., ## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -bin_SCRIPTS = refextract xmlmarclint xmlmarc2textmarc +""" +BibEdit CLI tool. +""" + +__revision__ = "$Id$" -EXTRA_DIST = refextract.in xmlmarclint.in xmlmarc2textmarc.in +try: + from invenio.bibeditcli import main +except ImportError, e: + print "Error: %s" % e + import sys + sys.exit(1) -CLEANFILES = *~ *.tmp +main() diff --git a/modules/bibedit/lib/Makefile.am b/modules/bibedit/lib/Makefile.am index f68993dfc..20b16696d 100644 --- a/modules/bibedit/lib/Makefile.am +++ b/modules/bibedit/lib/Makefile.am @@ -1,36 +1,37 @@ ## $Id$ ## This file is part of CDS Invenio. ## Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 CERN. ## ## CDS Invenio 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. ## ## CDS Invenio 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 CDS Invenio; if not, write to the Free Software Foundation, Inc., ## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. pylibdir = $(libdir)/python/invenio pylib_DATA = bibrecord_config.py \ bibrecord.py \ bibrecord_tests.py \ refextract_config.py \ refextract.py \ xmlmarc2textmarclib.py \ bibedit_config.py \ bibedit_engine.py \ bibedit_dblayer.py \ bibedit_templates.py \ - bibedit_regression_tests.py + bibedit_regression_tests.py \ + bibeditcli.py EXTRA_DIST = $(pylib_DATA) CLEANFILES = *~ *.tmp *.pyc diff --git a/modules/bibedit/lib/bibeditcli.py b/modules/bibedit/lib/bibeditcli.py new file mode 100644 index 000000000..b59939376 --- /dev/null +++ b/modules/bibedit/lib/bibeditcli.py @@ -0,0 +1,180 @@ +# -*- coding: utf-8 -*- +## +## $Id$ +## +## This file is part of CDS Invenio. +## Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 CERN. +## +## CDS Invenio 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. +## +## CDS Invenio 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 CDS Invenio; if not, write to the Free Software Foundation, Inc., +## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + +""" +BibEdit CLI tool. + +Usage: bibedit [options] + +General options: + -h, --help print this help + -V, --version print version number + +Options to inspect record history: + --list-record-revisions [recid] list all revisions of a record + --get-record-revision [recid.revdate] print given record revision + --diff-record-revisions [recidA.revdateB] print difference between record A + [recidC.revdateD] dated B and record C dated D +""" + +__revision__ = "$Id$" + +import re +import sys +import zlib +import difflib + +_RE_RECORD_REVISION_FORMAT = re.compile(r'^(\d+)\.(\d{14})$') + +from invenio.dbquery import run_sql + +def print_usage(): + """Print help.""" + print __doc__ + +def print_version(): + """Print version information.""" + print __revision__ + +def list_record_revisions(recid): + """ + Return list of all known MARCXML revisions for record RECID. + """ + out = [] + res = run_sql("""SELECT DATE_FORMAT(job_date, '%%Y%%m%%d%%H%%i%%s') + FROM hstRECORD WHERE id_bibrec=%s""", + (recid,)) + for row in res: + out.append(recid + '.' + row[0]) + return out + +def revision_valid_p(revid): + """ + Predicate to test validity of revision ID. + """ + if _RE_RECORD_REVISION_FORMAT.match(revid): + return True + return False + +def get_record_revision(revid): + """ + Return MARCXML string with corresponding to revision REVID of a + record. Return empty string if revision does not exist. REVID is + assumed to be washed already. + """ + out = "" + match = _RE_RECORD_REVISION_FORMAT.match(revid) + recid = match.group(1) + revdate = match.group(2) + job_date = "%s-%s-%s %s:%s:%s" % (revdate[0:4], revdate[4:6], + revdate[6:8], revdate[8:10], + revdate[10:12], revdate[12:14],) + res = run_sql("""SELECT marcxml FROM hstRECORD + WHERE id_bibrec=%s AND job_date=%s""", + (recid, job_date)) + if res: + for row in res: + out += zlib.decompress(row[0]) + "\n" + return out + +def cli_list_record_revisions(recid): + """ + Print list of all known MARCXML revisions for record RECID. + """ + print "\n".join(list_record_revisions(recid)) + +def cli_get_record_revision(revid): + """ + Return MARCXML revision REVID (=RECID.REVDATE) of a record. + Exit if things went wrong. + """ + if not revision_valid_p(revid): + print "ERROR: revision %s is invalid; " + \ + "must be NNN.YYYYMMDDhhmmss." % revid + sys.exit(1) + out = get_record_revision(revid) + if out: + print out + else: + print "ERROR: Revision %s not found." % revid + +def cli_diff_record_revisions(revid1, revid2): + """ + Return diffs of MARCXML record revisions REVID1, REVID2. + Exit if things went wrong. + """ + for revid in [revid1, revid2]: + if not revision_valid_p(revid): + print "ERROR: revision %s is invalid; " + \ + "must be NNN.YYYYMMDDhhmmss." % revid + sys.exit(1) + xml1 = get_record_revision(revid1) + xml2 = get_record_revision(revid2) + print "".join(difflib.unified_diff(xml1.splitlines(1), + xml2.splitlines(1), + revid1, + revid2,)) + +def main(): + """Main entry point.""" + if '--help' in sys.argv or \ + '-h' in sys.argv: + print_usage() + elif '--version' in sys.argv or \ + '-V' in sys.argv: + print_version() + else: + try: + cmd = sys.argv[1] + opts = sys.argv[2:] + if not opts: + raise IndexError + except IndexError: + print_usage() + sys.exit(1) + if cmd == '--list-record-revisions': + try: + recid = opts[0] + except IndexError: + print_usage() + sys.exit(1) + cli_list_record_revisions(recid) + elif cmd == '--get-record-revision': + try: + revid = opts[0] + except IndexError: + print_usage() + sys.exit(1) + cli_get_record_revision(revid) + elif cmd == '--diff-record-revisions': + try: + revid1 = opts[0] + revid2 = opts[1] + except IndexError: + print_usage() + sys.exit(1) + cli_diff_record_revisions(revid1, revid2) + else: + print """ERROR: Please specify a command. Please see '--help'.""" + sys.exit(1) + +if __name__ == '__main__': + main()