Subversion Repositories svn LFS-FR

Rev

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