~mistrynitesh/kubuntu-docs/fixes-two-bugs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
################################################################################
# Makefile for the Kubuntu Documentation
#
# Copyright (C) 2009 Richard A. Johnson <nixternal@ubuntu.com>
#
# 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 <http://www.gnu.org/licenses/>.
#
################################################################################

MAKECMD=make

# Language code for documents
LN=C

# XSL Processor
XSLTPROC=/usr/bin/xsltproc

# Stylesheets
CHUNKXSL=libs/kubuntu-chunk.xsl
NONCHUNKXSL=libs/kubuntu-nonchunk.xsl
CHUNKONLINEXSL=libs/kubuntu-chunk-online.xsl

# Output/build directory
BUILD=build
KBASE=$(BUILD)/kubuntu

################
## Make Targets
################

# Style
style:

	mkdir -p $(KBASE)/images
	mkdir -p $(KBASE)/common
	cp images/* $(KBASE)/images/
	cp libs/kubuntu.css $(KBASE)/common/

# All Kubuntu Documentation
all: common style desktopfiles

	for doc in `ls docs/`; do \
	    xsltproc -o $(KBASE)/docs/$$doc/$(LN)/index.html $(CHUNKXSL) \
	    docs/$$doc/$(LN)/$$doc.xml; done

# Common - ccbysa and contributors
common: clean

	mkdir -p $(KBASE)/docs
	xsltproc -o $(KBASE)/docs/contributors.html $(NONCHUNKXSL) \
	    common/contributors.xml
	xsltproc -o $(KBASE)/docs/license.html $(NONCHUNKXSL) \
	    common/ccbysa.xml

desktopfiles:
	mkdir -p $(KBASE)/data
	intltool-merge -d data/about/po/ data/about/about.desktop.in build/kubuntu/data/about.desktop
	cp build/kubuntu/data/about.desktop build/kubuntu/data/about.desktop.tobemoved
	intltool-merge -d data/directory/po/ data/directory/directory.desktop.in build/kubuntu/data/.directory
	intltool-merge -d data/kubuntu-docs/po/ data/kubuntu-docs/kubuntu-docs.desktop.in build/kubuntu/data/kubuntu-docs.desktop
	intltool-merge -d data/welcome/po/ data/welcome/welcome.desktop.in build/kubuntu/data/a_welcome.desktop

# Web - build docs for use on the web
web: common style

	cp -r /usr/share/doc/kde4/HTML/en/common/* $(KBASE)/common/
	for doc in `ls docs/`; do \
	    cp docs/$$doc/$(LN)/$$doc.xml docs/$$doc/$(LN)/$$doc.xml.orig; \
	    sed -i 's/help\:\/kubuntu\//\.\.\/\.\.\//g' docs/$$doc/$(LN)/$$doc.xml; \
	    xsltproc -o $(KBASE)/$$doc/$(LN)/index.html $(CHUNKONLINEXSL) \
	    docs/$$doc/$(LN)/$$doc.xml; \
	    mv docs/$$doc/$(LN)/$$doc.xml.orig docs/$$doc/$(LN)/$$doc.xml; done

# Clean the build directory
clean:

	rm -rf $(BUILD)