mirror of
https://github.com/goreleaser/nfpm
synced 2026-11-30 14:04:45 +01:00
Three packagers for macOS, built in pure Go on any platform: - pkg: an installer package (.pkg) from contents and the preinstall and postinstall scripts, as a product archive that declares its architecture. - app: an application bundle delivered as a zip (.app.zip), with a generated Info.plist. - dmg: the same bundle in a disk image (.dmg) next to a link to the Applications folder. app and dmg share the new "app" settings; pkg has its own. All three take name, version, arch and contents from the shared fields, can be signed with a PKCS#12 identity, and report the shared settings macOS has no place for instead of dropping them silently. Refs #535, #536. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
41 lines
1.1 KiB
Go
41 lines
1.1 KiB
Go
package macos
|
|
|
|
import (
|
|
"log"
|
|
|
|
"github.com/goreleaser/nfpm/v2"
|
|
)
|
|
|
|
// WarnRelationships reports the package relationships that are set, none of
|
|
// which a macOS format can express. They are warnings, not errors, so one
|
|
// configuration can keep serving the formats that do support them.
|
|
func WarnRelationships(packager string, info *nfpm.Info) {
|
|
for _, relationship := range []struct {
|
|
name string
|
|
values []string
|
|
}{
|
|
{"depends", info.Depends},
|
|
{"recommends", info.Recommends},
|
|
{"suggests", info.Suggests},
|
|
{"conflicts", info.Conflicts},
|
|
{"replaces", info.Replaces},
|
|
{"provides", info.Provides},
|
|
} {
|
|
if len(relationship.values) > 0 {
|
|
log.Printf(
|
|
"warning: %s: macOS has no package relationships, %s is ignored",
|
|
packager, relationship.name)
|
|
}
|
|
}
|
|
}
|
|
|
|
// WarnScripts reports the given scripts that are set but that the format
|
|
// never runs. names and scripts are parallel.
|
|
func WarnScripts(packager, reason string, names, scripts []string) {
|
|
for n, script := range scripts {
|
|
if script != "" {
|
|
log.Printf("warning: %s: %s, the %s script is ignored", packager, reason, names[n])
|
|
}
|
|
}
|
|
}
|