Page MenuHomeFreeBSD

devel/opengrok: update to 1.0 and takeover maintainership
ClosedPublic

Authored by ultima on Jun 25 2017, 5:37 PM.

Details

Summary
  • Updated to 1.0
  • New maintainer Jov <amutu@amutu.com>
  • New options, TOMCAT 8 and 85, 8 is the new default

Changelog: https://github.com/OpenGrok/OpenGrok/releases/tag/1.0

PR\: 220082
Sumitted by\: Jov <amutu@amutu.com> (maintainer)
Reviewed by\: lifanov (mentor), matthew (mentor)
Approved by\: lifanov (mentor), matthew (mentor)
Differential Revision\: https://reviews.freebsd.org/DXXXXX

Test Plan

portlint -AC:
WARN: Makefile: for new port, make $FreeBSD$ tag in comment section empty, to make SVN happy.
0 fatal errors and 1 warning found.

poudriere:
103i386
103amd64
110i386
110amd64
12i386
12amd64

Diff Detail

Repository
rP FreeBSD ports repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

devel/opengrok/Makefile
6 ↗(On Diff #30065)

USE_GITHUB isn't being used because this is precompiled.

devel/opengrok/Makefile
60 ↗(On Diff #30065)

This whole chunk should be:

TOMCAT85_VARS=    WEBAPP_HOME?= ${LOCALBASE}/apache-tomcat-8.5
64 ↗(On Diff #30065)
TOMCAT8_VARS=    WEBAPP_HOME?= ${LOCALBASE}/apache-tomcat-8.0
68 ↗(On Diff #30065)
TOMCAT7_VARS=    WEBAPP_HOME?= ${LOCALBASE}/apache-tomcat-7.0
72 ↗(On Diff #30065)
TOMCAT6_VARS=    WEBAPP_HOME?= ${LOCALBASE}/apache-tomcat-6.0
76 ↗(On Diff #30065)
RESIN3_VARS=    WEBAPP_HOME?= ${LOCALBASE}/resin3

Nowadays, any time you see:

.if ${PORT_OPTIONS:MFOO}

you can 99% of the time replace it with one of the constructs documented in ${PORTSDIR}/MK/bas.options.mk

You can still fetch it from GitHub and build it. This should be preferable to fetching precompiled jar files.

Other than the comments about ${OPTION}_VARS this all looks OK to me.

This revision is now accepted and ready to land.Jun 26 2017, 7:35 AM

Other than the comments about ${OPTION}_VARS this all looks OK to me.

I just added these and it will no longer build. First guess, OPT_VARS must be parsed after OPT_BUILD_DEPENDS/RUN_DEPENDS. Unless i'm doing something obviously wrong that I'm not seeing.

[103amd64-test-job-01] Extracting tomcat8-8.0.43: .......... done
===>   opengrok-1.0 depends on file: /bin/bootstrap.jar - not found
*** Error code 1
svn diff devel/opengrok/Makefile                                                                                                                                                                    
Index: devel/opengrok/Makefile                                                                                                                                                                                                                
===================================================================                                                                                                                                                                           
--- devel/opengrok/Makefile     (revision 444305)                                                                                                                                                                                             
+++ devel/opengrok/Makefile     (working copy)                                                                                                                                                                                                
@@ -1,25 +1,26 @@                                                                                                                                                                                                                             
 # $FreeBSD$                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                              
 PORTNAME=      opengrok                                                                                                                                                                                                                      
-PORTVERSION=   0.12.1.5                                                                                                                                                                                                                      
+PORTVERSION=   1.0                                                                                                                                                                                                                           
 CATEGORIES=    devel java                                                                                                                                                                                                                    
-MASTER_SITES=  http://java.net/projects/opengrok/downloads/download/                                                                                                                                                                         
+MASTER_SITES=  https://github.com/OpenGrok/OpenGrok/releases/download/${PORTVERSION}/                                                                                                                                                        
                                                                                                                                                                                                                                              
-MAINTAINER=    ports@FreeBSD.org                                                                                                                                                                                                             
+MAINTAINER=    amutu@amutu.com                                                                                                                                                                                                               
 COMMENT=       Fast and powerful code search and cross-reference engine                                                                                                                                                                      
                                                                                                                                                                                                                                              
 LICENSE=       CDDL APACHE20                                                                                                                                                                                                                 
 LICENSE_COMB=  multi                                                                                                                                                                                                                         
+LICENSE_FILE=  ${WRKSRC}/doc/LICENSE.txt                                                                                                                                                                                                     
                                                                                                                                                                                                                                              
 RUN_DEPENDS=   exctags:devel/ctags                                                                                                                                                                                                           
                                                                                                                                                                                                                                              
 USE_JAVA=      yes                                                                                                                                                                                                                           
-JAVA_VERSION=  1.7+                                                                                                                                                                                                                          
+JAVA_VERSION=  1.8+                                                                                                                                                                                                                          
 SHAREOWN=      www                                                                                                                                                                                                                           
 SHAREGRP=      www                                                                                                                                                                                                                           
 NO_BUILD=      yes                                                                                                                                                                                                                           
 NO_ARCH=       yes                                                                                                                                                                                                                           
-PORTDOCS=      CHANGES.txt EXAMPLE.txt LICENSE.txt                                                                                                                                                                                           
+PORTDOCS=      CHANGES.txt EXAMPLE.txt README.txt NOTICE.txt                                                                                                                                                                                 
 SUB_FILES=     opengrok                                                                                                                                                                                                                      
 SUB_LIST+=     LIBFILES="${LIBFILES:S,^,${DATADIR}/lib/,}" \                                                                                                                                                                                 
                JARFILE="${JARFILE}"                                                                                                                                                                                                          
@@ -28,40 +29,39 @@                                                                                                                                                                                                                           
                                                                                                                                                                                                                                              
 OPTIONS_DEFINE=                DOCS                                                                                                                                                                                                          
 OPTIONS_SINGLE=                AS                                                                                                                                                                                                            
-OPTIONS_SINGLE_AS=     TOMCAT7 TOMCAT6 RESIN3                                                                                                                                                                                                
-OPTIONS_DEFAULT=       TOMCAT6                                                                                                                                                                                                               
+OPTIONS_SINGLE_AS=     TOMCAT85 TOMCAT8 TOMCAT7 TOMCAT6 RESIN3                                                                                                                                                                               
+OPTIONS_DEFAULT=       TOMCAT8                                                                                                                                                                                                               
                                                                                                                                                                                                                                              
+TOMCAT8_DESC=          Tomcat 8.x support                                                                                                                                                                                                    
+TOMCAT85_DESC=         Tomcat 8.5.x support                                                                                                                                                                                                  
+                                                                                                                                                                                                                                             
+TOMCAT6_VARS=          WEBAPP_HOME?=${LOCALBASE}/apache-tomcat-6.0                                                                                                                                                                           
 TOMCAT6_BUILD_DEPENDS= ${WEBAPP_HOME}/bin/bootstrap.jar:www/tomcat6                                                                                                                                                                          
 TOMCAT6_RUN_DEPENDS=   ${WEBAPP_HOME}/bin/bootstrap.jar:www/tomcat6                                                                                                                                                                          
+TOMCAT7_VARS=          WEBAPP_HOME?=${LOCALBASE}/apache-tomcat-7.0                                                                                                                                                                           
 TOMCAT7_BUILD_DEPENDS= ${WEBAPP_HOME}/bin/bootstrap.jar:www/tomcat7                                                                                                                                                                          
 TOMCAT7_RUN_DEPENDS=   ${WEBAPP_HOME}/bin/bootstrap.jar:www/tomcat7                                                                                                                                                                          
+TOMCAT8_VARS=          WEBAPP_HOME?=${LOCALBASE}/apache-tomcat-8.0                                                                                                                                                                           
+TOMCAT8_BUILD_DEPENDS= ${WEBAPP_HOME}/bin/bootstrap.jar:www/tomcat8                                                                                                                                                                          
+TOMCAT8_RUN_DEPENDS=   ${WEBAPP_HOME}/bin/bootstrap.jar:www/tomcat8                                                                                                                                                                          
+TOMCAT85_VARS=         WEBAPP_HOME?=${LOCALBASE}/apache-tomcat-8.5                                                                                                                                                                           
+TOMCAT85_BUILD_DEPENDS=        ${WEBAPP_HOME}/bin/bootstrap.jar:www/tomcat85                                                                                                                                                                 
+TOMCAT85_RUN_DEPENDS=  ${WEBAPP_HOME}/bin/bootstrap.jar:www/tomcat85                                                                                                                                                                         
+RESIN3_VARS=           WEBAPP_HOME?=${LOCALBASE}/resin3                                                                                                                                                                                      
 RESIN3_BUILD_DEPENDS=  ${WEBAPP_HOME}/lib/resin.jar:www/resin3                                                                                                                                                                               
 RESIN3_RUN_DEPENDS=    ${WEBAPP_HOME}/lib/resin.jar:www/resin3                                                                                                                                                                               
                                                                                                                                                                                                                                              
 JARFILE=       ${DATADIR}/opengrok.jar                                                                                                                                                                                                       
 LIBFILES=      ant.jar \                                                                                                                                                                                                                     
-               bcel-5.2.jar \                                                                                                                                                                                                                
+               bcel-6.0.jar \                                                                                                                                                                                                                
                jrcs.jar \                                                                                                                                                                                                                    
-               lucene-analyzers-common-4.7.1.jar \                                                                                                                                                                                           
-               lucene-core-4.7.1.jar \                                                                                                                                                                                                       
-               lucene-queryparser-4.7.1.jar \                                                                                                                                                                                                
-               lucene-suggest-4.7.1.jar \                                                                                                                                                                                                    
-               swing-layout-0.9.jar                                                                                                                                                                                                          
+               lucene-analyzers-common-6.5.0.jar \                                                                                                                                                                                           
+               lucene-core-6.5.0.jar \                                                                                                                                                                                                       
+               lucene-queryparser-6.5.0.jar \                                                                                                                                                                                                
+               lucene-suggest-6.5.0.jar \                                                                                                                                                                                                    
+               swing-layout-0.9.jar \                                                                                                                                                                                                        
+               json-simple-1.1.1.jar                                                                                                                                                                                                         
                                                                                                                                                                                                                                              
-.include <bsd.port.options.mk>                                                                                                                                                                                                               
-                                                                                                                                                                                                                                             
-.if ${PORT_OPTIONS:MTOMCAT7}                                                                                                                                                                                                                 
-WEBAPP_HOME?=  ${LOCALBASE}/apache-tomcat-7.0                                                                                                                                                                                                
-.endif                                                                                                                                                                                                                                       
-                                                                                                                                                                                                                                             
-.if ${PORT_OPTIONS:MTOMCAT6}                                                                                                                                                                                                                 
-WEBAPP_HOME?=  ${LOCALBASE}/apache-tomcat-6.0                                                                                                                                                                                                
-.endif                                                                                                                                                                                                                                       
-                                                                                                                                                                                                                                             
-.if ${PORT_OPTIONS:MRESIN3}                                                                                                                                                                                                                  
-WEBAPP_HOME?=  ${LOCALBASE}/resin3                                                                                                                                                                                                           
-.endif                                                                                                                                                                                                                                       
-                                                                                                                                                                                                                                             
 WEBAPPS_DIR=   ${WEBAPP_HOME:S|^${LOCALBASE}/||}/webapps                                                                                                                                                                                     
                                                                                                                                                                                                                                              
 post-extract:

You can still fetch it from GitHub and build it. This should be preferable to fetching precompiled jar files.

I agree, I'll ask the new maintainer to make this move as it is definitely prefered! I think it would be best to leave it out of the update commit though. I suspect it to be a small challenge due to port not being created in this way, but as I have not made a deep dive, I have no real clue.

You can triple-backquote (`) text block to paste it into Phabricator, like so:

pre
   formatted
text
* goes here

Yes, that is much better thanks!

lifanov requested changes to this revision.Jun 26 2017, 5:45 PM

Also, it's an ordering issue. This works:

.include <bsd.port.options.mk>

TOMCAT85_VARS=  WEBAPP_HOME?=   ${LOCALBASE}/apache-tomcat-8.5
TOMCAT8_VARS=   WEBAPP_HOME?=   ${LOCALBASE}/apache-tomcat-8.0
TOMCAT7_VARS=   WEBAPP_HOME?=   ${LOCALBASE}/apache-tomcat-7.0
TOMCAT6_VARS=   WEBAPP_HOME?=   ${LOCALBASE}/apache-tomcat-6.0
RESIN3_VARS=    WEBAPP_HOME?=   ${LOCALBASE}/resin3

TOMCAT6_BUILD_DEPENDS=  ${WEBAPP_HOME}/bin/bootstrap.jar:www/tomcat6
TOMCAT6_RUN_DEPENDS=    ${WEBAPP_HOME}/bin/bootstrap.jar:www/tomcat6
TOMCAT7_BUILD_DEPENDS=  ${WEBAPP_HOME}/bin/bootstrap.jar:www/tomcat7
TOMCAT7_RUN_DEPENDS=    ${WEBAPP_HOME}/bin/bootstrap.jar:www/tomcat7
TOMCAT8_BUILD_DEPENDS=  ${WEBAPP_HOME}/bin/bootstrap.jar:www/tomcat8
TOMCAT8_RUN_DEPENDS=    ${WEBAPP_HOME}/bin/bootstrap.jar:www/tomcat8
TOMCAT85_BUILD_DEPENDS= ${WEBAPP_HOME}/bin/bootstrap.jar:www/tomcat85
TOMCAT85_RUN_DEPENDS=   ${WEBAPP_HOME}/bin/bootstrap.jar:www/tomcat85
RESIN3_BUILD_DEPENDS=   ${WEBAPP_HOME}/lib/resin.jar:www/resin3
RESIN3_RUN_DEPENDS=     ${WEBAPP_HOME}/lib/resin.jar:www/resin3
This revision now requires changes to proceed.Jun 26 2017, 5:45 PM

Note that bsd.port.options.mk is included before VARS are used.

Note that bsd.port.options.mk is included before VARS are used.

I thought that include wasnt necessary in the modern format which is why I left it out. This fixes the parsing issue, however a new issue arises, the WEBAPPS_DIR= ${WEBAPP_HOME:S|^${LOCALBASE}/||}/webapps is being parsed before OPT_VARS is set.

Actually, this is incorrect, the BUILD_DEPEND/RUN_DEPEND isn't even being added now. I'm going to try and move some stuff around.

103amd64

Umm, you're right! The options include is not necessary when using helpers.
Also, this works:

TOMCAT85_VARS=  WEBAPP_HOME=${LOCALBASE}/apache-tomcat-8.5
TOMCAT8_VARS=   WEBAPP_HOME=${LOCALBASE}/apache-tomcat-8.0
TOMCAT7_VARS=   WEBAPP_HOME=${LOCALBASE}/apache-tomcat-7.0
TOMCAT6_VARS=   WEBAPP_HOME=${LOCALBASE}/apache-tomcat-6.0
RESIN3_VARS=    WEBAPP_HOME=${LOCALBASE}/resin3

The helper just doesn't parse "?=" correctly.

$ make BATCH=y -VPLIST_SUB                                                     
T=apache-tomcat-8.0  OWNER=www GROUP=www JAVASHAREDIR="share/java"  JAVAJARDIR="share/java/classes" OSREL=12.0 PREFIX=%D LOCALBASE=/usr/local  RESETPREFIX=/usr/local PORTDOCS="" PORTEXAMPLES="" LIB32DIR=lib DOCSDIR="share/doc/opengrok"  EXAMPLESDIR="share/examples/opengrok"  DATADIR="share/opengrok"  WWWDIR="www/opengrok"  ETCDIR="etc/opengrok"
ultima edited edge metadata.

Ah ha! so thats the culprit. Would it be acceptable to remove the ability to export WEBAPP_HOME? I will say yes as the tomcat8 port as no similar option.

I don't believe this port would even work if the user overrides WEBAPP_HOME to something other than the one from OPTIONS.

OK, It looks good to me as-is. Make sure that the maintainer is still fine with it and you can commit it.

This revision is now accepted and ready to land.Jun 27 2017, 3:00 PM
This revision was automatically updated to reflect the committed changes.