1
0
mirror of git://projects.qi-hardware.com/openwrt-packages.git synced 2024-11-16 20:00:17 +02:00

Add nlove-run to nlove package

This commit is contained in:
bartbes 2011-02-13 17:29:02 +01:00
parent 48effcf18b
commit 90251ca0ba
2 changed files with 31 additions and 1 deletions

View File

@ -3,7 +3,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=nlove PKG_NAME:=nlove
PKG_REV:=494 PKG_REV:=494
PKG_VERSION:=r$(PKG_REV) PKG_VERSION:=r$(PKG_REV)
PKG_RELEASE:=1 PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://bitbucket.org/bartbes/nlove PKG_SOURCE_URL:=https://bitbucket.org/bartbes/nlove
@ -41,6 +41,7 @@ endef
define Package/nlove/install define Package/nlove/install
$(INSTALL_DIR) $(1)/usr/bin $(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/nlove $(1)/usr/bin/ $(INSTALL_BIN) $(PKG_BUILD_DIR)/nlove $(1)/usr/bin/
$(INSTALL_BIN) ./files/nlove-run
endef endef
$(eval $(call BuildPackage,nlove)) $(eval $(call BuildPackage,nlove))

29
nlove/files/nlove-run Executable file
View File

@ -0,0 +1,29 @@
#!/bin/sh
if [ $# -lt 1 ]; then
echo "Usage: $0 <name>"
exit 1
fi
if [ ! -f "$HOME/.nlove/$1.love" ]; then
echo "Game not found, will now attempt to download it."
echo "This requires working internet access."
mkdir -p /usr/share/nlove > /dev/null
echo "Downloading... "
wget -q "http://dl.dropbox.com/u/440010/nlove/games/$1.love" -O "/usr/share/nlove/$1.love" > /dev/null
if [ $? -ne 0 ]; then
echo "An error occured during downloading, are you sure $1 exists?"
echo "And do you have internet access?"
exit 1
fi
echo "Done."
echo -n "Installing launcher... "
mkdir -p /usr/share/gmenu2x/sections/nlove
(echo "title=$1" &&
echo "exec=/usr/bin/`basename $0`" &&
echo "params=$1" &&
echo "wrapper=true") > /usr/share/gmenu2x/sections/nlove/$1
echo "Done."
fi
nlove "/usr/share/nlove/$1.love"
exit 0