go-macos-pkg was built out of a desire to generate and sign macOS pkgs on non-macOS OSs.

pkg.go.dev

About

go-macos-pkg was built out of a desire to generate and sign macOS pkgs on non-macOS OSs.

Caveats

  • Right now most of the heavy lifting is done by calling the xar and cpio utilities, as there aren't currently (2021) Go libraries that write xar or pre-SVR4 cpio files. The good news is those utilites are available on other OSs, unlike productsign/productbuild
  • Right now only payload-free (e.g. just runs postinstall) packages can be generated as that's all I currently need. It shouldn't be too hard for someone to add payload capabilities, though.

Usage

script := []byte("#!/bin/bash\necho 'hello, world!'\n")

pkg, err := macospkg.GeneratePkg("com.github.korylprince.go-macos-pkg", "1.0.0", script)
if err != nil {
    log.Fatalln("could not generate pkg:", err)
}

// use Apple Developer ID Installer cert and key to sign
signed, err := macospkg.SignPkg(pkg, cert, key)
if err != nil {
    log.Fatalln("could not sign pkg:", err)
}

if err = os.WriteFile("signed.pkg", signed, 0644); err != nil {
    log.Fatalln("could not write signed pkg:", err)
}
Similar Resources

twitter clone front-end for Internet Engineering course - fall 99 built by go+echo

twitter backend build twitter-like back-end for internet engeering course - fall 99 with go+echo+gorm team mates Roozbeh Sharifnasab + Parsa Fadaee +

Nov 9, 2022

A serverless sync server for Santa, built on AWS

Rudolph Rudolph is the control server counterpart of Santa, and is used to rapidly deploy configurations to Santa agents. Rudolph is built in Amazon W

Dec 5, 2022

A Lambda function built with SAM (Serverless Application Module)

AWS SAM Lambda Function © Israel Pereira Tavares da Silva The AWS Serverless Application Model (SAM) is an open-source framework for building serverle

Dec 19, 2021

A simple api built in Go that facilitates directly sending email from your client side html to your inbox

go-email-service A simple api built in Go that facilitates directly sending emai

Dec 28, 2021

An app/container built in Go to automate a Twitter account using Notion

Notion Tweeter Notion Tweeter is a utility I built using Go to help automate scheduling my tweets using Notion as a backend. More documentation coming

Sep 26, 2022

Komikuapitk - Restful API Manga bahasa Indonesia built with Go

Komikku API Restful API Manga bahasa Indonesia built with ❤️ and Go Usage Clone

Sep 2, 2022

A simple OpenWeather API client built in Go for learning purpose.

OpenWeather client A simple OpenWeather API client built in Go for learning purpose

May 1, 2022

Generate Markdown table for starred repo for a user.

Generate Markdown table for starred repo for a user.

List of Starred Repository How this generated? Id Name Description Star Counts Topics/Tags Last Updated 1 coreutils Cross-platform Rust rewrite of the

Dec 14, 2022

🔗 Generate a temporary login URL for the AWS Console

AWS Console 🔗 Generate a temporary login URL for the AWS Console Installation Prebuilt binaries for several architectures can be found attached to an

Dec 20, 2022
Comments
  • Hw to install xar utility on Linux/Ubuntu or Windows?

    Hw to install xar utility on Linux/Ubuntu or Windows?

    Hi, I tried

    1. sudo apt-get install xar E: Unable to locate package xar

    2. try build and install from the code https://code.google.com/archive/p/xar/downloads and it came out this error when running $./configure

    checking for OpenSSL_add_all_ciphers in -lcrypto... no configure: error: Cannot build without libcrypto (OpenSSL)

    The issue is that the xar code I was trying to build is 10 years old, and uses the deprecated OpenSSL 1.0 API.

    https://github.com/mackyle/xar/tree/master/xar looks even older

    So how to install xar utility on Linux?

Dynamodb-expire-non-latest - Dynamodb spike to find best solution to set expire on old records

Goal, expire non-latest records User (identified by IP address), adds record A,

Jan 5, 2022
Mailctl - A non-TUI, easy-to-use, fun, modern console-based email app

mailctl (in alpha) modern console-based email app (not TUI!) Thanks for checking

Oct 5, 2022
A web server that sits beside jupyterhub and scrapes answers out of notebook files.

A Prototype grader tool that runs with jupyterhub that essentially parses jupyter notebooks and responds with a set of form fields automatically fille

Feb 22, 2022
planet is a blockchain built using Cosmos SDK and Tendermint and created with Starport.

planet planet is a blockchain built using Cosmos SDK and Tendermint and created with Starport. Get started starport chain serve serve command install

Oct 31, 2021
A decentralized vinyl marketplace demo built with Go, Cosmos SDK and Starport

emusicchain emusicchain is a blockchain built using Cosmos SDK and Tendermint and created with Starport. Get started starport chain serve serve comma

Dec 5, 2021
A very simple local client-server calculator project built using Cobra and socket programming, written in Go.

Golculator Introduction A very simple local client-server calculator project built using Cobra and socket programming, written in Go. Setup and run Fi

Apr 3, 2022
A simple command line -based snake game built with go and termbox
A simple command line -based snake game built with go and termbox

snake-task Snake Game A simple command line -based snake game built with go and termbox library. This is a test task for a Golang positon. It took me

Jan 16, 2022
Simple CRUD API written in Go, built using AWS SAM tool and using the AWS' infrastructure.
Simple CRUD API written in Go, built using AWS SAM tool and using the AWS' infrastructure.

tutor-pet API Simple CRUD API written in Go, built using AWS SAM tool and using the AWS' infrastructure. Macro architecture: Code architecture: Pre-Re

Aug 17, 2022
Nvote - Decentralized, vote-driven community similar to services like Reddit and HackerNews. Built on nostr

NVote Nvote is a decentralized, vote-driven community similar to services like R

Jan 4, 2023