1
####################################################################################
2
# Makefile for the GNOME Ubuntu Documentation
3
# Copyright (C) 2005-2006 Ubuntu Documentation Project (ubuntu-doc@lists.ubuntu.com)
4
# This program is free software; you can redistribute it and/or modify
5
# it under the terms of the GNU General Public License as published by
6
# the Free Software Foundation; either version 2 of the License, or
7
# (at your option) any later version.
9
# This program is distributed in the hope that it will be useful,
10
# but WITHOUT ANY WARRANTY; without even the implied warranty of
11
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
# GNU General Public License for more details.
14
# You should have received a copy of the GNU General Public License
15
# along with this program; if not, write to the Free Software
16
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17
# On Debian based systems a copy of the GPL can be found
18
# at /usr/share/common-licenses/GPL
20
####################################################################################
24
SRCDIR=../ubuntu-kylin-help
26
INSTALLDIR=/var/www/14.04/
29
# Space-separated list of language codes for documents. HTML will only be
30
# built for those codes in the list
31
# Ex. HELP_LINGUAS=ja it for Japanese and Italian
32
# Note that the corresponding .page files for the locales must have been built
33
# for the HTML to be built in turn. This means all the locales for which
34
# HTML output is needed will have to have been specified in the main
35
# HELP_LINGUAS variable in the ubuntu-kylinkylin-help Makefile
38
index_file_exists = $(wildcard $(SRCDIR)/$(lingua)/index.page)
39
linguas := $(HELP_LINGUAS)
41
$(foreach lingua, $(linguas), \
42
$(if $(index_file_exists), \
44
$(warning Cannot find source index page for locale: $(lingua), \
45
skipping. You will probably have to build it adding it to \
46
the HELP_LINGUAS variable in the Makefile at $(SRCDIR) \
49
# Ubuntu Mallard Customization Layer
52
# Builds the HTML files for all specified language codes, specifiying the
53
# language in the final documents and performing some other necessary
54
# text replacements not handled by yelp-build.
55
# Language codes are normalized to IETF format, as opposed to glibc format
56
ubuntu-kylin-help: clean style
57
for lc in C $(help_linguas); do \
58
lang=`echo $$lc | $(SED) -e 's/[@_]/-/'`; \
59
if test "$$lang" = "C"; then lang=en; fi; \
60
if test "$$lang" = "gl"; then lang=gl-GL; fi; \
61
if test "$$lang" = "ms"; then lang=ms-MS; fi; \
62
if test "$$lang" = "pl"; then lang=pl-PL; fi; \
63
yelp-build html -o "$(HTMLDESTDIR)/$$lang/" -x $(UBUNTUXSL) \
66
-e '1s/^/<!DOCTYPE html\>\n/' \
67
-e "s/<html>/<html lang="$$lang">/" \
68
-e 's|/usr/share/icons/.*/\(.*\.svg\)|img/\1|'\
69
"$(HTMLDESTDIR)/$$lang/"*.html; \
70
$(SED) -i -f "$(URLFIXER)" "$(HTMLDESTDIR)/$$lang/"*.html; \
71
echo "\nSearching for yelp help system internal links and either changing them to equivalent or related external links or deleting them:"; \
72
$(SED) -i -e '/help:language-selector/d' "$(HTMLDESTDIR)/$$lang/"session*.html; \
73
grep "href=\"ghelp:" "$(HTMLDESTDIR)/$$lang/"*.html; \
74
rm -rf "$(HTMLDESTDIR)/$$lang/usr"; \
80
# Copy style sheet and common images to build directory
81
# TODO: copy C/figures to destination only for those cases where there are
82
# no localized figures
84
for lc in C $(help_linguas); do \
85
lang=`echo $$lc | $(SED) -e 's/[@_]/-/'`; \
86
if test "$$lang" = "C"; then lang=en; fi; \
87
if test "$$lang" = "gl"; then lang=gl-GL; fi; \
88
if test "$$lang" = "ms"; then lang=ms-MS; fi; \
89
if test "$$lang" = "pl"; then lang=pl-PL; fi; \
90
mkdir -p "$(HTMLDESTDIR)/$$lang/img"; \
91
mkdir -p "$(HTMLDESTDIR)/$$lang/figures"; \
92
cp img/* "$(HTMLDESTDIR)/$$lang/img"; \
93
cp "$(SRCDIR)/C/figures/"* "$(HTMLDESTDIR)/$$lang/figures"; \
96
# Installs all HTML files to a multilingual site (e.g. run with Apache and
99
rm -Rf "$(INSTALLDIR)"/*; \
100
cp -R "$(HTMLDESTDIR)/"* "$(INSTALLDIR)"; \
101
for lc in C $(help_linguas); do \
102
lang=`echo $$lc | $(SED) -e 's/[@_]/-/'`; \
103
if test "$$lang" = "C"; then lang=en; fi; \
104
if test "$$lang" = "gl"; then lang=gl-GL; fi; \
105
if test "$$lang" = "ms"; then lang=ms-MS; fi; \
106
if test "$$lang" = "pl"; then lang=pl-PL; fi; \
107
find "$(INSTALLDIR)/$$lang" -type f -exec mv {} {}.$$lang \; ; \
108
cp -af "$(INSTALLDIR)/$$lang"/* "$(INSTALLDIR)"; \
109
rm -Rf "$(INSTALLDIR)/$$lang" ; \