Rev 7138 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
7138 | jlepiller | 1 | #!/usr/bin/make -f |
2 | |||
3 | include include.mk |
||
4 | |||
5 | LANG := fr |
||
6 | GENDIR := lfsgen-$(LANG) |
||
7 | ORIGDIR := lfs-en |
||
8 | PODIR := $(LANG) |
||
9 | VERSION = trunk |
||
10 | EN_VER := tags/7.10 |
||
11 | #EN_VER := trunk/BOOK |
||
12 | DIFFDIR = diff |
||
13 | |||
14 | filestocopy := INSTALL process-scripts.sh obfuscate.sh pdf-fixups.sh README bootscripts udev-lfs aux-file-data.sh make-aux-files.sh |
||
15 | filestoget := $(filestocopy) packages.ent tidy.conf patches.ent general.ent 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 | FR_REPO:=svn://svn.linuxfromscratch.org/fr-lfs |
||
27 | EN_REPO:=svn://svn.linuxfromscratch.org/LFS |
||
28 | |||
29 | STYLE_BRANCH=trunk/lfs |
||
30 | |||
31 | SVN_en := "$(EN_REPO)/$(EN_VER)" |
||
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 | |||
7141 | jlepiller | 39 | all: genhtml genpdf |
7138 | jlepiller | 40 | @echo DONE |
41 | |||
42 | include.mk: $(ORIGDIR) |
||
43 | echo -n 'XML := ' > $@ |
||
44 | ls $(ORIGDIR)/*.xml $(ORIGDIR)/*/*.xml | sed 's|$(ORIGDIR)/|$(GENDIR)/|g' | tr '\n' ' ' >> $@ |
||
45 | echo >> $@ |
||
46 | echo -n 'PO := ' >> $@ |
||
47 | ls $(ORIGDIR)/*.xml $(ORIGDIR)/*/*.xml | sed 's|$(ORIGDIR)/|$(PODIR)/|g' | sed 's|.xml$$|.po|g' | tr '\n' ' ' >> $@ |
||
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 | $(MAKE) -j1 -C $(GENDIR) REV=$(REV) BASEDIR=../pdf pdf |
||
62 | |||
7141 | jlepiller | 63 | |
7138 | jlepiller | 64 | $(GENDIR)/%.xml: $(ORIGDIR)/%.xml $(PODIR)/%.po $(GENDIR) |
65 | po4a-translate -k 0 -f docbook -m $< -l $@ -p $(word 2,$^) |
||
7141 | jlepiller | 66 | sed -e 's|encoding="ISO-8859-1"|encoding="UTF-8"|g' \ |
67 | -e 's|xreflabel="Chapter 1 - Mailing Lists|xreflabel="Chapitre 1 - Listes de diffusion|g' \ |
||
68 | -e 's|xreflabel="Chapter 1 - Mirror sites|xreflabel="Chapitre 1 - Sites miroirs|g' \ |
||
69 | -e 's|xreflabel="Host System Requirements|xreflabel="Prérequis du système hôte|g' \ |
||
70 | -e "s|xreflabel='Package build instructions|xreflabel='Instructions de compilation des paquets|g" \ |
||
71 | -e 's|xreflabel="Creating the /etc/shells File|xreflabel="Créaction du fichier /etc/shells|g' \ |
||
72 | -e 's|xreflabel="Chapter|xreflabel="Chapitre|g' \ |
||
73 | -e 's|xreflabel="Appendix|xreflabel="Appendice|g' -i $@ |
||
7138 | jlepiller | 74 | |
75 | $(GENDIR)/index.xml: $(ORIGDIR)/index.xml $(PODIR)/index.po $(GENDIR) |
||
76 | po4a-translate -k 0 -f docbook -m $< -l $@ -p $(word 2,$^) |
||
77 | sed -e 's|<book>|<book lang="fr">|g' -i $@ |
||
78 | sed -e 's|encoding="ISO-8859-1"|encoding="UTF-8"|g' -i $@ |
||
79 | |||
80 | $(GENDIR)/images: images $(GENDIR) |
||
81 | rm -rf $@ |
||
82 | cp -r $< $(GENDIR) |
||
83 | |||
84 | $(GENDIR)/stylesheets: stylesheets $(GENDIR) |
||
85 | rm -rf $@ |
||
86 | cp -r $< $@ |
||
87 | |||
88 | $(GENDIR)/general.ent: $(ORIGDIR)/general.ent $(GENDIR) |
||
89 | #cp $< $@ |
||
90 | date1=$$(sed -n $(VERSION_LINE)p $< | sed 's/.*"\([^"]\+\)".*/\1/');\ |
||
91 | date2=$$(sed -n 10p $< | sed 's/.*"\([^"]\+\)".*/\1/');\ |
||
92 | sed -e "s/$$date2/$$(LANG=fr_FR.UTF-8 date -d "$${date2}" "+%d %B %Y")/g"\ |
||
93 | -e "s/Approximate build time/Temps de construction approximatif/g"\ |
||
94 | -e "s/Required disk space/Espace disque requis/g"\ |
||
95 | -e "s/Installation depends on/L'installation dépend de/g"\ |
||
96 | -e "s/Test suite depends on/La suite de tests dépend de/g"\ |
||
97 | -e "s/Must be installed before/Doit être installé avant/g"\ |
||
98 | -e "s/Optional dependencies/Dépendances facultatives/g"\ |
||
99 | -e "s/&lfs-root;blfs\//http:\/\/www.fr.linuxfromscratch.org\/view\/blfs-$(version)/g"\ |
||
7141 | jlepiller | 100 | -e "s/&blfs-root;view\/&short-version;/\&blfs-root;\&short-version;/g"\ |
7138 | jlepiller | 101 | -e "s/&lfs-root;hints\/downloads\/files\//http:\/\/www.fr.linuxfromscratch.org\/view\/astuces\//g"\ |
102 | $< > $@ |
||
103 | |||
104 | $(GENDIR)/packages.ent: $(ORIGDIR)/packages.ent $(GENDIR) |
||
105 | cp $< $@ |
||
106 | sed -e "s/KB/Ko/g" -e "s/MB/Mo/g" -e "s/GB/Go/g"\ |
||
107 | -e "s/less than/moins de/g"\ |
||
108 | -e "s/typically about/en général environ/g"\ |
||
109 | -e "s/about/environ/g"\ |
||
110 | -e "s/with tests/avec les tests/g"\ |
||
111 | $< > $@ |
||
112 | |||
113 | $(GENDIR)/patches.ent: $(ORIGDIR)/patches.ent $(GENDIR) |
||
114 | cp $< $@ |
||
115 | sed -e "s/KB/Ko/g" \ |
||
116 | $< > $@ |
||
117 | |||
118 | $(GENDIR)/tidy.conf: $(ORIGDIR)/tidy.conf $(GENDIR) |
||
119 | cp $< $@ |
||
120 | sed -e "s/latin1/UTF8/g" \ |
||
121 | $< > $@ |
||
122 | |||
123 | $(GENDIR)/Makefile: $(ORIGDIR)/Makefile $(GENDIR) |
||
124 | sed '/©/d' $< > $@ |
||
125 | |||
126 | lfsgen-%: |
||
127 | mkdir -p $@ |
||
128 | |||
129 | init: $(ORIGDIR) $(PODIR) stylesheets images |
||
130 | |||
131 | $(ORIGDIR)/%: $(ORIGDIR) |
||
132 | |||
133 | |||
134 | $(ORIGDIR): |
||
135 | [ -d $@ ] || svn co $(SVN_en) $(ORIGDIR)/ |
||
136 | |||
137 | stylesheets: |
||
138 | [ -d $@ ] || svn co $(SVN_stylesheets) stylesheets/ |
||
139 | |||
140 | images: |
||
141 | [ -d $@ ] || svn co $(SVN_images) images/ |
||
142 | |||
143 | svnup: init |
||
144 | if [ "$$(svn status -u $(ORIGDIR) | wc -l)" != "1" ]; then \ |
||
145 | svn update $(ORIGDIR);\ |
||
146 | fi |
||
147 | if [ "$$(svn status -u stylesheets | wc -l)" != "1" ]; then \ |
||
148 | svn update stylesheets;\ |
||
149 | fi |
||
150 | if [ "$$(svn status -u images | wc -l)" != "1" ]; then \ |
||
151 | svn update images;\ |
||
152 | fi |
||
153 | |||
154 | clean: |
||
155 | rm -rf $(DIFFDIR) $(GENDIR) $(ORIGDIR) stylesheets images include.mk html pdf |
||
156 | |||
157 | $(ORIGDIR)/%.xml: $(ORIGDIR) |
||
158 | |||
159 | |||
160 | $(PODIR)/%.po: $(ORIGDIR)/%.xml |
||
161 | po4a-updatepo -f docbook -m $< -p $@ |
||
162 | |||
163 | $(DIFFDIR): |
||
164 | mkdir $@ |
||
165 | |||
166 | gendiff: $(PO) $(DIFFDIR) |
||
167 | svn diff $(PODIR) | xz -zec9 > $(DIFFDIR)/lfs-$(VERSION)-`date "+%d%m%y%H%M%S"`.diff.xz |