File: bro-plugin-create-package.sh

package info (click to toggle)
broccoli-python 0.62-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 460 kB
  • ctags: 105
  • sloc: python: 407; sh: 202; makefile: 21
file content (43 lines) | stat: -rwxr-xr-x 1,031 bytes parent folder | download | duplicates (9)
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
#
# Helper script creating a tarball with a plugin's binary distribution. We'll
# also leave a MANIFEST in place with all files part of the tar ball.
#
# Called from BroPluginDynamic.cmake. Current directory is the plugin
# build directory.

if [ $# = 0 ]; then
    echo "usage: `basename $0` <canonical plugin name> [<additional files to include into binary distribution>]"
    exit 1
fi

name=$1
shift
addl=$@

# Copy additional distribution files into build directory.
for i in ${addl}; do
    if [ -e ../$i ]; then
        dir=`dirname $i`
        mkdir -p ${dir}
        cp -p ../$i ${dir}
    fi
done

tgz=${name}-`(test -e ../VERSION && cat ../VERSION | head -1) || echo 0.0`.tar.gz

rm -f MANIFEST ${name} ${name}.tgz ${tgz}

for i in __bro_plugin__ lib scripts ${addl}; do
    test -e $i && find -L $i -type f | sed "s%^%${name}/%g" >>MANIFEST
done

ln -s . ${name}
mkdir -p dist

flag="-T"
test `uname` = "OpenBSD" && flag="-I"
tar czf dist/${tgz} ${flag} MANIFEST

ln -s dist/${tgz} ${name}.tgz
rm -f ${name}