File: postinst

package info (click to toggle)
pktrace 1.0.3-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 172 kB
  • ctags: 228
  • sloc: python: 716; ansic: 556; makefile: 46; sh: 37
file content (43 lines) | stat: -rw-r--r-- 1,302 bytes parent folder | download
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
#! /bin/sh -e

# Here we handle compiling the tfm module for the various versions of
# Python which might be installed and set up the alternatives links.

#DEBHELPER#

if [ "$1" != configure ]; then
    exit 0
fi

cd /usr/share/pktrace

if [ -x /usr/bin/python2.1 ]; then
    python2.1 -c 'import py_compile; py_compile.compile("tfm21.py")'
    python2.1 -O -c 'import py_compile; py_compile.compile("tfm21.py")'
    update-alternatives --install \
	/usr/bin/pktrace pktrace /usr/bin/pktrace2.1 50
else
    update-alternatives --install \
	/usr/bin/pktrace pktrace /usr/bin/pktrace2.1 20
fi

if [ -x /usr/bin/python1.5 ]; then
    python1.5 -c 'import py_compile; py_compile.compile("tfm15.py")'
    python1.5 -O -c 'import py_compile; py_compile.compile("tfm15.py")'
    update-alternatives --install \
	/usr/bin/pktrace pktrace /usr/bin/pktrace1.5 40
else
    update-alternatives --install \
	/usr/bin/pktrace pktrace /usr/bin/pktrace1.5 20
fi

if [ -x /usr/bin/python2.2 ]; then
    python2.2 -c 'import py_compile; py_compile.compile("tfm22.py")'
    python2.2 -O -c 'import py_compile; py_compile.compile("tfm22.py")'
    update-alternatives --install \
	/usr/bin/pktrace pktrace /usr/bin/pktrace2.2 30
else
    update-alternatives --install \
	/usr/bin/pktrace pktrace /usr/bin/pktrace2.2 20
fi