Skip to main content

No project description provided

Project description

macOS-Pkg-Builder

Python module for creating macOS packages more easily through native tooling (pkgbuild). Primarily developed as an alternative to WhiteBox's Packages for easier CI/CD integration.

Usage

Installation:

pip3 install macos-pkg-builder

Sample invocation:

import macos_pkg_builder

pkg_obj = macos_pkg_builder.Packages(
    pkg_output="Sample.pkg",
    pkg_bundle_id="com.myapp.installer",
    pkg_preinstall_script="Samples/MyApp/MyPreinstall.sh",
    pkg_postinstall_script="Samples/MyApp/MyPostinstall.sh",
    pkg_file_structure={
        "Samples/MyApp/MyApp.app": "/Applications/MyApp.app",
        "Samples/MyApp/MyLaunchDaemon.plist": "/Library/LaunchDaemons/com.myapp.plist",
    },
)

pkg_obj.build()

Format of Packages constructor:

"""
    pkg_output:             Path to where the package will be saved.

    pkg_bundle_id:          Bundle ID of the package.

    pkg_version:            Version of the package.
                            Default: 1.0.0

    pkg_install_location:   Location where the package will be installed.
                            Default: /
                            Optional.

    pkg_allow_relocation:   Allow the embedded application to be installed where the user has an existing copy (outside expected install location)
                            Requires a valid bundle to be provided in 'pkg_file_structure' (ex. app, plugin, etc.)
                            Default: True

    pkg_file_structure:     File structure of the package.
                            Configured as a dictionary, where the key is the source file and the value is the destination.
                            Default: None
                            Optional if preinstall or postinstall scripts are provided.

    pkg_preinstall_script:  Path to the preinstall script.
                            Default: None
                            Optional.

    pkg_postinstall_script: Path to the postinstall script.
                            Default: None
                            Optional.

    File Structure:
        {
            # Source: Destination
            "~/Developer/MyApp.app": "/Applications/MyApp.app",
            "~/Developer/MyLaunchDaemon.plist": "/Library/LaunchDaemons/com.myapp.plist",

        }
"""

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

macos_pkg_builder-1.0.2-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file macos_pkg_builder-1.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for macos_pkg_builder-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 de70fc1a463c591393dcf457593e4231b57998208e6e45429972e5e39eb6fa92
MD5 3fab6b982fd03a7f0c926df4d8135392
BLAKE2b-256 1e66642920e86ab1dc7123407373b5e38531fa7d9076379ec51ac4f0c4d476d4

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page