Subversion Repositories svn LFS-FR

Rev

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