[MacPorts] #48302: tomcat8 @ 8.0.24 looking for review/feedback/help

Björn Raupach raupach at me.com
Sun Jul 12 11:03:08 PDT 2015


hi,

> On 11 Jul 2015, at 11:14, MacPorts <noreply at macports.org> wrote:
> 
> #48302: tomcat8 @ 8.0.24 looking for review/feedback/help
> -------------------------+--------------------------------
>  Reporter:  raupach@…   |      Owner:  macports-tickets@…
>      Type:  submission  |     Status:  new
>  Priority:  Normal      |  Milestone:
> Component:  ports       |    Version:  2.3.3
> Resolution:              |   Keywords:
>      Port:              |
> -------------------------+--------------------------------
> 
> Comment (by cal@…):
> 
> - `openmaintainer` is meaningless without a real maintainer associated
> with it. So either add yourself in the `domain.tld:localpart` obfuscated
> format, or just use `no maintainer`.

no maintainer it is

> - We prefer `sha256` and `rmd160` checksums nowadays. If you delete the
> checksums line and run `port -v checksum`, the correct line will be
> printed.

ok, did that

> - You're mixing tabs and spaces in the `depends_lib` line

my bad, I check for soft tabs again

> - MacPorts has a `delete` command that wraps `file delete` that you could
> use instead of `file delete` in the pre-destroot block. I think it doesn't
> make a difference in this case, but it's still shorter.
> - If you're overriding the destroot phase anyway, there's little point in
> splitting out parts of it into pre- or post-destroot.

I saw it in other java ports, for example maven and derby. They used pre-destroot to
remove unnecessary *.bat files. 

> - don't set `destroot.keepdirs` in a phase; do it at the top level of the
> Portfile
> - If you want, you can create a custom account for tomcat using the
> `add_users` directive. You could also use OS X' builtin `_www` user.

The tar.gz archive contains two empty directories: work and logs. Both
are needed for running Apache Tomcat.

Here is part of my Portfile:

    destroot.keepdirs   ${catalina_home}/logs ${catalina_home}/work

    set catalina_home ${destroot}${prefix}/share/java/${name}
    set tomcat_user tomcat
    set tomcat_group tomcat
    add_users ${tomcat_user} group=${tomcat_group} realname=Apache\ Tomcat

In the destroot phase I do a `xinstall -d -g ${tomcat_group} -m 755 ${catalina_home}`
and copy all the files via `file copy` to catalina_home. 

Why does the group not change? I expected root:tomcat but the directory is still root:admin.

The two directories work and logs do appear but I expected root:tomcat and not 
root:admin.

Should I do a `file attributes work -group tomcat` or something like that in the
post-activate phase?

> - Please provide a launchd control interface so `port load tomcat8` will
> start and `port unload tomcat8` will stop the server. Search other
> Portfiles for `startupitem` to see how it's done -- if you need help,
> please feel free to ask here or on -dev.

thanks. I have a look.

> - If your port installs configuration files that should stay around after
> a user uninstalls the port and should not be overwritten by updates, move
> the configuration file by appending ".sample" and add a note (`notes your-
> text-here`) to tell the user that he needs to configure tomcat by creating
> the file before starting it.

will do

> 
> -- 
> Ticket URL: <https://trac.macports.org/ticket/48302#comment:1>
> MacPorts <https://www.macports.org/>
> Ports system for OS X



More information about the macports-dev mailing list