While the daemon.sh is not directly used by the port, uses might still use it for development, thus the scripts needs to be fixed. Commons Daemon is a runtime dependency so the spot in daemon.sh: > # If not explicitly set, look for jsvc in CATALINA_BASE first then CATALINA_HOME > if [ -z "$JSVC" ]; then > JSVC="$CATALINA_BASE/bin/jsvc" > if [ ! -x "$JSVC" ]; then > JSVC="$CATALINA_HOME/bin/jsvc" > fi > fi Shall be replaced with > JSVC=%%PREFIX%%/bin/jsvc or similar.
This likely applies to 7.0 and 9.0 too.
I don't know how to do this without hard-coded /usr/local.
(In reply to VVD from comment #2) There is no need to, you can simple patch the file with JSVC=%%PREFIX%%/bin/jsvc and then perform substition. Look what I do with Nexus OSS: https://github.com/michael-o/freebsd-ports/blob/master/devel/nexus2-oss/Makefile#L45 and https://github.com/michael-o/freebsd-ports/blob/master/devel/nexus2-oss/files/patch-conf_wrapper.conf#L20. I think this is perfectly fine. Also make sure to replace line 138: CLASSPATH="$CLASSPATH$CATALINA_HOME/bin/bootstrap.jar:$CATALINA_HOME/bin/commons-daemon.jar" too with ${JAVAJARDIR}/commons-daemon.jar. See https://svnweb.freebsd.org/ports/head/devel/jakarta-commons-daemon/Makefile?view=markup#l33 If you need further assistance, let me know.
So, I can use %%PREFIX%% in patches. Ok, I'll try.
Created attachment 199644 [details] 1st draft Check, plz, this one - is it what you ask?
(In reply to VVD from comment #5) The patch looks good to me, but is incomplete. Please look at this line: https://github.com/apache/tomcat/blob/trunk/bin/daemon.sh#L140 The last path component must be replaced with %JAVAJARDIR%/commons-daemon.jar. See: # make -V JAVAJARDIR /usr/local/share/java/classes # ll /usr/local/share/java/classes/ antlr-3.5.2-complete.jar jline-0.9.94.jar ojdbc-11.2.0.4.jar commons-daemon.jar jline.jar swt-devel.jar hamcrest.jar junit.jar hamcrest1.3.jar junit4.jar
Created attachment 199793 [details] Patch for tomcat9 Check this, plz.
(In reply to VVD from comment #7) Looks very good to me.
Summary contains www/tomcat85, patch is for www/tomcat9. Please clarify which (all?) tomcat ports require the update, and update the summary and patches accordingly
The change applies in general to Tomcat 7/8.5/9 while the patch applies to Tomcat 9 only here. It require slight modifications for 8.5 (and 7 likely).
Created attachment 199796 [details] Patch for tomcat85
(In reply to VVD from comment #11) Applies cleanly, works for me.
Ping! I have to update tomcat85 and tomcat9 to next versions, but can't - I need this patch commited before.
Can someone provide clarity on tomcat7 being affected, and provide a patch for that version too please (set maintainer-approval ? ale@, now CC'd, for that patch, as he is maintainer of tomcat7)
(In reply to Kubilay Kocak from comment #14) As this ticket is labeled for Tomcat 8.5 and 9, I really like to spin another ticket for 7 for those who care and continue with this one so that the maintainer can update Tomcat 8.5 and 9.
(In reply to Michael Osipov from comment #15) I understand the sentiment. Note also that this issue was originally only titled tomcat85 and expanded to include tomcat9 only later. There is nothing preventing the existing patches from being committed, but the issue should be resolved completely, in any ports that are affected by it, which was the basis for comment 14. It's also beneficial in that the maintainer of tomcat7 is a committer, more relevantly appropriate to address the issue across all tomcat ports than someone not familiar with them.
I don't think it worth the effort to patch the tomcat ports for a file that is not used by the port. You can create the setenv.sh file and add the following line to have the same effect: JSVC=/usr/local/bin/jsvc
(In reply to Alex Dupre from comment #17) I do not agree while I understand your argument. Supplied content should always follow POLA. Given that people might waste 15 to 30 min to understand the issue we can easily fix this upfront. That is what a port is for.
tomcat6/7/8 are Alex Dupre's ports and he can do what he want. But tomcat85 and 9 are "mine" and I want to add this patch. Who can commit it?
(In reply to Kubilay Kocak from comment #16) To apply this patch to Tomcat 7 the previous changes made to 85 and 9 have to replicated first. The Makefiles should be minimally different. The current maintainer is ale@. He should be able to do this. As soon as he has done that I can change this patch for tomcat7, but I don't want this issue to be blocked just because ale@ needs time to address those changes first. PS: I am an official Tomcat committer, though don't have any commit permission on the ports.
(In reply to VVD from comment #19) Correct, and given that 6 and 8 are deprecated, even less stuff to be maintained. I have requested their removal.
A commit references this bug: Author: swills Date: Sun Jan 27 15:21:17 UTC 2019 New revision: 491357 URL: https://svnweb.freebsd.org/changeset/ports/491357 Log: www/tomcat{85,9}: fix daemon.sh reference to jsvc PR: 230325 Submitted by: VVD <vvd@unislabs.com> (maintainer) Reported by: Michael Osipov <michael.osipov@siemens.com> Changes: head/www/tomcat85/Makefile head/www/tomcat85/files/patch-bin__daemon.sh head/www/tomcat9/Makefile head/www/tomcat9/files/patch-bin__daemon.sh
Committed, thanks!
Thanks! Update tomcat9 to 9.0.14: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=235249 Update tomcat85 to 8.5.37: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=235250