# Makefile for tuxpaint-stamps

# Tux Paint - A simple drawing program for children.
# This is a collection of 'rubber stamp' images for Tux Paint.

# Copyright (c) 2005 by Bill Kendrick and others
# bill@newbreedsoftware.com
# http://www.newbreedsoftware.com/tuxpaint/

# September 6, 2002 - November 25, 2005


VER_DATE=`date +"%Y.%m.%d"`


# Where to install things:

PREFIX=/usr/local


# Data:

DATA_PREFIX=$(PREFIX)/share/tuxpaint/


# "make" with no arguments provides info on installing tuxpaint stamps:

all:
	@echo
	@echo "To install these Tux Paint stamps, run 'make install'"
	@echo "(probably as 'root' superuser)"
	@echo
	@echo "The stamps will be placed in:"
	@echo "  $(DATA_PREFIX)stamps"
	@echo
	@if [ -x "`which tuxpaint`" ]; then echo ""; else \
	echo "(Tux Paint doesn't appear to be installed, though!!!)"; \
	echo; fi


clean:
	@echo
	@echo "There's no source here, so 'make clean' doesn't make sense!"
	@echo



releaseclean:
	@echo
	@echo "Cleaning release directory"
	@echo
	@rm -rf "build/tuxpaint-stamps-$(VER_DATE)" "build/tuxpaint-stamps-$(VER_DATE).tar.gz"
	@-if [ -d build ] ; then rmdir build ; fi

releasedir: build/tuxpaint-stamps-$(VER_DATE)

build/tuxpaint-stamps-$(VER_DATE):
	@echo
	@echo "Creating release directory"
	@echo
	@mkdir -p build/tuxpaint-stamps-$(VER_DATE)
	@find . -follow \
		\( -wholename '*/CVS' -o -name .cvsignore -o -name 'build' -o -name '.#*' \) \
		-prune -o -type f -exec cp --parents -vdp \{\} build/tuxpaint-stamps-$(VER_DATE)/ \;

release: releasedir
	@echo
	@echo "Creating release tarball"
	@echo
	@cd build ; \
		tar -czvf tuxpaint-stamps-$(VER_DATE).tar.gz tuxpaint-stamps-$(VER_DATE)



# "make install" installs the stamps
# (depending on the *PREFIX variables at the top, you probably need
# to do this as superuser ("root"))

install:	install-stamps
	@echo
	@echo "All done! Now (preferably NOT as 'root' superuser),"
	@echo "you can type the command 'tuxpaint' to run the program and"
	@echo "see these stamps!!!"
	@echo
	@echo "For more information, see the 'tuxpaint' man page,"
	@echo "run 'tuxpaint --usage' or see $(DOC_PREFIX)README.txt"
	@echo
	@if [ -x "`which tuxpaint`" ]; then echo "Enjoy!"; else \
	echo "(Tux Paint doesn't appear to be installed, though!!!)"; fi
	@echo


# "make uninstall" should remove the various parts from their
# installation locations.  BE SURE the *PREFIX variables at the top
# are the same as they were when you installed, of course!!!

uninstall:
	@echo
	@echo "Removing Tux Paint stamps from $(DATA_PREFIX)"
	@echo
	@/bin/rm -r $(DATA_PREFIX)stamps


# Install the stamps:

install-stamps:
	@echo
	@echo "...Installing stamp files... (to $(DATA_PREFIX))"
	@echo
	@install -d $(DATA_PREFIX)stamps
	@cp -R stamps/* $(DATA_PREFIX)stamps
	@chmod -R a+rX,g-w,o-w $(DATA_PREFIX)stamps

