-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·52 lines (44 loc) · 1.5 KB
/
build.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
#!/bin/bash
PKGNAME="shhh"
PKGROOT="pkgroot"
DEPS=("bash" "ffmpeg" "yad" "expect")
FEEDBACKMAIL="[email protected]"
#DEPS="bash, ffmpeg, yad, expect"
while getopts ":v:f" opt; do
case ${opt} in
f )
FORCE="-f "
;;
v )
VERSION=$OPTARG
;;
\? )
echo "Invalid option: $OPTARG" 1>&2
;;
: )
echo "Invalid option: $OPTARG requires an argument" 1>&2
;;
esac
done
if [[ -z $VERSION ]]
then
echo "Please, set a version with -v." 1>&2
exit 127
fi
# check fpm
type -P "fpm" 2>&1 > /dev/null || { echo "fpm is required."; exit 1; }
# recompile the binary
shc -f shhh.sh -r -m $FEEDBACKMAIL
sudo rm shhh.sh.x.c
sudo cp shhh.sh.x $PKGROOT/usr/bin/shhh
sudo rm shhh.sh.x
# create .deb
#fpm -s dir -t deb "$FORCE"-n $PKGNAME -v "$VERSION" -d "$DEPS" --chdir "$PKGROOT" usr
echo fpm -s dir -t deb "$FORCE"-n $PKGNAME -v "$VERSION" $(for DEP in ${DEPS[@]}; do echo "-d $DEP "; done) --chdir "$PKGROOT" usr
fpm -s dir -t deb "$FORCE"-n $PKGNAME -v "$VERSION" $(for DEP in ${DEPS[@]}; do echo "-d $DEP "; done) --chdir "$PKGROOT" usr
#fpm -s dir -t pacman "$FORCE"-n $PKGNAME -v "$VERSION" -d "$DEPS" --chdir "$PKGROOT" usr
# create arch pkg
echo fpm -s dir -t pacman "$FORCE"-n $PKGNAME -v "$VERSION" $(for DEP in ${DEPS[2]}; do echo "-d $DEP "; done) --chdir "$PKGROOT" usr
fpm -s dir -t pacman "$FORCE"-n $PKGNAME -v "$VERSION" $(for DEP in ${DEPS[2]}; do echo "-d $DEP "; done) --chdir "$PKGROOT" usr
# move packages to build folder
mv *.deb *.tar.xz build 2> /dev/null