File: hylafax-client.postinst

package info (click to toggle)
hylafax 3%3A6.0.7-11.1
  • links: PTS
  • area: main
  • in suites: trixie
  • size: 10,844 kB
  • sloc: sh: 15,305; ansic: 14,429; makefile: 1,562; cpp: 781; awk: 529
file content (52 lines) | stat: -rw-r--r-- 1,354 bytes parent folder | download | duplicates (2)
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
#! /bin/sh -e


#DEBHELPER#

# generate /etc/hylafax/pagesizes

newfile=`tempfile`
chmod a+r "$newfile"
cat /usr/share/hylafax/pagesizes | sed -e 's/^default/#default/' >> "$newfile"
perl -e 'print "default\t\t\t" . `paperconf -N|tr -d "\n"` . "\t";
	print int(`paperconf -mw` * 1200 / 25.4) . "\t";
	print int(`paperconf -mh` * 1200 / 25.4) . "\t";
	print int((`paperconf -mw` * 1200 / 25.4 - 300)*0.962) . "\t";
	print int((`paperconf -mh` * 1200 / 25.4 - 100)*0.948) . "\t";
	print "472\t345\n";' >> "$newfile"

#
# Copy the new pagesizes file in /var/spool/hylafax
# or copy the old one to /etc/hylafax
#

if [ -f /var/spool/hylafax/etc/pagesizes -a -f /etc/hylafax/pagesizes ];
then
	a=$(md5sum /var/spool/hylafax/etc/pagesizes| awk '{print $1}')
	b=$(md5sum /etc/hylafax/pagesizes| awk '{print $1}')
	if [ "$a" != "$b" ]
	then
		if [ /etc/hylafax/pagesizes -nt /var/spool/hylafax/etc/pagesizes ]
		then
			ucf "$newfile" /etc/hylafax/pagesizes
			cp -p /etc/hylafax/pagesizes /var/spool/hylafax/etc/pagesizes
		else
			ucf /var/spool/hylafax/etc/pagesizes /etc/hylafax/pagesizes
		fi
	fi
else
	ucf "$newfile" /etc/hylafax/pagesizes
fi

# register config file with package name to ucf
ucfr hylafax-client /etc/hylafax/pagesizes

rm -f "$newfile"

# see #1064792
if [ ! -e /usr/sbin/textfmt ]
then
	ln -sf ../bin/textfmt /usr/sbin/textfmt
fi

exit 0