From 90251ca0ba16f6acb45f960e2c26e0d07c431170 Mon Sep 17 00:00:00 2001 From: bartbes Date: Sun, 13 Feb 2011 17:29:02 +0100 Subject: [PATCH] Add nlove-run to nlove package --- nlove/Makefile | 3 ++- nlove/files/nlove-run | 29 +++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100755 nlove/files/nlove-run diff --git a/nlove/Makefile b/nlove/Makefile index b32aa0f..61c8aaa 100755 --- a/nlove/Makefile +++ b/nlove/Makefile @@ -3,7 +3,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=nlove PKG_REV:=494 PKG_VERSION:=r$(PKG_REV) -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://bitbucket.org/bartbes/nlove @@ -41,6 +41,7 @@ endef define Package/nlove/install $(INSTALL_DIR) $(1)/usr/bin $(INSTALL_BIN) $(PKG_BUILD_DIR)/nlove $(1)/usr/bin/ + $(INSTALL_BIN) ./files/nlove-run endef $(eval $(call BuildPackage,nlove)) diff --git a/nlove/files/nlove-run b/nlove/files/nlove-run new file mode 100755 index 0000000..ac4d75d --- /dev/null +++ b/nlove/files/nlove-run @@ -0,0 +1,29 @@ +#!/bin/sh + +if [ $# -lt 1 ]; then + echo "Usage: $0 " + 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