How gpgtools/macgpg2 works
Project Type and Purpose
• MacGPG2 is a packaging/build‐orchestration project that produces a macOS‐ready distribution of GnuPG 2 (with GnuTLS, Nettle, etc.) by applying a curated set of patches and bundling binaries, configs, and helper scripts into a payload for installation.
High-Level Components
a. Upstream Sources
• GnuPG, GnuTLS, Nettle upstream tarballs or repos
b. Patch Management
• patches/gnupg
• patches/gnutls
• patches/nettle
c. Build Orchestration
• Makefile
• shell scripts (add_version_plist.sh, create_gpg.sh, check_for_new_versions*.sh/.py)
• Version.config, libs.json
• build tools (gcc/clang, lzip, patch, autotools)
d. Packaging & Payload
• payload/bin (convert-keyring, etc.)
• payload/libexec (fixGpgHome, shutdown-gpg-agent)
• payload/etc/skel/.gnupg (default configs)
e. Distribution & Installation
• Resulting “build/MacGPG2” directory → copy to /usr/local/MacGPG2
Relationships & Data Flow
1. Fetch upstream sources
2. Apply patches via patch management
3. Invoke Makefile and helper scripts to configure, compile, and link binaries
4. Generate versioned artifacts (using Version.config, add_version_plist.sh)
5. Populate payload tree with executables, libexec utilities, and config skeletons
6. Package “build/MacGPG2” for end‐user installation
Architectural Patterns & Principles
• Pipeline/chain of transformations: Source → Patch → Build → Package
• Single‐repository orchestration: all patches, scripts, and packaging in one cohesive tree
• Separation of concerns:
• patches/ for all source tweaks
• scripts/Makefile for orchestration
• payload/ for final install layout