/
Build XBMC4Gamers.sh
114 lines (93 loc) · 2.99 KB
/
Build XBMC4Gamers.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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
#!/bin/bash
VERSION=$(cat version.txt)
red=`tput setaf 1`
green=`tput setaf 2`
yellow=`tput setaf 3`
blue=`tput setaf 4`
magenta=`tput setaf 5`
cyan=`tput setaf 6`
white=`tput setaf 7`
reset=`tput sgr0`
# Create array of all folders we want to remove
REMOVE_FILES=(./XBMC/plugins \
./XBMC/sounds\
./XBMC/userdata\
./XBMC/visualisations\
./XBMC/web\
./XBMC/system/keymaps\
./XBMC/system/cdrip\
./XBMC/system/scrapers\
./XBMC/system/players/mplayer/codecs\
./XBMC/scripts\
./XBMC/skin \
./XBMC/screensavers \
"./XBMC/system/filezilla server.xml" \
./XBMC/copying.txt \
./XBMC/keymapping.txt \
./XBMC/media/icon.png \
./XBMC/media/Splash_2007.png \
./XBMC/media/Splash_2008.png \
./XBMC/media/weather.rar)
COPY_SYSTEM_FILES=(./XBMC/media \
./XBMC/language \
./XBMC/screenshots \
./XBMC/UserData)
echo "#############################################"
echo "#"
echo "# Welcome to the ${blue}XBMC4Gamers${reset} build script."
echo "#"
echo "# Shell script by:"
echo "# ${blue}Dominic Hock (Subtixx)${reset}"
echo "#"
echo "# XBMC4Gamers Version:"
echo "# ${blue}$VERSION${reset}"
echo "#"
echo "#############################################"
# Check for XBMC folder and XBMC/system folder existance
if [ ! -d "./XBMC" ]; then
echo "${red}ERROR: Place a fresh copy of XBMC into this folder and try again.${reset}"
exit 1
fi
if [ ! -d "./XBMC/system" ]; then
echo "${red}ERROR: Place a fresh copy of XBMC into this folder and try again.${reset}"
exit 1
fi
echo "${green}Building XBMC4Gamers...${reset}"
echo "${green}Removing unneeded files...${reset}"
# Remove all files we don't need
for i in "${REMOVE_FILES[@]}"
do
if [ -e "$i" ]; then
echo "Removing $i"
rm -r "$i"
fi
done
echo "${green}Copying system files...${reset}"
for i in "${COPY_SYSTEM_FILES[@]}"
do
if [ -e "$i" ]; then
echo "Copying $i"
cp -a "$i" "./XBMC/system/"
fi
done
echo "${green}Copying XBMC4Gamers mod files...${reset}"
cp -a "./Mod Files/." "./XBMC/"
cp "./changes.txt" "./XBMC/system/SystemInfo/changes.txt"
echo "${green}Setting variables...${reset}"
if [ ! -e "./XBMC/skins/Profile Skin/language/English/strings.po" ]; then
echo "${red}ERROR: Place a fresh copy of XBMC into this folder and try again.${reset}"
rm -r "./XBMC"
exit 1
fi
sed -i "s/0.0.000/$VERSION/g" "./XBMC/skins/Profile Skin/language/English/strings.po"
if [ ! -d "./XBMC/skins/Manage Profiles Skin" ]; then
mkdir -p "./XBMC/skins/Manage Profiles Skin/language/English"
fi
if [ ! -d "./XBMC/skins/DVD2Xbox Skin" ]; then
mkdir -p "./XBMC/skins/DVD2Xbox Skin/language/English"
fi
cp "./XBMC/skins/Profile Skin/language/English/strings.po" "./XBMC/skins/Manage Profiles Skin/language/English/strings.po"
cp "./XBMC/skins/Profile Skin/language/English/strings.po" "./XBMC/skins/DVD2Xbox Skin/language/English/strings.po"
cp "Source/default.xbe" "./XBMC/default.xbe"
mv "./XBMC" "./XBMC4Gamers"
echo "${green}Done!${reset}"