Repository Structure
An Azure Linux repository typically consists of:SPECS Directory
Root directory (
$(SPEC_DIR)) with subdirectories for each packageImage Configs
Configuration files (
$(CONFIG_FILE)) defining target imagesToolkit
Build system tools and makefiles
SPECS Directory Layout
Each package has its own subdirectory within the SPECS folder to avoid name collisions:Each spec file is accompanied by a
*.signatures.json file that records expected cryptographic hashes for every source file used in the package.SPEC Files
SPEC files define how packages are built. They contain:- Package metadata (name, version, summary, license)
- Build and runtime dependencies
- Source file locations
- Build instructions
- Installation procedures
- File lists for each package/subpackage
Creating SRPMs
The build system operates on Source RPMs (SRPMs). An SRPM includes both:- The spec file defining the package
- All associated source files (archives, patches, configs, etc.)
SRPM Creation Process
The srpmpacker Tool
Thesrpmpacker tool converts spec files into SRPMs by:
File Signature Handling
Hash checking behavior is controlled by$(SRPM_FILE_SIGNATURE_HANDLING):
- enforce (default)
- skip
- update
Most secure - Only packages source files matching the listed hash
- Validates all source files against signatures
- Downloads missing files from online package server
- Build fails if hashes don’t match
Intermediate Build Artifacts
Intermediate SRPMs
Oncesrpmpacker determines a spec needs re-packaging, it generates an SRPM in:
Intermediate SPECs
Canonical copies of spec files are extracted from SRPMs for dependency analysis:These intermediate specs are used by the
specreader tool to calculate dependency information without reparsing the original files.Build Optimization
The scheduler will skip rebuilding a package if it determines the package is up-to-date. This check includes:- Spec file modification time
- Source file modification times
- Signature file changes
- Dependency changes
Working on Individual Packages
Working on Individual Packages
When iterating on a single package, you may need to force a rebuild even when the build system thinks it’s up-to-date. See the Package Stage guide for tips on:
- Forcing rebuilds of specific packages
- Clearing cached build state
- Bypassing up-to-date checks during development
Source Server Integration
When local sources are missing or have mismatched hashes,srpmpacker queries the source server to download matching files.
Source Server Behavior
- Downloads are verified against the signature hash
- Only sources with matching hashes are accepted
- If no matching source is found, build fails with
404 error - Downloaded sources are cached for future builds
Signature File Format
The*.signatures.json file contains hashes for all sources:
Next Steps
Package Building
Learn how SRPMs are built into RPMs with dependency resolution
Initial Preparation
Return to the initial preparation phase