2011-05-15 10:29:43 +08:00
|
|
|
#
|
|
|
|
# Chakra Packages for Chakra, part of chakra-project.org
|
|
|
|
#
|
|
|
|
# maintainer (i686): Phil Miller <philm[at]chakra-project[dog]org>
|
|
|
|
# maintainer (x86_64): Manuel Tortosa <manutortosa[at]chakra-project[dot]org>
|
2010-03-14 23:48:48 +08:00
|
|
|
|
2011-05-31 03:46:36 +08:00
|
|
|
pkgbase=postgresql
|
2012-01-12 03:19:57 +08:00
|
|
|
pkgname=('postgresql-libs' 'postgresql-docs' 'postgresql')
|
2012-09-27 05:28:49 +08:00
|
|
|
pkgver=9.2.1
|
2012-01-12 03:19:57 +08:00
|
|
|
_majorver=${pkgver%.*}
|
2012-09-27 05:28:49 +08:00
|
|
|
pkgrel=1
|
2010-03-14 23:48:48 +08:00
|
|
|
arch=('i686' 'x86_64')
|
2012-01-12 03:19:57 +08:00
|
|
|
url="http://www.postgresql.org/"
|
2011-05-31 03:46:36 +08:00
|
|
|
license=('custom:PostgreSQL')
|
2012-09-27 05:28:49 +08:00
|
|
|
makedepends=('krb5' 'libxml2' 'python2' 'perl' 'tcl' 'openssl>=1.0.0')
|
|
|
|
source=("ftp://ftp.postgresql.org/pub/source/v${pkgver}/postgresql-${pkgver}.tar.bz2"
|
|
|
|
'postgresql.rcd'
|
|
|
|
'postgresql.confd'
|
|
|
|
'postgresql.pam'
|
|
|
|
'postgresql.logrotate'
|
|
|
|
'postgresql.service'
|
|
|
|
'postgresql-initdb')
|
|
|
|
sha256sums=('db61d498105a7d5fe46185e67ac830c878cdd7dc1f82a87f06b842217924c461'
|
|
|
|
'b2931d7a719e765f14811b9109310b2418d3064bfcedef699573fc25854a2201'
|
|
|
|
'3de5c059eead8816db15c2c5588e6196d6c4b0d704faf1a20912796cf589ba81'
|
|
|
|
'57dfd072fd7ef0018c6b0a798367aac1abb5979060ff3f9df22d1048bb71c0d5'
|
|
|
|
'6abb842764bbed74ea4a269d24f1e73d1c0b1d8ecd6e2e6fb5fb10590298605e'
|
|
|
|
'7014ccc8f3bbac8be9473a43fca2ed4037ee04e56d8e07d6027b3b4ef0317c89'
|
|
|
|
'c22f82a3cf5b555935039853fab2d7e5ff6188cdb1fb528fa9171a87b94f42b0')
|
2010-03-14 23:48:48 +08:00
|
|
|
|
|
|
|
build() {
|
2012-01-12 03:19:57 +08:00
|
|
|
cd "${srcdir}/postgresql-${pkgver}"
|
2010-03-14 23:48:48 +08:00
|
|
|
|
2012-09-27 05:28:49 +08:00
|
|
|
./configure --prefix=/usr \
|
|
|
|
--mandir=/usr/share/man \
|
|
|
|
--datadir=/usr/share/postgresql \
|
|
|
|
--with-krb5 \
|
|
|
|
--with-libxml \
|
|
|
|
--with-openssl \
|
|
|
|
--with-perl \
|
|
|
|
--with-python PYTHON=/usr/bin/python2 \
|
|
|
|
--with-tcl \
|
|
|
|
--with-pam \
|
|
|
|
--with-system-tzdata=/usr/share/zoneinfo \
|
|
|
|
--enable-nls \
|
|
|
|
--enable-thread-safety
|
2010-03-14 23:48:48 +08:00
|
|
|
|
2011-05-31 03:46:36 +08:00
|
|
|
make world
|
2010-03-14 23:48:48 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
package_postgresql-libs() {
|
|
|
|
pkgdesc="Libraries for use with PostgreSQL"
|
2012-09-27 05:28:49 +08:00
|
|
|
depends=('krb5' 'openssl>=1.0.0' 'readline>=6.0')
|
2012-01-12 03:19:57 +08:00
|
|
|
provides=('postgresql-client')
|
|
|
|
conflicts=('postgresql-client')
|
2010-03-14 23:48:48 +08:00
|
|
|
|
2012-01-12 03:19:57 +08:00
|
|
|
cd "${srcdir}/postgresql-${pkgver}"
|
2011-05-31 03:46:36 +08:00
|
|
|
|
|
|
|
# install license
|
2012-09-27 05:28:49 +08:00
|
|
|
install -Dm0644 COPYRIGHT "${pkgdir}/usr/share/licenses/postgresql-libs/LICENSE"
|
2010-03-14 23:48:48 +08:00
|
|
|
|
|
|
|
# install libs
|
2012-01-12 03:19:57 +08:00
|
|
|
for dir in src/interfaces src/bin/pg_config src/bin/psql; do
|
|
|
|
make -C ${dir} DESTDIR="${pkgdir}" install
|
2010-03-14 23:48:48 +08:00
|
|
|
done
|
|
|
|
|
2012-09-27 05:28:49 +08:00
|
|
|
install -D -m0644 doc/src/sgml/man1/pg_config.1 "${pkgdir}/usr/share/man/man1/pg_config.1"
|
|
|
|
install -D -m0644 doc/src/sgml/man1/psql.1 "${pkgdir}/usr/share/man/man1/psql.1"
|
2011-05-31 03:46:36 +08:00
|
|
|
|
|
|
|
cd src/include
|
2010-03-14 23:48:48 +08:00
|
|
|
|
2011-05-31 03:46:36 +08:00
|
|
|
mkdir -p "${pkgdir}"/usr/include/{libpq,postgresql/internal/libpq}
|
2010-03-14 23:48:48 +08:00
|
|
|
|
|
|
|
# these headers are needed by the public headers of the interfaces
|
2012-09-27 05:28:49 +08:00
|
|
|
install -m0644 pg_config.h "${pkgdir}/usr/include/"
|
|
|
|
install -m0644 pg_config_os.h "${pkgdir}/usr/include/"
|
|
|
|
install -m0644 postgres_ext.h "${pkgdir}/usr/include/"
|
|
|
|
install -m0644 libpq/libpq-fs.h "${pkgdir}/usr/include/libpq/"
|
|
|
|
install -m0644 pg_config_manual.h "${pkgdir}/usr/include/"
|
2010-03-14 23:48:48 +08:00
|
|
|
|
|
|
|
# these headers are needed by the not-so-public headers of the interfaces
|
2012-09-27 05:28:49 +08:00
|
|
|
install -m0644 c.h "${pkgdir}/usr/include/postgresql/internal/"
|
|
|
|
install -m0644 port.h "${pkgdir}/usr/include/postgresql/internal/"
|
|
|
|
install -m0644 postgres_fe.h "${pkgdir}/usr/include/postgresql/internal/"
|
|
|
|
install -m0644 libpq/pqcomm.h "${pkgdir}/usr/include/postgresql/internal/libpq/"
|
2010-03-14 23:48:48 +08:00
|
|
|
}
|
|
|
|
|
2012-01-12 03:19:57 +08:00
|
|
|
package_postgresql-docs() {
|
|
|
|
pkgdesc="HTML documentation for PostgreSQL"
|
|
|
|
options=(docs)
|
|
|
|
|
|
|
|
cd "${srcdir}/postgresql-${pkgver}"
|
|
|
|
|
|
|
|
# install license
|
2012-09-27 05:28:49 +08:00
|
|
|
install -Dm0644 COPYRIGHT "${pkgdir}/usr/share/licenses/postgresql-docs/LICENSE"
|
2012-01-12 03:19:57 +08:00
|
|
|
|
|
|
|
make -C doc/src/sgml DESTDIR="${pkgdir}" install-html
|
|
|
|
chown -R root:root "${pkgdir}/usr/share/doc/postgresql/html/"
|
|
|
|
|
|
|
|
# clean up
|
|
|
|
rmdir "${pkgdir}"/usr/share/man/man{1,3,7}
|
|
|
|
rmdir "${pkgdir}"/usr/share/man
|
|
|
|
}
|
|
|
|
|
2010-03-14 23:48:48 +08:00
|
|
|
package_postgresql() {
|
|
|
|
pkgdesc="A sophisticated object-relational DBMS"
|
2011-05-31 03:46:36 +08:00
|
|
|
backup=('etc/conf.d/postgresql' 'etc/pam.d/postgresql' 'etc/logrotate.d/postgresql')
|
2012-09-27 05:28:49 +08:00
|
|
|
depends=("postgresql-libs>=${pkgver}" 'krb5' 'libxml2' 'readline>=6.0' 'openssl>=1.0.0')
|
2011-05-31 03:46:36 +08:00
|
|
|
optdepends=('python2: for PL/Python support'
|
2012-01-12 03:19:57 +08:00
|
|
|
'perl: for PL/Perl support'
|
2012-09-27 05:28:49 +08:00
|
|
|
'tcl: for PL/Tcl support'
|
2012-01-12 03:19:57 +08:00
|
|
|
'postgresql-old-upgrade: upgrade from previous major version using pg_upgrade')
|
|
|
|
install=postgresql.install
|
2010-03-14 23:48:48 +08:00
|
|
|
|
2012-01-12 03:19:57 +08:00
|
|
|
cd "${srcdir}/postgresql-${pkgver}"
|
2010-03-14 23:48:48 +08:00
|
|
|
|
|
|
|
# install
|
2011-05-31 03:46:36 +08:00
|
|
|
make DESTDIR="${pkgdir}" install
|
|
|
|
make -C contrib DESTDIR="${pkgdir}" install
|
|
|
|
make -C doc/src/sgml DESTDIR="${pkgdir}" install-man
|
2012-01-12 03:19:57 +08:00
|
|
|
|
|
|
|
# we don't want these, they are in the -libs package
|
|
|
|
for dir in src/interfaces src/bin/pg_config src/bin/psql; do
|
|
|
|
make -C ${dir} DESTDIR="${pkgdir}" uninstall
|
|
|
|
done
|
2011-05-31 03:46:36 +08:00
|
|
|
rm "${pkgdir}/usr/share/man/man1/pg_config.1"
|
2012-01-12 03:19:57 +08:00
|
|
|
rm "${pkgdir}/usr/share/man/man1/psql.1"
|
2010-03-14 23:48:48 +08:00
|
|
|
|
2011-05-31 03:46:36 +08:00
|
|
|
# install license
|
2012-09-27 05:28:49 +08:00
|
|
|
install -D -m0644 COPYRIGHT "${pkgdir}/usr/share/licenses/${pkgbase}/LICENSE"
|
2010-03-14 23:48:48 +08:00
|
|
|
|
|
|
|
# clean up unneeded installed items
|
2011-05-31 03:46:36 +08:00
|
|
|
rm -rf "${pkgdir}/usr/include/postgresql/internal"
|
|
|
|
rm -rf "${pkgdir}/usr/include/libpq"
|
2012-01-12 03:19:57 +08:00
|
|
|
find "${pkgdir}/usr/include" -maxdepth 1 -type f -execdir rm {} +
|
|
|
|
rmdir "${pkgdir}/usr/share/doc/postgresql/html"
|
2010-03-14 23:48:48 +08:00
|
|
|
|
|
|
|
# install launch script
|
2012-09-27 05:28:49 +08:00
|
|
|
install -Dm0755 "${srcdir}/postgresql.rcd" "${pkgdir}/etc/rc.d/postgresql"
|
2010-03-14 23:48:48 +08:00
|
|
|
|
|
|
|
# install conf file
|
2012-09-27 05:28:49 +08:00
|
|
|
install -Dm0644 "${srcdir}/postgresql.confd" "${pkgdir}/etc/conf.d/postgresql"
|
2010-03-14 23:48:48 +08:00
|
|
|
|
2012-09-27 05:28:49 +08:00
|
|
|
# install pam file
|
|
|
|
install -Dm0644 "${srcdir}/postgresql.pam" "${pkgdir}/etc/pam.d/postgresql"
|
2010-03-14 23:48:48 +08:00
|
|
|
|
2012-09-27 05:28:49 +08:00
|
|
|
# install logrotate file
|
|
|
|
install -Dm0644 "${srcdir}/postgresql.logrotate" "${pkgdir}/etc/logrotate.d/postgresql"
|
2010-03-14 23:48:48 +08:00
|
|
|
|
2012-06-23 23:38:19 +08:00
|
|
|
# install systemd unit
|
2012-09-27 05:28:49 +08:00
|
|
|
install -Dm0644 "${srcdir}/postgresql.service" "${pkgdir}/usr/lib/systemd/system/postgresql.service"
|
|
|
|
install -Dm0644 "$srcdir/postgresql-initdb" "$pkgdir/usr/lib/systemd/scripts/postgresql-initdb"
|
2012-06-23 23:38:19 +08:00
|
|
|
}
|