Index: head/textproc/apache-solr/Makefile =================================================================== --- head/textproc/apache-solr/Makefile (revision 438756) +++ head/textproc/apache-solr/Makefile (revision 438757) @@ -1,54 +1,54 @@ # Created by: Gea-Suan Lin # $FreeBSD$ PORTNAME= apache-solr PORTVERSION= 6.5.0 +PORTREVISION= 1 CATEGORIES= textproc java MASTER_SITES= APACHE/lucene/solr/${PORTVERSION} DISTNAME= solr-${PORTVERSION} MAINTAINER= idefix@fechner.net COMMENT= High performance search server built using Lucene Java LICENSE= APACHE20 -CONFLICTS_INSTALL= apache-solr3-* apache-solr-4* apache-solr-5* +RUN_DEPENDS= bash:shells/bash -RUN_DEPENDS= bash:shells/bash \ - lsof:sysutils/lsof +CONFLICTS_INSTALL= apache-solr3-* apache-solr-4* apache-solr-5* USES= cpe tar:tgz USE_JAVA= yes JAVA_VERSION= 1.8+ JAVA_RUN= yes NO_BUILD= yes NO_ARCH= yes PLIST_SUB+= PORTVERSION="${PORTVERSION}" SUB_FILES= pkg-message pkg-install USE_RC_SUBR= solr USERS= solr GROUPS= ${USERS} CPE_PRODUCT= solr CPE_VENDOR= apache post-patch: ${REINPLACE_CMD} -e 's|solr.log=.*|solr.log=/var/log/solr|g' ${WRKSRC}/server/resources/log4j.properties do-install: cd ${WRKSRC} && ${COPYTREE_SHARE} . ${STAGEDIR}${PREFIX}/${CPE_PRODUCT} ${INSTALL_SCRIPT} ${WRKSRC}/bin/solr ${STAGEDIR}${PREFIX}/${CPE_PRODUCT}/bin ${INSTALL_DATA} ${WRKSRC}/bin/solr.in.sh ${STAGEDIR}${PREFIX}/etc/solr.in.sh-dist ${ECHO} 'SOLR_HOME="/var/db/solr"' >> ${STAGEDIR}${PREFIX}/etc/solr.in.sh-dist ${ECHO} 'LOG4J_PROPS="/var/db/solr/log4j.properties"' >> ${STAGEDIR}${PREFIX}/etc/solr.in.sh-dist ${ECHO} 'SOLR_LOGS_DIR="/var/log/solr"' >> ${STAGEDIR}${PREFIX}/etc/solr.in.sh-dist ${ECHO} 'SOLR_PORT="8983"' >> ${STAGEDIR}${PREFIX}/etc/solr.in.sh-dist ${ECHO} 'SOLR_PID_DIR="/var/db/solr"' >> ${STAGEDIR}${PREFIX}/etc/solr.in.sh-dist ${ECHO} 'SOLR_OPTS="$$SOLR_OPTS -Djetty.host=localhost"' >> ${STAGEDIR}${PREFIX}/etc/solr.in.sh-dist ${MKDIR} ${STAGEDIR}/var/db/solr ${MKDIR} ${STAGEDIR}/var/log/solr ${INSTALL_DATA} ${WRKSRC}/server/solr/solr.xml ${STAGEDIR}/var/db/solr/solr.xml-dist ${INSTALL_DATA} ${WRKSRC}/server/resources/log4j.properties ${STAGEDIR}/var/db/solr/log4j.properties-dist .include Index: head/textproc/apache-solr/files/patch-bin_solr =================================================================== --- head/textproc/apache-solr/files/patch-bin_solr (nonexistent) +++ head/textproc/apache-solr/files/patch-bin_solr (revision 438757) @@ -0,0 +1,31 @@ +--- bin/solr.orig 2017-04-15 09:06:51 UTC ++++ bin/solr +@@ -1757,13 +1757,12 @@ function launch_solr() { + 1>"$SOLR_LOGS_DIR/solr-$SOLR_PORT-console.log" 2>&1 & echo $! > "$SOLR_PID_DIR/solr-$SOLR_PORT.pid" + + # no lsof on cygwin though +- if hash lsof 2>/dev/null ; then # hash returns true if lsof is on the path + echo -n "Waiting up to $SOLR_STOP_WAIT seconds to see Solr running on port $SOLR_PORT" + # Launch in a subshell to show the spinner + (loops=0 + while true + do +- running=`lsof -PniTCP:$SOLR_PORT -sTCP:LISTEN` ++ running=`sockstat -ls -P tcp -p $SOLR_PORT | grep LISTEN` + if [ -z "$running" ]; then + slept=$((loops * 2)) + if [ $slept -lt $SOLR_STOP_WAIT ]; then +@@ -1781,13 +1780,6 @@ function launch_solr() { + fi + done) & + spinner $! +- else +- echo -e "NOTE: Please install lsof as this script needs it to determine if Solr is listening on port $SOLR_PORT." +- sleep 10 +- SOLR_PID=`ps auxww | grep start\.jar | grep -w "\-Djetty\.port=$SOLR_PORT" | grep -v grep | awk '{print $2}' | sort -r` +- echo -e "\nStarted Solr server on port $SOLR_PORT (pid=$SOLR_PID). Happy searching!\n" +- return; +- fi + fi + } + Property changes on: head/textproc/apache-solr/files/patch-bin_solr ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/textproc/apache-solr/files/solr.in =================================================================== --- head/textproc/apache-solr/files/solr.in (revision 438756) +++ head/textproc/apache-solr/files/solr.in (revision 438757) @@ -1,68 +1,68 @@ #!/bin/sh # # Copyright (c) 2014, Radim Kolar # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, # this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH # DAMAGE. # $FreeBSD$ # # PROVIDE: solr # REQUIRE: LOGIN # KEYWORD: shutdown . /etc/rc.subr name=solr rcvar=solr_enable load_rc_config $name : ${solr_enable:=NO} : ${solr_instance:=/var/db/solr} solr_start () { su -m solr -c "${command} start" } solr_stop () { su -m solr -c "${command} stop" } solr_status () { su -m solr -c "${command} status" } -# add %%LOCALBASE%%/[bin|sbin] to path -export PATH=$PATH:%%LOCALBASE%%/bin:%%LOCALBASE%%/sbin +# add %%LOCALBASE%%/bin to path +export PATH=$PATH:%%LOCALBASE%%/bin # let the start script read some custom settings export SOLR_INCLUDE=/usr/local/etc/solr.in.sh required_files="${solr_instance}/solr.xml /usr/local/etc/solr.in.sh ${solr_instance}/log4j.properties" command=%%PREFIX%%/solr/bin/solr start_cmd=solr_start stop_cmd=solr_stop status_cmd=solr_status run_rc_command "$1"