ports/105849: [devel/gettext] [patch] Add MINIMAL option

Alex Kozlov spam at rm-rf.kiev.ua
Sat Nov 25 20:30:14 UTC 2006


>Number:         105849
>Category:       ports
>Synopsis:       [devel/gettext] [patch] Add MINIMAL option
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Nov 25 20:30:12 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Alex Kozlov
>Release:        FreeBSD 6.1
>Organization:
private
>Environment:
>Description:
Vast majority of ports use only libintl(and msgfmt) from gettext.
Add a new MINIMAL option for install only them.
>How-To-Repeat:
>Fix:
--- Makefile.orig	Thu Feb 23 12:35:39 2006
+++ Makefile.		Mon Nov 18 22:57:18 2006
@@ -30,17 +30,26 @@
 		EMACS="no"
 CONFIGURE_ARGS=	--disable-csharp \
 		--mandir=${PREFIX}/man
-INSTALLS_SHLIB=	yes
+USE_LDCONFIG= yes
 
 .if !defined(WITHOUT_GETTEXT_OPTIONS)
 OPTIONS=	EXAMPLES "install example files" off \
-		HTMLMAN "install man pages in HTML format" off
+		HTMLMAN "install man pages in HTML format" off \
+		MINIMAL "install only libintl" off
 .endif
 PLIST=		${WRKDIR}/plist
 PLISTU=		${WRKDIR}/plist-unsorted
 PLIST_SUB=	LOCALBASE=${LOCALBASE} X11BASE=${X11BASE} \
 		VERSION=${PORTVERSION}
 
+.ifdef USE_GETTEXT
+.error	USE_GETTEXT is defined as an environment variable, or in the arguments \
+	to "make".  Please unset it and restart the build.
+.endif
+
+.include <bsd.port.pre.mk>
+
+.if !defined(WITH_MINIMAL)
 MAN1=		autopoint.1 gettext.1 gettextize.1 msgattrib.1 msgcat.1 \
 		msgcmp.1 msgcomm.1 msgconv.1 msgen.1 msgexec.1 \
 		msgfilter.1 msgfmt.1 msggrep.1 msginit.1 msgmerge.1 \
@@ -52,14 +61,10 @@
 		bindtextdomain.3 bind_textdomain_codeset.3
 
 INFO=		autosprintf gettext
-
-.ifdef USE_GETTEXT
-.error	USE_GETTEXT is defined as an environment variable, or in the arguments \
-	to "make".  Please unset it and restart the build.
+.else
+MAN1=		msgfmt.1
 .endif
 
-.include <bsd.port.pre.mk>
-
 .if ${OSVERSION} < 500000
 CONFIGURE_ARGS+=	--with-libexpat-prefix=${LOCALBASE}/lib
 LIB_DEPENDS+=	expat.6:${PORTSDIR}/textproc/expat2
@@ -74,6 +79,15 @@
 	@sleep 5
 .endif
 
+.if defined(WITH_MINIMAL)
+post-patch:
+	# make msgfmt static
+	@${REINPLACE_CMD} -e \
+                's:$$(LINK) $$(msgfmt_LDFLAGS):$$(LINK) $$(msgfmt_LDFLAGS) -static:'\
+                ${WRKSRC}/gettext-tools/src/Makefile.in
+
+.endif
+
 post-build:
 .if exists(${PREFIX}/bin/kaffe)
 	-${MV} ${PREFIX}/bin/jar.backup ${PREFIX}/bin/jar
@@ -82,9 +96,11 @@
 	@sleep 5
 .endif
 
+.if !defined(WITH_MINIMAL)
 pre-install:
 	@${RM} -f ${PLISTU}
 	@${TOUCH} ${PLISTU}
+
 .if !defined (NOPORTDOCS)
 .for ii in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 foot toc
 	${ECHO_CMD} %%DOCSDIR%%/gettext_${ii}.html >> ${PLISTU}
@@ -125,6 +141,25 @@
 .if !defined (WITH_HTMLMAN)
 	cd ${WRKSRC}/gettext-runtime/man && make uninstall-html
 	cd ${WRKSRC}/gettext-tools/man && make uninstall-html
+.endif
+
+.else # WITH_MINIMAL
+pre-install:
+	@${ECHO} include/libintl.h > ${PLIST}
+	@${ECHO} lib/libintl.a >> ${PLIST}
+	@${ECHO} lib/libintl.la >> ${PLIST}
+	@${ECHO} lib/libintl.so >> ${PLIST}
+	@${ECHO} lib/libintl.so.6 >> ${PLIST}
+	@${ECHO} bin/msgfmt >> ${PLIST}
+
+do-install:
+	${INSTALL_MAN} ${WRKSRC}/gettext-tools/man/msgfmt.1  ${PREFIX}/man/man1/
+	${INSTALL_DATA} ${WRKSRC}/gettext-tools/intl/libintl.h ${PREFIX}/include/
+	${INSTALL_DATA} ${WRKSRC}/gettext-tools/intl/.libs/libintl.a ${PREFIX}/lib/
+	${INSTALL_DATA} ${WRKSRC}/gettext-tools/intl/.libs/libintl.so.6 ${PREFIX}/lib/
+	(cd ${WRKSRC} && ${LIBTOOL} --mode=install \
+	${INSTALL_DATA} ${WRKSRC}/gettext-tools/intl/libintl.la ${PREFIX}/lib/)
+	${INSTALL_PROGRAM} ${WRKSRC}/gettext-tools/src/msgfmt ${PREFIX}/bin/msgfmt
 .endif
 
 .include <bsd.port.post.mk>
>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list