File: make-libhfst-dist.sh

package info (click to toggle)
hfst 3.16.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 14,532 kB
  • sloc: cpp: 101,875; sh: 6,717; python: 5,225; yacc: 4,985; lex: 2,900; makefile: 2,017; xml: 6
file content (43 lines) | stat: -rwxr-xr-x 1,268 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/sh

# A script for creating a minimal LGPL package for HFST which contains
# only openfst back-ends, HFST library and python bindings.
# First argument is the the normal HFST
# distribution tarball and second one the directory where alternative files
# for LGPL distribution can be found (folder lgpl-release in hfst repository).

if [ "$1" = "--help" -o "$1" = "-h" ]; then
    echo ""
    echo "A script for creating a minimal LGPL package for HFST which contains"
    echo "only openfst back-ends, HFSTlibrary and python bindings."
    echo ""
    echo "Usage: make-libhfst-dist.sh DIST LGPL_DIR"
    echo ""
    echo "DIST:     the normal HFST distribution tarball"
    echo "LGPL_DIR: the folder where alternative files for LGPL distribution can be found"
    echo ""
    exit 0
fi

if [ ! -e "$1" ]; then
    echo "File "$1" does not exist"
    exit 1
fi

if [ ! -d "$2" ]; then
    echo "Directory "$2" does not exist"
    exit 1
fi

OUTPUT=`tar -xzvf $1`
DIR=`echo $OUTPUT | perl -pe 's/ /\n/g;' | head -1 | perl -pe 's/\///;'`
cd $DIR
cp -R $2/* .
autoreconf -i && ./configure && make dist
tar -xzf $1
NEWDIRNAME="lib"$DIR
mv $DIR $NEWDIRNAME
TARBALL="lib"$DIR".tar.gz"
tar -czvf $TARBALL "lib"$DIR
cp $TARBALL ../
echo "Created lgpl package "$TARBALL