-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathctl.sh
executable file
·63 lines (51 loc) · 1.63 KB
/
ctl.sh
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
61
62
63
#!/bin/bash
NAME="xfce4-chicago95"
VERSION="1.0.0"
PACKAGE_VERSION="1"
DIST="dist"
DIST_ROOT="${DIST}/${NAME}_${VERSION}-${PACKAGE_VERSION}"
SRC="src"
ctl_help()
{
echo "NAME"
echo " $0 - Development console for this project"
echo ""
echo "SYNOPSIS"
echo " $0 COMMAND"
echo " $0 --help, -h"
echo
echo "COMMAND"
echo " dist Pack all of components into Debian package"
echo " clear Clear temporary files"
}
ctl_dist()
{
rm -rf $DIST
mkdir -vp ${DIST_ROOT}/usr/share/themes
cp -r $SRC/Theme/Chicago95 ${DIST_ROOT}/usr/share/themes/${NAME}
mkdir -vp ${DIST_ROOT}/usr/share/icons
cp -r ${SRC}/Icons/Chicago95 ${DIST_ROOT}/usr/share/icons/${NAME}
mkdir -vp ${DIST_ROOT}/usr/share/icons
cp -r ${SRC}/Cursors/Chicago95_Cursor_Black \
${DIST_ROOT}/usr/share/icons/${NAME}_cursor_black
mkdir -vp ${DIST_ROOT}/usr/bin
cp ${SRC}/cli.sh ${DIST_ROOT}/usr/bin/${NAME}
mkdir -vp ${DIST_ROOT}/DEBIAN
cp ${SRC}/debian/control ${DIST_ROOT}/DEBIAN
sed -i -- "s/\$NAME/${NAME}/g" ${DIST_ROOT}/DEBIAN/control
sed -i -- "s/\$VERSION/${VERSION}/g" ${DIST_ROOT}/DEBIAN/control
sed -i -- "s/\$PACKAGE_VERSION/${PACKAGE_VERSION}/g" \
${DIST_ROOT}/DEBIAN/control
dpkg-deb --build -D $DIST_ROOT $DIST
}
ctl_clear()
{
rm -rf $DIST
}
case "$1" in
dist) ctl_dist; exit 0;;
clear) ctl_clear; exit 0;;
--help) ctl_help; exit 0;;
-h) ctl_help; exit 0;;
*) ctl_help; exit 1;;
esac