OS X package support #332

Merged
merged 1 commit into from Jan 7, 2013

2 participants

@timsutton

For issue #317.

Documentation is up on my Wiki fork here:

https://github.com/timsutton/fpm/wiki/OS-X-packages

Not exactly sure if I can issue a pull request for the Wiki changes.

@timsutton timsutton Initial OS X package support, #317.
Basic support for OS X flat packages (.pkg)

- input/output
- output supports scripts, postinstall actions (using --info option),
  ownership option and bundle-id-prefix option
- requires pkgbuild (therefore OS X 10.7+ only), pkgutil for input
- no tests yet

ignore .DS_Store

ignore .pkg

identifier gets its own method

first few osxpkg spec tests

osxpkg: extract name and version from PackageInfo on input

osxpkg: rename option bundle-id-prefix to identifier-prefix

- 'bundle-id' is ambiguous, given the various 'bundle'-related logic possible with OS X packages

osxpkg: fix old 'osx_' attribute prefix to 'osxpkg' in osxpkg.erb

New option: --osxpkg-dont-obsolete, to add files to 'dont-obsolete' element in PackageInfo.

osxpkg: Define public/private methods.

osxpkg_spec: Tests for basic attributes through input/output
4df9617
@jordansissel jordansissel commented on the diff Jan 7, 2013
lib/fpm/package/osxpkg.rb
+class FPM::Package::OSXpkg < FPM::Package
+
+ # Map of what scripts are named.
+ SCRIPT_MAP = {
+ :before_install => "preinstall",
+ :after_install => "postinstall",
+ } unless defined?(SCRIPT_MAP)
+
+ POSTINSTALL_ACTIONS = [ "logout", "restart", "shutdown" ]
+ OWNERSHIP_OPTIONS = ["recommended", "preserve", "preserve-other"]
+
+ option "--identifier-prefix", "IDENTIFIER_PREFIX",
+ "Reverse domain prefix prepended to package identifier, " \
+ "ie. 'org.great.my'. If this is omitted, the identifer " \
+ "will be the package name."
+ option "--payload-free", :flag, "Define no payload, assumes use of script options.",
@jordansissel
Owner

maybe have this be "--payload" with a default of true? Then you can do: --no-osxpkg-payload

Thoughts?

Sure. The term 'payload-free' is a term of art from the OS X sysadmin world, but I agree the double negative isn't necessary.

I've just made the changes, would you like this as a separate pull request?

@jordansissel
Owner

Oooh ok, if it's already a term used in the OS X system, let's keep it. Thanks for clarifying! :)

Well, not used by the system, but by Mac enterprise mailing lists and bloggers. Packaging on OS X has little official documentation :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@jordansissel jordansissel merged commit 7ce7264 into jordansissel:master Jan 7, 2013

1 check failed

Details default The Travis build failed
@jordansissel
Owner

Thanks! :)

@timsutton

Not being very familiar with Github Wikis, I just realized I can edit the master repo's wiki directly, so please disregard my message in the pull request.

You can also close #317, was hoping that by referencing it in my commit it wouldn't create a new pull request, but it did.

Thanks for FPM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment