Blame indexhtml/Makefile

d428ee
###############################################################################
d428ee
#
d428ee
#  The Apache HTTP server test page Makefile
d428ee
#  Copyright (C) 2019  Alain Reguera Delgado
d428ee
#
d428ee
#  This program is free software: you can redistribute it and/or modify it
d428ee
#  under the terms of the GNU General Public License as published by the Free
d428ee
#  Software Foundation, either version 3 of the License, or (at your option)
d428ee
#  any later version.
d428ee
#
d428ee
#  This program is distributed in the hope that it will be useful, but WITHOUT
d428ee
#  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
d428ee
#  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
d428ee
#  more details.
d428ee
#
d428ee
#  You should have received a copy of the GNU General Public License along with
d428ee
#  this program.  If not, see <https://www.gnu.org/licenses/>.
d428ee
#
d428ee
###############################################################################
d428ee
d428ee
#==============================================================================
d428ee
# Configuration
d428ee
#==============================================================================
d428ee
lang = en_US
d428ee
prefix = .
d428ee
srcdir = .
d428ee
datarootdir = $(prefix)/$(lang)
d428ee
localedir = PO
1395ad
version = 8.0
d428ee
d428ee
#==============================================================================
d428ee
# Requirements
d428ee
#==============================================================================
d428ee
all: $(datarootdir)/index.html
1395ad
build: centos-indexhtml-$(version).tar.gz
1395ad
1395ad
#==============================================================================
1395ad
# Sources
1395ad
#==============================================================================
1395ad
centos-indexhtml-$(version).tar.gz: \
1395ad
	$(prefix)/??_??/* \
1395ad
	$(prefix)/index.html \
1395ad
	$(prefix)/common/css/* \
1395ad
	$(prefix)/common/images/* \
1395ad
	$(prefix)/common/fonts/*
1395ad
	tar -czf centos-indexhtml-$(version).tar.gz $(prefix)/??_??/* $(prefix)/index.html $(prefix)/common/
d428ee
d428ee
#======================================================================
d428ee
# Translations
d428ee
#======================================================================
d428ee
$(localedir)/$(lang).pot: $(srcdir)/index.tpl.html
d428ee
	xml2po -o /tmp/$(lang).pot $(srcdir)/index.tpl.html
d428ee
	if [[ ! -f $(localedir)/$(lang).pot ]];then \
d428ee
		msginit -i /tmp/$(lang).pot -o $(localedir)/$(lang).pot -l $(lang) --no-translator --width=80; \
d428ee
	else \
d428ee
		msgmerge -U $(localedir)/$(lang).pot /tmp/$(lang).pot; \
d428ee
	fi
d428ee
	rm /tmp/$(lang).pot
d428ee
$(localedir)/$(lang).po: $(localedir)/$(lang).pot
d428ee
	if [[ ! -f $(localedir)/$(lang).po ]];then \
d428ee
		msginit -i $(localedir)/$(lang).pot -o $(localedir)/$(lang).po -l $(lang) --no-translator --width=80; \
d428ee
	else \
d428ee
		msgmerge -U $(localedir)/$(lang).po $(localedir)/$(lang).pot; \
d428ee
	fi
d428ee
d428ee
#======================================================================
d428ee
# Pages
d428ee
#======================================================================
d428ee
$(datarootdir):
d428ee
	mkdir -p $(datarootdir)
d428ee
$(datarootdir)/index.html: $(datarootdir) $(localedir)/$(lang).po $(srcdir)/index.tpl.html
d428ee
	xmllint -noout $(srcdir)/index.tpl.html
d428ee
	xml2po -p $(localedir)/$(lang).po -o $(datarootdir)/index.html $(srcdir)/index.tpl.html