-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchroot-pkg-config.sh
executable file
·95 lines (73 loc) · 2.61 KB
/
chroot-pkg-config.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#!/bin/bash
#https://wiki.archlinux.org/index.php/DeveloperWiki:Building_in_a_Clean_Chroot
destination1=$HOME"/darklinux/darklinux-repo/x86_64/"
destiny=$destination1
# 2. makepkg"
# 1. chroot"
CHOICE=1
pwdpath=$(echo $PWD)
pwd=$(basename "$PWD")
#which packages are always going to build with makepkg or choice 2
makepkglist=""
for i in $makepkglist
do
if [[ "$pwd" == "$i" ]] ; then
CHOICE=2
fi
done
search1=$(basename "$PWD")
search2=arcolinux
search=$search1
rm -rf /tmp/tempbuild
if test -f "/tmp/tempbuild"; then
rm /tmp/tempbuild
fi
mkdir /tmp/tempbuild
cp -r $pwdpath/* /tmp/tempbuild/
#cp -r $pwdpath/.* /tmp/tempbuild
cd /tmp/tempbuild/
if [[ $CHOICE == "1" ]] ; then
tput setaf 2
echo "#############################################################################################"
echo "######### Let us build the package in CHROOT "$(basename `pwd`)
echo "#############################################################################################"
tput sgr0
CHROOT=$HOME/Documents/chroot
arch-nspawn $CHROOT/root pacman -Syu
makechrootpkg -c -r $CHROOT
echo "Signing the package"
echo "#############################################################################################"
gpg --detach-sign $search*pkg.tar.zst
else
tput setaf 3
echo "#############################################################################################"
echo "######### Let us build the package with MAKEPKG "$(basename `pwd`)
echo "#############################################################################################"
tput sgr0
makepkg --sign
fi
echo "Moving created files to " $destiny
echo "#############################################################################################"
mv $search*pkg.tar.zst $destiny
mv $search*pkg.tar.zst.sig $destiny
echo "Cleaning up"
echo "#############################################################################################"
echo "deleting unnecessary folders"
echo "#############################################################################################"
if [[ -f $wpdpath/*.log ]]; then
rm $pwdpath/*.log
fi
if [[ -f $wpdpath/*.deb ]]; then
rm $pwdpath/*.deb
fi
if [[ -f $wpdpath/*.tar.gz ]]; then
rm $pwdpath/*.tar.gz
fi
tput setaf 8
echo "#############################################################################################"
echo "################### build done ######################"
echo "#############################################################################################"
tput sgr0
cd $HOME/darklinux/darklinux-repo/
sh repo-scan-git-v3.sh
#sh git-v3.sh