# ----------------------------------------------------------------------
# Copyright (C) 2001 Bodo Bauer <bb@bb-zone.com>
#
# 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. 
#
# This program is distributed in the hope that it will be useful, 
# but WITHOUT ANY WARRANTY; without even the implied warranty of 
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 
# General Public License for more details. 
#
# 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. 
# ----------------------------------------------------------------------

prefix=/usr
version = 1.1.0

bbgallery:
	sed s]%%%INSTPREFIX%%%]${prefix}] mkgallery.pl | \
	sed s]%%%VERSION%%%]${version}] > bbgallery

install: bbgallery
	mkdir -p ${instroot}${prefix}/bin
	mkdir -p ${instroot}${prefix}/lib/bbgallery
	install -m 755 bbgallery ${instroot}${prefix}/bin/bbgallery
	install -m 755 Contrib/JPG2jpg.pl ${instroot}${prefix}/bin/JPG2jpg
	install -m 755 gimp_scale.pl ${instroot}${prefix}/lib/bbgallery/gimp_scale.pl

clean:
	rm -f bbgallery bbgallery.spec *~ core

dist:
	if test -d bbgallery-${version}; then rm -rf bbgallery-${version}; fi
	mkdir -p bbgallery-${version}
	cp CHANGELOG bbgallery.spec.in README gimp_scale.pl mkgallery.pl COPYING CREDITS Makefile bbgallery-${version}
	cp -a Contrib bbgallery-${version}
	tar cjvf bbgallery-${version}.tar.bz2 bbgallery-${version}
	rm -rf bbgallery-${version}

rpmdist: dist
	sed s]%%%VERSION%%%]${version}] bbgallery.spec.in > bbgallery.spec
	mv bbgallery-${version}.tar.bz2	/usr/src/packages/SOURCES
	rpm -ba bbgallery.spec
	rm bbgallery.spec

