Rev 7180 | Rev 7189 | 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 |
7156 | jlepiller | 6 | |
7180 | jlepiller | 7 | GENDIR := blfsgen-$(LANGUAGE) |
7156 | jlepiller | 8 | ORIGDIR := blfs-en |
7180 | jlepiller | 9 | PODIR := $(LANGUAGE) |
7164 | jlepiller | 10 | VERSION = tags/7.10 |
7156 | jlepiller | 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 | |||
19 | ifeq ($(REV), systemd) |
||
20 | VERSION_LINE=4 |
||
21 | endif |
||
22 | |||
23 | EN_REPO:=svn://svn.linuxfromscratch.org/BLFS |
||
24 | |||
25 | SVN_en := "$(EN_REPO)/$(VERSION)/" |
||
26 | |||
7164 | jlepiller | 27 | .PHONY: svnup |
7156 | jlepiller | 28 | |
7160 | jlepiller | 29 | #all: genhtml genpdf |
30 | all: genhtml |
||
7156 | jlepiller | 31 | @echo DONE |
32 | |||
33 | include.mk: $(ORIGDIR) |
||
34 | echo -n 'XML := ' > $@ |
||
7164 | jlepiller | 35 | find $(ORIGDIR) -type d -name stylesheets -prune -o -name '*.xml' -a -type f -print | sed 's|$(ORIGDIR)/|$(GENDIR)/|g' | tr '\n' ' ' >> $@ |
7156 | jlepiller | 36 | echo >> $@ |
37 | echo -n 'PO := ' >> $@ |
||
7164 | jlepiller | 38 | 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 | 39 | echo >> $@ |
40 | echo -n 'IMAGES := ' >> $@ |
||
41 | find images -type f | sed 's|^|$(GENDIR)/|g' | tr '\n' ' ' >> $@ |
||
42 | echo >> $@ |
||
43 | echo -n 'STYLESHEETS := ' >> $@ |
||
44 | find stylesheets -type f | sed 's|^|$(GENDIR)/|g' | tr '\n' ' ' >> $@ |
||
7156 | jlepiller | 45 | |
46 | |||
47 | |||
48 | .SECONDEXPANSION: |
||
49 | $(addprefix $(GENDIR)/,$(filestocopy)): INPUT=$(ORIGDIR)$(subst $(GENDIR),,$@) |
||
50 | $(addprefix $(GENDIR)/,$(filestocopy)): $$(INPUT) $(GENDIR) |
||
51 | cp -r $< $@ |
||
52 | |||
53 | |||
7163 | jlepiller | 54 | genhtml: $(XML) $(STYLESHEETS) $(IMAGES) $(COPY) |
7183 | jlepiller | 55 | $(MAKE) -j1 -C $(GENDIR) REV=$(REV) BASEDIR=../html-$(REV)-$(LANGUAGE) |
7156 | jlepiller | 56 | |
7163 | jlepiller | 57 | genpdf: $(XML) $(STYLESHEETS) $(IMAGES) $(COPY) |
7183 | jlepiller | 58 | $(MAKE) -j1 -C $(GENDIR) REV=$(REV) BASEDIR=../pdf-$(REV)-$(LANGUAGE) pdf |
7156 | jlepiller | 59 | |
7180 | jlepiller | 60 | TRANSLATE_CMD = po4a-translate -k 0 -f docbook -m $< -l $@ -p $(word 2,$^) -M ascii -L UTF-8 |
7160 | jlepiller | 61 | |
7163 | jlepiller | 62 | $(GENDIR)/%.xml: $(ORIGDIR)/%.xml $(PODIR)/%.po |
7160 | jlepiller | 63 | $(TRANSLATE_CMD) |
7180 | jlepiller | 64 | ./sed_$(LANGUAGE).sh $@ |
7160 | jlepiller | 65 | sed '0,/#-#/s|\([^>]*\) #-# \([^<]*\)|\1|' -i $@ |
66 | sed '0,/#-#/s|\([^>]*\) #-# \([^<]*\)|\2|' -i $@ |
||
7156 | jlepiller | 67 | sed -e 's|encoding="ISO-8859-1"|encoding="UTF-8"|g' -i $@ |
7164 | jlepiller | 68 | touch $(word 2,$^) |
69 | touch $@ |
||
7156 | jlepiller | 70 | |
7163 | jlepiller | 71 | $(GENDIR)/index.xml: $(ORIGDIR)/index.xml $(PODIR)/index.po |
7160 | jlepiller | 72 | $(TRANSLATE_CMD) |
7180 | jlepiller | 73 | ./sed_$(LANGUAGE).sh $@ |
7156 | jlepiller | 74 | sed -i -e 's|<book>|<book lang="fr">|g' \ |
75 | -e 's|encoding="ISO-8859-1"|encoding="UTF-8"|g' -i $@ |
||
76 | |||
7163 | jlepiller | 77 | $(GENDIR)/images/%: images/% |
78 | mkdir -p $$(dirname $@) |
||
7156 | jlepiller | 79 | rm -rf $@ |
7163 | jlepiller | 80 | cp $< $@ |
7156 | jlepiller | 81 | |
7163 | jlepiller | 82 | $(GENDIR)/stylesheets/%: stylesheets/% |
83 | mkdir -p $$(dirname $@) |
||
7156 | jlepiller | 84 | rm -rf $@ |
7163 | jlepiller | 85 | cp $< $@ |
7156 | jlepiller | 86 | |
7163 | jlepiller | 87 | $(GENDIR)/general.ent: $(ORIGDIR)/general.ent |
7156 | jlepiller | 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 | |||
7163 | jlepiller | 104 | $(GENDIR)/packages.ent: $(ORIGDIR)/packages.ent |
7156 | jlepiller | 105 | cp $< $@ |
106 | |||
7163 | jlepiller | 107 | $(GENDIR)/gnome.ent: $(ORIGDIR)/gnome.ent |
7156 | jlepiller | 108 | cp $< $@ |
109 | |||
7163 | jlepiller | 110 | $(GENDIR)/tidy.conf: $(ORIGDIR)/tidy.conf |
7156 | jlepiller | 111 | cp $< $@ |
112 | sed -e "s/latin1/UTF8/g" \ |
||
113 | $< > $@ |
||
114 | |||
7163 | jlepiller | 115 | $(GENDIR)/Makefile: $(ORIGDIR)/Makefile |
7156 | jlepiller | 116 | sed '/©/d' $< > $@ |
117 | |||
118 | init: $(ORIGDIR) |
||
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 | |||
7164 | jlepiller | 131 | $(ORIGDIR)/%.xml: init |
7156 | jlepiller | 132 | |
133 | |||
134 | $(PODIR)/%.po: $(ORIGDIR)/%.xml $(PODIR) |
||
7180 | jlepiller | 135 | po4a-updatepo -f docbook -m $< -p $@ -M ascii |
7164 | jlepiller | 136 | touch $< |
137 | touch $@ |
||
7156 | jlepiller | 138 | |
7164 | jlepiller | 139 | update: $(PO) |
7183 | jlepiller | 140 | |
141 | upload: |
||
142 | (cd html-systemd-$(LANGUAGE); rsync --progress --recursive * jlepiller@www.linuxfromscratch.org:/srv/www/www.fr.linuxfromscratch.org/view/blfs-systemd-svn/) |
||
143 | (cd html-sysv-$(LANGUAGE); rsync --progress --recursive * jlepiller@www.linuxfromscratch.org:/srv/www/www.fr.linuxfromscratch.org/view/blfs-svn/) |