summaryrefslogtreecommitdiff
path: root/scripts/tarpkg
blob: 818f99ea789e14b8f1f595c3454e024a59f81ee3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/env bash
# create/install compressed tar balls

if [ "$1" = "build" ];then
	if [ ! -d $2 ];then
		echo "not a directory"
		exit 1
	fi
	pkgname=$(grep "^Package:" $2/CONTROL/control | sed -e "s/^[^:]*:[[:space:]]*//")
	version=$(grep "^Version:" $2/CONTROL/control | sed -e "s/^[^:]*:[[:space:]]*//")
	arch=$(grep "^Architecture:" $2/CONTROL/control | sed -e "s/^[^:]*:[[:space:]]*//")
	rm -rf $2/CONTROL 
	(cd $2 && tar -czf $3/${pkgname}_${version}_${arch}.tar.gz .)
elif [ "$1" = "install" ];then
	tar -xzpf $2 -C ${INSTROOT}
else
	echo "unknown command"
	exit 1
fi