ports/165265: [patch] databases/postgresql-docs: build docs for Pg 9

Ben Morrow ben at morrow.me.uk
Sat Feb 18 13:50:11 UTC 2012


>Number:         165265
>Category:       ports
>Synopsis:       [patch] databases/postgresql-docs: build docs for Pg 9
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Sat Feb 18 13:50:10 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator:     Ben Morrow <ben at morrow.me.uk>
>Release:        FreeBSD 8.2-RELEASE-p5 amd64
>Organization:
morrow.me.uk
>Environment:
System: FreeBSD anubis.morrow.me.uk 8.2-RELEASE-p5 FreeBSD 8.2-RELEASE-p5 #1: Fri Dec 30 19:03:35 GMT 2011 mauzo at anubis:/usr/obj/usr/src/sys/ANUBIS amd64


        
>Description:
Currently the postgresql-docs port is marken BROKEN when build against
PostgreSQL 9.0 and 9.1 because the tarball no longer contains prebuilt
docs. This patch updates the port to build the docs from source for
those versions.

>How-To-Repeat:
	
>Fix:

	

--- postgresql-docs-9.1 begins here ---
diff -ur .zfs/snapshot/orig/databases/postgresql-docs/Makefile databases/postgresql-docs/Makefile
--- .zfs/snapshot/orig/databases/postgresql-docs/Makefile	2012-02-18 12:44:44.989481551 +0000
+++ databases/postgresql-docs/Makefile	2012-02-18 13:05:43.134509362 +0000
@@ -30,15 +30,42 @@
 PGSQL_VER=	${DEFAULT_PGSQL_VER}
 .endif
 
-.if (${PGSQL_VER} == 90) || (${PGSQL_VER} == 91)
-BROKEN=		"not implemented yet"
-.endif
- 
-NO_BUILD=	YES
 SLAVE_ONLY=	YES
-PATCHDIR=	mustnotexist
 
 PGDOCSDIR?=	${DOCSDIR}/release-${PGSQL_VER}
+PGDOCSREL?=	${PGDOCSDIR:S,^${PREFIX}/,,}
+
+.if ${PGSQL_VER} >= 90
+
+_sgmldir=   ${PREFIX}/share/sgml
+_dbdir=	    ${_sgmldir}/docbook
+_tp=	    ${PORTSDIR}/textproc
+
+BUILD_DEPENDS+=	onsgmls:${_tp}/opensp \
+		openjade:${_tp}/openjade \
+		${_sgmldir}/iso8879/catalog:${_tp}/iso8879 \
+		${_dbdir}/dsssl/modular/catalog:${_tp}/dsssl-docbook-modular \
+		${_dbdir}/4.2/docbook.dtd:${_tp}/docbook-420
+
+do-build:
+	${GMAKE} -C ${WRKSRC} html
+
+do-install:
+	${MKDIR} ${PGDOCSDIR}
+	(cd ${WRKSRC}/doc/src/sgml/html && \
+	    ${COPYTREE_SHARE} \* ${PGDOCSDIR})
+
+post-install:
+	@(cd ${PREFIX} && \
+	    ${FIND} ${PGDOCSREL} -type f)   >> ${TMPPLIST}
+	@${ECHO} "@dirrm ${PGDOCSREL}"	    >> ${TMPPLIST}
+	@${ECHO} "@unexec rmdir %D/${DOCSDIR_REL} 2>/dev/null || true" \
+					    >> ${TMPPLIST}
+
+.else
+ 
+NO_BUILD=	YES
+PATCHDIR=	mustnotexist
 
 do-install:
 	@ $(MKDIR) ${PGDOCSDIR}; \
@@ -53,4 +80,6 @@
 	  ${ECHO} @dirrm ${PGDOCSDIR:S,^${PREFIX}/,,} >> ${TMPPLIST} ;\
 	  ${ECHO} "@unexec rmdir %D/${DOCSDIR:S,^${PREFIX}/,,} 2> /dev/null || true" >> ${TMPPLIST}
 
+.endif # 9 or greater
+
 .include "${MASTERDIR}/Makefile"
diff -ur .zfs/snapshot/orig/databases/postgresql91-server/Makefile databases/postgresql91-server/Makefile
--- .zfs/snapshot/orig/databases/postgresql91-server/Makefile	2012-02-18 12:46:00.581039268 +0000
+++ databases/postgresql91-server/Makefile	2012-02-18 12:56:06.338275264 +0000
@@ -334,7 +334,7 @@
 	@${SH} ${PKGINSTALL} ${PORTNAME} PRE-INSTALL
 .endif
 
-.if !defined(NO_BUILD)
+.if !defined(NO_BUILD) && !target(do-build)
 
 do-build:
 	@ cd ${WRKSRC}/src/backend && ${SETENV} ${MAKE_ENV} ${GMAKE} symlinks
@@ -366,26 +366,29 @@
 	@${SED} -n s,pgsql,${PG_GROUP},gp ${PORTSDIR}/GIDs > ${WRKDIR}/pggid
 .  endif
 
+.  if !target(do-install)
 do-install:
 	@for dir in ${INSTALL_DIRS}; do \
 	    cd ${WRKSRC}/$${dir} && \
 		${SETENV} ${MAKE_ENV} ${GMAKE} ${INSTALL_TARGET}; \
 	done
-.  if defined(SERVER_ONLY)
+.    if defined(SERVER_ONLY)
 	@ ${MKDIR} ${PREFIX}/share/postgresql ;\
 	${MKDIR} ${PREFIX}/etc/periodic/daily ;\
 	${INSTALL_SCRIPT} ${WRKDIR}/502.pgsql \
 			${PREFIX}/etc/periodic/daily
 	${MKDIR} ${PREFIX}/${PG_USER} && ${CHOWN} ${PG_USER}:${PG_GROUP} ${PREFIX}/${PG_USER}
-.  endif # SERVER_ONLY
-.  if defined(CLIENT_ONLY)
+.    endif # SERVER_ONLY
+.    if defined(CLIENT_ONLY)
 	@ cd ${WRKSRC}/src && ${SETENV} ${MAKE_ENV} ${GMAKE} install-local
-.  endif
+.    endif
 	@ if [ -r ${PKGMESSAGE} ]; then \
 		${MKDIR} ${DOCSDIR} ;\
 		${INSTALL_DATA} ${PKGMESSAGE} ${DOCSDIR}/README${PKGNAMESUFFIX} ;\
 		${CAT} ${PKGMESSAGE} ;\
 	fi
+.  endif # !target(do-install)
+
 .endif # !NO_BUILD
 
 .if defined(SERVER_ONLY)
--- postgresql-docs-9.1 ends here ---


>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list