I am trying to resurrect a postgis package, and it failed to build because pgxs.mk and friends were not installed. I am only worrying about postgresql84 for now. pg_config says: PGXS = /usr/pkg/lib/postgresql/pgxs/src/makefiles/pgxs.mk but the package does not install that. The following patch installs the files that postgis expects from the pgxs hierarchy. The only tricky part is removing workdir references from the tool paths built into the makefile. With this patch the postgis build is to the point where it is running into its own issues, or something tricky with the pgxs system. I got a parallel build failure, so MAKE_JOBS_SAFE needs to be no. I would like to commit this. Any objections? Index: databases/postgresql84-client/Makefile =================================================================== RCS file: /cvsroot/pkgsrc/databases/postgresql84-client/Makefile,v retrieving revision 1.1.1.1 diff -u -p -r1.1.1.1 Makefile --- databases/postgresql84-client/Makefile 29 Jul 2009 06:27:56 -0000 1.1.1.1 +++ databases/postgresql84-client/Makefile 14 Dec 2009 12:38:32 -0000 @@ -1,10 +1,14 @@ # $NetBSD: Makefile,v 1.1.1.1 2009/07/29 06:27:56 adam Exp $ PKGNAME= postgresql84-client-${BASE_VERS} +PKGREVISION= 1 COMMENT= PostgreSQL database client programs PKG_DESTDIR_SUPPORT= user-destdir +# Couldn't find -lpgport, then rebuilt ok. +MAKE_JOBS_SAFE= no + .include "../../databases/postgresql84/Makefile.common" USE_TOOLS+= gzip tar @@ -65,12 +69,42 @@ post-wrapper: touch ${BUILDLINK_DIR}/include/crypt.h .endif +# postgis requires some pgsql build machinery to build, in particular: +# lib/postgresql/pgxs/src/makefiles/pgxs.mk +# lib/postgresql/pgxs/src/Makefile.[several] +# lib/postgresql/pgxs/config/install-sh +# lib/postgresql/pgxs/config/mkinstalldirs + +# Makefile.global has references to tools via bl3. Ideally these +# should be changed dynamically to point to the new tools directory +# when building the packages that uses the makefile. For now, we just +# point them back to bare invocations because this will usually work. +SUBST_CLASSES+= dework +SUBST_STAGE.dework= post-build +SUBST_MESSAGE.dework= Fixing references to workdir tools in installed file. +SUBST_FILES.dework= src/Makefile.global +SUBST_SED.dework+= -e 's,/.*databases/postgresql[0-9]*-client/work/.tools/bin/,,' +SUBST_SED.dework+= -e 's,/.*databases/postgresql[0-9]*-client/work/postgresql-[0-9\.]*,/dev/null,' + +DEST_PG_PGXS= ${DESTDIR}${PG_PREFIX}/lib/postgresql/pgxs + post-install: - cd ${WRKSRC}/doc; for file in \ + (cd ${WRKSRC}/doc; for file in \ FAQ* KNOWN_BUGS MISSING_FEATURES README.* TODO \ bug.template; \ do \ ${INSTALL_DATA} $$file ${DESTDIR}${PG_DOC_DIR}/$$file; \ - done + done); \ + ${MKDIR} ${DEST_PG_PGXS}/src/makefiles; \ + (cd ${WRKSRC}/src; \ + ${INSTALL_DATA} makefiles/pgxs.mk ${DEST_PG_PGXS}/src/makefiles; \ + for file in Makefile.shlib Makefile.global Makefile.port; do \ + ${INSTALL_DATA} $$file ${DEST_PG_PGXS}/src; \ + done); \ + ${MKDIR} ${DEST_PG_PGXS}/config; \ + (cd ${WRKSRC}/config; \ + for file in install-sh mkinstalldirs; do \ + ${INSTALL_DATA} $$file ${DEST_PG_PGXS}/config; \ + done); .include "../../mk/bsd.pkg.mk" Index: databases/postgresql84-client/PLIST =================================================================== RCS file: /cvsroot/pkgsrc/databases/postgresql84-client/PLIST,v retrieving revision 1.2 diff -u -p -r1.2 PLIST --- databases/postgresql84-client/PLIST 10 Sep 2009 10:06:19 -0000 1.2 +++ databases/postgresql84-client/PLIST 14 Dec 2009 12:38:33 -0000 @@ -1751,3 +1751,9 @@ ${PG_SUBPREFIX}share/locale/tr/LC_MESSAG ${PG_SUBPREFIX}share/locale/tr/LC_MESSAGES/psql-8.4.mo ${PG_SUBPREFIX}share/postgresql/pg_service.conf.sample ${PG_SUBPREFIX}share/postgresql/psqlrc.sample +${PG_SUBPREFIX}lib/postgresql/pgxs/src/Makefile.global +${PG_SUBPREFIX}lib/postgresql/pgxs/src/Makefile.port +${PG_SUBPREFIX}lib/postgresql/pgxs/src/Makefile.shlib +${PG_SUBPREFIX}lib/postgresql/pgxs/src/makefiles/pgxs.mk +${PG_SUBPREFIX}lib/postgresql/pgxs/config/install-sh +${PG_SUBPREFIX}lib/postgresql/pgxs/config/mkinstalldirs
Attachment:
pgpWYw1CXu9nY.pgp
Description: PGP signature