X-Git-Url: http://git.openwrt.org/?a=blobdiff_plain;f=libs%2Fpostgresql%2FMakefile;h=8f91b517803aa20e20d4912131221afab8f4e14f;hb=2216dbf4f065c4818bee971138e7e6a2efc10f36;hp=68a74842f0015c30675393ebf8498ac651f59796;hpb=31746dfb3bbcd2d9658d1f4fe234e6d09bbf4a12;p=openwrt%2Fsvn-archive%2Farchive.git diff --git a/libs/postgresql/Makefile b/libs/postgresql/Makefile index 68a74842f0..8f91b51780 100644 --- a/libs/postgresql/Makefile +++ b/libs/postgresql/Makefile @@ -1,5 +1,5 @@ -# -# Copyright (C) 2006 OpenWrt.org +# +# Copyright (C) 2006-2011 OpenWrt.org # # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. @@ -8,26 +8,23 @@ include $(TOPDIR)/rules.mk PKG_NAME:=postgresql -PKG_VERSION:=8.3.3 -PKG_RELEASE:=1 +PKG_VERSION:=9.0.1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=\ - 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://ftp9.us.postgresql.org/pub/mirrors/postgresql/source/v$(PKG_VERSION) \ http://ftp.be.postgresql.org/postgresql/source/v$(PKG_VERSION) \ ftp://ftp-archives.postgresql.org/pub/source/v$(PKG_VERSION) -PKG_MD5SUM:=0ae4bd9620e84d3e08dcf923808d14d0 - -PKG_BUILD_DEPENDS:=libnotimpl +PKG_MD5SUM:=57ba57e43cfe29e16dacbf5789be98d1 +PKG_BUILD_PARALLEL:=1 include $(INCLUDE_DIR)/package.mk define Package/libpq SECTION:=libs CATEGORY:=Libraries - DEPENDS:=+zlib +libreadline +libncurses + DEPENDS:=+zlib +libreadline +libncurses +coreutils-su TITLE:=PostgreSQL client library URL:=http://www.postgresql.org/ SUBMENU:=database @@ -80,7 +77,6 @@ define Build/Configure --sbindir=/usr/sbin \ --sysconfdir=/etc \ $(DISABLE_NLS) \ - $(DISABLE_LARGEFILE) \ --enable-shared \ --enable-static \ --disable-integer-datetimes \ @@ -98,12 +94,15 @@ define Build/Configure --without-tk \ --with-zlib="yes" \ --enable-depend \ + --with-system-timezone=/tmp \ ); $(MAKE) -C $(PKG_BUILD_DIR)/src/interfaces/ecpg/preproc CC="$(HOSTCC)" CFLAGS+="-I../../libpq" mv $(PKG_BUILD_DIR)/src/interfaces/ecpg/preproc/ecpg \ $(PKG_BUILD_DIR)/src/interfaces/ecpg/preproc/ecpg.host $(MAKE) -C $(PKG_BUILD_DIR)/src/timezone CC="$(HOSTCC)" - mv $(PKG_BUILD_DIR)/src/timezone/zic $(PKG_BUILD_DIR)/src/timezone/zic.host + mv $(PKG_BUILD_DIR)/src/timezone/zic $(PKG_BUILD_DIR)/host-zic + $(INSTALL_DIR) $(STAGING_DIR)/host/bin/ + $(CP) $(PKG_BUILD_DIR)/host-zic $(STAGING_DIR)/host/bin/zic $(MAKE) -C $(PKG_BUILD_DIR)/src/bin/pg_config CC="$(HOSTCC)" mv $(PKG_BUILD_DIR)/src/bin/pg_config/pg_config \ $(PKG_BUILD_DIR)/src/bin/pg_config/pg_config.host @@ -114,7 +113,6 @@ define Build/Configure CFLAGS="$(TARGET_CFLAGS)" \ CPPFLAGS="$$$$CPPFLAGS $(TARGET_CPPFLAGS)" \ LDFLAGS="$(TARGET_LDFLAGS)" \ - LIBS="-lnotimpl" \ ./configure \ --target=$(GNU_TARGET_NAME) \ --host=$(GNU_TARGET_NAME) \ @@ -154,17 +152,20 @@ define Build/Configure $(if $(CONFIG_TARGET_avr32),--disable-spinlocks) \ ); $(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 - # 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 endef TARGET_CFLAGS += $(FPIC) +# because PROFILE means something else in the project Makefile +unexport PROFILE + define Build/Compile - $(MAKE) -C "$(PKG_BUILD_DIR)" \ + $(MAKE) $(PKG_JOBS) -C "$(PKG_BUILD_DIR)" \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + all + $(MAKE) $(PKG_JOBS) -C "$(PKG_BUILD_DIR)" \ DESTDIR="$(PKG_INSTALL_DIR)" \ - all install + install endef define Package/libpq/install @@ -183,98 +184,65 @@ define Package/pgsql-server/install $(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 \ - $(PKG_INSTALL_DIR)/usr/bin/clusterdb \ - $(PKG_INSTALL_DIR)/usr/bin/createdb \ - $(PKG_INSTALL_DIR)/usr/bin/createlang \ - $(PKG_INSTALL_DIR)/usr/bin/createuser \ - $(PKG_INSTALL_DIR)/usr/bin/droplang \ - $(PKG_INSTALL_DIR)/usr/bin/dropuser \ - $(PKG_INSTALL_DIR)/usr/bin/initdb \ - $(PKG_INSTALL_DIR)/usr/bin/ipcclean \ - $(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 \ - $(PKG_INSTALL_DIR)/usr/bin/pg_resetxlog \ - $(PKG_INSTALL_DIR)/usr/bin/reindexdb \ - $(PKG_INSTALL_DIR)/usr/bin/vacuumdb \ - $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin ln -sf postgres $(1)/usr/bin/postmaster $(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 \ - $(PKG_INSTALL_DIR)/usr/share/postgresql/snowball_create.sql \ + $(CP) -r $(PKG_INSTALL_DIR)/usr/share/postgresql/* \ $(1)/usr/share/postgresql - $(INSTALL_DATA) ./files/postgresql.config $(1)/etc/config/postgresql + $(INSTALL_DATA) ./files/postgresql.config $(1)/etc/config/postgresql - $(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 - $(CP) -r \ - $(PKG_INSTALL_DIR)/usr/lib/postgresql \ - $(1)/usr/lib +define Package/pgsql-server/conffiles +/etc/config/postgresql 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 +group=$$(grep '^postgres:' /etc/group | cut -f3 -d:) +if [ -z "$${group}" ] ; then + group=1000 + tst=$$(cat /etc/group | grep ":$${group}:") + while [ -n "$${tst}" ] ; do + group=$$(($${group}+1)) + tst=$$(cat /etc/group | grep ":$${group}:") + done + echo "postgres:x:$${group}:" >>/etc/group fi -if [ "$${RG}" != "0" -o "$${RU}" != "0" ]; then - echo "Failed to created postgres user" - exit 1 +user=$$(cat /etc/passwd | grep "^postgres:") +if [ -z "$${user}" ] ; then + num="$${group}" + tst=$$(cat /etc/passwd | grep ":.*:$${num}:") + while [ -n "$${tst}" ] ; do + num=$$(($${num}+1)) + tst=$$(cat /etc/passwd | grep ":.*:$${num}:") + done + echo "postgres:*:$${num}:$${group}:PostgreSQL administrator:/tmp:/bin/ash" >>/etc/passwd fi endef define Build/InstallDev - mkdir -p $(1)/usr/bin + $(INSTALL_DIR) $(1)/usr/bin $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/bin/pg_config/pg_config.host $(1)/usr/bin/pg_config - mkdir -p $(1)/usr/include + $(INSTALL_DIR) $(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/pg_config_manual.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 + $(INSTALL_DIR) $(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 + $(CP) $(PKG_BUILD_DIR)/host-zic $(1)/usr/bin/zic endef $(eval $(call BuildPackage,libpq))