Working on new port for PhantomBot. I need guidance on how/where to install it.

I am trying to learn how to write a port for PhantomBot which is a Twitch bot written in Java. It uses Apache ant to build. I have USE_ANT=yes in the Makefile, and so it automatically runs ant on build.xml. But immediately after ant finishes building the project, make is called on the Makefile in the project's source directory. This is completely unnecessary as the Makefile basically just sets environment variables and runs ant. So, if not for the error encountered because it requires gmake, it would just end up building the same project twice in a row.

I thought perhaps I could simply delete the Makefile in the project's source, but then there is a failure because it can't find the Makefile.

How do I prevent make from running on the project after ant finishes? It doesn't make any sense to me that it would do this because the handbook says that setting USE_ANT sets ant as the submake command. I wouldn't expect BSD make to be run at all in this case.
 
I figured out how to handle the issues I described above. But the biggest issue I need help figuring out is how/where to install this thing. This is a Twitch chat bot written in Java. It runs as a daemon. So I'll need to write an RC script to manage the daemon. That shouldn't be very difficult. But the upstream documentation ( https://phantombot.dev/guides/ ), for Unix-like OSes such as Linux and Mac, instruct the user to create a dedicated user for the bot, a home directory for that dedicated user, and install the bot into a directory within that home directory. Apparently the bot is written in such a way that it expects all the files to be within a single hierarchical directory structure. It doesn't seem to have any support for having some files in /usr, some in /etc, etc. And I was already told on IRC that giving a bot/daemon its own home directory was a no-go.

Now I suppose this limitation could be overcome with the creative use of symlinks. But perhaps it would be easiest if there were a directory that would be suitable for such programs. /opt is the only thing I can think of which might be suitable. But if no such thing exists, then I'd need to figure out where to put everyting. There's the main jar file as well as all the supporting jars and classes which would be static and which I would have automatically replaced during updates of the package. There are the configuration files which can be edited manually by the user but may also be changed by the program when the user interacts with the web interface. Then there are the directories user-added features like media files, scripts, etc. So it's not entirely clear where these things should be put even if it was divvied up across the filesystem and pointed to by symlinks in some central directory.

I may be overthinking this a bit, but I need good answers because I have two other programs I want to write ports for (BBS software such as Synchronet and WWIV) which also are designed by upstream to be run as daemons with a dedicated user which have their own home directories.
 
Back
Top