Skip to content

Commit 3938060

Browse files
author
Hubert
authored
Upgrade to v1.10
1 parent a57cdeb commit 3938060

File tree

1 file changed

+86
-10
lines changed

1 file changed

+86
-10
lines changed

Makefile

Lines changed: 86 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,49 @@
1-
# @(#) MinecraftShellLibrary:Makefile v1.00 (2016-09-18) / Hubert Tournier
1+
# @(#) MinecraftShellLibrary:Makefile v1.10 (2016-09-30) / Hubert Tournier
22

3-
VERSION=1.00
3+
VERSION=1.10
44

55
DEFAULTDESTDIR=/home/minecraft
66
DEFAULTUSER=minecraft
77
DEFAULTGROUP=minecraft
88

9+
# Commands without display
10+
OLD_WOD_CMD=achievement ban ban-ip mcclear debug defaultgamemode deop difficulty effect enchant gamemode gamerule give help kick mckill me op pardon playsound save-all save-on save-off say setblock setidletimeout setworldspawn spawnpoint spreadplayers summon tell tellraw testfor testforblock mctime toggledownfall tp weather xp
11+
108_WOD_CMD=blockdata clone entitydata execute fill particle replaceitem stats testforblocks title trigger worldborder
12+
109_WOD_CMD=stopsound
13+
110_WOD_CMD=teleport
14+
BKT_WOD_CMD=pex pex_reload mute kit
15+
SELECTED_WOD_CMD=${OLD_WOD_CMD} ${BKT_WOD_CMD}
16+
17+
# Commands with display
18+
OLD_WID_CMD=banlist list scoreboard seed whitelist
19+
108_WID_CMD=
20+
109_WID_CMD=
21+
110_WID_CMD=
22+
BKT_WID_CMD=mem mv_who
23+
SELECTED_WID_CMD=${OLD_WID_CMD} ${BKT_WID_CMD}
24+
25+
default: usage
26+
27+
usage:
28+
@echo "make tarball : Prepare a .tar.gz file for distributing the library"
29+
@echo "make install : Install the library in a user provided Minecraft server directory"
30+
@echo "make uninstall : Uninstall the library from a user provided Minecraft server directory"
31+
932
tarball:
10-
@tar czf MinecraftShellLibrary-${VERSION}.tar.gz License Makefile ReadMe README.md .minecraft-library .server-settings.ini Commands CronTasks
33+
@tar czf MinecraftShellLibrary-${VERSION}.tar.gz License Makefile ReadMe README.md .minecraft-library .server-settings.ini Commands CronTasks Scripts config
1134

1235
verifyprerequisites:
13-
@[ "`whereis screen | sed "s/screen://"`" = "" ] && echo "WARNING: GNU Screen doesn't seem to be installed. You'll need it!"
14-
@[ "`whereis nbt2yaml | sed "s/nbt2yaml://"`" = "" ] && echo "WARNING: NBT2YAML doesn't seem to be installed. You'll need it!"
36+
@if [ "`whereis screen`" = "screen:" ] ; then echo "WARNING: GNU Screen doesn't seem to be installed. You'll need it!" ; fi
37+
@if [ "`whereis nbt2yaml`" = "nbt2yaml:" ] ; then echo "WARNING: NBT2YAML doesn't seem to be installed. You'll need it!" ; fi
1538

1639
install: verifyprerequisites
1740
@echo -n "Destination directory [$(DEFAULTDESTDIR)]: " ; \
1841
read DESTDIR ; \
1942
[ "$$DESTDIR" = "" ] && DESTDIR=$(DEFAULTDESTDIR) ; \
43+
if [ ! -d "$$DESTDIR" ] ; \
44+
then echo "ERROR: There is no Minecraft server in $$DESTDIR" ; \
45+
exit 0 ; \
46+
fi ; \
2047
echo -n "Minecraft user [$(DEFAULTUSER)]: " ; \
2148
read USER ; \
2249
[ "$$USER" = "" ] && USER=$(DEFAULTUSER) ; \
@@ -26,9 +53,58 @@ install: verifyprerequisites
2653
install -m 0755 -o $$USER -g $$GROUP .minecraft-library $$DESTDIR ; \
2754
install -m 0755 -o $$USER -g $$GROUP .server-settings.ini $$DESTDIR ; \
2855
[ ! -f $$DESTDIR/.server-settings ] && cp .server-settings.ini $$DESTDIR/.server-settings ; \
29-
cp -R Commands CronTasks $$DESTDIR ; \
30-
chown -R $$USER:$$GROUP $$DESTDIR/Commands $$DESTDIR/CronTasks $$DESTDIR/.server-settings ; \
31-
chmod 0755 $$DESTDIR/Commands $$DESTDIR/CronTasks $$DESTDIR/.server-settings ; \
32-
mv $$DESTDIR/Commands/* $$DESTDIR ; \
33-
rmdir $$DESTDIR/Commands
56+
mkdir -p $$DESTDIR/Commands/setuid ; \
57+
for I in $(SELECTED_WOD_CMD) ; \
58+
do \
59+
ln Commands/Wrapper $$DESTDIR/Commands/$$I ; \
60+
ln Commands/setuid/GenericCommandWithoutResults $$DESTDIR/Commands/setuid/$$I ; \
61+
done ; \
62+
for I in $(SELECTED_WID_CMD) ; \
63+
do \
64+
ln Commands/Wrapper $$DESTDIR/Commands/$$I ; \
65+
ln Commands/setuid/GenericCommandWithResults $$DESTDIR/Commands/setuid/$$I ; \
66+
done ; \
67+
ln Commands/Wrapper $$DESTDIR/Commands/mc ; \
68+
ln Commands/setuid/PassThrough $$DESTDIR/Commands/setuid/mc ; \
69+
mkdir -p $$DESTDIR/CronTasks ; \
70+
install -m 0755 -o $$USER -g $$GROUP CronTasks/CronMonitor $$DESTDIR/CronTasks ; \
71+
install -m 0755 -o $$USER -g $$GROUP CronTasks/CronDetectCheaters $$DESTDIR/CronTasks ; \
72+
mkdir -p $$DESTDIR/Scripts/setuid ; \
73+
install -m 0755 -o $$USER -g $$GROUP Scripts/mcchat $$DESTDIR/Scripts ; \
74+
install -m 0755 -o $$USER -g $$GROUP Scripts/mclast $$DESTDIR/Scripts ; \
75+
ln Scripts/Wrapper $$DESTDIR/Scripts/start.sh ; \
76+
ln Scripts/Wrapper $$DESTDIR/Scripts/stop ; \
77+
install -m 0755 -o $$USER -g $$GROUP Scripts/setuid/start.sh $$DESTDIR/Scripts/setuid ; \
78+
install -m 0755 -o $$USER -g $$GROUP Scripts/setuid/startbukkit.sh $$DESTDIR/Scripts/setuid ; \
79+
install -m 0755 -o $$USER -g $$GROUP Scripts/setuid/stop $$DESTDIR/Scripts/setuid ; \
80+
install -m 0644 -o $$USER -g $$GROUP config/MSL_ForbiddenMods.txt-ini $$DESTDIR/config ; \
81+
[ ! -f $$DESTDIR/config/MSL_ForbiddenMods.txt ] && cp config/MSL_ForbiddenMods.txt-ini $$DESTDIR/config/MSL_ForbiddenMods.txt ; \
82+
install -m 0644 -o $$USER -g $$GROUP config/MSL_ForbiddenMods-full.txt-ini $$DESTDIR/config ; \
83+
[ ! -f $$DESTDIR/config/MSL_ForbiddenMods-full.txt ] && cp config/MSL_ForbiddenMods-full.txt-ini $$DESTDIR/config/MSL_ForbiddenMods-full.txt ; \
84+
chown -R $$USER:$$GROUP $$DESTDIR/Commands $$DESTDIR/CronTasks $$DESTDIR/Scripts $$DESTDIR/.server-settings ; \
85+
chmod 0755 $$DESTDIR/Commands $$DESTDIR/CronTasks $$DESTDIR/Scripts $$DESTDIR/.server-settings
3486

87+
uninstall:
88+
@echo -n "Destination directory [$(DEFAULTDESTDIR)]: " ; \
89+
read DESTDIR ; \
90+
[ "$$DESTDIR" = "" ] && DESTDIR=$(DEFAULTDESTDIR) ; \
91+
if [ ! -d "$$DESTDIR" ] ; \
92+
then echo "ERROR: There is no Minecraft server in $$DESTDIR" ; \
93+
exit 0 ; \
94+
fi ; \
95+
rm -f $$DESTDIR/.minecraft-library $$DESTDIR/.server-settings.ini ; \
96+
rm -f $$DESTDIR/CronTasks/CronMonitor $$DESTDIR/CronTasks/CronDetectCheaters ; \
97+
rm -f $$DESTDIR/Scripts/mcchat $$DESTDIR/Scripts/mclast $$DESTDIR/Scripts/start.sh $$DESTDIR/Scripts/stop ; \
98+
rm -f $$DESTDIR/Scripts/setuid/start.sh $$DESTDIR/Scripts/setuid/startbukkit.sh $$DESTDIR/Scripts/setuid/stop ; \
99+
rm -f $$DESTDIR/config/MSL_ForbiddenMods.txt-ini $$DESTDIR/config/MSL_ForbiddenMods-full.txt-ini ; \
100+
rm -f $$DESTDIR/Commands/mc $$DESTDIR/Commands/setuid/mc ; \
101+
for I in $(SELECTED_WOD_CMD) ; \
102+
do \
103+
rm -f $$DESTDIR/Commands/$$I ; \
104+
rm -f $$DESTDIR/Commands/setuid/$$I ; \
105+
done ; \
106+
for I in $(SELECTED_WID_CMD) ; \
107+
do \
108+
rm -f $$DESTDIR/Commands/$$I ; \
109+
rm -f $$DESTDIR/Commands/setuid/$$I ; \
110+
done

0 commit comments

Comments
 (0)