What is the recommended way to package a C ++ daemon on Mac OSX?

I am working on a multi-platform project consisting of a service / daemon that runs on Windows, Linux and Mac OSX.

The code I have is portable, and the application works fine (from the command line) on all systems. Since this application is designed to run in the background, I made it a Windows service on Windows and a Linux daemon (with corresponding scripts in init.d) for Linux.

Now my problem is Mac OSX: I have little experience with this operating system, and it’s hard for me to find the best methods for my situation:

I would like to have an installer for my project (I believe in the .dmg file, which is most likely to install .app, please correct me if there is a better alternative).

Here is some information about my project:

  • It is fully built in C ++ (it uses boost, curl, iconv)
  • The current build system is not Xcode (however, if there is a way to keep my current code layout while integrating and embedding everything in Xcode, I don't mind, I did something similar for Windows anyway).
  • No graphical user interface
  • The daemon should start automatically at startup (or even better: make a user choice).
  • The daemon requires root access during its execution.

This is probably a lot of context for consideration on one issue, so I will try to simplify its reading:

How would you package / create the installer for the pure-C ++ daemon on Mac OSX?

+4
source share
3 answers

, .app - GUI, . ( , , , , ..), unix /usr/local/libexec ( , Linux). , /usr/local OS X, , .

: launchd. .plist /Library/LaunchDaemons (LaunchDaemons root , LaunchAgents , ). , - launchd , , , , . , .

: mah - . - PackageMaker GUI (, - ), CLI, , . /usr/local/libexec, "" ( libexec ), /usr - /usr/local , , , , . , /Library/LaunchDaemons , .plist, .

+3

.app , , , , (, , , , /dylib ), ).

, , , - pkgbuild productbuild, /usr/bin. OS X, Pro-Xcode Developer ID ready pkg, .

+3

Apple? , ( , , ).

( ). launchd / deamon OSX . - , OS X, .

+2

All Articles