#~~syntax:makefile
#==============================================================================
# ttyrpld - TTY replay daemon
#   Copyright © Jan Engelhardt <jengelh [at] linux01 gwdg de>, 2004 - 2005
#   -- License restrictions apply (GPL v2)
#
#   This file is part of ttyrpld.
#   ttyrpld 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; however ONLY version 2 of the License.
#
#   ttyrpld 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 kit; if not, write to:
#   Free Software Foundation, Inc., 59 Temple Place - Suite 330,
#   Boston, MA 02111-1307, USA.
#
#   -- For details, see the file named "LICENSE.GPL2"
#==============================================================================

# PREFIX will be overriden by RPM SPECFILE
PREFIX := /usr/local
LOCALE_PATH := ${ROOT}${PREFIX}/share/locale

ALL_MO := $(patsubst %.po,%.mo,$(wildcard */LC_MESSAGES/*.po))

.PHONY: all install uninstall clean

all: ${ALL_MO};

%.mo: %.po;
	@echo -en "$@: ";
	@msgfmt --statistics -o $@ $<;

install: all;
	@echo "Installing locale files to ${LOCALE_PATH}";
	for i in *; do \
            [ ! -d "$$i" ] && continue; \
            install -dm0755 "${LOCALE_PATH}/$$i/LC_MESSAGES"; \
            install -m0644 "$$i/LC_MESSAGES/ttyrpld.mo" "${LOCALE_PATH}/$$i/LC_MESSAGES/"; \
        done;

uninstall: ;
	rm -f ${LOCALE_PATH}/*/LC_MESSAGES/ttyrpld.mo;

clean: ;
	rm -f ${ALL_MO};

#==============================================================================
