aboutsummaryrefslogtreecommitdiffstats
path: root/main/postgresql/APKBUILD
blob: 6de9ceb15137c7ae69be45f1f0df3005ad63e0f6 (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
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=postgresql
pkgver=9.2.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"
depends_dev="readline-dev openssl-dev zlib-dev libxml2-dev"
makedepends="$depends_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
}

build() {
	cd "$_builddir"
	./configure --prefix=/usr \
		--mandir=/usr/share/man \
		--with-openssl \
		|| 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="6ee5bb53b97da7c6ad9cb0825d3300dd  postgresql-9.2.4.tar.bz2
de29e4cea00a3318a77587fbbc7b6243  initdb.patch
01cc8d4a4cbc77a7b6f84344155232d5  postgresql.initd
ca9759d29dc86402858821d5fdec48a1  postgresql.confd
d2a51db4436e550d56bb1e96699faef4  pg-restore.initd
bf45384752b320b369f1425939763178  pg-restore.confd"
sha256sums="d97dd918a88a4449225998f46aafa85216a3f89163a3411830d6890507ffae93  postgresql-9.2.4.tar.bz2
4942f9ebb71d4d661af9ed5eed5f594e044d07b5b90724834bddaa4eb455d98b  initdb.patch
a2ed1adeb70b0098e7e50f74aa601175b56f643a53836d8d325fcac07eb9e614  postgresql.initd
1fa4243aa2f9f79a6886e7e4733e8e9deec1920019005a98722d58e0dd02c772  postgresql.confd
d73701e9a5fff2d7088ee50d7c7fc8a2fa19f651237d8b880c579e0e09515609  pg-restore.initd
31414d8b57c4cd2116b6014de3f1329875151910753fbd616daec4554866d02f  pg-restore.confd"
sha512sums="1f347a8e75f4c350cc1ee2e0406b1b696f8e82cd259bb17404113874516fdf4c395517962a5320d5c386994cae7ebe7dbdbbeb7ae79c76d6d506ce5bda662c3e  postgresql-9.2.4.tar.bz2
f674d5b0d29d69287a6aaa248a1bca1f96b8915029bb3dfb52e60b279071bdfe161835ea90740c8962419fa736e9e37e0aea6db0eb2666d3559dbaaea0b1c676  initdb.patch
215d3e2a08a018148f901a80e4c915b314188d50874e465a2181259b0dd5f95d4b18e2e3a9e428a1cdff03f51f8ce67245f4503157d542e11519d2d9fba08a80  postgresql.initd
23841c941051d06e43be767a6018973c9195408dc3a93e8e0c3c76aa5679f7b11852c26e0e53af73202b497e520dd88ae20821cc3000abfbfa21b5a428cdb1ec  postgresql.confd
e7f8e08edc54c54c513786f8ea34cb6deac61106cff8004fbe56b9b32b22a4d5acdff256e864ef242b91d7704595fd9ec27ccbcef70da5d5c85f049d92304bf2  pg-restore.initd
c14a5684e914abb3b0ee71bbf15eed71a9264deacaa404a6e3af6bfc330d93e7598624d0ed11a94263106cc660f7f54c8ff57e759033cf606a795f69ff6c1c7c  pg-restore.confd"