Commit 0b86fc2d authored by Erick's avatar Erick

Remove the old extension intsallation mechanism (stklos-install)

parent 7c19f58d
......@@ -6900,7 +6900,7 @@ LIB_SUMMARY="(:system ($SYST_LIBS) :compiled ($COMP_LIBS))"
ac_config_files="$ac_config_files Makefile src/Makefile src/extraconf.h doc/Makefile lib/Makefile utils/Makefile utils/stklos-config utils/stklos-script examples/Makefile lib/Match.d/Makefile lib/SILex.d/Makefile lib/Lalr.d/Makefile lib/ScmPkg.d/Makefile tests/Makefile doc/stklos.1 doc/stklos-config.1 doc/stklos-compile.1 doc/stklos-genlex.1 doc/stklos-install.1 doc/stklos-pkg.1 doc/skb/stklos-version.stk pkgman/Makefile"
ac_config_files="$ac_config_files Makefile src/Makefile src/extraconf.h doc/Makefile lib/Makefile utils/Makefile utils/stklos-config utils/stklos-script examples/Makefile lib/Match.d/Makefile lib/SILex.d/Makefile lib/Lalr.d/Makefile lib/ScmPkg.d/Makefile tests/Makefile doc/stklos.1 doc/stklos-config.1 doc/stklos-compile.1 doc/stklos-genlex.1 doc/stklos-pkg.1 doc/skb/stklos-version.stk pkgman/Makefile"
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
......@@ -7644,7 +7644,6 @@ do
"doc/stklos-config.1") CONFIG_FILES="$CONFIG_FILES doc/stklos-config.1" ;;
"doc/stklos-compile.1") CONFIG_FILES="$CONFIG_FILES doc/stklos-compile.1" ;;
"doc/stklos-genlex.1") CONFIG_FILES="$CONFIG_FILES doc/stklos-genlex.1" ;;
"doc/stklos-install.1") CONFIG_FILES="$CONFIG_FILES doc/stklos-install.1" ;;
"doc/stklos-pkg.1") CONFIG_FILES="$CONFIG_FILES doc/stklos-pkg.1" ;;
"doc/skb/stklos-version.stk") CONFIG_FILES="$CONFIG_FILES doc/skb/stklos-version.stk" ;;
"pkgman/Makefile") CONFIG_FILES="$CONFIG_FILES pkgman/Makefile" ;;
......
......@@ -2,7 +2,7 @@
###
### Author: Erick Gallesio [eg@unice.fr]
### Creation date: 28-Dec-1999 21:19 (eg)
### Last file update: 5-Aug-2010 23:58 (eg)
### Last file update: 10-Aug-2010 10:36 (eg)
AC_PREREQ(2.64)
AC_INIT([stklos], [1.00])
......@@ -428,8 +428,7 @@ AC_CONFIG_FILES([Makefile src/Makefile src/extraconf.h doc/Makefile
lib/Match.d/Makefile lib/SILex.d/Makefile lib/Lalr.d/Makefile
lib/ScmPkg.d/Makefile tests/Makefile
doc/stklos.1 doc/stklos-config.1 doc/stklos-compile.1
doc/stklos-genlex.1 doc/stklos-install.1 doc/stklos-pkg.1
doc/skb/stklos-version.stk
doc/stklos-genlex.1 doc/stklos-pkg.1 doc/skb/stklos-version.stk
pkgman/Makefile])
AC_OUTPUT
......
......@@ -2,11 +2,10 @@
#
# Author: Erick Gallesio [eg@unice.fr]
# Creation date: 11-Apr-2000 10:30 (eg)
# Last file update: 28-Oct-2006 16:54 (eg)
# Last file update: 10-Aug-2010 10:44 (eg)
mandir = $(prefix)/share/man
man_MANS = stklos.1 stklos-config.1 stklos-compile.1 stklos-genlex.1\
stklos-install.1
man_MANS = stklos.1 stklos-config.1 stklos-compile.1 stklos-genlex.1
EXTRA_DIST = $(man_MANS)
DOCDB = DOCDB
......
......@@ -19,7 +19,7 @@
#
# Author: Erick Gallesio [eg@unice.fr]
# Creation date: 11-Apr-2000 10:30 (eg)
# Last file update: 28-Oct-2006 16:54 (eg)
# Last file update: 10-Aug-2010 10:44 (eg)
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
......@@ -41,8 +41,8 @@ POST_UNINSTALL = :
subdir = doc
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
$(srcdir)/stklos-compile.1.in $(srcdir)/stklos-config.1.in \
$(srcdir)/stklos-genlex.1.in $(srcdir)/stklos-install.1.in \
$(srcdir)/stklos-pkg.1.in $(srcdir)/stklos.1.in TODO
$(srcdir)/stklos-genlex.1.in $(srcdir)/stklos-pkg.1.in \
$(srcdir)/stklos.1.in TODO
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
......@@ -50,7 +50,7 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/src/stklosconf.h
CONFIG_CLEAN_FILES = stklos.1 stklos-config.1 stklos-compile.1 \
stklos-genlex.1 stklos-install.1 stklos-pkg.1
stklos-genlex.1 stklos-pkg.1
CONFIG_CLEAN_VPATH_FILES =
SOURCES =
DIST_SOURCES =
......@@ -217,9 +217,7 @@ target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
man_MANS = stklos.1 stklos-config.1 stklos-compile.1 stklos-genlex.1\
stklos-install.1
man_MANS = stklos.1 stklos-config.1 stklos-compile.1 stklos-genlex.1
EXTRA_DIST = $(man_MANS)
DOCDB = DOCDB
OTHERDB = ../src/$(DOCDB) ../lib/$(DOCDB)
......@@ -274,8 +272,6 @@ stklos-compile.1: $(top_builddir)/config.status $(srcdir)/stklos-compile.1.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
stklos-genlex.1: $(top_builddir)/config.status $(srcdir)/stklos-genlex.1.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
stklos-install.1: $(top_builddir)/config.status $(srcdir)/stklos-install.1.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
stklos-pkg.1: $(top_builddir)/config.status $(srcdir)/stklos-pkg.1.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
install-man1: $(man_MANS)
......
.\" -*- nroff -*-
.\" First parameter, NAME, should be all caps
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
.\" other parameters are allowed: see man(7), man(1)
.TH STKLOS-SETUP 1 "version @VERSION@"
.\" Please adjust this date whenever revising the manpage.
.\"
.\" Some roff macros, for reference:
.\" .nh disable hyphenation
.\" .hy enable hyphenation
.\" .ad l left justify
.\" .ad b justify to both left and right margins
.\" .nf disable filling
.\" .fi enable filling
.\" .br insert line break
.\" .sp <n> insert n1 empty lines
.\" for manpage-specific macros, see man(7)
.SH NAME
stklos-setup \- Management of STklos extensions
.SH SYNOPSIS
\fbstklos-setup\fR [\fIoptions\fR] extension
.SH DESCRIPTION
The
.B stklos-setup
command is the general tool for downloading, installing and uninstalling
.B STklos
extensions. If the command is run as super user, the installation is
done in the standard
.B STklos
installations directories. If it is run as a normal user, the files
will be installed in the user repository (that is somewhere in
\fI~/.stklos\fR directory.
.LP
When called without option, this command will search the extension in
the current directory and try to install it. If the extension is not
available, it will try to fetch it (using
.BR wget (1)
).
.SH OPTIONS
Here are the options available in the version @VERSION@ of
.B stklos.
.IP "--list | -l"
List already installed extensions
.IP "--uninstall | -u"
Uninstall the given extension
.IP "--keep | -k"
Keep the intermediary files. This is useful to fix incorrect extensions
.IP "--help | -h | -?"
Show a list of options
.SH "FILES"
.IP "~/.stklos/ext"
The \fBSTklos\fR user extension repository
.SH "SEE ALSO"
.BR stklos (1)
......@@ -2,11 +2,10 @@
#
# Author: Erick Gallesio [eg@unice.fr]
# Creation date: 14-Aug-2000 13:13 (eg)
# Last file update: 23-May-2005 14:42 (eg)
# Last file update: 10-Aug-2010 10:42 (eg)
scmbin = stklos-compile stklos-genlex
bin_SCRIPTS = stklos-config stklos-ext-install stklos-script \
stklos-install $(scmbin)
bin_SCRIPTS = stklos-config stklos-script $(scmbin)
stklos-compile: stklos-compile.stk
......
......@@ -19,7 +19,7 @@
#
# Author: Erick Gallesio [eg@unice.fr]
# Creation date: 14-Aug-2000 13:13 (eg)
# Last file update: 23-May-2005 14:42 (eg)
# Last file update: 10-Aug-2010 10:42 (eg)
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
......@@ -210,9 +210,7 @@ top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
scmbin = stklos-compile stklos-genlex
bin_SCRIPTS = stklos-config stklos-ext-install stklos-script \
stklos-install $(scmbin)
bin_SCRIPTS = stklos-config stklos-script $(scmbin)
all: all-am
.SUFFIXES:
......
#!/usr/local/bin/snow -f
;;;; -*- scheme -*-
;;;;
;;;; d o c 2 t e x i -- Build texi file from documentation
;;;;
;;;; Copyright © 2000 Erick Gallesio - I3S-CNRS/ESSI <eg@unice.fr>
;;;;
;;;;
;;;; 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.
;;;;
;;;; Author: Erick Gallesio [eg@unice.fr]
;;;; Creation date: 11-Apr-2000 12:12 (eg)
;;;; Last file update: 11-Apr-2000 12:47 (eg)
;;;;
(require "regexp")
(define rgxp (string->regexp "\\|([^|]+)\\|"))
(define (rewrite-definition def)
(regexp-replace-all rgxp def "@t{\\1}"))
(define (generate in)
(do ((l (read in) (read in)))
((eof-object? l))
(let ((type (get-keyword :type (cdr l)))
(syn (get-keyword :synopsys (cdr l)))
(def (get-keyword :description (cdr l))))
(format #t "@deffn ~A ~A\n" type syn)
(format #t "~A\n" (rewrite-definition def))
(format #t "@end deffn\n")))
(close-input-port in))
(define (main files)
(format #t "@c Automatically generated. DO NOT EDIT! -*-texinfo-*-\n\n")
(for-each (lambda (f) (generate (open-input-file f)))
files)
(format #t "@ EOF\n"))
(main *argv*)
#!/bin/sh
# -*- shell-script -*-
#
# stklos-ext-installer -- STklos extension installer
#
# Copyright 2005-2007 Erick Gallesio - I3S-CNRS/ESSI <eg@essi.fr>
#
#
# 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.
#
# Author: Erick Gallesio [eg@essi.fr]
# Creation date: 18-Mar-2005 14:51 (eg)
# Last file update: 12-Apr-2007 15:06 (eg)
#
usage()
{
echo "Usage: $0 pkg file dir mode
where
pkg: the package to which the file belongs (ignored if empty string)
file: the file to copy (can be a dir)
dir: the directory to which the file must be copied (ignored if not root)
mode: the protection bits"
}
if [ $# -ne 4 ] ;then
usage >&2
exit 1
fi
PKG=$1
FILE=$2
DIR=$3
MODE=$4
# Create the destination directory
if [ `id -u` -eq 0 ] ;then
DEST=`stklos-config -p`/$DIR
DB=`stklos-config -p`/share/stklos/extensions
else
DEST=$HOME/.stklos/ext
DB=$HOME/.stklos/
fi
mkdir -p $DEST
# Copy file
if [ -d $FILE ] ;then
mkdir -p $DEST/$FILE
else
mkdir -p $DEST/`dirname $FILE`
cp $FILE $DEST/$FILE
fi
# Set protection
chmod $MODE $DEST/$FILE
# Retain in our DB that this file was installed
if [ `id -u` -eq 0 ] ;then
DBDIR=`stklos-config -p`/share/stklos/extensions
else
DBDIR=$HOME/.stklos/ext/extensions
fi
mkdir -p $DBDIR
DB=$DBDIR/$PKG
echo -n >> $DB
grep -v $DEST/$FILE $DB > /tmp/stklos-install.$$
(cat /tmp/stklos-install.$$; echo $DEST/$FILE) > $DB
exit 0
#!/bin/sh
# -*- shell-script -*-
# stklos-install -- Install STklos extensions
#
# Copyright 2001-2010 Erick Gallesio - I3S-CNRS/ESSI <eg@unice.fr>
#
#
# 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.
#
# Author: Erick Gallesio [eg@essi.fr]
# Creation date: 18-Mar-2005 13:26 (eg)
# Last file update: 14-May-2010 17:00 (eg)
#
DISTURL="http://www.stklos.net/download/extensions"
PROG=$0
opt_keep=0
opt_uninstall=0
# ----------------------------------------------------------------------
# Usage ...
# ----------------------------------------------------------------------
usage()
{
cat <<EOF
Usage: stklos-setup [OPTIONS] package
Options:
[--help | -h | -?] Show a list of options
|--keep | -k] Keep files to fix installation problems
[--uninstall | -u] Uninstall previously installed package
[--list | -l] List installed extensions
EOF
exit $1
}
# ----------------------------------------------------------------------
# trace ...
# ----------------------------------------------------------------------
trace()
{
case $TERM in
vt100|xterm*|rxvt|urxvt*) begin=""; end="" ;;
*) begin=""; end="";;
esac
echo "${begin}**** $1${end}" >&2
}
# ----------------------------------------------------------------------
# find_in_path ...
# ----------------------------------------------------------------------
find_in_path() {
file=$1
res=""
for i in $(echo $PATH | sed -e 's/:/ /g') ;do
if [ -x $i/$file ] ;then
res=$i/$file
break;
fi
done
echo $res
}
# ----------------------------------------------------------------------
# try-fetch ...
# ----------------------------------------------------------------------
try_fetch()
{
# Try to fetch package with wget, then curl and finally fetch
pkg=$1
trace "Package $pkg is absent. Try to fetch it from $DISTURL"
for prog in "wget" "curl" "fetch"
do
abs=$(find_in_path $prog)
if [ "$abs" != "" ] ;then
case $prog in
wget|fetch)
$prog $DISTURL/${pkg}.stgz 2>/dev/null >&2 ;;
curl)
$prog -o ${pkg}.stgz $DISTURL/${pkg}.stgz 2>/dev/null >&2 ;;
esac
if [ $? = 0 ] ;then
trace "Download finished"
else
trace "Error while downloading $DISTURL/${pkg}.stgz"
fi
return 0;
fi
done
}
# ----------------------------------------------------------------------
# die ...
# ----------------------------------------------------------------------
die()
{
echo $1 >&2
exit 1
}
# ----------------------------------------------------------------------
# find_prefix ...
# ----------------------------------------------------------------------
find_prefix()
{
if [ `id -u` -eq 0 ] ;then
echo "`stklos-config --prefix`/share/stklos/extensions"
else
echo $HOME/.stklos/ext/extensions
fi
}
# ----------------------------------------------------------------------
# install_package ...
# ----------------------------------------------------------------------
install_package()
{
pkg=$1
TMP=/tmp/stklos-setup-$$
BUILDDIR=$TMP/`basename $pkg`
trace "Installing package $pkg"
if [ ! -f ${pkg}.stgz ] ;then
try_fetch $pkg
fi
if [ ! -f ${pkg}.stgz ] ;then
# Not here after fetch. Signal an error
trace "Cannot find extension $pkg. "
trace "Place \"$pkg.stgz\" file in current directory and run $PROG again"
exit 1
fi
if [ `id -u` -eq 0 ] ;then
prefix=`stklos-config --prefix`
else
mkdir -p $HOME/.stklos
prefix=$HOME/.stklos
fi
trace "Installation takes place in in $BUILDDIR"
mkdir -p $TMP || die "$PROG: cannot make trmporary directory"
cat $pkg.stgz | (cd $TMP; tar xvfz -)
(eval "cd ${BUILDDIR}*";
trace "Configuring package ..." && ./configure &&
trace "Make package ..." && make &&
trace "Installing package ..." && make install)
if [ $? = 0 -a $opt_keep = 0 ] ;then
/bin/rm -rf $TMP
else
trace "Problem while compiling package."
trace "Look at $BUILDDIR directory for more information"
fi
trace "Package $pkg is successfully installed."
}
# ----------------------------------------------------------------------
# uninstall_package ...
# ----------------------------------------------------------------------
uninstall_package()
{
pkg=$1
trace "Unstalling package $pkg"
DBDIR=`find_prefix`
DATAFILE=`echo $DBDIR/$pkg*`
if [ ! -f $DATAFILE ] ;then
trace "Package $pkg was not previously installed. Quit."
exit 1;
fi
echo -n "Please confirm deletion of `basename $DATAFILE`? "
read R
case $R in
y|Y) trace "Deleting files ..."
cat $DATAFILE | while read file ;do
trace " $file"
rm -f $file
done
rm -f $DATAFILE
trace "Package $pkg is successfully uninstalled."
;;
*) trace "No package uninstalled" ;;
esac
}
# ----------------------------------------------------------------------
# list_extensions ...
# ----------------------------------------------------------------------
list_extensions()
{
trace "Available extensions:"
DIR=`find_prefix`
if [ -d $DIR ] ;then
cd $DIR
ls | while read line ;do
echo " $line"
done
fi
}
#
# Program starts here
#
if test $# -eq 0; then
usage 1 1>&2
fi
while test $# -gt 0; do
case $1 in
--help|-h|-\?)
usage 0 1>&2
exit 0;
;;
--keep|-k)
opt_keep=1;
shift
;;
--uninstall|-u)
opt_uninstall=1
shift
;;
--list|-l)
list_extensions
exit 0
;;
-*)
echo "bad option $1" 1>&2
usage 1 1>&2
exit 1
;;
*)
if [ $# -gt 1 ] ;then
echo "$PROG: too much arguments: $*" 1>&2
exit 1
fi
pkg=`basename $1 .stgz`
if [ $opt_uninstall = 1 ] ;then
uninstall_package $pkg
else
install_package $pkg
fi
exit 0
;;
esac
done
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment