aboutsummaryrefslogtreecommitdiffstats
path: root/english/security/oval/Makefile
blob: 22d3f089ce7178777cf7e8c933a6bff6de2ca3af (plain) (blame)
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
51
52
53
# If this makefile is not generic enough to support a translation,
# please contact debian-www.

WMLBASE=../..
CUR_DIR=security/oval
SUBS=

PYTHON=/usr/bin/python

include $(WMLBASE)/Make.lang

# NOTE: CUR_YEAR is defined in $(WMLBASE)/Makefile.common
XMLFILES=$(shell for year in `seq 2001 $(CUR_YEAR)`; do echo oval-definitions-$$year.xml; done)

XMLDESTFILES=$(patsubst %,$(HTMLDIR)/%,$(XMLFILES))

all:: check_empty_files $(XMLFILES)

install:: $(XMLDESTFILES)

oval-definitions-%.xml: generate.py \
	$(wildcard oval/*/*.py) \
	$(wildcard $(ENGLISHDIR)/security/%/dsa-*.wml)  \
	$(wildcard $(ENGLISHDIR)/security/%/dla-*.wml)  \
	$(wildcard $(ENGLISHDIR)/security/%/dsa-*.data) \
	$(wildcard $(ENGLISHDIR)/security/%/dla-*.data)
	@[ -e $(PYTHON) ] || { echo "ERROR: Required python binary $(PYTHON) is not available, aborting generation" >&2; exit 1; }
	-$(PYTHON) generate.py -d .. -y $(patsubst oval-definitions-%.xml,%,$@) >$@
# Warn if empty files are generated
# Note: They cannot be removed or the install target will fail later
	@[ -s $@ ] || echo "WARNING: OVAL Definition $@ is empty, please review script and/or DSAs" 

$(XMLDESTFILES): $(HTMLDIR)/%: %
	@test -d $(HTMLDIR) || mkdir -m g+w -p $(HTMLDIR)
	install -m 664 -p $< $(HTMLDIR)

# TODO 'clean' could also remove the python-compiled files generated
# by Python when running the script
clean::
	  -rm -f oval-definitions-*.xml
	
cleandest::
	  -rm -f $(HTMLDIR)/oval-definitions-*.xml
	
# Remove empty files to force regeneration
check_empty_files:
	@for file in oval-definitions-*.xml; do \
		if [ -e "$$file" -a ! -s "$$file" ] ; then \
			rm $$file ; \
		fi \
	done

.PHONY : check_empty_files

© 2014-2024 Faster IT GmbH | imprint | privacy policy