Solved Remove old files and place new ones from internet

Hello all,

I'm trying to update a really old port mail/james to 3.4.0 PR 243859. It's built with Java 8 which runs OK on Java 11 with some caveat. It uses log4j (v1) that's EOL in 2015. I'd want to replace with log4j2 jars. I've tested it works with Java 11 because log4j is really broken in Java 9+ and there's a matter of security risk in using EOL software. I can use the patch files to replace the log4j configurations file but I'm at a loss on removing the old jars and put int the new ones. I remember seeing "remove" command in the Makefile for one of the ports. The process I was thinking of is this:

1) Extract
2) Patch (log4j configurations)
3) Remove the old jars.
4) Get the new jars
5) Package

I'm stuck on how to proceed at 3 & 4. I'm thinking that I could tell the port to download the needed jars from the maven repo.

Thanks,
Tommy
 
I didn't understand everything you plan here, but you should definitely follow two principles:
- Anything that must be downloaded has to be done in the fetch phase (so, "get new jars" can't happen after "extract")
- Changing things in the upstream source must be done in the patch phase

You can use special targets like post-patch: in the Makefile if you need to add custom commands.
 
I didn't understand everything you plan here, but you should definitely follow two principles:
- Anything that must be downloaded has to be done in the fetch phase (so, "get new jars" can't happen after "extract")
- Changing things in the upstream source must be done in the patch phase

You can use special targets like post-patch: in the Makefile if you need to add custom commands.
Hi Zirias,

I've found a good working example of what I was looking for in www/tomcat9's Make file. It has the 'remove' command I remembered seeing in the post-patch section you've mentioned.
Makefile:
post-patch:
        @${RM} ${WRKSRC}/bin/commons-daemon-native.tar.gz ${WRKSRC}/bin/commons-daemon.jar ${WRKSRC}/bin/tomcat-native.tar.gz
        @${REINPLACE_CMD} -e 's|%%PREFIX%%|${PREFIX}|g; s|%%JAVAJARDIR%%|${JAVAJARDIR}|g' ${WRKSRC}/bin/daemon.sh
        @${FIND} ${WRKSRC} -name '*.bak' -delete -o -name '*.orig' -delete

Hi SirDice,

Thanks for the reminder. I forgot about the multiple files from different sources.

I have quick question regarding "UPDATING". Do I enter that in the patch? or in the PR? It basically says this:

Code:
YYYYMMDD:
  AFFECTS: users of mail/james
  AUTHOR: ...
 
  This port with built with Java 8 and uses log4j (v1).  Log4j was EOL in 2015
  and is broken in Java 9+.  The log4j has been replaced with log4j2 to mitigate
  security risks and making it more flexibile for later Java versions.


Thank you both.
 
I have quick question regarding "UPDATING". Do I enter that in the patch? or in the PR? It basically says this:
This doesn't need to go in UPDATING. You can add it in the pkg-message. Entries in UPDATING are only needed if there any special considerations when upgrading, if a dependency has to be upgraded beforehand for example.
 
This doesn't need to go in UPDATING. You can add it in the pkg-message. Entries in UPDATING are only needed if there any special considerations when upgrading, if a dependency has to be upgraded beforehand for example.
Thank you for the clarification. I misunderstood about the changes it mentioned in the porter's handbook.
 
Back
Top