Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
84 lines (67 sloc) 2.89 KB
#########################################################################
# Simple makefile for packaging Roku Video Player example
#
# Makefile Usage:
# > make
# > make install
# > make remove
#
# Important Notes:
# To use the "install" and "remove" targets to install your
# application directly from the shell, you must do the following:
#
# 1) Make sure that you have the curl command line executable in your path
# 2) Set the variable ROKU_DEV_TARGET in your environment to the IP
# address of your Roku box. (e.g. export ROKU_DEV_TARGET=192.168.1.1.
# Set in your this variable in your shell startup (e.g. .bashrc)
##########################################################################
APPNAME = cmyth
VERSION = 0.1
ZIP_EXCLUDE= -x pkg\* -x .git\* -x ._\* -x \*/._\* -x NOTES -x README -x \*.xcf -x \*.py
PKGREL = pkg
ZIPREL = pkg
.PHONY: all $(APPNAME)
$(APPNAME):
@echo "*** Creating $(APPNAME).zip ***"
@echo " >> removing old application zip $(ZIPREL)/$(APPNAME).zip"
@if [ -e "$(ZIPREL)/$(APPNAME).zip" ]; \
then \
rm $(ZIPREL)/$(APPNAME).zip; \
fi
@echo " >> creating destination directory $(ZIPREL)"
@if [ ! -d $(ZIPREL) ]; \
then \
mkdir -p $(ZIPREL); \
fi
@echo " >> setting directory permissions for $(ZIPREL)"
@if [ ! -w $(ZIPREL) ]; \
then \
chmod 755 $(ZIPREL); \
fi
# zip .png files without compression
# do not zip up Makefiles, or any files ending with '~'
@echo " >> creating application zip $(ZIPREL)/$(APPNAME).zip"
(zip -0 -r "$(ZIPREL)/$(APPNAME).zip" . -i \*.png $(ZIP_EXCLUDE)); \
(zip -9 -r "$(ZIPREL)/$(APPNAME).zip" . -x \*~ -x \*.png -x Makefile $(ZIP_EXCLUDE)); \
@echo "*** developer zip $(APPNAME) complete ***"
install: $(APPNAME)
@echo "Installing $(APPNAME) to host $(ROKU_DEV_TARGET)"
@curl -s -S -F "mysubmit=Install" -F "archive=@$(ZIPREL)/$(APPNAME).zip" -F "passwd=" http://$(ROKU_DEV_TARGET)/plugin_install | grep "<font color" | sed "s/<font color=\"red\">//"
pkg: install
@echo "*** Creating Package ***"
@echo " >> creating destination directory $(PKGREL)"
@if [ ! -d $(PKGREL) ]; \
then \
mkdir -p $(PKGREL); \
fi
@echo " >> setting directory permissions for $(PKGREL)"
@if [ ! -w $(PKGREL) ]; \
then \
chmod 755 $(PKGREL); \
fi
@echo "Packaging $(APPNAME) on host $(ROKU_DEV_TARGET)"
@read -p "Password: " REPLY ; echo $$REPLY | xargs -i curl -s -S -Fmysubmit=Package -Fapp_name=$(APPNAME)/$(VERSION) -Fpasswd={} -Fpkg_time=`expr \`date +%s\` \* 1000` "http://$(ROKU_DEV_TARGET)/plugin_package" | grep '^<font face=' | sed 's/.*href=\"\([^\"]*\)\".*/\1/' | sed 's#pkgs/##' | xargs -i curl -s -S -o $(PKGREL)/$(APPNAME)_{} http://$(ROKU_DEV_TARGET)/pkgs/{}
@echo "*** Package $(APPNAME) complete ***"
remove:
@echo "Removing $(APPNAME) from host $(ROKU_DEV_TARGET)"
@curl -s -S -F "mysubmit=Delete" -F "archive=" -F "passwd=" http://$(ROKU_DEV_TARGET)/plugin_install | grep "<font color" | sed "s/<font color=\"red\">//"