| ############################################################################### |
| # |
| # centos-indexhtml - the CentOS web browser's default page |
| # 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-indexhtml-$(version) |
| localedir = ../PO |
| |
| #============================================================================== |
| # Requirements |
| #============================================================================== |
| all: $(package)/$(lang)/index.html |
| |
| build: $(prefix)/$(package).tar.gz |
| |
| #============================================================================== |
| # Sources |
| #============================================================================== |
| $(package): |
| mkdir -p $(package) |
| |
| $(package)/$(lang): |
| mkdir -p $(package)/$(lang) |
| |
| $(prefix)/$(package).tar.gz: \ |
| $(package) \ |
| $(package)/??-??/* \ |
| index.tpl.html \ |
| index.html \ |
| $(localedir)/*.po \ |
| ../common/css/* \ |
| ../common/images/* \ |
| ../common/fonts/* |
| cp -a index.html $(package) |
| rsync -a --exclude="images/pb-*.png" ../common $(package) |
| tar -czf $(prefix)/$(package).tar.gz $(package) |
| |
| $(package)/$(lang)/index.html: $(package)/$(lang) $(localedir)/$(lang).po index.tpl.html |
| xmllint -noout index.tpl.html |
| xml2po -l $(lang) -p $(localedir)/$(lang).po -o $(package)/$(lang)/index.html index.tpl.html |
| sed -i 's/<html lang="en-US">/<html lang="$(lang)">/' $(package)/$(lang)/index.html |