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