-
Notifications
You must be signed in to change notification settings - Fork 7
/
configure
executable file
·71 lines (58 loc) · 1.48 KB
/
configure
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
#!/bin/sh
if [ -f makefile ]
then
echo "Configuration done. Run '$([ "$(uname)" = Linux ] && printf %smake||printf %s "gmake -f makefile")'."
exit 0
fi
name=retrosmart-icon-theme
path=$name/scalable
suf='.svg'
for i in src/*.links
do
source="src/$(basename $i .links).svg"
if [ -f "$source" ]
then
links="$links $i"
else
echo "File $source not found"
exit 1
fi
done
for i in $(cat src/preview.list)
do
source="src/$i"
if [ -f "$source" ]
then
preview="$preview $source"
else
echo "File $source not found"
exit 1
fi
done
makefile() {
echo "include makefile.in"
echo "$name:"
printf "\tmkdir -p $path"
echo "$name/index.theme: $name"
printf "\tcp src/index.theme $name/"
for i in $links
do
local source="src/$(basename "$i" .links).svg"
local bsource="$(basename "$source")"
for j in $(cat $i)
do
icons="$icons $path/$j"
echo "$path/$j: $name/index.theme"
if [ "$bsource" = "$j" ]
then
printf "\tcp $source $path/$j"
else
printf "\tcd $path && ln -s $bsource $j"
fi
done
done
echo "icons: $icons"
echo "preview.png: $preview"
printf "\tmontage -verbose -resize 64 -geometry +16+16 -tile 9x6 $preview preview.png"
}
makefile > makefile && echo "Configuration done. Run '$([ "$(uname)" = Linux ] && printf %smake||printf %s "gmake -f makefile")'." || echo "Configuration failed. Please debug."