summaryrefslogtreecommitdiff
path: root/debian/postinst
blob: 89a5bcb076d8ec22af5b1cc5d29f30e58ff0a65a (plain)
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
#!/bin/sh

set -e

case $1 in
	configure)
		# disable mandb
		dpkg-divert --add --package pgdg-buildenv --rename /usr/bin/mandb
		test -e /usr/bin/mandb || ln -s /bin/true /usr/bin/mandb

		# remove existing apt translations so apt does not try to refresh them
		rm -vf /var/lib/apt/lists/*Translation*

		# install locales for the PostgreSQL testsuite
		vendor=$(lsb_release -is)
		case $vendor in
			Ubuntu)
				locale-gen en_US.UTF-8 ru_RU ru_RU.UTF-8
				;;
			*)
				while read locale ; do
					if ! grep -q "^$locale\$" /etc/locale.gen ; then
						echo "$locale" >> /etc/locale.gen
						run=1
					fi
				done <<-EOF
				en_US.UTF-8 UTF-8
				ru_RU ISO-8859-5
				ru_RU.UTF-8 UTF-8
				EOF
				[ "$run" ] && locale-gen
				;;
		esac
		;;
esac

#DEBHELPER#

exit 0