blob: f1b0813fc9980a21f70e4c3d0bffd6c02f55c87d (
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
|
#!/bin/sh
set -e
set -u
main()
{
case "${1-}" in
'')
config
;;
'clean')
clean
;;
esac
}
msg()
{
printf 'config: '
printf "${@}"
printf '\n'
}
config()
{
local plat=
local pkg=
plat="$(sed '1{s/^config-\([^ ][^ ]*\) (.*$/\1/;};1!q;' changelog)"
# Make "-common" package to provide source package documentation files.
mkdir -p "config-${plat}-common.pkg"
cat >"config-${plat}-common.pkg/control" <<-EOF
Architecture: all
Platform: all
Description: "${plat}" platform configuration - common files
EOF
>"config-${plat}-common.pkg/docs"
msg 'Metadata for package "%s" generated.' "config-${plat}-common"
# Make each config-* package.
for pkg in src/build/*; do
pkg="${pkg#src/build/}"
mkdir -p "config-${pkg}-${plat}.pkg"
cat >"config-${pkg}-${plat}.pkg/control" <<-EOF
Architecture: all
Platform: all
Depends: config-${plat}-common (= \${Binary-Version})
Description: "${plat}" platform configuration for ${pkg}
EOF
msg 'Metadata for package "%s" generated.' \
"config-${pkg}-${plat}"
done
for pkg in src/run/*; do
pkg="${pkg#src/run/}"
mkdir -p "config-${pkg}.pkg"
cat >"config-${pkg}.pkg/control" <<-EOF
Architecture: all
Platform: ${plat}
Depends: config-${plat}-common (= \${Binary-Version})
Description: "${plat}" platform configuration for ${pkg}
EOF
msg 'Metadata for package "%s" generated.' \
"config-${pkg}"
done
}
clean()
{
rm -Rf config-*.pkg/
}
main "${@}"
|