-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathrunme.sh
executable file
·61 lines (50 loc) · 1.49 KB
/
runme.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
#!/bin/bash
#####################################################################
# runme.sh for PKGBUILD file
#
# run the PKGBUILD file
#
# Copyright 2015 Yunhui Fu
# License: GPL v3.0 or later
#####################################################################
PACKAGER="Yunhui Fu <[email protected]>"
DN=$(pwd)
EXEC_MKPKG="${DN}/makepkg.sh"
#export GIT_SSL_NO_VERIFY=true
check_install_tool() {
if [ ! -x "${EXEC_MKPKG}" ]; then
git clone https://github.com/yhfudev/bash-fakemakepkg.git "${DN}/fakemakepkg-git"
EXEC_MKPKG="${DN}/fakemakepkg-git/makepkg.sh"
fi
if [ ! -x "${EXEC_MKPKG}" ]; then
echo "error to get makepkg"
exit 1
fi
( cd "${DN}/fakemakepkg-git" && git pull )
}
check_install_tool
mkdir -p ${DN}/pkgdst
mkdir -p ${DN}/srcdst
mkdir -p ${DN}/srcpkgdst
if [ ! -f "${DN}/mymakepkg.conf" ]; then
cat << EOF > "${DN}/mymakepkg.conf"
# generated by $0
# $(date)
PACKAGER="${PACKAGER}"
PKGEXT=.pkg.tar.gz
PKGDEST=${DN}/pkgdst
SRCDEST=${DN}/srcdst
SRCPKGDEST=${DN}/srcpkgdst
DLAGENTS=('ftp::/usr/bin/aria2c -UWget -s4 %u -o %o'
'http::/usr/bin/aria2c -UWget -s4 %u -o %o'
'https::/usr/bin/aria2c -UWget -s4 %u -o %o'
'rsync::/usr/bin/rsync -z %u %o'
'scp::/usr/bin/scp -C %u %o')
EOF
fi
${EXEC_MKPKG} --config "${DN}/mymakepkg.conf" -p "${DN}/PKGBUILD" --dryrun
if [ ! "$?" = "0" ]; then
echo "error in checking the script!"
exit 1
fi
${EXEC_MKPKG} --config "${DN}/mymakepkg.conf" -p "${DN}/PKGBUILD"