pmval: improve handling of shifting metric instances
[pcp.git] / debian / fixcontrol.master
blob0329231415c3a2510ae1332a10d9a9d87224164b
1 #!/bin/sh
3 # generate control preamble from control.master
5 tmp=/var/tmp/$$
6 trap "rm -f $tmp.*; exit 0" 0 1 2 3 15
9 # dh-python not always available ... this is not checked for in configure
10 # so have to base it on the platform type and version
12 rm -f $tmp.no
14 if [ -f /etc/os-release ]
15 then
16 NAME=`sed -n -e 's/"//'g -e '/^NAME=/s/NAME=//p' </etc/os-release`
17 if [ "$NAME" = "Debian GNU/Linux" ]
18 then
19 VERSION_ID=`sed -n -e 's/"//'g -e '/^VERSION_ID=/s/VERSION_ID=//p' </etc/os-release`
20 case "$VERSION_ID"
23 touch $tmp.no
25 esac
26 elif [ "$NAME" = "Ubuntu" ]
27 then
28 VERSION_ID=`sed -n -e 's/"//'g -e '/^VERSION_ID=/s/VERSION_ID=//p' </etc/os-release`
29 case "$VERSION_ID"
31 12.04|12.10|13.04)
32 touch $tmp.no
34 esac
36 elif [ -f /etc/debian_version ]
37 then
38 VERSION_ID=`cat /etc/debian_version`
39 case "$VERSION_ID"
41 6.*)
42 touch $tmp.no
44 esac
47 if [ -f $tmp.no ]
48 then
49 echo "s/?{dh-python}//" >>$tmp.sed
50 else
51 echo "s/?{dh-python}/dh-python,/" >>$tmp.sed
54 # for some others we rely on what configure has discovered
56 if [ ! -f ../src/include/builddefs ]
57 then
58 echo "fixcontrol.master: Botch: ../src/include/builddefs does not exist"
59 exit 1
62 eval `egrep '^(PMDA_|HAVE_)' ../src/include/builddefs | sed -e 's/ //g'`
64 if $PMDA_PAPI
65 then
66 echo "s/?{libpapi-dev}/libpapi-dev [!s390x],/" >>$tmp.sed
67 else
68 echo "s/?{libpapi-dev}//" >>$tmp.sed
71 if $PMDA_PERFEVENT
72 then
73 echo "s/?{libpfm4-dev}/libpfm4-dev,/" >>$tmp.sed
74 else
75 echo "s/?{libpfm4-dev}//" >>$tmp.sed
78 if $HAVE_PYTHON_JSONPOINTER
79 then
80 echo "s/?{python-json-pointer}/python-json-pointer,/" >>$tmp.sed
81 else
82 echo "s/?{python-json-pointer}//" >>$tmp.sed
85 if $HAVE_PYTHON_REQUESTS
86 then
87 echo "s/?{python-requests}/python-requests,/" >>$tmp.sed
88 else
89 echo "s/?{python-requests}//" >>$tmp.sed
92 sed -f $tmp.sed <control.master