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
25 $(DL_DIR
)/$(PKG_SOURCE
):
26 $(SCRIPT_DIR
)/download.pl
$(DL_DIR
) $(PKG_SOURCE
) $(PKG_MD5SUM
) $(PKG_SOURCE_URL
)
28 $(PKG_BUILD_DIR
)/.prepared
: $(DL_DIR
)/$(PKG_SOURCE
)
29 $(PKG_CAT
) $(DL_DIR
)/$(PKG_SOURCE
) |
tar -C
$(BUILD_DIR
) $(TAR_OPTIONS
) -
30 $(PATCH
) $(PKG_BUILD_DIR
) .
/patches
31 touch
$(PKG_BUILD_DIR
)/.prepared
33 $(PKG_BUILD_DIR
)/.configured
: $(PKG_BUILD_DIR
)/.prepared
34 # ./configure advertise "--infodir", but does not support it, replaced with "--docdir"
35 (cd
$(PKG_BUILD_DIR
); rm -rf config.cache config.status
; \
36 $(TARGET_CONFIGURE_OPTS
) \
37 CFLAGS
="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \
38 CPPFLAGS
="$$CPPFLAGS -I$(STAGING_DIR)/usr/include" \
39 LDFLAGS
="-L$(STAGING_DIR)/usr/lib" \
41 --target
=$(GNU_TARGET_NAME
) \
42 --host
=$(GNU_TARGET_NAME
) \
43 --build
=$(GNU_HOST_NAME
) \
49 --datadir=/usr
/share \
50 --includedir=/usr
/include \
51 --docdir
=/usr
/share
/info \
53 --libexecdir
=/usr
/lib \
54 --localstatedir
=/var \
55 --mandir=/usr
/share
/man \
59 $(DISABLE_LARGEFILE
) \
62 --disable-integer-datetimes \
72 --without-rendezvous \
77 touch
$(PKG_BUILD_DIR
)/.configured
79 $(PKG_BUILD_DIR
)/.built
: $(PKG_BUILD_DIR
)/.configured
80 $(MAKE
) -C
"$(PKG_BUILD_DIR)/src" \
81 $(TARGET_CONFIGURE_OPTS
) \
83 touch
$(PKG_BUILD_DIR
)/.built
85 $(STAGING_DIR
)/usr
/lib
/libpq.so
: $(PKG_BUILD_DIR
)/.built
86 $(MAKE
) -C
"$(PKG_BUILD_DIR)/src" \
87 DESTDIR
="$(STAGING_DIR)" \
89 $(MAKE
) -C
"$(PKG_BUILD_DIR)/src/include" \
90 DESTDIR
="$(STAGING_DIR)" \
92 $(MAKE
) -C
"$(PKG_BUILD_DIR)/src/interfaces/libpq" \
93 DESTDIR
="$(STAGING_DIR)" \
95 mkdir
-p
$(STAGING_DIR
)/usr
/lib
96 cp
-a
$(PKG_BUILD_DIR
)/src
/interfaces
/libpq
/libpq.so
* $(STAGING_DIR
)/usr
/lib
/
97 cp
$(PKG_BUILD_DIR
)/src
/interfaces
/libpq
/libpq.a
$(STAGING_DIR
)/usr
/lib
/
99 $(IPKG_LIBPQ
): $(STAGING_DIR
)/usr
/lib
/libpq.so
100 $(SCRIPT_DIR
)/make-ipkg-dir.sh
$(IDIR_LIBPQ
) .
/ipkg
/libpq.control
$(PKG_VERSION
)-$(PKG_RELEASE
) $(ARCH
)
101 mkdir
-p
$(IDIR_LIBPQ
)/usr
/lib
102 cp
-fpR
$(STAGING_DIR
)/usr
/lib
/libpq.so.
* $(IDIR_LIBPQ
)/usr
/lib
/
103 $(STRIP
) $(IDIR_LIBPQ
)/usr
/lib
/*.so
*
104 mkdir
-p
$(PACKAGE_DIR
)
105 $(IPKG_BUILD
) $(IDIR_LIBPQ
) $(PACKAGE_DIR
)
107 $(INFO_LIBPQ
): $(IPKG_LIBPQ
)
108 $(IPKG
) install $(IPKG_LIBPQ
)
110 prepare
: $(PKG_BUILD_DIR
)/.prepared
111 compile
: $(IPKG_LIBPQ
)
112 install: $(INFO_LIBPQ
)
115 -$(MAKE
) -C
"$(PKG_BUILD_DIR)" \
116 DESTDIR
="$(STAGING_DIR)" \
118 rm -rf
$(PKG_BUILD_DIR
) $(IPKG_LIBPQ
)