forked from Zren/plasma-applet-eventcalendar
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build
executable file
·44 lines (34 loc) · 1.54 KB
/
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
#!/bin/bash
# Version 8
startDir=$PWD
### Translations
if [ -d "package/translate" ]; then
echo "[build] translate dir found, running merge."
(cd package/translate && sh ./merge && sh ./build)
if [ "$(git diff --stat .)" != "" ]; then
echo "[build] Changed detected. Cancelling build."
git diff --stat .
# exit
fi
fi
### Variables
packageNamespace=$(kreadconfig5 --file="$PWD/package/metadata.desktop" --group="Desktop Entry" --key="X-KDE-PluginInfo-Name")
packageName="${packageNamespace##*.}" # Strip namespace (Eg: "org.kde.plasma.")
packageVersion=$(kreadconfig5 --file="$PWD/package/metadata.desktop" --group="Desktop Entry" --key="X-KDE-PluginInfo-Version")
packageAuthor=$(kreadconfig5 --file="$PWD/package/metadata.desktop" --group="Desktop Entry" --key="X-KDE-PluginInfo-Author")
packageAuthorEmail=$(kreadconfig5 --file="$PWD/package/metadata.desktop" --group="Desktop Entry" --key="X-KDE-PluginInfo-Email")
packageWebsite=$(kreadconfig5 --file="$PWD/package/metadata.desktop" --group="Desktop Entry" --key="X-KDE-PluginInfo-Website")
packageComment=$(kreadconfig5 --file="$PWD/package/metadata.desktop" --group="Desktop Entry" --key="Comment")
### *.plasmoid
filenameTag="-plasma5.13"
filename="${packageName}-v${packageVersion}${filenameTag}.plasmoid"
rm ${packageName}-v*.plasmoid # Cleanup
(cd package \
&& zip -r $filename * \
&& mv $filename $startDir/$filename \
)
cd $startDir
echo "[plasmoid] md5: $(md5sum $filename | awk '{ print $1 }')"
echo "[plasmoid] sha256: $(sha256sum $filename | awk '{ print $1 }')"
### Done
cd $startDir