-
Notifications
You must be signed in to change notification settings - Fork 0
/
build
executable file
·50 lines (38 loc) · 846 Bytes
/
build
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
#!/bin/bash
export PACKAGER="Antonio Hernández <[email protected]>"
ac_tmpdir=./tmp
ac_pkgpath=./packages/$1
if [ ! -d "$ac_pkgpath" ]; then
echo "No package name specified."
exit 1
fi
if [ ! -f $ac_pkgpath/abs/PKGBUILD ]; then
echo "Can't find $ac_pkgpath/abs/PKGBUILD file."
exit 1
fi
ac_clean_tmp_dir () {
rm -rf $ac_tmpdir
mkdir $ac_tmpdir
}
ac_copy_assets () {
cp $ac_pkgpath/abs/* $ac_tmpdir
source $ac_pkgpath/abs/PKGBUILD
if [ -d "$ac_pkgpath/src" ]; then
local dirname=`basename "$source" .tar.gz`
cp -r $ac_pkgpath/src $ac_tmpdir/$dirname
cd $ac_tmpdir
tar -zcf $source $dirname
cd -
fi
}
ac_build () {
cd $ac_tmpdir
makepkg -g >> PKGBUILD
makepkg -c -d
}
ac_main () {
ac_clean_tmp_dir
ac_copy_assets
ac_build
}
ac_main