areguera / centos / Artwork

Forked from centos/Artwork 5 years ago
Clone
Blob Blame History Raw
###############################################################################
#
#  centos-noindex - the CentOS test page for Apache HTTP server
#  Copyright (C) 2019  Alain Reguera Delgado
#
#  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 3 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, see <https://www.gnu.org/licenses/>.
#
###############################################################################

#==============================================================================
# Configuration
#==============================================================================
lang = en-US
prefix = .
version = 8.0
package = centos-noindex-$(version)
localedir = ../PO

#==============================================================================
# Requirements
#==============================================================================
all: $(package)/index.html.$(lang)

build: $(prefix)/$(package).tar.gz

#==============================================================================
# Sources
#==============================================================================
$(package):
	mkdir -p $(package)

$(prefix)/$(package).tar.gz: \
	$(package) \
	$(package)/index.html.??-?? \
	index.tpl.html \
	$(localedir)/*.po \
	../common/css/* \
	../common/images/* \
	../common/fonts/*
	rsync -a ../common $(package)
	tar -czf $(prefix)/$(package).tar.gz $(package)

$(package)/index.html.$(lang): $(package) $(localedir)/$(lang).po index.tpl.html
	xmllint -noout index.tpl.html
	xml2po -l $(lang) -p $(localedir)/$(lang).po -o $(package)/index.html.$(lang) index.tpl.html
	sed -i 's/<html lang="en-US">/<html lang="$(lang)">/' $(package)/index.html.$(lang)