##
## This file is part of the 'OpenPrinting Japan' project
## $Id: Makefile.am,v 1.2 2005/03/23 00:58:01 gishi Exp $
##
## Copyright (C) 2004 by Turbolinux,Inc.
## This file is free software, distributed under the terms of the GNU
## General Public License.  As a special exception to the GNU General
## Public License, this file may be distributed as part of a program
## that contains a configuration script generated by Autoconf, under
## the same distribution terms as the rest of that program.

AUTOMAKE_OPTIONS = foreign

SUBDIRS = libopvp opvp ppd doc fonts

EXTRA_DIST = VERSION @PACKAGE@.spec README.jp

distdir=$(PACKAGE)-$(VERSION)$(RELEASE_TAG)

clean-local:
	rm -f *~
	rm -f *.bak
	rm -f *.spec

@PACKAGE@.spec:
	sed -e "s|__PACKAGE__|@PACKAGE@|" \
	-e "s|__VERSION__|@VERSION@|" \
	-e "s|__RELEASE_TAG__|@RELEASE_TAG@|" \
	-e "s|__HPPAGECOLOR_VERSION__|@HPPAGECOLOR_VERSION@|" \
	-e '/%changelog/,$$d' @PACKAGE@.spec.in > @PACKAGE@.tmp
	echo "%changelog" >> @PACKAGE@.tmp
	cat ChangeLog >> @PACKAGE@.tmp
	mv -f @PACKAGE@.tmp @PACKAGE@.spec

dist-hook: @PACKAGE@.spec

rpm: dist
	rpm -tb @PACKAGE@-@VERSION@@RELEASE_TAG@.tar.gz ; \
	rm -f @PACKAGE@-@VERSION@@RELEASE_TAG@.tar.gz

srpm: dist
	rpm -ts @PACKAGE@-@VERSION@@RELEASE_TAG@.tar.gz ; \
	rm -f @PACKAGE@-@VERSION@@RELEASE_TAG@.tar.gz
