3 include $(TOPDIR
)/rules.mk
8 PKG_MD5SUM
:=32dac2916d16287d95e0c958a75161fa
11 ftp
://ftp3.us.postgresql.org
/pub
/postgresql
/source
/v
$(PKG_VERSION
)/ \
12 ftp
://ftp.br.postgresql.org
/pub
/PostgreSQL
/source
/v
$(PKG_VERSION
)/ \
13 ftp
://ftp.au.postgresql.org
/pub
/postgresql
/source
/v
$(PKG_VERSION
)/ \
14 ftp
://ftp.tw.postgresql.org
/pub
/postgresql
/source
/v
$(PKG_VERSION
)/ \
15 http
://nthill.free.fr
/openwrt
/sources
/$(PKG_NAME
)/
16 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.bz2
19 PKG_BUILD_DIR
:=$(BUILD_DIR
)/$(PKG_NAME
)-$(PKG_VERSION
)
21 IPKG_LIBPQ
:=$(PACKAGE_DIR
)/libpq_
$(PKG_VERSION
)-$(PKG_RELEASE
)_
$(ARCH
).ipk
22 IDIR_LIBPQ
:=$(PKG_BUILD_DIR
)/ipkg
23 INFO_LIBPQ
:=$(IPKG_STATE_DIR
)/info/libpq.list
26 ifeq ($(BR2_GCC_3_4
),y
)
27 EXTRA_CFLAGS
+= -fno-unit-at-a-time
30 $(DL_DIR
)/$(PKG_SOURCE
):
31 $(SCRIPT_DIR
)/download.pl
$(DL_DIR
) $(PKG_SOURCE
) $(PKG_MD5SUM
) $(PKG_SOURCE_URL
)
33 $(PKG_BUILD_DIR
)/.prepared
: $(DL_DIR
)/$(PKG_SOURCE
)
34 $(PKG_CAT
) $(DL_DIR
)/$(PKG_SOURCE
) |
tar -C
$(BUILD_DIR
) $(TAR_OPTIONS
) -
35 $(PATCH
) $(PKG_BUILD_DIR
) .
/patches
36 touch
$(PKG_BUILD_DIR
)/.prepared
38 $(PKG_BUILD_DIR
)/.configured
: $(PKG_BUILD_DIR
)/.prepared
39 # ./configure advertise "--infodir", but does not support it, replaced with "--docdir"
40 (cd
$(PKG_BUILD_DIR
); rm -rf config.cache config.status
; \
41 $(TARGET_CONFIGURE_OPTS
) \
42 CFLAGS
="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \
43 CPPFLAGS
="$$CPPFLAGS -I$(STAGING_DIR)/usr/include" \
44 LDFLAGS
="-L$(STAGING_DIR)/usr/lib" \
46 --target
=$(GNU_TARGET_NAME
) \
47 --host
=$(GNU_TARGET_NAME
) \
48 --build
=$(GNU_HOST_NAME
) \
54 --datadir=/usr
/share \
55 --includedir=/usr
/include \
56 --docdir
=/usr
/share
/info \
58 --libexecdir
=/usr
/lib \
59 --localstatedir
=/var \
60 --mandir=/usr
/share
/man \
64 $(DISABLE_LARGEFILE
) \
67 --disable-integer-datetimes \
77 --without-rendezvous \
82 touch
$(PKG_BUILD_DIR
)/.configured
84 $(PKG_BUILD_DIR
)/.built
: $(PKG_BUILD_DIR
)/.configured
85 $(MAKE
) -C
"$(PKG_BUILD_DIR)" \
86 $(TARGET_CONFIGURE_OPTS
)
87 touch
$(PKG_BUILD_DIR
)/.built
89 $(STAGING_DIR
)/usr
/lib
/libpq.so
: $(PKG_BUILD_DIR
)/.built
90 $(MAKE
) -C
"$(PKG_BUILD_DIR)" \
91 DESTDIR
="$(STAGING_DIR)" \
94 $(IPKG_LIBPQ
): $(STAGING_DIR
)/usr
/lib
/libpq.so
95 $(SCRIPT_DIR
)/make-ipkg-dir.sh
$(IDIR_LIBPQ
) .
/ipkg
/libpq.control
$(PKG_VERSION
)-$(PKG_RELEASE
) $(ARCH
)
96 mkdir
-p
$(IDIR_LIBPQ
)/usr
/lib
97 cp
-fpR
$(STAGING_DIR
)/usr
/lib
/libpq.so.
* $(IDIR_LIBPQ
)/usr
/lib
/
98 $(STRIP
) $(IDIR_LIBPQ
)/usr
/lib
/*.so
*
99 mkdir
-p
$(PACKAGE_DIR
)
100 $(IPKG_BUILD
) $(IDIR_LIBPQ
) $(PACKAGE_DIR
)
102 $(INFO_LIBPQ
): $(IPKG_LIBPQ
)
103 $(IPKG
) install $(IPKG_LIBPQ
)
105 prepare
: $(PKG_BUILD_DIR
)/.prepared
106 compile
: $(IPKG_LIBPQ
)
107 install: $(INFO_LIBPQ
)
110 -$(MAKE
) -C
"$(PKG_BUILD_DIR)" \
111 DESTDIR
="$(STAGING_DIR)" \
113 rm -rf
$(PKG_BUILD_DIR
) $(IPKG_LIBPQ
)