#
#	MP3Roaster Makefile (GNU make)
#
#	$Id: Makefile,v 1.4 2004/02/21 15:15:57 eim Exp $
#
#	This Makefile allows to install MP3Roaster system wide, this way MP3roaster
#	can be used by all user of our system with personal configuration files in
#	their respective home directories.
#

#
# Here are some Debian specific vars
#
# ${DESTDIR}	The install destination directory,
# 		when we debianize there'll be debian.
#

BINPATH  = /usr/local/bin
MANPATH  = /usr/local/man
DOCPATH  = /usr/local/doc
ETCPATH  = /etc


all:
	@echo
	@echo "MP3Roaster MAKEFILE"
	@echo "==================="
	@echo
	@echo "Hello, with this makefile you can easily install and uninstall MP3Roaster."
	@echo
	@echo -e "\t* INSTALL MP3Roaster with ... \t% make install"
	@echo -e "\t* UNINSTALL MP3Roaster with ... \t% make uninstall"
	@echo
	@echo "MP3Roaster will be installed system wide so every user of this box can"
	@echo "use it with personal configuration files."
	@echo


install:
	@echo
	@echo "INSTALLING MP3Roaster"
	@echo "====================="
	@echo
	@echo "This procedure will install MP3Roaster."
	@echo


# EXECUTABLES
# Symlinking requires some special operations in the Debian GNU/Linux
# control file during debianizing so it's better we avoid the symlink.
	@echo -n -e "\t* Installing binaries .............. "
	@install -D mp3roaster.pl $(BINPATH)/mp3roaster
	@echo "done."

# MAN PAGES
	@echo -n -e "\t* Installing manual ................ "
	@install -m 0644 Docs/man/mp3roaster.1.gz $(MANPATH)/man1
	@echo "done."

# DOCUMENTS
	@echo -n -e "\t* Installing documentation ......... "
	@install -d $(DOCPATH)/mp3roaster
	@install -m 0644 Docs/COPYING $(DOCPATH)/mp3roaster
	@install -m 0644 Docs/ChangeLog $(DOCPATH)/mp3roaster
	@install -m 0644 Docs/INSTALL $(DOCPATH)/mp3roaster
	@install -m 0644 Docs/README $(DOCPATH)/mp3roaster
	@echo "done."

# /ETC CONFIGURATIONS
	@echo -n -e "\t* Installing configuration ......... "
	@install -d $(ETCPATH)/mp3roaster
	@install -m 0644 Docs/examples/mp3roasterrc $(ETCPATH)/mp3roaster
	@echo "done."

	@echo
	@echo "Installed successfully."
	@echo
	

uninstall: 
	@echo
	@echo "UNINSTALLING MP3Roaster"
	@echo "======================="

	@echo
	@echo "This procedure will completely remove MP3Roaster from your system."
	@echo "Only MP3Roaster user configurations in the home directories will remain."
	@echo
        
# EXECUTABLES
	@echo -n -e "\t* Removing binaries .............. "
	@rm $(BINPATH)/mp3roaster
	@echo "done."

# MAN PAGES
	@echo -n -e "\t* Removing manual ................ "
	@rm $(MANPATH)/man1/mp3roaster.1.gz
	@echo "done."

# DOCUMENTS
	@echo -n -e "\t* Removing documentation ......... "
	@rm -r $(DOCPATH)/mp3roaster
	@echo "done."

# /ETC CONFIGURATIONS
	@echo -n -e "\t* Removing configuration ......... "
	@rm -r $(ETCPATH)/mp3roaster
	@echo "done."

	@echo
	@echo "Uninstalled successfully."
	@echo
