~ubuntu-branches/ubuntu/hardy/debian-edu/hardy

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
#!/usr/bin/make -f

# TARGET_DIST is one of stable, sarge, etch, terra, unstable, or any other available
# sources.list file available
TARGET_DIST := $(shell head -1 debian/changelog |awk '{print $$3}'|tr -d ';')
SOURCELIST := ./sources.list.$(TARGET_DIST)

all: debian-edu-tasks.desc debian/control

debian/control: gen-control debian/control.stub debian/changelog tasks/* $(SOURCELIST)
	(cat debian/control.stub; \
	 ./gen-control -s $(SOURCELIST) -D -c -m -i -A) > $@.new && mv $@.new $@

tasksel: debian-edu-tasks.desc
debian-edu-tasks.desc: gen-control tasks/* $(SOURCELIST) debian/changelog
	./gen-control -s $(SOURCELIST) -t -A > debian-edu-tasks.desc.new && mv debian-edu-tasks.desc.new debian-edu-tasks.desc

packages.txt: gen-control tasks/* $(SOURCELIST)
	./gen-control -s $(SOURCELIST) -a > packages.txt.$$$$ && mv packages.txt.$$$$ packages.txt

avoidpackages.txt: gen-control tasks/* $(SOURCELIST)
	./gen-control -s $(SOURCELIST) -e > avoidpackages.txt.$$$$ && mv avoidpackages.txt.$$$$ avoidpackages.txt

by_vote:
	rm -f by_vote
	wget http://developer.skolelinux.no/popcon/by_vote

packages-sorted.txt: packages.txt by_vote
	for pkg in `cat packages.txt` ; do \
		grep " $$pkg " by_vote ; \
	done | LANG=C sort -r -n -k 4 -k 3 > packages-sorted.txt
usage: packages-sorted.txt

clean: 
	rm -rf tmp
	rm -f tasks/*~a
	rm -rf tasksel
	rm -f packages.txt by_vote packages-sorted.txt