Merge branch 'master' of git://git.pcp.io/kenj/pcp into kenj-merge
[pcp.git] / debian / fixcontrol.master
blob2f89083145fdf109efc22baca6f7b7c269e4645a
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'`
63 if $PMDA_PAPI
64 then
65 echo "s/?{libpapi-dev}/libpapi-dev,/" >>$tmp.sed
66 echo "s/?{libpfm4-dev}/libpfm4-dev,/" >>$tmp.sed
67 else
68 echo "s/?{libpapi-dev}//" >>$tmp.sed
69 echo "s/?{libpfm4-dev}//" >>$tmp.sed
72 if $HAVE_PYTHON_JSONPOINTER
73 then
74 echo "s/?{python-json-pointer}/python-json-pointer,/" >>$tmp.sed
75 else
76 echo "s/?{python-json-pointer}//" >>$tmp.sed
79 if $HAVE_PYTHON_REQUESTS
80 then
81 echo "s/?{python-requests}/python-requests,/" >>$tmp.sed
82 else
83 echo "s/?{python-requests}//" >>$tmp.sed
86 sed -f $tmp.sed <control.master