Traccar port

Your MASTER_SITES is not good. The port should download the original sources. The original sources are hosted on Github here: https://github.com/traccar/traccar. The way it's set up now it will never be accepted. You can submit your port here: https://bugs.freebsd.org/bugzilla/
Packages don't need to be created, they will be created from the port (if it's been accepted).


Code:
RUN_DEPENDS=		${LOCALBASE}/openjdk11-jre/bin/java:java/openjdk11-jre
This is not how you add a dependency on Java.

Code:
USES=			mysql:server, mysql:client
Why is it pulling in mysql:server?

Code:
: ${traccar_java:="/usr/local/openjdk11-jre/bin/java"} # path to your JRE
Doesn't take into account the default Java might change. See "Using Java" in the porter's handbook.
 
This port not need original sources. Because they are not adapted for freebsd at all. Compilation from original sources will not work on freebsd.
Traccar devs not plan support freebsd.
USE_JAVA is not good in this case, because port must be located in java. Easy way its run as www.
dist files contains just original extracted compiled servlet.
About mysql... yes, I think needs remove this.

PS: I reworked port.
MASTER_SITES= https://github.com/traccar/traccar/releases/download/v4.12/
USES= zip
 
Because they are not adapted for FreeBSD at all. Compilation from original sources will not work on FreeBSD.
That's exactly what a port is supposed to do. Make it work on FreeBSD.
Traccar devs not plan support FreeBSD.
That's fine, a large portion of our ports aren't supported by the upstream developers.
USE_JAVA is not good in this case, because port must be located in java.
I doubt this. It's usually just a case of setting the various class paths correctly.
Easy way its run as www.
It would be preferable to have its own 'traccar' uid for this.
 

but it's not very clear how to add a user to GIDs and UIDs. maybe patch from port?
Add an additional patch for the ports/UIDs and ports/GIDs files. Do not patch these files from within the port. This patch just has to be applied by the committer. So you add two patches when submitting the port, one is for the port itself, the other for patching the UIDs and GIDs files.
 
I tried to improve the port for my own needs although it needs a bit more such as for the pkg-message. The updated port and a patch can be found here: https://people.freebsd.org/~scf/traccar/

Some of the changes I made to it:
  • Use UID and GID specific to traccar.
  • Use the provided default.xml yet comment out all the listeners by default. Otherwise, the server opens all of those ports. Already, the traccar.xml.in with the port opens the port for the Android client.
  • default.xml and traccar.xml are installed as .sample files.
  • Improve utilization of variables passed for substitution in the port files.
  • Switched to a little newer Java version 12, but this could be 11 to match what upstream uses.
  • Removed the requirement on MySQL from the rc script. Two reasons for this:
    • It is hard-coded against MySQL yet other database engines could be used. I tested with PostgreSQL.
    • There is no guarantee the database server will be on the same host as traccar.
For the last point, I am not sure if there is a better way to guarantee that the database server is running before traccar. For what I have been testing, the database server is running before other services, but I do not know how to make that work with the port. Possibly, traccar can handle database issues better if it does not already?

It still uses the compiled release from the GitHub server repo. While it would be great for someone to convert the port to actually compile everything, I lack the time to do that. :(

Thank you for the hard work to get it to this point, metacreo!
 
Back
Top