]> Sergey Matveev's repositories - public-inbox.git/blob - ci/profiles.sh
t/httpd-unix.t: avoid race in between bind() and listen()
[public-inbox.git] / ci / profiles.sh
1 #!/bin/sh
2 # Copyright (C) 2019 all contributors <meta@public-inbox.org>
3 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
4
5 # Prints OS-specific package profiles to stdout (one per-newline) to use
6 # as command-line args for ci/deps.perl.  Called automatically by ci/run.sh
7
8 # set by os-release(5) or similar
9 ID= VERSION_ID=
10 case $(uname -o) in
11 GNU/Linux)
12         for f in /etc/os-release /usr/lib/os-release
13         do
14                 test -f $f || continue
15                 . $f
16
17                 # Debian sid (and testing) have no VERSION_ID
18                 case $ID--$VERSION_ID in
19                 debian--)
20                         case $PRETTY_NAME in
21                         */sid) VERSION_ID=sid ;;
22                         *)
23                                 echo >&2 "$ID, but no VERSION_ID"
24                                 echo >&2 "==> $f <=="
25                                 cat >&2 $f
26                                 exit 1
27                                 ;;
28                         esac
29                         ;;
30                 esac
31
32                 case $ID--$VERSION_ID in
33                 -|*--|--*) continue ;;
34                 *--*) break ;;
35                 esac
36         done
37         ;;
38 FreeBSD)
39         ID=freebsd
40         VERSION_ID=$(uname -r | cut -d . -f 1)
41         test "$VERSION_ID" -lt 11 && {
42                 echo >&2 "ID=$ID $(uname -r) too old to support";
43                 exit 1
44         }
45 esac
46
47 case $ID in
48 freebsd) PKG_FMT=pkg ;;
49 debian|ubuntu) PKG_FMT=deb ;;
50 centos|redhat|fedora) PKG_FMT=rpm ;;
51 *) echo >&2 "PKG_FMT undefined for ID=$ID in $0"
52 esac
53
54 case $ID-$VERSION_ID in
55 freebsd-11|freebsd-12) sed "s/^/$PKG_FMT /" <<EOF
56 all devtest-
57 all devtest IO::KQueue-
58 all devtest IO::KQueue
59 v2essential
60 essential
61 essential devtest-
62 EOF
63         ;;
64 debian-sid|debian-9|debian-10) sed "s/^/$PKG_FMT /" <<EOF
65 all devtest
66 all devtest Search::Xapian-
67 all devtest-
68 v2essential
69 essential
70 essential devtest-
71 EOF
72         ;;
73 centos-7) sed "s/^/$PKG_FMT /" <<EOF
74 v2essential devtest
75 essential devtest
76 all Search::Xapian-
77 EOF
78         ;;
79 esac