#
# Georges Mariano (georges.mariano@inrets.fr)
# Copyright 2002
#
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# $Id: Makefile,v 1.6 2002/04/28 20:02:37 yeupou Exp $
#

DESTDIR=

PACKAGE=tetex-frogg
VERSION=0.3

PREFIX=/usr

TEXSHARE=$(DESTDIR)/$(PREFIX)/share/texmf


BSTDIR=$(TEXSHARE)/bibtex/bst/

# like plbib, germbib
FRBST=$(TEXSHARE)/bibtex/bst/frbib

LATEXSHARE=$(TEXSHARE)/tex/latex
LATEXMISC=$(LATEXSHARE)/misc

DOC = $(DESTDIR)/$(PREFIX)/share/doc/$(PACKAGE)-doc

install-bst:
	if [ ! -e doc.tmp ]; then mkdir -p $(FRBST) && cp bst/*.bst $(FRBST) ; fi

install-sty:
	if [ ! -e doc.tmp ]; then mkdir -p $(LATEXMISC) && cp sty/*.sty $(LATEXMISC) ; fi

install-cls:
	if [ ! -e doc.tmp ]; then mkdir -p $(LATEXMISC) && cp cls/*.cls $(LATEXMISC) && cp cls/*.ins $(LATEXMISC) ; fi

install-lettre:
	if [ ! -e doc.tmp ] ;\
	then \
		cp -d lettre/inputs/lettre.cls* $(LATEXMISC) ;\
	    cp lettre/inputs/default* $(LATEXMISC) ;\
	fi
	if [ -e doc.tmp ] ;\
	then \
	    mkdir -p $(DOC)/lettre/examples ;\
	    cp lettre/inputs/*.tpl $(DOC)/lettre/examples ;\
	    cp lettre/inputs/*.ins $(DOC)/lettre/examples ;\
	    cp lettre/doc/* $(DOC)/lettre ;\
	fi
	    
install-doc:
	if [ -e doc.tmp ]; then mkdir -p $(DOC) && cp -r doc/* $(DOC) ; fi
	

install: install-bst install-sty install-lettre clean

rpm:
	checkinstall -y -R --pkgname=$(PACKAGE) --pkgversion=$(VERSION) --pkgarch=noarch --pkggroup="Applications/Publishing"

rpm-doc:
	touch doc.tmp
	checkinstall -y -R --pkgname=$(PACKAGE)-doc --pkgversion=$(VERSION) --pkgarch=noarch --pkggroup="Applications/Publishing"

clean:
	rm -rf *tmp doc-pak *tgz
