-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall
executable file
·42 lines (35 loc) · 945 Bytes
/
install
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
#! /bin/sh
usage="\
Usage: $0 [DESTDIR]
install ARIA client
if DESTDIR is given aria-client will be install into DESTDIR,
else aria-client will be install into '/'
"
DATADIR="/usr/share/aria-client"
BINDIR="/usr/bin"
CURRDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
if [ $# -gt 1 ] ; then
echo "$usage"
exit 1
fi
if [ $# -eq 0 ] ; then
DESTDIR=""
if [ $UID -ne 0 ] ;then
echo "Error: you cannot perform this operation unless you are root"
exit 1
fi
else
DESTDIR="$1"
fi
echo "Starting..."
sed s_HOME=src/_HOME=/usr/share/aria-client/_ -i ${CURRDIR}/aria
echo "Creating Directory...."
install -d ${DESTDIR}/usr/share/aria-client/ && \
echo -e "\tCreated"
echo "Copying files...."
cp -r ${CURRDIR}/src/* ${DESTDIR}${DATADIR}/ && \
rm -R ${DESTDIR}${DATADIR}/other && \
rm -R ${DESTDIR}${DATADIR}/ui_files && \
install --mode=755 -D ${CURRDIR}/aria ${DESTDIR}${BINDIR}/aria-client && \
echo -e "\tFinished"
exit 0