Subversion Repositories svn LFS-FR

Rev

Rev 7110 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
7109 jlepiller 1
#!/usr/bin/make -f
2
 
3
include include.mk
4
 
5
LANG := fr
6
GENDIR := blfsgen-$(LANG)
7
ORIGDIR := blfs-en
8
PODIR := blfs-fr-po
9
VERSION = tags/7.9
10
FR_VERSION = branches/BLFS_po_dev
11
DIFFDIR = diff
12
 
13
filestocopy := INSTALL obfuscate.sh README
14
filestoget := $(filestocopy) general.ent gnome.ent packages.ent tidy.conf Makefile
15
COPY:=$(addprefix $(GENDIR)/,$(filestoget))
16
REV=sysv
17
VERSION_LINE=1
18
BASEDIR=../html-sysv
19
 
20
ifeq ($(REV), systemd)
21
VERSION_LINE=4
22
BASEDIR=../html-systemd
23
endif
24
 
25
FR_REPO:=svn://svn.linuxfromscratch.org/fr-lfs
26
EN_REPO:=svn://svn.linuxfromscratch.org/BLFS
27
 
28
STYLE_BRANCH=trunk/blfs
29
 
30
SVN_en := "$(EN_REPO)/$(VERSION)/"
31
SVN_po := "$(FR_REPO)/$(FR_VERSION)/"
32
SVN_stylesheets := "$(FR_REPO)/$(STYLE_BRANCH)/stylesheets"
33
SVN_images := "$(FR_REPO)/$(STYLE_BRANCH)/images"
34
 
35
 
36
 
37
.PHONY: $(GENDIR)/stylesheets $(GENDIR)/images svnup
38
 
39
all: genhtml
40
	@echo DONE
41
 
42
include.mk: $(ORIGDIR)
43
	echo -n 'XML := ' > $@
7110 jlepiller 44
	find $(ORIGDIR) -type d -name stylesheets -prune -o -name '*.xml' -print | sed 's|$(ORIGDIR)/|$(GENDIR)/|g' | tr '\n' ' ' >> $@
7109 jlepiller 45
	echo >> $@
46
	echo -n 'PO := ' >> $@
7110 jlepiller 47
	find $(ORIGDIR) -type d -name stylesheets -prune -o -name '*.xml' -print | sed 's|$(ORIGDIR)/|$(PODIR)/|g' | sed 's|.xml$$|.po|g' | tr '\n' ' ' >> $@
7109 jlepiller 48
 
49
 
50
 
51
.SECONDEXPANSION:
52
$(addprefix $(GENDIR)/,$(filestocopy)): INPUT=$(ORIGDIR)$(subst $(GENDIR),,$@)
53
$(addprefix $(GENDIR)/,$(filestocopy)): $$(INPUT) $(GENDIR)
54
	cp -r $< $@
55
 
56
 
57
genhtml: $(XML) $(GENDIR)/stylesheets $(GENDIR)/images $(COPY)
58
	$(MAKE) -j1 -C $(GENDIR) REV=$(REV) BASEDIR=$(BASEDIR)
59
 
60
genpdf: $(XML) $(GENDIR)/stylesheets $(GENDIR)/images $(COPY)
61
	echo $(filestocopy)
62
	$(MAKE) -j1 -C $(GENDIR) REV=$(REV) BASEDIR=../pdf pdf
63
 
64
$(GENDIR)/%.xml: $(ORIGDIR)/%.xml $(PODIR)/%.po $(GENDIR)
65
	po4a-translate -k 0 -f docbook -m $< -l $@ -p $(word 2,$^) -M ascii -L UTF-8
66
	sed -e 's|encoding="ISO-8859-1"|encoding="UTF-8"|g' -i $@
67
 
68
$(GENDIR)/index.xml: $(ORIGDIR)/index.xml $(PODIR)/index.po $(GENDIR)
69
	po4a-translate -k 0 -f docbook -m $< -l $@ -p $(word 2,$^) -M ascii -L UTF-8
70
	sed -i -e 's|<book>|<book lang="fr">|g' \
71
	       -e 's|encoding="ISO-8859-1"|encoding="UTF-8"|g' -i $@
72
 
7137 jlepiller 73
$(GENDIR)/general/progs/perl-modules.xml: $(ORIGDIR)/general/progs/perl-modules.xml $(PODIR)/general/progs/perl-modules.po $(GENDIR)
74
	po4a-translate -k 0 -f docbook -m $< -l $@ -p $(word 2,$^) -M ascii -L UTF-8
75
	sed -e 's|build and installation instructions|instructions de configuration et d\'installaton|g' \
76
	    -i $@
77
 
7109 jlepiller 78
$(GENDIR)/images: images $(GENDIR)
79
	rm -rf $@
80
	cp -r $< $(GENDIR)
81
 
82
$(GENDIR)/stylesheets: stylesheets $(GENDIR)
83
	rm -rf $@
84
	cp -r $< $@
85
 
86
$(GENDIR)/general.ent: $(ORIGDIR)/general.ent $(GENDIR)
87
	#cp $< $@
88
	cat $< | tr '\n' '\r' | \
89
	sed -e "s|The BLFS Team|L'équipe de BLFS|g" \
90
	    -e "s|The BLFS Development Team|L'équipe de développement de BLFS|g" \
91
	    -e "s|Unknown|Inconnu|g" \
92
	    -e "s|<!ENTITY lfs\([0-9]\)\([0-9]\)_checked [^\r]*\r[^\r]*\">|<!ENTITY lfs\1\2_checked \"<para>Ce paquet est connu pour se construire correctement sur une plateforme LFS-\1.\2.</para>\">|g" \
93
	    -e "s|<!ENTITY lfs\([0-9]\)\([0-9]\)_built [^\r]*\r[^\r]*\">|<!ENTITY lfs\1\2_built \"<para>Ce paquet est connu pour se construire correctement sur une plateforme LFS-\1.\2 mais n'a pas été testé.</para>\">|g" \
94
	    -e "s|<!ENTITY lfssvn_checked [^\r]*\r[^\r]*\">|<!ENTITY lfssvn_checked \"Ce paquet est connu pour se construire correctement sur une plateforme LFS-SVN-\">|g" \
95
	    -e "s|<!ENTITY lfssvn_built [^\r]*\">|<!ENTITY lfssvn_checked \"Ce paquet est connu pour se construire correctement sur une plateforme LFS-SVN-\">|g" \
96
	    -e "s|<!ENTITY lfssvn_checked2 [^\r]*\">|<!ENTITY lfssvn_checked2 \" .\">|g" \
97
	    -e "s|<!ENTITY lfssvn_built2 [^\r]*\">|<!ENTITY lfssvn_built2 \" mais n'a pas été testé.\">|g" \
98
	    -e "s|<!ENTITY as_root *\"[^\"]*\">||g" \
99
	    -e "s|<!ENTITY not-katamari *\"[^\"]*\">|<!ENTITY not-katamari \"<para>Ce paquet ne fait pas partie de Xorg Katamari et est seulement fourni comme dépendance d'autres paquets ou pour tester l'installation complète de Xorg.</para>\">|g" \
100
	    -e "s|<!ENTITY parallel_issues *\"[^\"]*\">|<!ENTITY parallel_issues \"<note><para>Ce paquet peut parfois échouer quand il est construit avec plusieurs processeurs. Voir <xref linkend='parallel-builds'/> pour plus d'information.</para></note>\">|g" \
101
	    | tr '\r' '\n' > $@
102
		cat general.ent.as_root >> $@
103
 
104
$(GENDIR)/packages.ent: $(ORIGDIR)/packages.ent $(GENDIR)
105
	cp $< $@
106
 
107
$(GENDIR)/gnome.ent: $(ORIGDIR)/gnome.ent $(GENDIR)
108
	cp $< $@
109
 
110
$(GENDIR)/tidy.conf: $(ORIGDIR)/tidy.conf $(GENDIR)
111
	cp $< $@
112
	sed -e "s/latin1/UTF8/g" \
113
	    $< > $@
114
 
115
$(GENDIR)/Makefile: $(ORIGDIR)/Makefile $(GENDIR)
116
	sed '/&copy;/d' $< > $@
117
 
118
blfsgen-%:
119
	mkdir -p $@
120
 
121
init: $(ORIGDIR) $(PODIR) stylesheets images
122
 
123
$(ORIGDIR)/%: $(ORIGDIR)
124
 
125
 
126
$(ORIGDIR):
127
	[ -d $@ ] || svn co $(SVN_en) $(ORIGDIR)/
128
 
129
$(PODIR):
130
	[ -d $@ ] || svn co $(SVN_po) $(PODIR)/
131
 
132
stylesheets:
133
	[ -d $@ ] || svn co $(SVN_stylesheets) stylesheets/
134
 
135
images:
136
	[ -d $@ ] || svn co $(SVN_images) images/
137
 
138
svnup: init
139
	if [ "$$(svn status -u $(ORIGDIR) | wc -l)" != "1" ]; then \
140
	svn update $(ORIGDIR);\
141
	fi
142
	if [ "$$(svn status -u $(PODIR) | wc -l)" != "1" ]; then \
143
	svn update $(PODIR);\
144
	fi
145
	if [ "$$(svn status -u stylesheets | wc -l)" != "1" ]; then \
146
	svn update stylesheets;\
147
	fi
148
	if [ "$$(svn status -u images | wc -l)" != "1" ]; then \
149
	svn update images;\
150
	fi
151
 
152
clean:
153
	rm -rf $(DIFFDIR) $(GENDIR) $(PODIR) $(ORIGDIR) stylesheets images include.mk html pdf
154
 
155
$(ORIGDIR)/%.xml: $(ORIGDIR)
156
 
157
 
158
$(PODIR)/%.po: $(ORIGDIR)/%.xml $(PODIR)
159
	po4a-updatepo -f docbook -m $< -p $@ -M ascii
160
 
161
$(DIFFDIR):
162
	mkdir $@
163
 
164
gendiff: $(PO) $(DIFFDIR)
165
	svn diff $(PODIR) | xz  -zec9 > $(DIFFDIR)/lfs-$(VERSION)-`date "+%d%m%y%H%M%S"`.diff.xz