| 1 |
PYTHON = python
|
| 2 |
PYTHON_MODULES = $(wildcard lib/python/*.py)
|
| 3 |
BUG_LISTS = $(wildcard data/*/list)
|
| 4 |
|
| 5 |
# Adjust these if necessary. The architecture selection is rather
|
| 6 |
# arbitrary at the moment. More architectures can be added later.
|
| 7 |
|
| 8 |
MIRROR = http://ftp.de.debian.org/debian/
|
| 9 |
LENNY_ARCHS = alpha amd64 arm armel hppa i386 ia64 mips mipsel powerpc s390 sparc
|
| 10 |
SQUEEZE_ARCHS = amd64 armel hppa i386 ia64 mips mipsel powerpc s390 sparc
|
| 11 |
SID_ARCHS = alpha amd64 armel hppa i386 ia64 kfreebsd-i386 kfreebsd-amd64 mips mipsel powerpc s390 sparc
|
| 12 |
|
| 13 |
STABLE = lenny
|
| 14 |
TESTING = squeeze
|
| 15 |
|
| 16 |
STABLE_uc = $(shell echo "$(STABLE)" | tr "[:lower:]" "[:upper:]")
|
| 17 |
TESTING_uc = $(shell echo "$(TESTING)" | tr "[:lower:]" "[:upper:]")
|
| 18 |
|
| 19 |
all:
|
| 20 |
rm -f data/security-new.db data/security-new.db.journal
|
| 21 |
if test -e data/security.db; then cp data/security.db data/security-new.db; fi
|
| 22 |
$(PYTHON) bin/update-db data/security-new.db
|
| 23 |
mv data/security-new.db data/security.db
|
| 24 |
|
| 25 |
clean:
|
| 26 |
-rm data/security.db lib/python/test_security.db
|
| 27 |
-rm stamps/*-*
|
| 28 |
|
| 29 |
.PHONY: check check-syntax
|
| 30 |
|
| 31 |
test check: check-syntax
|
| 32 |
|
| 33 |
check-syntax: stamps/CVE-syntax \
|
| 34 |
stamps/DSA-syntax stamps/DTSA-syntax
|
| 35 |
|
| 36 |
stamps/CVE-syntax: data/CVE/list bin/check-syntax $(PYTHON_MODULES)
|
| 37 |
$(PYTHON) bin/check-syntax CVE data/CVE/list
|
| 38 |
touch $@
|
| 39 |
|
| 40 |
stamps/DSA-syntax: data/DSA/list bin/check-syntax $(PYTHON_MODULES)
|
| 41 |
$(PYTHON) bin/check-syntax DSA data/DSA/list
|
| 42 |
touch $@
|
| 43 |
|
| 44 |
stamps/DTSA-syntax: data/DTSA/list bin/check-syntax $(PYTHON_MODULES)
|
| 45 |
$(PYTHON) bin/check-syntax DTSA data/DTSA/list
|
| 46 |
touch $@
|
| 47 |
|
| 48 |
.PHONY: serve
|
| 49 |
serve:
|
| 50 |
@bash bin/test-web-server
|
| 51 |
|
| 52 |
.PHONY: update-packages update-testing update-stable
|
| 53 |
update-packages: update-testing
|
| 54 |
set -e ; for rel in sid experimental ; do \
|
| 55 |
for archive in main contrib non-free ; do \
|
| 56 |
$(PYTHON) bin/apt-update-file \
|
| 57 |
$(MIRROR)/dists/$$rel/$$archive/source/Sources \
|
| 58 |
data/packages/$${rel}__$${archive}_Sources ; \
|
| 59 |
done ; \
|
| 60 |
for arch in $(SID_ARCHS) ; do \
|
| 61 |
for archive in main contrib non-free ; do \
|
| 62 |
$(PYTHON) bin/apt-update-file \
|
| 63 |
$(MIRROR)/dists/$$rel/$$archive/binary-$$arch/Packages \
|
| 64 |
data/packages/$${rel}__$${archive}_$${arch}_Packages ; \
|
| 65 |
done ; \
|
| 66 |
done ; \
|
| 67 |
done
|
| 68 |
|
| 69 |
update-testing:
|
| 70 |
set -e ; for rel in $(TESTING) ; do \
|
| 71 |
for archive in main contrib non-free ; do \
|
| 72 |
$(PYTHON) bin/apt-update-file \
|
| 73 |
$(MIRROR)/dists/$$rel/$$archive/source/Sources \
|
| 74 |
data/packages/$${rel}__$${archive}_Sources ; \
|
| 75 |
done ; \
|
| 76 |
for arch in $($(TESTING_uc)_ARCHS) ; do \
|
| 77 |
for archive in main contrib non-free ; do \
|
| 78 |
$(PYTHON) bin/apt-update-file \
|
| 79 |
$(MIRROR)/dists/$$rel/$$archive/binary-$$arch/Packages \
|
| 80 |
data/packages/$${rel}__$${archive}_$${arch}_Packages ; \
|
| 81 |
done ; \
|
| 82 |
done ; \
|
| 83 |
done
|
| 84 |
|
| 85 |
update-stable:
|
| 86 |
set -e ; for rel in $(STABLE) ; do \
|
| 87 |
for archive in main contrib non-free ; do \
|
| 88 |
$(PYTHON) bin/apt-update-file \
|
| 89 |
$(MIRROR)/dists/$$rel/$$archive/source/Sources \
|
| 90 |
data/packages/$${rel}__$${archive}_Sources ; \
|
| 91 |
done ; \
|
| 92 |
for arch in $($(STABLE_uc)_ARCHS) ; do \
|
| 93 |
for archive in main contrib non-free ; do \
|
| 94 |
$(PYTHON) bin/apt-update-file \
|
| 95 |
$(MIRROR)/dists/$$rel/$$archive/binary-$$arch/Packages \
|
| 96 |
data/packages/$${rel}__$${archive}_$${arch}_Packages ; \
|
| 97 |
done ; \
|
| 98 |
done ; \
|
| 99 |
done
|
| 100 |
|
| 101 |
.PHONY: update-security update-old-security update-testing-security
|
| 102 |
ST_MIRROR = http://security.debian.org/dists/$(TESTING)/updates
|
| 103 |
ST_FILE = data/packages/$(TESTING)_security_
|
| 104 |
update-testing-security:
|
| 105 |
$(PYTHON) bin/apt-update-file \
|
| 106 |
$(ST_MIRROR)/main/source/Sources $(ST_FILE)main_Sources
|
| 107 |
set -e ; for arch in $($(TESTING_uc)_ARCHS) ; do \
|
| 108 |
$(PYTHON) bin/apt-update-file \
|
| 109 |
$(ST_MIRROR)/main/binary-$${arch}/Packages $(ST_FILE)main_$${arch}_Packages ; \
|
| 110 |
done
|
| 111 |
|
| 112 |
SEC_MIRROR = http://security.debian.org/dists
|
| 113 |
update-security: update-old-security
|
| 114 |
for archive in $(STABLE); do \
|
| 115 |
for section in main contrib non-free ; do \
|
| 116 |
$(PYTHON) bin/apt-update-file \
|
| 117 |
$(SEC_MIRROR)/$$archive/updates/$$section/source/Sources \
|
| 118 |
data/packages/$${archive}_security_$${section}_Sources ; \
|
| 119 |
for arch in $($(STABLE_uc)_ARCHS) ; do \
|
| 120 |
$(PYTHON) bin/apt-update-file \
|
| 121 |
$(SEC_MIRROR)/$$archive/updates/$$section/binary-$$arch/Packages \
|
| 122 |
data/packages/$${archive}_security_$${section}_$${arch}_Packages ; \
|
| 123 |
done ; \
|
| 124 |
done ; \
|
| 125 |
done
|
| 126 |
|
| 127 |
VOLATILE_MIRROR = http://volatile.debian.net/debian-volatile/dists
|
| 128 |
update-volatile:
|
| 129 |
set -e && for archive in $(STABLE) ; do \
|
| 130 |
for arch in $(LENNY_ARCHS) ; do \
|
| 131 |
$(PYTHON) bin/apt-update-file \
|
| 132 |
$(VOLATILE_MIRROR)/$${archive}/volatile/main/binary-$$arch/Packages \
|
| 133 |
data/packages/$${archive}-volatile__main_$${arch}_Packages ; \
|
| 134 |
done ; \
|
| 135 |
$(PYTHON) bin/apt-update-file \
|
| 136 |
$(VOLATILE_MIRROR)/$${archive}/volatile/main/source/Sources \
|
| 137 |
data/packages/$${archive}-volatile__main_Sources ; \
|
| 138 |
done
|
| 139 |
$(PYTHON) bin/apt-update-file \
|
| 140 |
$(VOLATILE_MIRROR)/lenny/volatile/main/binary-armel/Packages \
|
| 141 |
data/packages/lenny-volatile__main_armel_Packages
|
| 142 |
|
| 143 |
BACKPORTS_MIRROR = http://www.backports.org/backports.org/dists
|
| 144 |
update-backports:
|
| 145 |
set -e && for archive in $(STABLE) ; do \
|
| 146 |
for arch in $(LENNY_ARCHS) ; do \
|
| 147 |
$(PYTHON) bin/apt-update-file \
|
| 148 |
$(BACKPORTS_MIRROR)/$${archive}-backports/main/binary-$$arch/Packages \
|
| 149 |
data/packages/$${archive}-backports__main_$${arch}_Packages ; \
|
| 150 |
done ; \
|
| 151 |
$(PYTHON) bin/apt-update-file \
|
| 152 |
$(BACKPORTS_MIRROR)/$${archive}-backports/main/source/Sources \
|
| 153 |
data/packages/$${archive}-backports__main_Sources ; \
|
| 154 |
done
|
| 155 |
$(PYTHON) bin/apt-update-file \
|
| 156 |
$(BACKPORTS_MIRROR)/lenny-backports/main/binary-armel/Packages \
|
| 157 |
data/packages/lenny-backports__main_armel_Packages
|
| 158 |
|
| 159 |
update-lists:
|
| 160 |
svn update -q data
|
| 161 |
|
| 162 |
update-nvd:
|
| 163 |
for x in $$(seq 2002 $$(date +%Y)) ; do \
|
| 164 |
name=nvdcve-$$x.xml; \
|
| 165 |
wget -q -Odata/nvd/$$name http://nvd.nist.gov/download/$$name || true; \
|
| 166 |
done
|
| 167 |
python bin/update-nvd data/nvd/nvdcve-*.xml
|