Blame html/centos-indexhtml/Makefile

d6a59a
###############################################################################
d6a59a
#
d6a59a
#  centos-indexhtml - the CentOS web browser's default page
d6a59a
#  Copyright (C) 2019  Alain Reguera Delgado
d6a59a
#
d6a59a
#  This program is free software: you can redistribute it and/or modify it
d6a59a
#  under the terms of the GNU General Public License as published by the Free
d6a59a
#  Software Foundation, either version 3 of the License, or (at your option)
d6a59a
#  any later version.
d6a59a
#
d6a59a
#  This program is distributed in the hope that it will be useful, but WITHOUT
d6a59a
#  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
d6a59a
#  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
d6a59a
#  more details.
d6a59a
#
d6a59a
#  You should have received a copy of the GNU General Public License along with
d6a59a
#  this program.  If not, see <https://www.gnu.org/licenses/>.
d6a59a
#
d6a59a
###############################################################################
d6a59a
d6a59a
#==============================================================================
d6a59a
# Configuration
d6a59a
#==============================================================================
d6a59a
lang = en-US
d6a59a
prefix = .
d6a59a
version = 8.0
d6a59a
package = centos-indexhtml-$(version)
d6a59a
localedir = ../PO
d6a59a
d6a59a
#==============================================================================
d6a59a
# Requirements
d6a59a
#==============================================================================
d6a59a
all: $(package)/$(lang)/index.html
d6a59a
d6a59a
build: $(prefix)/$(package).tar.gz
d6a59a
d6a59a
#==============================================================================
d6a59a
# Sources
d6a59a
#==============================================================================
d6a59a
$(package):
d6a59a
	mkdir -p $(package)
d6a59a
d6a59a
$(package)/$(lang):
d6a59a
	mkdir -p $(package)/$(lang)
d6a59a
d6a59a
$(prefix)/$(package).tar.gz: \
d6a59a
	$(package) \
d6a59a
	$(package)/??-??/* \
d6a59a
	index.tpl.html \
d6a59a
	index.html \
d6a59a
	$(localedir)/*.po \
d6a59a
	../common/css/* \
d6a59a
	../common/images/* \
d6a59a
	../common/fonts/*
d6a59a
	cp -a index.html $(package)
d6a59a
	rsync -a --exclude="images/pb-*.png" ../common $(package)
d6a59a
	tar -czf $(prefix)/$(package).tar.gz $(package)
d6a59a
d6a59a
$(package)/$(lang)/index.html: $(package)/$(lang) $(localedir)/$(lang).po index.tpl.html
d6a59a
	xmllint -noout index.tpl.html
d6a59a
	xml2po -l $(lang) -p $(localedir)/$(lang).po -o $(package)/$(lang)/index.html index.tpl.html
d6a59a
	sed -i 's/<html lang="en-US">/<html lang="$(lang)">/' $(package)/$(lang)/index.html