Use autogen.sh on gEDA/gaf.
[minipack.git] / mpk
blobb3cf93cb4c3adea69000e81ed882f88a542f328e
1 #! /bin/sh
3 # mpk - top level, user visible script.
4 # This file is part of Minipack - an automated build tool
6 # Copyright (C) 2008 Cesar Strauss
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2 of the License, or
11 # (at your option) any later version.
13 # This program is distributed in the hope that it will be useful, but
14 # WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 # General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, write to the Free Software
20 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22 bindir=$(dirname $0)
23 prog=$(basename $0)
24 case $bindir in
25 /*) ;;
26 *) bindir=$PWD/$bindir;;
27 esac
28 mpk=$bindir/$prog
29 prefix=$(cd $bindir && pwd)
30 tooldir=$prefix/tools
32 topdir=$PWD
33 builddir=$topdir/build
34 resultdir=$topdir/result
35 sourcedir=$topdir/sources
36 recipedir=$prefix/recipes
37 patchdir=$prefix/patches
39 export PATH=$tooldir:$resultdir/bin:$PATH
41 test -f ~/minipack.conf && . ~/minipack.conf
42 test -f $topdir/minipack.conf && . $topdir/minipack.conf
44 get_recipe_name()
46 name=$recipedir/$1.recipe
47 if [ ! -f $name ]; then
48 echo >&2 "Recipe for \"$1\" not found."
49 exit 1
51 echo $name
54 cmd=$1
55 shift
56 tool=$tooldir/mpk-$cmd
57 if [ -f $tool ]; then
58 . $tool "$@"
59 else
60 echo $prog: Invalid command: $cmd