Bug 100894

Summary: Add OPTION dialog support and using pkg-message for refering later
Product: Ports & Packages Reporter: Takeshi MUTOH <mutoh>
Component: Individual Port(s)Assignee: Martin Wilke <miwi>
Status: Closed FIXED    
Severity: Affects Only Me CC: chris
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   

Description Takeshi MUTOH 2006-07-26 23:30:17 UTC
Currently, lang/squeak use knob without using dialog/OPTIONS.

Furthermore, some message for user don't use pkg-message.
So if user refer is later, he must read Makefile directory.

So I want to change
- all knob can specify OPTIONS, so we select knob using dialog
- split message for users from Makefile to pkg-message

Fix: Please apply patch below.



--
Takeshi MUTOH	<mutoh@openedu.org>--1bPcnqX2fbEBXuR1K25ImjdLYXF1TTVVvBKwo4TtRGhUIw6B
Content-Type: text/plain; name="file.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="file.diff"

diff -ruN /usr/ports/lang/squeak/Makefile squeak/Makefile
--- /usr/ports/lang/squeak/Makefile	Wed Jun 14 07:01:23 2006
+++ squeak/Makefile	Sun Jun 18 16:42:25 2006
@@ -36,6 +36,15 @@
 PATCHNUMBER=		5429
 
 ##################################################
+OPTIONS+=		MPG_MMX		"MMX support (MPG plugin)" off
+OPTIONS+=		NPSQUEAK	"browser plugin support" on
+OPTIONS+=		RFB		"remote frame buffer support" on
+OPTIONS+=		FFI		"libffi support" off
+OPTIONS+=		X		"X Windows support" on
+
+.include <bsd.port.pre.mk>
+
+##################################################
 DIST_SUBDIR=		squeak
 ONLY_FOR_ARCHS=		i386
 MAN1=			inisqueak.1 squeak.1
@@ -70,11 +79,11 @@
 
 ##################################################
 # Knobs
-.if defined(WITH_RFB) && (${WITH_RFB}=="no")
+.if defined(WITHOUT_RFB)
 CONFIGURE_ARGS+=	--without-rfb
 .endif
 
-.if defined(WITH_NPSQUEAK) && (${WITH_NPSQUEAK}=="no")
+.if defined(WITHOUT_NPSQUEAK)
 CONFIGURE_ARGS+=	--without-npsqueak
 PLIST_NPSQUEAK=		"@comment feature not wanted - "
 .else
@@ -82,7 +91,7 @@
 PLIST_NPSQUEAK=
 .endif
 
-.if defined(WITH_X) && (${WITH_X}=="no")
+.if defined(WITHOUT_X)
 CONFIGURE_ARGS+=	--without-x
 PLIST_X=		"@comment feature not wanted - "
 .else
@@ -91,11 +100,11 @@
 PLIST_X=
 .endif
 
-.if defined(WITH_MPG_MMX) && (${WITH_MPG_MMX}=="yes")
+.if defined(WITH_MPG_MMX)
 CONFIGURE_ARGS+=	--enable-mpg-mmx
 .endif
 
-.if defined(WITH_FFI) && (${WITH_FFI}=="yes")
+.if defined(WITH_FFI)
 LIB_DEPENDS+=		ffi.2:${PORTSDIR}/devel/libffi
 PLIST_FFI=
 EXT_PLUGINS+=		SqueakFFIPrims
@@ -112,6 +121,10 @@
 MAKE_ARGS+=		CCFLAGS="${CFLAGS}"
 .endif
 
+PKGMESSAGE=		${WRKDIR}/pkg-message
+PKGMESSAGE_SUB=		PREFIX=${PREFIX} \
+			VMVERSION=${VMVERSION}
+
 PLIST_SUB=		IMAGEVERSION=${IMAGEVERSION}\
 			PATCHNUMBER=${PATCHNUMBER}\
 			VMVERSION=${VMVERSION}\
@@ -119,36 +132,9 @@
 			PLIST_X=${PLIST_X} \
 			PLIST_FFI=${PLIST_FFI}
 
-.include <bsd.port.pre.mk>
-
-##################################################
-pre-everything::
-	@${ECHO_MSG} " "
-	@${ECHO_MSG} " ------------------------- Please note: -------------------------"
-	@${ECHO_MSG} " "
-	@${ECHO_MSG} "  Squeak has the following tunable options:"
-	@${ECHO_MSG} " "
-	@${ECHO_MSG} "    WITH_MPG_MMX=      [yes|no]  MMX support (MPG plugin)"
-	@${ECHO_MSG} "                            ^^   (default: disabled)"
-	@${ECHO_MSG} "    WITH_NPSQUEAK=     [yes|no]  browser plugin support"
-	@${ECHO_MSG} "                        ^^^      (default: enabled)"
-	@${ECHO_MSG} "    WITH_RFB=          [yes|no]  remote frame buffer support"
-	@${ECHO_MSG} "                        ^^^      (default: enabled)"
-	@${ECHO_MSG} "    WITH_X=            [yes|no]  X Windows support"
-	@${ECHO_MSG} "                        ^^^      (default: enabled)"
-	@${ECHO_MSG} "    WITH_FFI=          [yes|no]  FFI support"
-	@${ECHO_MSG} "                            ^^   (default: disabled)"
-	@${ECHO_MSG} " "
-	@${ECHO_MSG} "  additional make arguments"
-	@${ECHO_MSG} "    CC=<aString>"
-	@${ECHO_MSG} "    CFLAGS=<aString>"
-	@${ECHO_MSG} " "
-	@${ECHO_MSG} " ------------------ Thanks for your attention! ------------------"
-	@${ECHO_MSG} " "
-
 ##################################################
 post-patch:
-	${REINPLACE_CMD} \
+	@${REINPLACE_CMD} \
 		-e "s,%%LOCALBASE%%,${LOCALBASE},g" \
 		-e "s,%%X11BASE%%,${X11BASE},g" \
 		${WRKSRC}/platforms/unix/npsqueak/npsqueakregister.in \
@@ -159,8 +145,6 @@
 ##################################################
 pre-configure:
 	@${MKDIR} ${CONFIGURE_WRKSRC}
-	@cd ${WRKSRC}/platforms/unix/npsqueak && \
-		${REINPLACE_CMD} -e 's|include|include -I${X11BASE}/include|g' Makefile
 
 ##################################################
 post-configure:
@@ -179,7 +163,7 @@
 .for file in ${FILES_TO_GZIP}
 	(cd ${WRKDIR} && ${GZIP_CMD} ${file} && ${INSTALL_DATA} ${file}.gz ${PREFIX}/share/squeak/)
 .endfor
-.if defined(WITH_NPSQUEAK) && (${WITH_NPSQUEAK}=="yes")
+.if defined(WITH_NPSQUEAK)
 	(cd ${DISTDIR}/${DIST_SUBDIR} && ${UNZIP_CMD} -u SqueakPlugin.zip -d ${WRKDIR})
 	(cd ${WRKDIR} && ${INSTALL_DATA} SqueakPlugin.image ${PREFIX}/share/squeak/npsqueak.image)
 .endif
@@ -189,21 +173,8 @@
 		${WRKSRC}/build/inisqueak > ${WRKSRC}/build/inisqueak.tmp
 	${INSTALL_SCRIPT} ${WRKSRC}/build/inisqueak.tmp ${PREFIX}/bin/inisqueak
 	${CHMOD} 755 ${PREFIX}/bin/inisqueak
-	@${ECHO_MSG} " "
-	@${ECHO_MSG} " ------------------------- Please note: -------------------------"
-	@${ECHO_MSG} " "
-	@${ECHO_MSG} "  In order to be able to make use of squeak you need to have an"
-	@${ECHO_MSG} "    image and a changes file in your working directory as well"
-	@${ECHO_MSG} "    as access to a source file. This is easy by using inisqueak."
-	@${ECHO_MSG} "    Please see the inisqueak(1) manpage for details."
-	@${ECHO_MSG} " "
-	@${ECHO_MSG} "  Make sure you have the following values in your environment"
-	@${ECHO_MSG} "    variables:"
-	@${ECHO_MSG} "    PATH:            ${PREFIX}/bin"
-	@${ECHO_MSG} "    LD_LIBRARY_PATH: ${PREFIX}/lib"
-	@${ECHO_MSG} "                     ${PREFIX}/share/squeak/${VMVERSION}"
-	@${ECHO_MSG} " "
-	@${ECHO_MSG} " ------------------ Thanks for your attention! ------------------"
-	@${ECHO_MSG} " "
+	@${SED} ${PKGMESSAGE_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
+		< ${PKGDIR}/pkg-message > ${PKGMESSAGE}
+	@${CAT} ${PKGMESSAGE}
 
 .include <bsd.port.post.mk>
diff -ruN /usr/ports/lang/squeak/pkg-message squeak/pkg-message
--- /usr/ports/lang/squeak/pkg-message	Thu Jan  1 09:00:00 1970
+++ squeak/pkg-message	Sun Jun 18 15:08:21 2006
@@ -0,0 +1,17 @@
+ ------------------------- Please note: -------------------------
+
+  In order to be able to make use of squeak you need to have an
+    image and a changes file in your working directory as well
+    as access to a source file. This is easy by using inisqueak.
+    Please see the inisqueak(1) manpage for details.
+
+  Make sure you have the following values in your environment
+    variables:
+    PATH:            %%PREFIX%%/bin
+    LD_LIBRARY_PATH: %%PREFIX%%/lib
+                     %%PREFIX%%/share/squeak/%%VMVERSION%%
+
+ If you want to use web browser plugin,
+    run %%PREFIX%%/share/squeak/npsqueakregister.
+ ------------------ Thanks for your attention! ------------------
+
How-To-Repeat: 
make
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2006-07-27 00:04:18 UTC
State Changed
From-To: open->feedback

Awaiting maintainers feedback
Comment 2 chris 2006-07-27 18:06:00 UTC
Edwin

I approve the patch!

best regards - Chris

> Maintainer of lang/squeak,
>
> Please note that PR ports/100894 has just been submitted.
>
> If it contains a patch for an upgrade, an enhancement or a bug fix
> you agree on, reply to this email stating that you approve the patch
> and a committer will take care of it.
>
> The full text of the PR can be found at:
>     http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/100894
>
> --
> Edwin Groothuis
> edwin@FreeBSD.org
>
Comment 3 Martin Wilke freebsd_committer freebsd_triage 2006-07-27 18:26:33 UTC
Responsible Changed
From-To: freebsd-ports-bugs->miwi

I'll take it.
Comment 4 Martin Wilke freebsd_committer freebsd_triage 2006-07-29 23:26:51 UTC
State Changed
From-To: feedback->closed

Committed. Thanks!