-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·47 lines (36 loc) · 966 Bytes
/
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
#!/bin/bash
set -e
BASEDIR=$(dirname $(readlink -f $0))
OUTPUTDIR=$BASEDIR/output
TMPDIR=$BASEDIR/tmp
USRDIR=$TMPDIR/usr
BINDIR=$USRDIR/bin
LICDIR=$USRDIR/share/licenses/dua
umask 022
rm -rf $OUTPUTDIR $USRDIR
mkdir -p $OUTPUTDIR
mkdir -p $BINDIR
mkdir -p $TMPDIR
mkdir -p $LICDIR
cargo build --release --target x86_64-unknown-linux-gnu
cp target/release/dua $BINDIR
cp LICENSE $LICDIR
version=$(git describe --tags 2>/dev/null) || version=nover
typeset -a CARGS=(
-a x86_64
-s dir
-n dua
-v"$version"
--description "Disk Usage Analyzer"
-m "[email protected]"
--deb-no-default-config-files
--vendor "Istvan Szekeres"
--url "https://github.com/Pistahh/dua"
-C $TMPDIR
-p $OUTPUTDIR
)
typeset -a DIRS=( usr )
typeset -a DEB_DEPS=()
typeset -a PACMAN_DEPS=()
(cd $BASEDIR && fpm -t deb "${CARGS[@]}" "${DEB_DEPS[@]}" "${DIRS[@]}")
(cd $BASEDIR && fpm -t pacman "${CARGS[@]}" "${PACMAN_DEPS[@]}" "${DIRS[@]}")