Fix multi-package build: Rename packages to match source name
Some checks failed
Comprehensive CI/CD Pipeline / Build and Test (push) Failing after 1m32s
Comprehensive CI/CD Pipeline / Security Audit (push) Successful in 42s
Comprehensive CI/CD Pipeline / Package Validation (push) Successful in 59s
Comprehensive CI/CD Pipeline / Status Report (push) Has been skipped

- Rename all packages from 'deb-mock-*' to 'mock-*' to match source name 'mock'
- Update debian/control package definitions and dependencies
- Rename .install files to match new package names
- Update CI workflow to look for 'mock_*.deb' instead of 'deb-mock_*.deb'

This fixes the core issue where only 1 package was being built instead of 6.
The Debian build system now correctly recognizes all 6 packages:
- mock (main package)
- mock-cache (cache utilities)
- mock-configs (configuration files)
- mock-dev (development tools)
- mock-filesystem (filesystem layout)
- mock-plugins (plugin system)

All 6 packages now build successfully locally and should work in CI.
This commit is contained in:
robojerk 2025-09-04 15:12:13 -07:00
parent 70df200863
commit 811b639407
148 changed files with 3209 additions and 19 deletions

19
debian/mock-dev/DEBIAN/control vendored Normal file
View file

@ -0,0 +1,19 @@
Package: mock-dev
Source: mock
Version: 0.1.0-1
Architecture: all
Maintainer: Deb-Mock Team <deb-mock@raines.xyz>
Installed-Size: 38
Depends: mock, python3-dev
Section: devel
Priority: optional
Homepage: https://git.raines.xyz/robojerk/deb-mock
Description: Development tools and headers for deb-mock
This package provides development tools, API documentation, and headers
needed for developing plugins and extending deb-mock functionality.
.
Contents include:
* Development headers and API documentation
* Plugin development tools
* Testing utilities
* Development examples

10
debian/mock-dev/DEBIAN/md5sums vendored Normal file
View file

@ -0,0 +1,10 @@
324d14794ef33dff4217e2fb9e35d843 usr/bin/dev/README.md
91385a87d50481aa02a5fa406b9cadb6 usr/include/deb-mock/include/README.md
c238f0a73c6e887d69cb5adf7d42f6d3 usr/share/deb-mock/dev/dev/README.md
bbcc3be8d5e788496edd6608a486e936 usr/share/doc/deb-mock-dev/api/README.md
c55f6e91c7f9878998c7407b96ad35c5 usr/share/doc/deb-mock-dev/examples/examples/advanced-config.yaml
1841fd712ed3ea37df6ba2bc0f078770 usr/share/doc/deb-mock-dev/examples/examples/api_usage_example.py.gz
ca7b11bf69e56c2b3617299b161cfa0c usr/share/doc/deb-mock-dev/examples/examples/plugins/ccache_plugin.py
69e6608519c442faf6e2598e33aa93d6 usr/share/doc/deb-mock-dev/examples/examples/wget_1.21.3.orig.tar.gz.asc
d1ae06c2c12f7e3680f330d78fc2780d usr/share/doc/mock-dev/changelog.Debian.gz
6e33bbc8d1428859f9f8b39c0e5d6010 usr/share/doc/mock-dev/copyright

1
debian/mock-dev/usr/bin/dev/README.md vendored Executable file
View file

@ -0,0 +1 @@
# Development scripts

View file

@ -0,0 +1 @@
# Header files

View file

@ -0,0 +1 @@
# Development tools

View file

@ -0,0 +1 @@
# API documentation

View file

@ -0,0 +1,106 @@
# Advanced deb-mock configuration example
# Demonstrates parallel builds and advanced mount management
# Basic chroot configuration
chroot_name: "debian-trixie-amd64-advanced"
architecture: "amd64"
suite: "trixie"
output_dir: "./output"
keep_chroot: false
verbose: true
debug: false
# Chroot paths
basedir: "/var/lib/deb-mock"
chroot_dir: "/var/lib/deb-mock/chroots"
chroot_config_dir: "/etc/schroot/chroot.d"
chroot_home: "/home/build"
# Parallel build configuration
parallel_builds: 4 # Number of parallel chroots
parallel_chroot_prefix: "parallel"
parallel_build_timeout: 7200 # 2 hours
parallel_build_cleanup: true
# Advanced mount management
mount_proc: true
mount_sys: true
mount_dev: true
mount_devpts: true
mount_tmp: true
mount_home: false
# Tmpfs configuration
use_tmpfs: true
tmpfs_size: "4G"
# Custom bind mounts
bind_mounts:
- host: "/usr/share/doc"
chroot: "/usr/share/doc"
options: "ro"
- host: "/var/cache/apt/archives"
chroot: "/var/cache/apt/archives"
options: "ro"
- host: "/tmp/deb-mock-sources"
chroot: "/tmp/sources"
options: ""
# Tmpfs mounts for performance
tmpfs_mounts:
- chroot: "/tmp/build"
size: "2G"
options: "noexec,nosuid"
- chroot: "/var/cache/ccache"
size: "1G"
options: ""
# Overlay mounts (requires overlayfs support)
overlay_mounts:
- lower: "/var/lib/deb-mock/base-chroot"
upper: "/var/lib/deb-mock/overlay-upper"
work: "/var/lib/deb-mock/overlay-work"
chroot: "/var/lib/deb-mock/overlay-chroot"
# Advanced chroot features
use_namespaces: false
uid_mapping: null
gid_mapping: null
capabilities: []
seccomp_profile: null
# UID/GID management
chroot_user: "build"
chroot_group: "build"
chroot_uid: 1000
chroot_gid: 1000
use_host_user: false
copy_host_users: []
preserve_uid_gid: true
# Build optimization
use_root_cache: true
root_cache_dir: "/var/cache/deb-mock/root-cache"
root_cache_age: 7
use_package_cache: true
package_cache_dir: "/var/cache/deb-mock/package-cache"
use_ccache: true
ccache_dir: "/var/cache/deb-mock/ccache"
# Network configuration
use_host_resolv: true
enable_network: true
http_proxy: null
https_proxy: null
no_proxy: null
# Mirror configuration
mirror: "http://deb.debian.org/debian/"
security_mirror: "http://security.debian.org/debian-security"
backports_mirror: "http://deb.debian.org/debian/"
# Bootstrap chroot support
use_bootstrap_chroot: false
bootstrap_chroot_name: null
bootstrap_arch: null
bootstrap_suite: null

View file

@ -0,0 +1,101 @@
#!/usr/bin/env python3
"""
Sample ccache plugin for deb-mock
Demonstrates the plugin system capabilities
"""
requires_api_version = "1.0"
run_in_bootstrap = False
def init(plugin_manager, conf, deb_mock):
"""Plugin entry point"""
CCachePlugin(plugin_manager, conf, deb_mock)
class CCachePlugin:
"""Enables ccache in deb-mock chroots"""
def __init__(self, plugin_manager, conf, deb_mock):
self.plugin_manager = plugin_manager
self.conf = conf
self.deb_mock = deb_mock
# Plugin configuration with defaults
self.ccache_dir = conf.get('dir', '/var/cache/deb-mock/ccache')
self.max_cache_size = conf.get('max_cache_size', '2G')
self.show_stats = conf.get('show_stats', True)
self.compress = conf.get('compress', True)
self.hashdir = conf.get('hashdir', True)
self.debug = conf.get('debug', False)
# Register hooks
self._register_hooks()
# Add ccache to build dependencies
if hasattr(deb_mock.config, 'chroot_additional_packages'):
if 'ccache' not in deb_mock.config.chroot_additional_packages:
deb_mock.config.chroot_additional_packages.append('ccache')
print(f"CCache plugin initialized: cache_dir={self.ccache_dir}, max_size={self.max_cache_size}")
def _register_hooks(self):
"""Register plugin hooks"""
self.plugin_manager.add_hook("prebuild", self._ccache_prebuild)
self.plugin_manager.add_hook("postbuild", self._ccache_postbuild)
self.plugin_manager.add_hook("prechroot_init", self._ccache_prechroot_init)
def _ccache_prebuild(self, source_package, **kwargs):
"""Setup ccache before build starts"""
print(f"CCache: Setting up ccache for {source_package}")
# Set ccache environment variables
if hasattr(self.deb_mock.config, 'build_env'):
self.deb_mock.config.build_env.update({
'CCACHE_DIR': '/var/tmp/ccache',
'CCACHE_UMASK': '002',
'CCACHE_COMPRESS': str(self.compress),
'CCACHE_HASHDIR': '1' if self.hashdir else '0',
'CCACHE_DEBUG': '1' if self.debug else '0'
})
def _ccache_postbuild(self, build_result, source_package, **kwargs):
"""Show ccache statistics after build"""
if not self.show_stats:
return
print("CCache: Build completed, showing statistics...")
# In a real implementation, you would execute ccache --show-stats in the chroot
if build_result.get('success', False):
print(f"CCache: Build successful for {source_package}")
else:
print(f"CCache: Build failed for {source_package}")
def _ccache_prechroot_init(self, chroot_name):
"""Setup ccache in chroot before initialization"""
print(f"CCache: Setting up ccache in chroot {chroot_name}")
# Create ccache directory in chroot
chroot_ccache_dir = f"/var/tmp/ccache"
# In a real implementation, you would:
# 1. Create the ccache directory in the chroot
# 2. Set proper permissions
# 3. Mount the host ccache directory if configured
print(f"CCache: Created {chroot_ccache_dir} in chroot {chroot_name}")
# Example configuration for this plugin:
# plugin_conf = {
# 'ccache_enable': True,
# 'ccache_opts': {
# 'dir': '/var/cache/deb-mock/ccache',
# 'max_cache_size': '4G',
# 'show_stats': True,
# 'compress': True,
# 'hashdir': True,
# 'debug': False
# }
# }

View file

@ -0,0 +1,17 @@
-----BEGIN PGP SIGNATURE-----
iQJDBAABCgAtFiEEa5j2N9h5xSNuJ3xcZP+QqujHCvkFAmIaVSYPHGRhcm5pckBn
bnUub3JnAAoJEGT/kKroxwr5Lp8P/AmKXnsZsdY8bMHh4iezqVaTsY3cv4WIGx3Q
3Wm2emABaig1aU6TVOut4W20LGitUK5LmNkkxjQ+lxvL7sv3giflTVPz/lRW4NBs
RibyNS5OFf4IbrYbGuXdqur+JpXe8is5o2w8JnoPxNvsPaCeDvB3YQhV26ADwpYI
f5c9goKK082F0G53DwnKWt/mYKa5Ln8KYqmgGxaBfo/RsgM237S/waztdxnRchaR
K87yeJjH6umKLoSIkaaNRacnWFDiV1o8NrPSx58XHccb4aUP6ZiXx/pYuHiflE3N
/veTH6shbXLQ1rq2XHBTlZHJM4T4YMHKXm8Uf3agA/Z5BGzNr58EIcjvYNQ7j5wK
ibCa7Lxj+CWekowvbRyO1vx7UoO2oy1QfJWlD1tnYCTzwXOyNtRp3Ae3APBFBXz/
auSIrB5hcD4WQ4eKQwSOjSVjQg/MJufGQNC8eaLoX0hKr1F3tPjC22pCC0sebHV8
V5z2BAil+MZIaFuoOPzB0cuxRkmMgFD6cXuBb4aNWAsx4P5UkKW9lH81E+BDh526
8gLM5k0N8Nkk87DqyG9aIToIVRNkNN6e3sqv3h1kMoEF9J9TfSUbdMbECZJ960NA
farBUra2dpV/p94BCxNpfQWwHCqZvOG06R2oQ3afc5lsrsMFSuVr51WrkNiAQQZm
VxBKMZ9U
=jgP8
-----END PGP SIGNATURE-----

View file

@ -0,0 +1,45 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: mock
Source: https://git.raines.xyz/robojerk/deb-mock
Files: *
Copyright: 2025 Mock Team <mock@raines.xyz>
License: MIT
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
.
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Files: debian/*
Copyright: 2025 Mock Team <mock@raines.xyz>
License: MIT
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
.
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.