File: create-ultr-plugin-package.sh

package info (click to toggle)
kadu 4.1-1.1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 54,532 kB
  • sloc: cpp: 128,331; sh: 988; awk: 105; makefile: 75
file content (60 lines) | stat: -rwxr-xr-x 1,669 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/usr/bin/env bash

# %kadu copyright begin%
# Copyright 2012 RafaƂ Malinowski (rafal.przemyslaw.malinowski@gmail.com)
# Copyright 2008 Dawid Stawiarski (neeo@kadu.net)
# %kadu copyright end%
#
# 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, see <http://www.gnu.org/licenses/>.

PLUGIN_NAME=$1
VERSION=$2

function usage
{
	echo "Usage: $0 plugin-name package-version"
	echo "    plugin-name must be an external plugin name"
	echo "    package-version will be appended to package name"
}

if [ "!" == "!$PLUGIN_NAME" ]; then
	usage
	exit
fi

if [ "!" == "!$VERSION" ]; then
	usage
	exit
fi

PACKAGE_NAME=${PLUGIN_NAME/-/_}-$VERSION
PACKAGE_DIR=${PLUGIN_NAME/-/_}
PACKAGE_FILE=$PACKAGE_NAME.tar.bz2

if [ -d $PACKAGE_DIR ]; then
	rm -rf $PACKAGE_DIR
fi

if [ -e $PACKAGE_FILE ]; then
	rm -rf $PACKAGE_FILE
fi

git clone --recursive --depth 1 -- https://gitlab.com/kadu/$PLUGIN_NAME.git $PACKAGE_DIR
find $PACKAGE_DIR -name ".git*" | xargs rm -rf

tar cjf $PACKAGE_FILE $PACKAGE_DIR
md5sum $PACKAGE_FILE > $PACKAGE_FILE.md5
sha1sum $PACKAGE_FILE > $PACKAGE_FILE.sha1

echo "Package is available as $PACKAGE_NAME.tar.bz2"