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 44 45 46
|
# Makefile for PHP Web Counter
#
# by Eriberto
#
# Possible targets: install and uninstall
WEB_STUFF_PATH = $(DESTDIR)/usr/share
PROGRAM_PATH = $(WEB_STUFF_PATH)/phpwebcounter
IMAGES_PATH = $(PROGRAM_PATH)/images
CONFIG_PATH = $(DESTDIR)/etc/phpwebcounter
HITS_PATH = $(DESTDIR)/var/lib/phpwebcounter
HTTP_USER = www-data
HTTP_GROUP = www-data
all: phpwebcounter
phpwebcounter:
#
# ------------------------------------------------
# Run "# make install" to install PHP Web Counter.
# ------------------------------------------------
#
install:
@if [ ! -d $(PROGRAM_PATH) ]; then echo; echo Creating $(PROGRAM_PATH)...; mkdir -p $(PROGRAM_PATH); echo Installing program...; cp phpwebcounter.php $(PROGRAM_PATH); else echo "Run uninstall before install"; exit 1; fi
@if [ ! -d $(CONFIG_PATH) ]; then echo Creating $(CONFIG_PATH)...; mkdir -p $(CONFIG_PATH); fi
@echo Installing config file...; cp phpwebcounter.config.php $(CONFIG_PATH)
@if [ ! -d $(IMAGES_PATH) ]; then echo Creating $(IMAGES_PATH)...; mkdir -p $(IMAGES_PATH); fi
@echo Copying images...; cp -a images/* $(IMAGES_PATH)
@if [ ! -d $(HITS_PATH) ]; then echo Creating $(HITS_PATH)...; mkdir -p $(HITS_PATH); echo; fi
@chown $(HTTP_USER).$(HTTP_GROUP) $(HITS_PATH)
#
# --------------------------
# PHP Web Counter installed.
# --------------------------
#
uninstall:
rm -rf $(PROGRAM_PATH)
rm -rf $(HITS_PATH)
rm -rf $(CONFIG_PATH)
#
# ----------------------------
# PHP Web Counter uninstalled.
# ----------------------------
#
|