aboutsummaryrefslogtreecommitdiffstats
path: root/main/postgresql/APKBUILD
blob: 63074ae3dfb45683660cfa3a7640e5309ac1b090 (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
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=postgresql
pkgver=9.4.3
pkgrel=0
pkgdesc="A sophisticated object-relational DBMS"
url="http://www.postgresql.org/"
arch="all"
license="BSD"
depends="postgresql-client"
install="$pkgname.pre-upgrade"
depends_dev="openssl-dev"
makedepends="$depends_dev libedit-dev zlib-dev libxml2-dev"
subpackages="$pkgname-dev $pkgname-doc libpq $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-openssl \
		--with-libedit-preferred \
		|| return 1

	make world || return 1
}

package() {
	cd "$_builddir"
	make DESTDIR="$pkgdir" install install-docs || 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
}

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

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="05217e0921b51fb886e9e50875776bf1  postgresql-9.4.3.tar.bz2
00f0fc07fb8447f7e174c4cee0661722  initdb.patch
a7a193cce4443998e3a47fde4f10723e  postgresql.initd
199747784fcba0a92e55283b90993d78  postgresql.confd
140ed427fe54b435064f0e3c6f683aea  pg-restore.initd
bf45384752b320b369f1425939763178  pg-restore.confd"
sha256sums="734acfd2ac352dd0cd353d226f3199c2e1a2730200998aea5b38cf685136d755  postgresql-9.4.3.tar.bz2
36a65229bf31b20a95ff2e2cac1a6ece0c61afdcd0b544759ad12f34d1b98a39  initdb.patch
af57a4190b1f5019290d26429b973d31465a8224a2e552fc3ecaf4fb4e471d7f  postgresql.initd
70ac7bf24556c16e6324b4efe76fba425bb09a2f7e74afbb5f988333eb8df724  postgresql.confd
e509cdb77a4be8a74381b039bb8e5dc3a7b7ef3375785acf967092e4e6a34215  pg-restore.initd
31414d8b57c4cd2116b6014de3f1329875151910753fbd616daec4554866d02f  pg-restore.confd"
sha512sums="8d860c982f3cf62c9f9ef4aad7c2d637e1cf8285338d57fca833051d66747660ecbf46b351a2a1f81ba3fe150c8700e76dcc5219adbf07e9adccfde9f52ae9f1  postgresql-9.4.3.tar.bz2
6f7fdceb1a5aba3f00894ae88afdf25e5f9c7a0ffc00b11211011a6415ea73639d6a67f516cab66c6487484bab26ded3c93471d6d41ac0d3822926c22274f2ba  initdb.patch
af37b100cc67769817e4c9e997abecf50475d7f0bf9b0f1d51bf8454d45abd6c87d5d315ed6cafd14e0dd059e96723a6203b756236070d12968816666e63e522  postgresql.initd
e906e23241bed2624719c1e7e5305695cce1cb520f26f6a4c6bbb994f59db3cc4c63afcfe0e7fb705ad4691dd0a911770012fc16819e4c2686c7029e1e4a4a45  postgresql.confd
f5a1cba051e7d846c2d16703514601cb25729ed96b677c9bd0c199d64552120a8b14b238af01917fdb87106681e12dee6fff7447558155ba273e4f96be5e2892  pg-restore.initd
c14a5684e914abb3b0ee71bbf15eed71a9264deacaa404a6e3af6bfc330d93e7598624d0ed11a94263106cc660f7f54c8ff57e759033cf606a795f69ff6c1c7c  pg-restore.confd"