blob: 649478c2cf912aa5a21cce736177ab31e546ffef (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
DTDS = book.dtd gleps.dtd glsa.dtd guide.dtd metadata.dtd metadoc.dtd \
project.dtd projects.dtd repositories.dtd userinfo.dtd
DTDDEPS = $(patsubst %.dtd,%.dep,$(DTDS))
RNCS = $(patsubst %.dtd,%.rnc,$(DTDS))
ifdef ($(PV),)
PN=nxml-gentoo-schemas-$(PV)
else
PN=nxml-gentoo-schemas-$(shell date '+%Y%m%d')
endif
TARBALL=$(PN).tar.xz
.SUFFIXES: .dtd .rnc .dep
.PHONY: depend all clean
.PRECIOUS: $(RNCS) $(DTDS)
.INTERMEDIATE: $(DTDDEPS)
all: .depend $(TARBALL)
depend: .depend
clean:
rm -f *.dtd *.dep .depend
.depend: $(DTDDEPS)
cat *.dep > $@
$(TARBALL): Makefile LICENCE DONATING schemas.xml $(RNCS)
mkdir -p $(PN)
cp $^ $(PN)
tar cJf $@ $(PN)
.dtd.dep:
echo > $@
sed -n -e '/ENTITY/s|<!ENTITY % \w\+ SYSTEM "\(.*\)\.dtd">|\1|p' $< | \
while read dep; do \
echo "$(patsubst %.dtd,%.rnc,$<): $$dep.rnc $$dep.dtd" >> $@ || exit 1; \
echo "$(TARBALL): $$dep.rnc" >> $@ || exit 1; \
$(MAKE) "$$dep.dep" || exit 1; \
done
.dtd.rnc:
trang -I dtd -O rnc $< $@
%.dtd:
wget -N --no-verbose https://www.gentoo.org/dtd/$@
-include .depend
|