Rev 7158 | Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
7156 | jlepiller | 1 | #!/usr/bin/make -f |
2 | |||
3 | include include.mk |
||
4 | |||
5 | LANG := fr |
||
6 | LANGUAGE := fr_FR.UTF-8 |
||
7 | |||
8 | GENDIR := blfsgen-$(LANG) |
||
9 | ORIGDIR := blfs-en |
||
10 | PODIR := $(LANG) |
||
11 | VERSION = tags/7.9 |
||
12 | DIFFDIR = diff |
||
13 | |||
14 | LANG_EXPORT := LC_ALL=$(LANGUAGE) LANGUAGE=$(LANGUAGE) LANG=$(LANGUAGE) |
||
15 | |||
16 | filestocopy := INSTALL obfuscate.sh README |
||
17 | filestoget := $(filestocopy) general.ent gnome.ent packages.ent tidy.conf Makefile |
||
18 | COPY:=$(addprefix $(GENDIR)/,$(filestoget)) |
||
19 | REV=sysv |
||
20 | VERSION_LINE=1 |
||
21 | BASEDIR=../html-sysv |
||
22 | |||
23 | ifeq ($(REV), systemd) |
||
24 | VERSION_LINE=4 |
||
25 | BASEDIR=../html-systemd |
||
26 | endif |
||
27 | |||
28 | EN_REPO:=svn://svn.linuxfromscratch.org/BLFS |
||
29 | |||
30 | SVN_en := "$(EN_REPO)/$(VERSION)/" |
||
31 | |||
32 | .PHONY: $(GENDIR)/stylesheets $(GENDIR)/images svnup |
||
33 | |||
34 | all: genhtml genpdf |
||
35 | @echo DONE |
||
36 | |||
37 | include.mk: $(ORIGDIR) |
||
38 | echo -n 'XML := ' > $@ |
||
39 | find $(ORIGDIR) -type d -name stylesheets -prune -o -name '*.xml' -print | sed 's|$(ORIGDIR)/|$(GENDIR)/|g' | tr '\n' ' ' >> $@ |
||
40 | echo >> $@ |
||
41 | echo -n 'PO := ' >> $@ |
||
42 | find $(ORIGDIR) -type d -name stylesheets -prune -o -name '*.xml' -print | sed 's|$(ORIGDIR)/|$(PODIR)/|g' | sed 's|.xml$$|.po|g' | tr '\n' ' ' >> $@ |
||
43 | |||
44 | |||
45 | |||
46 | .SECONDEXPANSION: |
||
47 | $(addprefix $(GENDIR)/,$(filestocopy)): INPUT=$(ORIGDIR)$(subst $(GENDIR),,$@) |
||
48 | $(addprefix $(GENDIR)/,$(filestocopy)): $$(INPUT) $(GENDIR) |
||
49 | cp -r $< $@ |
||
50 | |||
51 | |||
52 | genhtml: $(XML) $(GENDIR)/stylesheets $(GENDIR)/images $(COPY) |
||
53 | $(LANG_EXPORT) $(MAKE) -j1 -C $(GENDIR) REV=$(REV) BASEDIR=$(BASEDIR) |
||
54 | |||
55 | genpdf: $(XML) $(GENDIR)/stylesheets $(GENDIR)/images $(COPY) |
||
56 | $(LANG_EXPORT) $(MAKE) -j1 -C $(GENDIR) REV=$(REV) BASEDIR=../pdf pdf |
||
57 | |||
58 | $(GENDIR)/%.xml: $(ORIGDIR)/%.xml $(PODIR)/%.po $(GENDIR) |
||
59 | $(LANG_EXPORT) po4a-translate -k 0 -f docbook -m $< -l $@ -p $(word 2,$^) -M ascii -L UTF-8 |
||
60 | sed -e 's|encoding="ISO-8859-1"|encoding="UTF-8"|g' -i $@ |
||
61 | |||
62 | $(GENDIR)/index.xml: $(ORIGDIR)/index.xml $(PODIR)/index.po $(GENDIR) |
||
63 | $(LANG_EXPORT) po4a-translate -k 0 -f docbook -m $< -l $@ -p $(word 2,$^) -M ascii -L UTF-8 |
||
64 | sed -i -e 's|<book>|<book lang="fr">|g' \ |
||
65 | -e 's|encoding="ISO-8859-1"|encoding="UTF-8"|g' -i $@ |
||
66 | |||
67 | $(GENDIR)/general/progs/perl-modules.xml: $(ORIGDIR)/general/progs/perl-modules.xml $(PODIR)/general/progs/perl-modules.po $(GENDIR) |
||
68 | $(LANG_EXPORT) po4a-translate -k 0 -f docbook -m $< -l $@ -p $(word 2,$^) -M ascii -L UTF-8 |
||
69 | sed -e 's|build and installation instructions|instructions de configuration et d\'installaton|g' \ |
||
70 | -i $@ |
||
71 | |||
72 | $(GENDIR)/images: $(GENDIR) |
||
73 | rm -rf $@ |
||
74 | cp -r images $(GENDIR) |
||
75 | |||
76 | $(GENDIR)/stylesheets: $(GENDIR) |
||
77 | rm -rf $@ |
||
78 | cp -r stylesheets $@ |
||
79 | |||
80 | $(GENDIR)/general.ent: $(ORIGDIR)/general.ent $(GENDIR) |
||
81 | #cp $< $@ |
||
82 | cat $< | tr '\n' '\r' | \ |
||
83 | sed -e "s|The BLFS Team|L'équipe de BLFS|g" \ |
||
84 | -e "s|The BLFS Development Team|L'équipe de développement de BLFS|g" \ |
||
85 | -e "s|Unknown|Inconnu|g" \ |
||
86 | -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" \ |
||
87 | -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" \ |
||
88 | -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" \ |
||
89 | -e "s|<!ENTITY lfssvn_built [^\r]*\">|<!ENTITY lfssvn_checked \"Ce paquet est connu pour se construire correctement sur une plateforme LFS-SVN-\">|g" \ |
||
90 | -e "s|<!ENTITY lfssvn_checked2 [^\r]*\">|<!ENTITY lfssvn_checked2 \" .\">|g" \ |
||
91 | -e "s|<!ENTITY lfssvn_built2 [^\r]*\">|<!ENTITY lfssvn_built2 \" mais n'a pas été testé.\">|g" \ |
||
92 | -e "s|<!ENTITY as_root *\"[^\"]*\">||g" \ |
||
93 | -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" \ |
||
94 | -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" \ |
||
95 | | tr '\r' '\n' > $@ |
||
96 | cat general.ent.as_root >> $@ |
||
97 | |||
98 | $(GENDIR)/packages.ent: $(ORIGDIR)/packages.ent $(GENDIR) |
||
99 | cp $< $@ |
||
100 | |||
101 | $(GENDIR)/gnome.ent: $(ORIGDIR)/gnome.ent $(GENDIR) |
||
102 | cp $< $@ |
||
103 | |||
104 | $(GENDIR)/tidy.conf: $(ORIGDIR)/tidy.conf $(GENDIR) |
||
105 | cp $< $@ |
||
106 | sed -e "s/latin1/UTF8/g" \ |
||
107 | $< > $@ |
||
108 | |||
109 | $(GENDIR)/Makefile: $(ORIGDIR)/Makefile $(GENDIR) |
||
110 | sed '/©/d' $< > $@ |
||
111 | |||
112 | blfsgen-%: |
||
113 | mkdir -p $@ |
||
114 | |||
115 | init: $(ORIGDIR) |
||
116 | |||
117 | $(ORIGDIR)/%: $(ORIGDIR) |
||
118 | |||
119 | |||
120 | $(ORIGDIR): |
||
121 | [ -d $@ ] || svn co $(SVN_en) $(ORIGDIR)/ |
||
122 | |||
123 | svnup: init |
||
124 | if [ "$$(svn status -u $(ORIGDIR) | wc -l)" != "1" ]; then \ |
||
125 | svn update $(ORIGDIR);\ |
||
126 | fi |
||
127 | |||
128 | clean: |
||
129 | rm -rf $(DIFFDIR) $(GENDIR) $(ORIGDIR) include.mk html-sysv html-systemd pdf |
||
130 | |||
131 | $(ORIGDIR)/%.xml: $(ORIGDIR) |
||
132 | |||
133 | |||
134 | $(PODIR)/%.po: $(ORIGDIR)/%.xml $(PODIR) |
||
135 | $(LANG_EXPORT) po4a-updatepo -f docbook -m $< -p $@ -M ascii |
||
136 | |||
137 | $(DIFFDIR): |
||
138 | mkdir $@ |
||
139 | |||
140 | gendiff: $(PO) $(DIFFDIR) |
||
141 | svn diff $(PODIR) | xz -zec9 > $(DIFFDIR)/lfs-$(VERSION)-`date "+%d%m%y%H%M%S"`.diff.xz |