# Makefile for pronto
# Written by ai
# $Id: Makefile,v 1.9 2002/05/25 00:43:20 muhri Exp $

VERSION = 2.4.0

PREFIX = /usr/local
LIBDIR = $(PREFIX)/lib/pronto
BINDIR = $(PREFIX)/bin
MODULEPREFIX = /usr
# MODULEPREFIX = $(LIBDIR)/modules

REDHAT = /usr/src/redhat
# on Mandrake systems
# REDHAT = /usr/src/RPM

CPANBUILD = ~/.cpan/build

CVSROOT=':pserver:anonymous@cvs.muhri.net:/home/cvsroot'

export CVSROOT

all: 

test:
	perl -e 'eval { require "prontolib.pl"; 1; } && print "Test passed.\n";'

install:
	install -d $(BINDIR)	
	install -d $(LIBDIR)
	install -d $(LIBDIR)/Pronto
	install -d $(LIBDIR)/Pronto/Data
	install -d $(LIBDIR)/Pronto/Crypt
	install -d $(LIBDIR)/pixmaps
	install -d $(LIBDIR)/pixmaps/neon
	install -d $(LIBDIR)/pixmaps/pro
	install -d $(LIBDIR)/pixmaps/aqua
	install -d $(LIBDIR)/pixmaps/penguin
	install -d $(LIBDIR)/migration-scripts
	install -d $(LIBDIR)/Prontocrypt
	install -d $(LIBDIR)/docs
	install -d $(LIBDIR)/docs/images
	install -c -m644 pixmaps/splash.xpm $(LIBDIR)/pixmaps
	install -c -m644 pixmaps/pro/*.xpm $(LIBDIR)/pixmaps/pro
	install -c -m644 pixmaps/neon/*.xpm $(LIBDIR)/pixmaps/neon
	install -c -m644 pixmaps/aqua/*.xpm $(LIBDIR)/pixmaps/aqua
	install -c -m644 pixmaps/penguin/*.xpm $(LIBDIR)/pixmaps/penguin
	install -c -m644 docs/*.* $(LIBDIR)/docs
	install -c -m644 docs/images/*.* $(LIBDIR)/docs/images
	install -c migration-scripts/*.* $(LIBDIR)/migration-scripts
	install -c migration-scripts/bodytext2db $(LIBDIR)/migration-scripts
	install -c -m644 prontolib.pl $(LIBDIR)
	install -c -m644 Pronto/*.pm  $(LIBDIR)/Pronto
	install -c -m644 Pronto/Data/*.pm $(LIBDIR)/Pronto/Data
	install -c -m644 Pronto/Crypt/*.pm $(LIBDIR)/Pronto/Crypt
	install -c pronto $(BINDIR)
	install -c pronto-main $(BINDIR)
	install -c prontoget  $(BINDIR)
	install -c prontosend $(BINDIR)
	install -c prontobrowser $(BINDIR)
	install -c cpronto.pl $(BINDIR)
	install -c -m2755 -o root -g mail prontolock $(BINDIR)
	install -c -m644 prontolib.pl $(LIBDIR)
	install -c -m644 HtmlStripper.pm $(LIBDIR)
	install -c -m644 pronto.gtkrc $(LIBDIR)

uninstall:
	rm -r $(LIBDIR)
	rm $(BINDIR)/pronto
	rm $(BINDIR)/prontoget
	rm $(BINDIR)/prontosend
	rm $(BINDIR)/pronto-main
	rm $(BINDIR)/prontobrowser
	rm $(BINDIR)/cpronto.pl
cvs-update: clean
	cvs login
	cvs -z3 update

clean:
	rm -rf *~ core \#* .\#*
	(cd Pronto && rm -fr *~ core \#* .\#*)
	(cd Pronto/Data	&& rm -fr *~ core \#* .\#*)

dist: clean
	rm -rf /tmp/pronto-$(VERSION)
	cp -r . /tmp/pronto-$(VERSION)
	tar czf ../pronto-$(VERSION).tar.gz -C /tmp/ pronto-$(VERSION)
	rm -rf /tmp/pronto-$(VERSION)

rpm-nomodules: dist
	cp pronto-nomodules.spec $(REDHAT)/SPECS/
	cp ../pronto-$(VERSION).tar.gz  $(REDHAT)/SOURCES/
	rpm -ba $(REDHAT)/SPECS/pronto-nomodules.spec

