2006-07-18 15:27:51 +00:00
|
|
|
#
|
2009-04-27 21:04:45 +00:00
|
|
|
# Copyright (C) 2006-2009 OpenWrt.org
|
2006-07-18 15:27:51 +00:00
|
|
|
#
|
|
|
|
# This is free software, licensed under the GNU General Public License v2.
|
|
|
|
# See /LICENSE for more information.
|
|
|
|
#
|
|
|
|
|
|
|
|
include $(TOPDIR)/rules.mk
|
|
|
|
|
|
|
|
PKG_NAME:=postgresql
|
2008-07-06 17:31:31 +00:00
|
|
|
PKG_VERSION:=8.3.3
|
2009-04-27 21:04:45 +00:00
|
|
|
PKG_RELEASE:=2
|
2006-07-18 15:27:51 +00:00
|
|
|
|
|
|
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
|
|
|
|
PKG_SOURCE_URL:=\
|
2008-01-18 17:10:03 +00:00
|
|
|
http://ftp7.us.postgresql.org/pub/postgresql/source/v$(PKG_VERSION) \
|
|
|
|
http://ftp8.us.postgresql.org/pub/postgresql/source/v$(PKG_VERSION) \
|
|
|
|
http://ftp9.us.postgresql.org/pub/postgresql/source/v$(PKG_VERSION) \
|
|
|
|
http://ftp.be.postgresql.org/postgresql/source/v$(PKG_VERSION) \
|
2006-11-21 21:23:58 +00:00
|
|
|
ftp://ftp-archives.postgresql.org/pub/source/v$(PKG_VERSION)
|
2008-07-06 17:31:31 +00:00
|
|
|
PKG_MD5SUM:=0ae4bd9620e84d3e08dcf923808d14d0
|
2006-07-18 15:27:51 +00:00
|
|
|
|
|
|
|
include $(INCLUDE_DIR)/package.mk
|
|
|
|
|
|
|
|
define Package/libpq
|
|
|
|
SECTION:=libs
|
|
|
|
CATEGORY:=Libraries
|
2007-07-27 15:56:44 +00:00
|
|
|
DEPENDS:=+zlib +libreadline +libncurses
|
2006-07-18 15:27:51 +00:00
|
|
|
TITLE:=PostgreSQL client library
|
|
|
|
URL:=http://www.postgresql.org/
|
2007-10-18 19:13:05 +00:00
|
|
|
SUBMENU:=database
|
2006-07-18 15:27:51 +00:00
|
|
|
endef
|
|
|
|
|
2007-10-14 04:32:56 +00:00
|
|
|
define Package/libpq/description
|
|
|
|
PostgreSQL client library.
|
|
|
|
endef
|
|
|
|
|
2006-07-18 15:27:51 +00:00
|
|
|
define Package/pgsql-cli
|
2006-07-26 01:26:21 +00:00
|
|
|
SECTION:=utils
|
|
|
|
CATEGORY:=Utilities
|
|
|
|
DEPENDS:=+libpq
|
2006-07-18 15:27:51 +00:00
|
|
|
TITLE:=Command Line Interface (CLI) to PostgreSQL databases
|
|
|
|
URL:=http://www.postgresql.org/
|
2007-10-18 19:13:05 +00:00
|
|
|
SUBMENU:=database
|
2006-07-18 15:27:51 +00:00
|
|
|
endef
|
|
|
|
|
2007-10-14 04:32:56 +00:00
|
|
|
define Package/pgsql-cli/description
|
|
|
|
Command Line Interface (CLI) to PostgreSQL databases.
|
|
|
|
endef
|
|
|
|
|
2007-04-09 23:25:36 +00:00
|
|
|
define Package/pgsql-server
|
|
|
|
SECTION:=utils
|
|
|
|
CATEGORY:=Utilities
|
2007-04-10 22:51:12 +00:00
|
|
|
DEPENDS:=+libpq
|
2007-04-09 23:25:36 +00:00
|
|
|
TITLE:=PostgreSQL databases Server
|
|
|
|
URL:=http://www.postgresql.org/
|
2007-10-18 19:13:05 +00:00
|
|
|
SUBMENU:=database
|
2007-04-09 23:25:36 +00:00
|
|
|
endef
|
|
|
|
|
2007-10-14 04:32:56 +00:00
|
|
|
define Package/pgsql-server/description
|
|
|
|
PostgreSQL databases Server.
|
|
|
|
endef
|
|
|
|
|
2007-04-11 17:27:38 +00:00
|
|
|
# Need a native ecpg ,pg_config, and zic for build
|
2006-07-18 15:27:51 +00:00
|
|
|
define Build/Configure
|
2007-04-09 23:25:36 +00:00
|
|
|
(cd $(PKG_BUILD_DIR); rm -f config.cache; \
|
|
|
|
./configure \
|
|
|
|
--prefix=/usr \
|
|
|
|
--exec-prefix=/usr \
|
|
|
|
--bindir=/usr/bin \
|
|
|
|
--datadir=/usr/share \
|
|
|
|
--includedir=/usr/include \
|
|
|
|
--infodir=/usr/share/info \
|
|
|
|
--libdir=/usr/lib \
|
|
|
|
--libexecdir=/usr/lib \
|
|
|
|
--localstatedir=/var \
|
|
|
|
--mandir=/usr/share/man \
|
|
|
|
--sbindir=/usr/sbin \
|
|
|
|
--sysconfdir=/etc \
|
|
|
|
$(DISABLE_NLS) \
|
|
|
|
$(DISABLE_LARGEFILE) \
|
|
|
|
--enable-shared \
|
|
|
|
--enable-static \
|
|
|
|
--disable-integer-datetimes \
|
|
|
|
--disable-rpath \
|
|
|
|
--without-java \
|
|
|
|
--without-krb4 \
|
|
|
|
--without-krb5 \
|
|
|
|
--without-openssl \
|
|
|
|
--without-pam \
|
|
|
|
--without-perl \
|
|
|
|
--without-python \
|
|
|
|
--without-readline \
|
|
|
|
--without-rendezvous \
|
|
|
|
--without-tcl \
|
|
|
|
--without-tk \
|
|
|
|
--with-zlib="yes" \
|
2007-06-12 14:39:47 +00:00
|
|
|
--enable-depend \
|
2007-04-09 23:25:36 +00:00
|
|
|
);
|
2007-07-12 13:25:07 +00:00
|
|
|
$(MAKE) -C $(PKG_BUILD_DIR)/src/interfaces/ecpg/preproc CC="$(HOSTCC)" CFLAGS+="-I../../libpq"
|
2007-04-09 23:25:36 +00:00
|
|
|
mv $(PKG_BUILD_DIR)/src/interfaces/ecpg/preproc/ecpg \
|
|
|
|
$(PKG_BUILD_DIR)/src/interfaces/ecpg/preproc/ecpg.host
|
2007-07-12 13:25:07 +00:00
|
|
|
$(MAKE) -C $(PKG_BUILD_DIR)/src/timezone CC="$(HOSTCC)"
|
2007-04-09 23:25:36 +00:00
|
|
|
mv $(PKG_BUILD_DIR)/src/timezone/zic $(PKG_BUILD_DIR)/src/timezone/zic.host
|
2007-07-12 13:25:07 +00:00
|
|
|
$(MAKE) -C $(PKG_BUILD_DIR)/src/bin/pg_config CC="$(HOSTCC)"
|
2007-04-11 17:27:38 +00:00
|
|
|
mv $(PKG_BUILD_DIR)/src/bin/pg_config/pg_config \
|
|
|
|
$(PKG_BUILD_DIR)/src/bin/pg_config/pg_config.host
|
2007-07-12 13:25:07 +00:00
|
|
|
$(MAKE) -C $(PKG_BUILD_DIR) distclean
|
2007-04-09 23:25:36 +00:00
|
|
|
|
2006-07-18 15:27:51 +00:00
|
|
|
(cd $(PKG_BUILD_DIR); rm -f config.cache; \
|
|
|
|
$(TARGET_CONFIGURE_OPTS) \
|
2007-02-01 23:48:59 +00:00
|
|
|
CFLAGS="$(TARGET_CFLAGS)" \
|
2007-04-10 22:51:12 +00:00
|
|
|
CPPFLAGS="$$$$CPPFLAGS $(TARGET_CPPFLAGS)" \
|
|
|
|
LDFLAGS="$(TARGET_LDFLAGS)" \
|
2006-07-18 15:27:51 +00:00
|
|
|
./configure \
|
|
|
|
--target=$(GNU_TARGET_NAME) \
|
|
|
|
--host=$(GNU_TARGET_NAME) \
|
|
|
|
--build=$(GNU_HOST_NAME) \
|
|
|
|
--program-prefix="" \
|
|
|
|
--program-suffix="" \
|
|
|
|
--prefix=/usr \
|
|
|
|
--exec-prefix=/usr \
|
|
|
|
--bindir=/usr/bin \
|
|
|
|
--datadir=/usr/share \
|
|
|
|
--includedir=/usr/include \
|
2007-04-09 23:25:36 +00:00
|
|
|
--infodir=/usr/share/info \
|
2006-07-18 15:27:51 +00:00
|
|
|
--libdir=/usr/lib \
|
|
|
|
--libexecdir=/usr/lib \
|
|
|
|
--localstatedir=/var \
|
|
|
|
--mandir=/usr/share/man \
|
|
|
|
--sbindir=/usr/sbin \
|
|
|
|
--sysconfdir=/etc \
|
|
|
|
$(DISABLE_NLS) \
|
|
|
|
$(DISABLE_LARGEFILE) \
|
|
|
|
--enable-shared \
|
|
|
|
--enable-static \
|
|
|
|
--disable-integer-datetimes \
|
|
|
|
--disable-rpath \
|
|
|
|
--without-java \
|
|
|
|
--without-krb4 \
|
|
|
|
--without-krb5 \
|
|
|
|
--without-openssl \
|
|
|
|
--without-pam \
|
|
|
|
--without-perl \
|
|
|
|
--without-python \
|
|
|
|
--without-rendezvous \
|
|
|
|
--without-tcl \
|
|
|
|
--without-tk \
|
|
|
|
--with-zlib="yes" \
|
2007-06-12 14:39:47 +00:00
|
|
|
--enable-depend \
|
2008-08-05 06:37:56 +00:00
|
|
|
$(if $(CONFIG_TARGET_avr32),--disable-spinlocks) \
|
2006-07-18 15:27:51 +00:00
|
|
|
);
|
2007-04-09 23:25:36 +00:00
|
|
|
$(SED) 's@ECPG = ../../preproc/ecpg@ECPG = ../../preproc/ecpg.host@' $(PKG_BUILD_DIR)/src/interfaces/ecpg/test/Makefile.regress
|
|
|
|
$(SED) 's@\./zic -d@./zic.host -d@' $(PKG_BUILD_DIR)/src/timezone/Makefile
|
2008-01-18 19:21:07 +00:00
|
|
|
# note: unclear if this is needed yet, commenting out for the moment
|
|
|
|
#$(SED) 's@US/Eastern@America/New_York@' $(PKG_BUILD_DIR)/src/timezone/Makefile
|
2006-07-18 15:27:51 +00:00
|
|
|
endef
|
|
|
|
|
2008-08-06 22:43:15 +00:00
|
|
|
TARGET_CFLAGS += $(FPIC)
|
|
|
|
|
2006-07-18 15:27:51 +00:00
|
|
|
define Build/Compile
|
2007-07-12 13:25:07 +00:00
|
|
|
$(MAKE) -C "$(PKG_BUILD_DIR)" \
|
2006-07-18 15:27:51 +00:00
|
|
|
DESTDIR="$(PKG_INSTALL_DIR)" \
|
|
|
|
all install
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/libpq/install
|
2006-11-23 00:29:07 +00:00
|
|
|
$(INSTALL_DIR) $(1)/usr/lib
|
2006-07-18 15:27:51 +00:00
|
|
|
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libpq.so.* $(1)/usr/lib/
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/pgsql-cli/install
|
2006-11-23 00:29:07 +00:00
|
|
|
$(INSTALL_DIR) $(1)/usr/bin
|
2007-12-09 18:59:01 +00:00
|
|
|
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/psql $(1)/usr/bin/
|
2006-07-18 15:27:51 +00:00
|
|
|
endef
|
|
|
|
|
2007-04-09 23:25:36 +00:00
|
|
|
define Package/pgsql-server/install
|
|
|
|
$(INSTALL_DIR) $(1)/usr/bin
|
|
|
|
$(INSTALL_DIR) $(1)/usr/share/postgresql
|
|
|
|
$(INSTALL_DIR) $(1)/usr/lib
|
|
|
|
$(INSTALL_DIR) $(1)/etc/init.d
|
|
|
|
$(INSTALL_DIR) $(1)/etc/config
|
|
|
|
$(INSTALL_BIN) \
|
|
|
|
$(PKG_INSTALL_DIR)/usr/bin/postgres \
|
|
|
|
$(PKG_INSTALL_DIR)/usr/bin/dropdb \
|
2008-01-18 19:21:07 +00:00
|
|
|
$(PKG_INSTALL_DIR)/usr/bin/clusterdb \
|
2007-04-09 23:25:36 +00:00
|
|
|
$(PKG_INSTALL_DIR)/usr/bin/createdb \
|
2008-01-18 19:21:07 +00:00
|
|
|
$(PKG_INSTALL_DIR)/usr/bin/createlang \
|
2007-04-09 23:25:36 +00:00
|
|
|
$(PKG_INSTALL_DIR)/usr/bin/createuser \
|
2008-01-18 19:21:07 +00:00
|
|
|
$(PKG_INSTALL_DIR)/usr/bin/droplang \
|
2007-04-09 23:25:36 +00:00
|
|
|
$(PKG_INSTALL_DIR)/usr/bin/dropuser \
|
|
|
|
$(PKG_INSTALL_DIR)/usr/bin/initdb \
|
2008-01-18 19:21:07 +00:00
|
|
|
$(PKG_INSTALL_DIR)/usr/bin/ipcclean \
|
2007-04-09 23:25:36 +00:00
|
|
|
$(PKG_INSTALL_DIR)/usr/bin/pg_config \
|
|
|
|
$(PKG_INSTALL_DIR)/usr/bin/pg_controldata \
|
|
|
|
$(PKG_INSTALL_DIR)/usr/bin/pg_ctl \
|
|
|
|
$(PKG_INSTALL_DIR)/usr/bin/pg_dump \
|
|
|
|
$(PKG_INSTALL_DIR)/usr/bin/pg_dumpall \
|
|
|
|
$(PKG_INSTALL_DIR)/usr/bin/pg_restore \
|
2008-01-18 19:21:07 +00:00
|
|
|
$(PKG_INSTALL_DIR)/usr/bin/pg_resetxlog \
|
|
|
|
$(PKG_INSTALL_DIR)/usr/bin/reindexdb \
|
2007-04-09 23:25:36 +00:00
|
|
|
$(PKG_INSTALL_DIR)/usr/bin/vacuumdb \
|
|
|
|
$(1)/usr/bin
|
2008-02-20 14:43:14 +00:00
|
|
|
ln -sf postgres $(1)/usr/bin/postmaster
|
2008-01-18 19:21:07 +00:00
|
|
|
|
2007-04-09 23:25:36 +00:00
|
|
|
$(INSTALL_BIN) ./files/postgresql.init $(1)/etc/init.d/postgresql
|
|
|
|
|
|
|
|
$(INSTALL_DATA) \
|
|
|
|
$(PKG_INSTALL_DIR)/usr/share/postgresql/postgres.bki \
|
|
|
|
$(PKG_INSTALL_DIR)/usr/share/postgresql/postgres.description \
|
|
|
|
$(PKG_INSTALL_DIR)/usr/share/postgresql/conversion_create.sql \
|
|
|
|
$(PKG_INSTALL_DIR)/usr/share/postgresql/information_schema.sql \
|
|
|
|
$(PKG_INSTALL_DIR)/usr/share/postgresql/pg_hba.conf.sample \
|
|
|
|
$(PKG_INSTALL_DIR)/usr/share/postgresql/pg_ident.conf.sample \
|
|
|
|
$(PKG_INSTALL_DIR)/usr/share/postgresql/pg_service.conf.sample \
|
|
|
|
$(PKG_INSTALL_DIR)/usr/share/postgresql/postgresql.conf.sample \
|
|
|
|
$(PKG_INSTALL_DIR)/usr/share/postgresql/sql_features.txt \
|
|
|
|
$(PKG_INSTALL_DIR)/usr/share/postgresql/postgres.shdescription \
|
|
|
|
$(PKG_INSTALL_DIR)/usr/share/postgresql/psqlrc.sample \
|
|
|
|
$(PKG_INSTALL_DIR)/usr/share/postgresql/recovery.conf.sample \
|
|
|
|
$(PKG_INSTALL_DIR)/usr/share/postgresql/system_views.sql \
|
2008-05-15 03:13:03 +00:00
|
|
|
$(PKG_INSTALL_DIR)/usr/share/postgresql/snowball_create.sql \
|
2007-04-09 23:25:36 +00:00
|
|
|
$(1)/usr/share/postgresql
|
|
|
|
|
2007-04-10 22:34:14 +00:00
|
|
|
$(INSTALL_DATA) ./files/postgresql.config $(1)/etc/config/postgresql
|
2007-04-09 23:25:36 +00:00
|
|
|
|
|
|
|
$(CP) -r \
|
|
|
|
$(PKG_INSTALL_DIR)/usr/share/postgresql/timezone \
|
|
|
|
$(PKG_INSTALL_DIR)/usr/share/postgresql/timezonesets \
|
|
|
|
$(1)/usr/share/postgresql
|
|
|
|
|
|
|
|
$(CP) -r \
|
|
|
|
$(PKG_INSTALL_DIR)/usr/lib/postgresql \
|
|
|
|
$(1)/usr/lib
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/pgsql-server/postinst
|
|
|
|
#!/bin/sh
|
|
|
|
grep -q '^postgres:' /etc/passwd && exit 0
|
|
|
|
|
|
|
|
if [ -e /bin/addgroup ]; then
|
|
|
|
/bin/addgroup postgres
|
|
|
|
RG=$$?
|
|
|
|
|
|
|
|
if [ -e /bin/adduser ]; then
|
|
|
|
/bin/adduser -h /tmp -H -g 'PostgreSQL administrator' -s /bin/ash -D -H -G postgres postgres
|
|
|
|
RU=$$?
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -z "$${RG}" -o -z "$${RU}" ]; then
|
|
|
|
echo "Could not find user utils, you will need to create the postgres user by hand"
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$${RG}" != "0" -o "$${RU}" != "0" ]; then
|
|
|
|
echo "Failed to created postgres user"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
endef
|
|
|
|
|
2006-07-18 15:27:51 +00:00
|
|
|
define Build/InstallDev
|
2007-10-07 03:20:26 +00:00
|
|
|
mkdir -p $(1)/usr/bin
|
2007-12-09 18:59:01 +00:00
|
|
|
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/bin/pg_config/pg_config.host $(1)/usr/bin/pg_config
|
2007-10-07 03:20:26 +00:00
|
|
|
mkdir -p $(1)/usr/include
|
|
|
|
$(CP) $(PKG_INSTALL_DIR)/usr/include/libpq $(1)/usr/include/
|
|
|
|
$(CP) $(PKG_INSTALL_DIR)/usr/include/libpq-fe.h $(1)/usr/include/
|
|
|
|
$(CP) $(PKG_INSTALL_DIR)/usr/include/pg_config.h $(1)/usr/include/
|
|
|
|
$(CP) $(PKG_INSTALL_DIR)/usr/include/postgres_ext.h $(1)/usr/include/
|
|
|
|
$(CP) $(PKG_INSTALL_DIR)/usr/include/postgresql $(1)/usr/include/
|
|
|
|
mkdir -p $(1)/usr/lib
|
|
|
|
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libpq.{a,so*} $(1)/usr/lib/
|
|
|
|
$(CP) $(PKG_BUILD_DIR)/src/interfaces/ecpg/preproc/ecpg.host $(1)/usr/bin/ecpg
|
|
|
|
$(CP) $(PKG_BUILD_DIR)/src/timezone/zic.host $(1)/usr/bin/zic
|
2006-07-18 15:27:51 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
$(eval $(call BuildPackage,libpq))
|
|
|
|
$(eval $(call BuildPackage,pgsql-cli))
|
2007-04-09 23:25:36 +00:00
|
|
|
$(eval $(call BuildPackage,pgsql-server))
|