[MacPorts] #52144: mariadb: support for mpkg / mdmg
MacPorts
noreply at macports.org
Mon Sep 5 02:32:51 CEST 2016
#52144: mariadb: support for mpkg / mdmg
-----------------------------+-----------------------
Reporter: ctreleaven@… | Owner: pixilla@…
Type: enhancement | Status: new
Priority: Normal | Milestone:
Component: ports | Version:
Resolution: | Keywords:
Port: mariadb-server |
-----------------------------+-----------------------
Comment (by ctreleaven@…):
Attached is a new patch that adds packaging support as well as a couple of
small tweaks to my previous patch. At over 150 lines, I know it is a lot
to take in but it breaks down into logical groups. As in the previous
patch, there are sections to copy the launchd plist out of ${filespath}
and update the ${prefix} and port name. Then there are post-activate and
pre-deactivate blocks to link/unlink the plist into
/Library/LaunchDaemons. Then 29 lines for the plist itself.
Now added is a pre-pkg block. This copies the two scripts (preinstall and
postinstall) from ${filespath} and fixes the @NAME@ and @PREFIX@
placeholders. Also, ensures that the scripts have 0755 permissions. The
preinstall script uses 'launchctl list' to check if the deamon is supposed
to be running. If so, it unloads it. The postinstall script:
- forces the launchd plist to 0644 permissions. I don't think the
_should_ be necessary but sometimes had problems during testing. Easier
just to use a sledgehammer and force it.
- remove the old link in /Library/LaunchDaemons (if one is there) and put
in the new one
- force the right user/group on our directories in var/run, var/db and
var/log.
- run the upstream database initialization script, mysql_install_db.
- again checks for a loaded daemon and unloads it if it is. Again ought
to be unnecessary but harmless if the preinstall script did its job.
- finally, use launchctl to load the daemon. The command line arguments
in the launchd plist should bring up a minimally configured db server.
Subsequently, the user (or another installer) can add a my.cnf
configuration file to customize as desired.
In addition, I made a gratuitous change to the long_description. (Wording
is a mash-up from the MariaDB About page.) This description appears on
the Installer splash screen after packaging and seems a little more
descriptive of what the user is about to inflict on their system.
Barring objections, I plan commit these changes under openmaintainer in
the next few days. I feel the startupitem to launchd plist changes are
relatively low risk. I'll try to handle anything that might crop up.
My packaging-related changes only have any effect if one is creating an
mpkg or mdmg. My impression is that there are very few people doing that
--it would not work now because of the daemondo problem.
--
Ticket URL: <https://trac.macports.org/ticket/52144#comment:3>
MacPorts <https://www.macports.org/>
Ports system for macOS
More information about the macports-tickets
mailing list