aboutsummaryrefslogtreecommitdiffstats
path: root/main/postgresql/APKBUILD
blob: 62c8a78edca72742f557e85b2df6d9a85d7f07ba (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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=postgresql
pkgver=9.5.4
pkgrel=0
pkgdesc="A sophisticated object-relational DBMS"
url="http://www.postgresql.org/"
arch="all"
license="BSD"
depends="postgresql-client"
install="$pkgname.pre-upgrade"
pkgusers="postgres"
pkggroups="postgres"
depends_dev="openssl-dev"
makedepends="$depends_dev libedit-dev zlib-dev libxml2-dev util-linux-dev
	openldap-dev"
subpackages="$pkgname-dev $pkgname-doc libpq $pkgname-libs $pkgname-client
	$pkgname-contrib"
patches="initdb.patch"
source="ftp://ftp.$pkgname.org/pub/source/v$pkgver/$pkgname-$pkgver.tar.bz2
	$patches
	$pkgname.initd
	$pkgname.confd
	pg-restore.initd
	pg-restore.confd
	"

_builddir="$srcdir"/$pkgname-$pkgver
prepare() {
	cd "$_builddir"
	for i in $patches; do
		msg $i
		patch -p1 -i "$srcdir"/$i || return 1
	done
	# sanity check of conf.d
	(
	. "$srcdir"/postgresql.confd
	_datadir=/var/lib/postgresql/${pkgver%.*}/data
	if [ "$_datadir" != "$PGDATA" ]; then
		die "PGDATA is $PGDATA while $_datadir is expected"
	fi
	) || return 1
}

build() {
	cd "$_builddir"
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--mandir=/usr/share/man \
		--with-ldap \
		--with-libedit-preferred \
		--with-libxml \
		--with-openssl \
		--with-uuid=e2fs \
		|| return 1

	make world || return 1
}

package() {
	cd "$_builddir"
	make DESTDIR="$pkgdir" install install-docs || return 1
	install -d -m755 -o postgres -g postgres \
		"$pkgdir"/var/lib/postgresql || return 1

	install -D -m755 "$srcdir"/postgresql.initd \
		"$pkgdir"/etc/init.d/postgresql || return 1
	install -D -m644 "$srcdir"/postgresql.confd \
		"$pkgdir"/etc/conf.d/postgresql || return 1 
	install -D -m755 "$srcdir"/pg-restore.initd \
		"$pkgdir"/etc/init.d/pg-restore || return 1
	install -D -m644 "$srcdir"/pg-restore.confd \
		"$pkgdir"/etc/conf.d/pg-restore || return 1
}

dev() {
	default_dev
	mkdir -p "$subpkgdir"/usr/bin "$subpkgdir"/usr/lib/postgresql
	mv "$pkgdir"/usr/bin/pg_config \
		"$pkgdir"/usr/bin/ecpg \
		"$subpkgdir"/usr/bin/ || return 1
	mv "$pkgdir"/usr/lib/postgresql/pgxs \
		"$subpkgdir"/usr/lib/postgresql/ || return 1
}

libpq() {
	depends=
	pkgdesc="PostgreSQL libraries"
	mkdir -p "$subpkgdir"/usr/lib
	mv "$pkgdir"/usr/lib/libpq.so.* "$subpkgdir"/usr/lib/
}

libs() {
	depends=
	default_libs
}

client() {
	depends=
	pkgdesc="PostgreSQL client"
	mkdir -p "$subpkgdir"/usr/bin
	mv "$pkgdir"/usr/bin/psql "$subpkgdir"/usr/bin/
}

contrib() {
	depends=
	pkgdesc="Extension modules distributed with PostgreSQL"
	cd "$_builddir"
	make DESTDIR="$subpkgdir" -C contrib install || return 1
}

md5sums="ad36fcf624748b8ed67783ad04529f43  postgresql-9.5.4.tar.bz2
538fa611966ee43c001dafdc1587c170  initdb.patch
a7a193cce4443998e3a47fde4f10723e  postgresql.initd
bc6fc0c00be27e64431dd8f99f454dd2  postgresql.confd
140ed427fe54b435064f0e3c6f683aea  pg-restore.initd
bf45384752b320b369f1425939763178  pg-restore.confd"
sha256sums="cf5e571164ad66028ecd7dd8819e3765470d45bcd440d258b686be7e69c76ed0  postgresql-9.5.4.tar.bz2
abd3761ecb47e41625d21bfda6a36badb047b0bedfd7cf0b1fbe61914fb3c9bc  initdb.patch
af57a4190b1f5019290d26429b973d31465a8224a2e552fc3ecaf4fb4e471d7f  postgresql.initd
1266f5bf116f936099bd3ffe7eef1728bfaaa29049d506dad77b56b81ae8cedb  postgresql.confd
e509cdb77a4be8a74381b039bb8e5dc3a7b7ef3375785acf967092e4e6a34215  pg-restore.initd
31414d8b57c4cd2116b6014de3f1329875151910753fbd616daec4554866d02f  pg-restore.confd"
sha512sums="e5220bc967443d54b9dcff7ba5aefccedbe1c219f953eb0d67254c709d52b0e647d1dc473446640804165b596fc5b75fa4ff8d63696123b87d8096c3a7795c34  postgresql-9.5.4.tar.bz2
0b88eee78380ed6cf543c851ac1cea5fc50bb6ef1bb51e03694003f43d2bf4e117ff06657f958d0e9c00ace3b8a6bab6ed0bd017d23f80cfd203dab33da81d46  initdb.patch
af37b100cc67769817e4c9e997abecf50475d7f0bf9b0f1d51bf8454d45abd6c87d5d315ed6cafd14e0dd059e96723a6203b756236070d12968816666e63e522  postgresql.initd
280b759c692d9399b7204744c6c2220c390e53351f33ab53ad4a3399446f7ee29d5c1a8d9087429a9246d8d10a759c861d9ac42d968a9358423bad9281748ec2  postgresql.confd
f5a1cba051e7d846c2d16703514601cb25729ed96b677c9bd0c199d64552120a8b14b238af01917fdb87106681e12dee6fff7447558155ba273e4f96be5e2892  pg-restore.initd
c14a5684e914abb3b0ee71bbf15eed71a9264deacaa404a6e3af6bfc330d93e7598624d0ed11a94263106cc660f7f54c8ff57e759033cf606a795f69ff6c1c7c  pg-restore.confd"