diff --git a/.forgejo/workflows/ci.yml b/.forgejo/workflows/ci.yml index f5452da..5a2cf29 100644 --- a/.forgejo/workflows/ci.yml +++ b/.forgejo/workflows/ci.yml @@ -156,16 +156,16 @@ jobs: dpkg-buildpackage -b -us -uc # Check if packages were created - if ls ../deb-mock_*.deb >/dev/null 2>&1; then + if ls ../mock_*.deb >/dev/null 2>&1; then echo "✅ Debian packages created successfully" echo "Built packages:" - ls -la ../deb-mock_*.deb + ls -la ../mock_*.deb # Copy packages to current directory echo "Copying packages to current directory..." - cp ../deb-mock_*.deb . + cp ../mock_*.deb . echo "✅ Packages copied:" - ls -la deb-mock_*.deb + ls -la mock_*.deb else echo "❌ No Debian packages found" exit 1 @@ -347,7 +347,7 @@ jobs: echo "Publishing .deb packages to Forgejo Debian Registry..." # .deb files are MANDATORY - fail if none exist - if ! ls deb-mock_*.deb >/dev/null 2>&1; then + if ! ls mock_*.deb >/dev/null 2>&1; then echo "❌ CRITICAL: No .deb files found!" echo "🚨 .deb packages are REQUIRED - build must fail" exit 1 @@ -365,7 +365,7 @@ jobs: FORGEJO_COMPONENT="main" # Package component # Publish each .deb file - for deb_file in deb-mock_*.deb; do + for deb_file in mock_*.deb; do echo "📦 Publishing $deb_file..." # Extract package info diff --git a/debian/.debhelper/generated/_source/home/.local/bin/deb-mock b/debian/.debhelper/generated/_source/home/.local/bin/deb-mock new file mode 100755 index 0000000..30ff949 --- /dev/null +++ b/debian/.debhelper/generated/_source/home/.local/bin/deb-mock @@ -0,0 +1,8 @@ +#!/usr/bin/python3 +# -*- coding: utf-8 -*- +import re +import sys +from deb_mock.cli import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/debian/.debhelper/generated/_source/home/.local/bin/pyproject-build b/debian/.debhelper/generated/_source/home/.local/bin/pyproject-build new file mode 100755 index 0000000..8e45e62 --- /dev/null +++ b/debian/.debhelper/generated/_source/home/.local/bin/pyproject-build @@ -0,0 +1,8 @@ +#!/usr/bin/python3 +# -*- coding: utf-8 -*- +import re +import sys +from build.__main__ import entrypoint +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(entrypoint()) diff --git a/debian/.debhelper/generated/_source/home/.rustup/settings.toml b/debian/.debhelper/generated/_source/home/.rustup/settings.toml new file mode 100644 index 0000000..e34067a --- /dev/null +++ b/debian/.debhelper/generated/_source/home/.rustup/settings.toml @@ -0,0 +1,3 @@ +version = "12" + +[overrides] diff --git a/debian/.debhelper/generated/mock-cache/dh_installchangelogs.dch.trimmed b/debian/.debhelper/generated/mock-cache/dh_installchangelogs.dch.trimmed new file mode 100644 index 0000000..38a9020 --- /dev/null +++ b/debian/.debhelper/generated/mock-cache/dh_installchangelogs.dch.trimmed @@ -0,0 +1,18 @@ +mock (0.1.0-1) unstable; urgency=medium + + * Initial release + * Debian package build environment manager + * Direct functional replacement for Fedora's Mock + * Features: + - Isolated chroot environments for package building + - Multi-package chain building support + - Build metadata capture and storage + - Reproducible build enforcement + - Core configurations for popular distributions + - Plugin system for extensibility + - Package management within chroots + - Advanced build options and debugging tools + * CI/CD integration with Forgejo Actions + * Comprehensive test suite with 30 tests + + -- Mock Team Wed, 22 Jan 2025 12:00:00 +0000 \ No newline at end of file diff --git a/debian/.debhelper/generated/mock-cache/installed-by-dh_install b/debian/.debhelper/generated/mock-cache/installed-by-dh_install new file mode 100644 index 0000000..f127f9f --- /dev/null +++ b/debian/.debhelper/generated/mock-cache/installed-by-dh_install @@ -0,0 +1,4 @@ +./cache-plugins/ +./cache.d/ +./cache-utils/mock-cache-clean +./docs/cache/ diff --git a/debian/.debhelper/generated/mock-cache/installed-by-dh_installdocs b/debian/.debhelper/generated/mock-cache/installed-by-dh_installdocs new file mode 100644 index 0000000..e69de29 diff --git a/debian/.debhelper/generated/mock-configs/dh_installchangelogs.dch.trimmed b/debian/.debhelper/generated/mock-configs/dh_installchangelogs.dch.trimmed new file mode 100644 index 0000000..38a9020 --- /dev/null +++ b/debian/.debhelper/generated/mock-configs/dh_installchangelogs.dch.trimmed @@ -0,0 +1,18 @@ +mock (0.1.0-1) unstable; urgency=medium + + * Initial release + * Debian package build environment manager + * Direct functional replacement for Fedora's Mock + * Features: + - Isolated chroot environments for package building + - Multi-package chain building support + - Build metadata capture and storage + - Reproducible build enforcement + - Core configurations for popular distributions + - Plugin system for extensibility + - Package management within chroots + - Advanced build options and debugging tools + * CI/CD integration with Forgejo Actions + * Comprehensive test suite with 30 tests + + -- Mock Team Wed, 22 Jan 2025 12:00:00 +0000 \ No newline at end of file diff --git a/debian/.debhelper/generated/mock-configs/installed-by-dh_install b/debian/.debhelper/generated/mock-configs/installed-by-dh_install new file mode 100644 index 0000000..261639f --- /dev/null +++ b/debian/.debhelper/generated/mock-configs/installed-by-dh_install @@ -0,0 +1,3 @@ +./deb_mock/configs/ +./configs/ +./default-configs/ diff --git a/debian/.debhelper/generated/mock-configs/installed-by-dh_installdocs b/debian/.debhelper/generated/mock-configs/installed-by-dh_installdocs new file mode 100644 index 0000000..e69de29 diff --git a/debian/.debhelper/generated/mock-dev/dh_installchangelogs.dch.trimmed b/debian/.debhelper/generated/mock-dev/dh_installchangelogs.dch.trimmed new file mode 100644 index 0000000..38a9020 --- /dev/null +++ b/debian/.debhelper/generated/mock-dev/dh_installchangelogs.dch.trimmed @@ -0,0 +1,18 @@ +mock (0.1.0-1) unstable; urgency=medium + + * Initial release + * Debian package build environment manager + * Direct functional replacement for Fedora's Mock + * Features: + - Isolated chroot environments for package building + - Multi-package chain building support + - Build metadata capture and storage + - Reproducible build enforcement + - Core configurations for popular distributions + - Plugin system for extensibility + - Package management within chroots + - Advanced build options and debugging tools + * CI/CD integration with Forgejo Actions + * Comprehensive test suite with 30 tests + + -- Mock Team Wed, 22 Jan 2025 12:00:00 +0000 \ No newline at end of file diff --git a/debian/.debhelper/generated/mock-dev/installed-by-dh_install b/debian/.debhelper/generated/mock-dev/installed-by-dh_install new file mode 100644 index 0000000..9e85016 --- /dev/null +++ b/debian/.debhelper/generated/mock-dev/installed-by-dh_install @@ -0,0 +1,5 @@ +./dev/ +./docs/api/ +./examples/ +./include/ +./scripts/dev/ diff --git a/debian/.debhelper/generated/mock-dev/installed-by-dh_installdocs b/debian/.debhelper/generated/mock-dev/installed-by-dh_installdocs new file mode 100644 index 0000000..e69de29 diff --git a/debian/.debhelper/generated/mock-filesystem/dh_installchangelogs.dch.trimmed b/debian/.debhelper/generated/mock-filesystem/dh_installchangelogs.dch.trimmed new file mode 100644 index 0000000..38a9020 --- /dev/null +++ b/debian/.debhelper/generated/mock-filesystem/dh_installchangelogs.dch.trimmed @@ -0,0 +1,18 @@ +mock (0.1.0-1) unstable; urgency=medium + + * Initial release + * Debian package build environment manager + * Direct functional replacement for Fedora's Mock + * Features: + - Isolated chroot environments for package building + - Multi-package chain building support + - Build metadata capture and storage + - Reproducible build enforcement + - Core configurations for popular distributions + - Plugin system for extensibility + - Package management within chroots + - Advanced build options and debugging tools + * CI/CD integration with Forgejo Actions + * Comprehensive test suite with 30 tests + + -- Mock Team Wed, 22 Jan 2025 12:00:00 +0000 \ No newline at end of file diff --git a/debian/.debhelper/generated/mock-filesystem/installed-by-dh_install b/debian/.debhelper/generated/mock-filesystem/installed-by-dh_install new file mode 100644 index 0000000..398e033 --- /dev/null +++ b/debian/.debhelper/generated/mock-filesystem/installed-by-dh_install @@ -0,0 +1,4 @@ +./filesystem/ +./templates/ +./chroot.d/ +./mounts/ diff --git a/debian/.debhelper/generated/mock-filesystem/installed-by-dh_installdocs b/debian/.debhelper/generated/mock-filesystem/installed-by-dh_installdocs new file mode 100644 index 0000000..e69de29 diff --git a/debian/.debhelper/generated/mock-plugins/dh_installchangelogs.dch.trimmed b/debian/.debhelper/generated/mock-plugins/dh_installchangelogs.dch.trimmed new file mode 100644 index 0000000..38a9020 --- /dev/null +++ b/debian/.debhelper/generated/mock-plugins/dh_installchangelogs.dch.trimmed @@ -0,0 +1,18 @@ +mock (0.1.0-1) unstable; urgency=medium + + * Initial release + * Debian package build environment manager + * Direct functional replacement for Fedora's Mock + * Features: + - Isolated chroot environments for package building + - Multi-package chain building support + - Build metadata capture and storage + - Reproducible build enforcement + - Core configurations for popular distributions + - Plugin system for extensibility + - Package management within chroots + - Advanced build options and debugging tools + * CI/CD integration with Forgejo Actions + * Comprehensive test suite with 30 tests + + -- Mock Team Wed, 22 Jan 2025 12:00:00 +0000 \ No newline at end of file diff --git a/debian/.debhelper/generated/mock-plugins/installed-by-dh_install b/debian/.debhelper/generated/mock-plugins/installed-by-dh_install new file mode 100644 index 0000000..de7934b --- /dev/null +++ b/debian/.debhelper/generated/mock-plugins/installed-by-dh_install @@ -0,0 +1,3 @@ +./deb_mock/plugins/ +./plugins/ +./docs/plugins/ diff --git a/debian/.debhelper/generated/mock-plugins/installed-by-dh_installdocs b/debian/.debhelper/generated/mock-plugins/installed-by-dh_installdocs new file mode 100644 index 0000000..e69de29 diff --git a/debian/.debhelper/generated/mock/dh_installchangelogs.dch.trimmed b/debian/.debhelper/generated/mock/dh_installchangelogs.dch.trimmed new file mode 100644 index 0000000..38a9020 --- /dev/null +++ b/debian/.debhelper/generated/mock/dh_installchangelogs.dch.trimmed @@ -0,0 +1,18 @@ +mock (0.1.0-1) unstable; urgency=medium + + * Initial release + * Debian package build environment manager + * Direct functional replacement for Fedora's Mock + * Features: + - Isolated chroot environments for package building + - Multi-package chain building support + - Build metadata capture and storage + - Reproducible build enforcement + - Core configurations for popular distributions + - Plugin system for extensibility + - Package management within chroots + - Advanced build options and debugging tools + * CI/CD integration with Forgejo Actions + * Comprehensive test suite with 30 tests + + -- Mock Team Wed, 22 Jan 2025 12:00:00 +0000 \ No newline at end of file diff --git a/debian/.debhelper/generated/mock/installed-by-dh_install b/debian/.debhelper/generated/mock/installed-by-dh_install new file mode 100644 index 0000000..bc240c0 --- /dev/null +++ b/debian/.debhelper/generated/mock/installed-by-dh_install @@ -0,0 +1,18 @@ +./deb_mock/ +./deb_mock/__init__.py +./deb_mock/api.py +./deb_mock/core.py +./deb_mock/cli.py +./deb_mock/config.py +./deb_mock/chroot.py +./deb_mock/sbuild.py +./deb_mock/plugin.py +./deb_mock/environment_manager.py +./deb_mock/exceptions.py +./deb_mock/metadata.py +./deb_mock/performance.py +./deb_mock/benchmarking.py +./deb_mock/cache.py +./deb_mock/uid_manager.py +./bin/mock +./config.yaml diff --git a/debian/.debhelper/generated/mock/installed-by-dh_installdocs b/debian/.debhelper/generated/mock/installed-by-dh_installdocs new file mode 100644 index 0000000..e69de29 diff --git a/debian/control b/debian/control index 3f44510..5df798a 100644 --- a/debian/control +++ b/debian/control @@ -8,10 +8,10 @@ Homepage: https://git.raines.xyz/robojerk/deb-mock Vcs-Git: https://git.raines.xyz/robojerk/deb-mock.git Vcs-Browser: https://git.raines.xyz/robojerk/deb-mock -Package: deb-mock +Package: mock Architecture: all -Depends: ${python3:Depends}, ${misc:Depends}, python3-click (>= 8.0.0), python3-yaml (>= 6.0), python3-jinja2 (>= 3.0.0), python3-requests (>= 2.25.0), python3-psutil (>= 5.8.0), sbuild, schroot, debootstrap, systemd-container, deb-mock-filesystem, deb-mock-configs -Recommends: deb-mock-plugins, ccache, python3-pytest, python3-pytest-cov +Depends: ${python3:Depends}, ${misc:Depends}, python3-click (>= 8.0.0), python3-yaml (>= 6.0), python3-jinja2 (>= 3.0.0), python3-requests (>= 2.25.0), python3-psutil (>= 5.8.0), sbuild, schroot, debootstrap, systemd-container, mock-filesystem, mock-configs +Recommends: mock-plugins, ccache, python3-pytest, python3-pytest-cov Description: Debian package build environment manager Deb-Mock is a low-level utility to create clean, isolated build environments for single Debian packages. This tool is a direct functional replacement for @@ -30,7 +30,7 @@ Description: Debian package build environment manager This tool is designed for developers, packagers, and CI/CD systems that need reliable, isolated environments for building Debian packages. -Package: deb-mock-filesystem +Package: mock-filesystem Architecture: all Depends: ${misc:Depends}, shadow-utils Description: Filesystem layout and chroot structure for deb-mock @@ -42,9 +42,9 @@ Description: Filesystem layout and chroot structure for deb-mock This package is required by deb-mock and provides the minimal filesystem structure needed for chroot operations. -Package: deb-mock-configs +Package: mock-configs Architecture: all -Depends: ${misc:Depends}, deb-mock +Depends: ${misc:Depends}, mock Description: Pre-built configurations for different distributions This package provides pre-built configurations for various Debian and Ubuntu distributions and architectures. It includes distribution-specific settings, @@ -55,9 +55,9 @@ Description: Pre-built configurations for different distributions * Ubuntu (jammy, noble) * Multiple architectures (amd64, arm64, etc.) -Package: deb-mock-plugins +Package: mock-plugins Architecture: all -Depends: ${misc:Depends}, deb-mock, python3-click +Depends: ${misc:Depends}, mock, python3-click Description: Extended functionality through plugins for deb-mock This package provides built-in plugins and extended functionality for deb-mock. It includes caching plugins, performance optimization tools, @@ -69,9 +69,9 @@ Description: Extended functionality through plugins for deb-mock * Debugging and monitoring plugins * Custom build hooks -Package: deb-mock-dev +Package: mock-dev Architecture: all -Depends: ${misc:Depends}, deb-mock, python3-dev +Depends: ${misc:Depends}, mock, python3-dev 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. @@ -82,10 +82,10 @@ Description: Development tools and headers for deb-mock * Testing utilities * Development examples -Package: deb-mock-cache +Package: mock-cache Architecture: all -Depends: ${misc:Depends}, deb-mock, ccache -Recommends: deb-mock-plugins +Depends: ${misc:Depends}, mock, ccache +Recommends: mock-plugins Description: Advanced caching and optimization for deb-mock This package provides advanced caching capabilities and performance optimization tools for deb-mock. It includes ccache integration, diff --git a/debian/deb-mock-cache.substvars b/debian/deb-mock-cache.substvars new file mode 100644 index 0000000..978fc8b --- /dev/null +++ b/debian/deb-mock-cache.substvars @@ -0,0 +1,2 @@ +misc:Depends= +misc:Pre-Depends= diff --git a/debian/deb-mock-cache/DEBIAN/conffiles b/debian/deb-mock-cache/DEBIAN/conffiles new file mode 100644 index 0000000..e678dab --- /dev/null +++ b/debian/deb-mock-cache/DEBIAN/conffiles @@ -0,0 +1 @@ +/etc/deb-mock/cache.d/cache.d/README.md diff --git a/debian/deb-mock-cache/DEBIAN/control b/debian/deb-mock-cache/DEBIAN/control new file mode 100644 index 0000000..142aa76 --- /dev/null +++ b/debian/deb-mock-cache/DEBIAN/control @@ -0,0 +1,21 @@ +Package: deb-mock-cache +Source: mock +Version: 0.1.0-1 +Architecture: all +Maintainer: Deb-Mock Team +Installed-Size: 24 +Depends: deb-mock, ccache +Recommends: deb-mock-plugins +Section: devel +Priority: optional +Homepage: https://git.raines.xyz/robojerk/deb-mock +Description: Advanced caching and optimization for deb-mock + This package provides advanced caching capabilities and performance + optimization tools for deb-mock. It includes ccache integration, + build artifact caching, and various performance optimization plugins. + . + Features include: + * Compiler cache integration + * Build artifact caching + * Performance monitoring + * Optimization utilities diff --git a/debian/deb-mock-cache/DEBIAN/md5sums b/debian/deb-mock-cache/DEBIAN/md5sums new file mode 100644 index 0000000..9f59e10 --- /dev/null +++ b/debian/deb-mock-cache/DEBIAN/md5sums @@ -0,0 +1,5 @@ +85d4004c09017d1078cfb1ee034918a7 usr/bin/mock-cache-clean +b5e97ad2c2786c52db6a46fd0e6dcc99 usr/share/deb-mock/cache-plugins/cache-plugins/README.md +ae7f7a9aa354f9831386524f1a3f947b usr/share/doc/deb-mock-cache/cache/README.md +d1ae06c2c12f7e3680f330d78fc2780d usr/share/doc/deb-mock-cache/changelog.Debian.gz +6e33bbc8d1428859f9f8b39c0e5d6010 usr/share/doc/deb-mock-cache/copyright diff --git a/debian/deb-mock-cache/etc/deb-mock/cache.d/cache.d/README.md b/debian/deb-mock-cache/etc/deb-mock/cache.d/cache.d/README.md new file mode 100644 index 0000000..13a87fc --- /dev/null +++ b/debian/deb-mock-cache/etc/deb-mock/cache.d/cache.d/README.md @@ -0,0 +1 @@ +# Cache configurations diff --git a/debian/deb-mock-cache/usr/bin/mock-cache-clean b/debian/deb-mock-cache/usr/bin/mock-cache-clean new file mode 100755 index 0000000..0805089 --- /dev/null +++ b/debian/deb-mock-cache/usr/bin/mock-cache-clean @@ -0,0 +1,32 @@ +#!/bin/bash +# Cache cleaning utility for mock + +CACHE_DIR="/var/cache/mock" +ARTIFACT_CACHE="$CACHE_DIR/artifacts" +DEPENDENCY_CACHE="$CACHE_DIR/dependencies" + +case "$1" in + "clean") + echo "Cleaning mock cache..." + rm -rf "$ARTIFACT_CACHE"/* + rm -rf "$DEPENDENCY_CACHE"/* + echo "Cache cleaned successfully" + ;; + "status") + echo "Cache status:" + echo "Artifact cache: $(du -sh $ARTIFACT_CACHE 2>/dev/null || echo '0B')" + echo "Dependency cache: $(du -sh $DEPENDENCY_CACHE 2>/dev/null || echo '0B')" + ;; + "purge") + echo "Purging all mock cache..." + rm -rf "$CACHE_DIR"/* + echo "Cache purged successfully" + ;; + *) + echo "Usage: $0 {clean|status|purge}" + echo " clean - Clean build artifacts and dependencies" + echo " status - Show cache usage statistics" + echo " purge - Remove all cached data" + exit 1 + ;; +esac diff --git a/debian/deb-mock-cache/usr/share/deb-mock/cache-plugins/cache-plugins/README.md b/debian/deb-mock-cache/usr/share/deb-mock/cache-plugins/cache-plugins/README.md new file mode 100644 index 0000000..84830de --- /dev/null +++ b/debian/deb-mock-cache/usr/share/deb-mock/cache-plugins/cache-plugins/README.md @@ -0,0 +1 @@ +# Cache plugins diff --git a/debian/deb-mock-cache/usr/share/doc/deb-mock-cache/cache/README.md b/debian/deb-mock-cache/usr/share/doc/deb-mock-cache/cache/README.md new file mode 100644 index 0000000..e4bb393 --- /dev/null +++ b/debian/deb-mock-cache/usr/share/doc/deb-mock-cache/cache/README.md @@ -0,0 +1 @@ +# Cache documentation diff --git a/debian/deb-mock-cache/usr/share/doc/deb-mock-cache/copyright b/debian/deb-mock-cache/usr/share/doc/deb-mock-cache/copyright new file mode 100644 index 0000000..0d2de1f --- /dev/null +++ b/debian/deb-mock-cache/usr/share/doc/deb-mock-cache/copyright @@ -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 +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 +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. \ No newline at end of file diff --git a/debian/deb-mock-configs.substvars b/debian/deb-mock-configs.substvars new file mode 100644 index 0000000..978fc8b --- /dev/null +++ b/debian/deb-mock-configs.substvars @@ -0,0 +1,2 @@ +misc:Depends= +misc:Pre-Depends= diff --git a/debian/deb-mock-configs/DEBIAN/conffiles b/debian/deb-mock-configs/DEBIAN/conffiles new file mode 100644 index 0000000..cf721e6 --- /dev/null +++ b/debian/deb-mock-configs/DEBIAN/conffiles @@ -0,0 +1 @@ +/etc/deb-mock/configs/default-configs/README.md diff --git a/debian/deb-mock-configs/DEBIAN/control b/debian/deb-mock-configs/DEBIAN/control new file mode 100644 index 0000000..4a2c625 --- /dev/null +++ b/debian/deb-mock-configs/DEBIAN/control @@ -0,0 +1,19 @@ +Package: deb-mock-configs +Source: mock +Version: 0.1.0-1 +Architecture: all +Maintainer: Deb-Mock Team +Installed-Size: 27 +Depends: deb-mock +Section: devel +Priority: optional +Homepage: https://git.raines.xyz/robojerk/deb-mock +Description: Pre-built configurations for different distributions + This package provides pre-built configurations for various Debian and Ubuntu + distributions and architectures. It includes distribution-specific settings, + architecture-specific configurations, and default build configurations. + . + Configurations are provided for: + * Debian (bookworm, trixie, sid) + * Ubuntu (jammy, noble) + * Multiple architectures (amd64, arm64, etc.) diff --git a/debian/deb-mock-configs/DEBIAN/md5sums b/debian/deb-mock-configs/DEBIAN/md5sums new file mode 100644 index 0000000..376e845 --- /dev/null +++ b/debian/deb-mock-configs/DEBIAN/md5sums @@ -0,0 +1,8 @@ +7f73e949ec4e65dbae7fb6db6f2525c8 usr/share/deb-mock/configs/configs/__init__.py +6fbcd9334f6d0b934875f739c0f2252d usr/share/deb-mock/configs/configs/debian-bookworm-amd64.yaml +a28570c0bbf8603381aa394af6e7acf0 usr/share/deb-mock/configs/configs/debian-sid-amd64.yaml +f07c51ef116c5cd4613176a9c01a561d usr/share/deb-mock/configs/configs/debian-trixie-amd64.yaml +24d888bad86e9f74d3406b8ae2a1182c usr/share/deb-mock/configs/configs/ubuntu-jammy-amd64.yaml +0ccf439247ced5fc7509a401ae8d2898 usr/share/deb-mock/configs/configs/ubuntu-noble-amd64.yaml +d1ae06c2c12f7e3680f330d78fc2780d usr/share/doc/deb-mock-configs/changelog.Debian.gz +6e33bbc8d1428859f9f8b39c0e5d6010 usr/share/doc/deb-mock-configs/copyright diff --git a/debian/deb-mock-configs/etc/deb-mock/configs/default-configs/README.md b/debian/deb-mock-configs/etc/deb-mock/configs/default-configs/README.md new file mode 100644 index 0000000..13fa48e --- /dev/null +++ b/debian/deb-mock-configs/etc/deb-mock/configs/default-configs/README.md @@ -0,0 +1 @@ +# Default configurations diff --git a/debian/deb-mock-configs/usr/share/deb-mock/configs/configs/__init__.py b/debian/deb-mock-configs/usr/share/deb-mock/configs/configs/__init__.py new file mode 100644 index 0000000..2196e28 --- /dev/null +++ b/debian/deb-mock-configs/usr/share/deb-mock/configs/configs/__init__.py @@ -0,0 +1,50 @@ +""" +Deb-Mock Core Configurations + +This package provides default configuration files for various Debian-based Linux distributions, +similar to Mock's mock-core-configs package. +""" + +from pathlib import Path +from typing import Dict, List + +import yaml + +# Base directory for config files +CONFIGS_DIR = Path(__file__).parent + + +def get_available_configs() -> List[str]: + """Get list of available configuration names""" + configs = [] + for config_file in CONFIGS_DIR.glob("*.yaml"): + if config_file.name != "__init__.py": + configs.append(config_file.stem) + return sorted(configs) + + +def load_config(config_name: str) -> Dict: + """Load a configuration by name""" + config_file = CONFIGS_DIR / f"{config_name}.yaml" + if not config_file.exists(): + raise ValueError(f"Configuration '{config_name}' not found") + + with open(config_file, "r") as f: + return yaml.safe_load(f) + + +def list_configs() -> Dict[str, Dict]: + """List all available configurations with their details""" + configs = {} + for config_name in get_available_configs(): + try: + config = load_config(config_name) + configs[config_name] = { + "description": config.get("description", ""), + "suite": config.get("suite", ""), + "architecture": config.get("architecture", ""), + "mirror": config.get("mirror", ""), + } + except Exception: + continue + return configs diff --git a/debian/deb-mock-configs/usr/share/deb-mock/configs/configs/debian-bookworm-amd64.yaml b/debian/deb-mock-configs/usr/share/deb-mock/configs/configs/debian-bookworm-amd64.yaml new file mode 100644 index 0000000..d934c49 --- /dev/null +++ b/debian/deb-mock-configs/usr/share/deb-mock/configs/configs/debian-bookworm-amd64.yaml @@ -0,0 +1,36 @@ +# Debian Bookworm (Debian 12) - AMD64 +# Equivalent to Mock's fedora-35-x86_64 config +description: "Debian Bookworm (Debian 12) - AMD64" +chroot_name: "debian-bookworm-amd64" +architecture: "amd64" +suite: "bookworm" +mirror: "http://deb.debian.org/debian/" + +# Build environment +build_env: + DEB_BUILD_OPTIONS: "parallel=4,nocheck" + DEB_BUILD_PROFILES: "nocheck" + DEB_CFLAGS_SET: "-O2" + DEB_CXXFLAGS_SET: "-O2" + DEB_LDFLAGS_SET: "-Wl,-z,defs" + +# Build options +build_options: + - "--verbose" + - "--no-run-lintian" + +# Chroot configuration +chroot_dir: "/var/lib/deb-mock/chroots" +chroot_config_dir: "/etc/schroot/chroot.d" + +# sbuild configuration +sbuild_config: "/etc/sbuild/sbuild.conf" +sbuild_log_dir: "/var/log/sbuild" + +# Output configuration +output_dir: "./output" +metadata_dir: "./metadata" +keep_chroot: false +verbose: false +debug: false + diff --git a/debian/deb-mock-configs/usr/share/deb-mock/configs/configs/debian-sid-amd64.yaml b/debian/deb-mock-configs/usr/share/deb-mock/configs/configs/debian-sid-amd64.yaml new file mode 100644 index 0000000..185de69 --- /dev/null +++ b/debian/deb-mock-configs/usr/share/deb-mock/configs/configs/debian-sid-amd64.yaml @@ -0,0 +1,36 @@ +# Debian Sid (Unstable) - AMD64 +# Equivalent to Mock's fedora-rawhide-x86_64 config +description: "Debian Sid (Unstable) - AMD64" +chroot_name: "debian-sid-amd64" +architecture: "amd64" +suite: "sid" +mirror: "http://deb.debian.org/debian/" + +# Build environment +build_env: + DEB_BUILD_OPTIONS: "parallel=4,nocheck" + DEB_BUILD_PROFILES: "nocheck" + DEB_CFLAGS_SET: "-O2" + DEB_CXXFLAGS_SET: "-O2" + DEB_LDFLAGS_SET: "-Wl,-z,defs" + +# Build options +build_options: + - "--verbose" + - "--no-run-lintian" + +# Chroot configuration +chroot_dir: "/var/lib/deb-mock/chroots" +chroot_config_dir: "/etc/schroot/chroot.d" + +# sbuild configuration +sbuild_config: "/etc/sbuild/sbuild.conf" +sbuild_log_dir: "/var/log/sbuild" + +# Output configuration +output_dir: "./output" +metadata_dir: "./metadata" +keep_chroot: false +verbose: false +debug: false + diff --git a/debian/deb-mock-configs/usr/share/deb-mock/configs/configs/debian-trixie-amd64.yaml b/debian/deb-mock-configs/usr/share/deb-mock/configs/configs/debian-trixie-amd64.yaml new file mode 100644 index 0000000..c1b2e18 --- /dev/null +++ b/debian/deb-mock-configs/usr/share/deb-mock/configs/configs/debian-trixie-amd64.yaml @@ -0,0 +1,55 @@ +# Debian Trixie AMD64 configuration for deb-mock +# This is a pre-built configuration for Debian Trixie on AMD64 + +environment: + name: "debian-trixie-amd64" + architecture: "amd64" + suite: "trixie" + distribution: "debian" + +mirror: + base_url: "http://deb.debian.org/debian" + components: ["main", "contrib", "non-free"] + security_url: "http://security.debian.org/debian-security" + +packages: + essential: + - "build-essential" + - "devscripts" + - "debhelper" + - "dh-python" + - "python3-setuptools" + - "python3-pytest" + - "python3-yaml" + - "python3-click" + - "python3-jinja2" + - "python3-requests" + + build_tools: + - "sbuild" + - "schroot" + - "debootstrap" + - "ccache" + - "distcc" + + development: + - "git" + - "vim" + - "nano" + - "less" + - "curl" + - "wget" + +chroot: + size: "10G" + filesystem: "ext4" + compression: true + cache_enabled: true + parallel_jobs: 4 + +build: + timeout: 3600 + memory_limit: "2G" + cpu_limit: 4 + network_enabled: true + user_namespace: true diff --git a/debian/deb-mock-configs/usr/share/deb-mock/configs/configs/ubuntu-jammy-amd64.yaml b/debian/deb-mock-configs/usr/share/deb-mock/configs/configs/ubuntu-jammy-amd64.yaml new file mode 100644 index 0000000..2167fad --- /dev/null +++ b/debian/deb-mock-configs/usr/share/deb-mock/configs/configs/ubuntu-jammy-amd64.yaml @@ -0,0 +1,36 @@ +# Ubuntu Jammy (22.04 LTS) - AMD64 +# Equivalent to Mock's rhel-9-x86_64 config +description: "Ubuntu Jammy (22.04 LTS) - AMD64" +chroot_name: "ubuntu-jammy-amd64" +architecture: "amd64" +suite: "jammy" +mirror: "http://archive.ubuntu.com/ubuntu/" + +# Build environment +build_env: + DEB_BUILD_OPTIONS: "parallel=4,nocheck" + DEB_BUILD_PROFILES: "nocheck" + DEB_CFLAGS_SET: "-O2" + DEB_CXXFLAGS_SET: "-O2" + DEB_LDFLAGS_SET: "-Wl,-z,defs" + +# Build options +build_options: + - "--verbose" + - "--no-run-lintian" + +# Chroot configuration +chroot_dir: "/var/lib/deb-mock/chroots" +chroot_config_dir: "/etc/schroot/chroot.d" + +# sbuild configuration +sbuild_config: "/etc/sbuild/sbuild.conf" +sbuild_log_dir: "/var/log/sbuild" + +# Output configuration +output_dir: "./output" +metadata_dir: "./metadata" +keep_chroot: false +verbose: false +debug: false + diff --git a/debian/deb-mock-configs/usr/share/deb-mock/configs/configs/ubuntu-noble-amd64.yaml b/debian/deb-mock-configs/usr/share/deb-mock/configs/configs/ubuntu-noble-amd64.yaml new file mode 100644 index 0000000..1d82687 --- /dev/null +++ b/debian/deb-mock-configs/usr/share/deb-mock/configs/configs/ubuntu-noble-amd64.yaml @@ -0,0 +1,36 @@ +# Ubuntu Noble (24.04 LTS) - AMD64 +# Equivalent to Mock's fedora-40-x86_64 config +description: "Ubuntu Noble (24.04 LTS) - AMD64" +chroot_name: "ubuntu-noble-amd64" +architecture: "amd64" +suite: "noble" +mirror: "http://archive.ubuntu.com/ubuntu/" + +# Build environment +build_env: + DEB_BUILD_OPTIONS: "parallel=4,nocheck" + DEB_BUILD_PROFILES: "nocheck" + DEB_CFLAGS_SET: "-O2" + DEB_CXXFLAGS_SET: "-O2" + DEB_LDFLAGS_SET: "-Wl,-z,defs" + +# Build options +build_options: + - "--verbose" + - "--no-run-lintian" + +# Chroot configuration +chroot_dir: "/var/lib/deb-mock/chroots" +chroot_config_dir: "/etc/schroot/chroot.d" + +# sbuild configuration +sbuild_config: "/etc/sbuild/sbuild.conf" +sbuild_log_dir: "/var/log/sbuild" + +# Output configuration +output_dir: "./output" +metadata_dir: "./metadata" +keep_chroot: false +verbose: false +debug: false + diff --git a/debian/deb-mock-configs/usr/share/doc/deb-mock-configs/copyright b/debian/deb-mock-configs/usr/share/doc/deb-mock-configs/copyright new file mode 100644 index 0000000..0d2de1f --- /dev/null +++ b/debian/deb-mock-configs/usr/share/doc/deb-mock-configs/copyright @@ -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 +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 +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. \ No newline at end of file diff --git a/debian/deb-mock-dev.substvars b/debian/deb-mock-dev.substvars new file mode 100644 index 0000000..978fc8b --- /dev/null +++ b/debian/deb-mock-dev.substvars @@ -0,0 +1,2 @@ +misc:Depends= +misc:Pre-Depends= diff --git a/debian/deb-mock-dev/DEBIAN/control b/debian/deb-mock-dev/DEBIAN/control new file mode 100644 index 0000000..7ae99fe --- /dev/null +++ b/debian/deb-mock-dev/DEBIAN/control @@ -0,0 +1,19 @@ +Package: deb-mock-dev +Source: mock +Version: 0.1.0-1 +Architecture: all +Maintainer: Deb-Mock Team +Installed-Size: 47 +Depends: deb-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 diff --git a/debian/deb-mock-dev/DEBIAN/md5sums b/debian/deb-mock-dev/DEBIAN/md5sums new file mode 100644 index 0000000..e592818 --- /dev/null +++ b/debian/deb-mock-dev/DEBIAN/md5sums @@ -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 +d1ae06c2c12f7e3680f330d78fc2780d usr/share/doc/deb-mock-dev/changelog.Debian.gz +6e33bbc8d1428859f9f8b39c0e5d6010 usr/share/doc/deb-mock-dev/copyright +c55f6e91c7f9878998c7407b96ad35c5 usr/share/doc/deb-mock-dev/examples/examples/advanced-config.yaml +90a7df9e78271d486c0b6fd3457dc101 usr/share/doc/deb-mock-dev/examples/examples/api_usage_example.py +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 diff --git a/debian/deb-mock-dev/usr/bin/dev/README.md b/debian/deb-mock-dev/usr/bin/dev/README.md new file mode 100755 index 0000000..b1a8f17 --- /dev/null +++ b/debian/deb-mock-dev/usr/bin/dev/README.md @@ -0,0 +1 @@ +# Development scripts diff --git a/debian/deb-mock-dev/usr/include/deb-mock/include/README.md b/debian/deb-mock-dev/usr/include/deb-mock/include/README.md new file mode 100644 index 0000000..9b92694 --- /dev/null +++ b/debian/deb-mock-dev/usr/include/deb-mock/include/README.md @@ -0,0 +1 @@ +# Header files diff --git a/debian/deb-mock-dev/usr/share/deb-mock/dev/dev/README.md b/debian/deb-mock-dev/usr/share/deb-mock/dev/dev/README.md new file mode 100644 index 0000000..d661c51 --- /dev/null +++ b/debian/deb-mock-dev/usr/share/deb-mock/dev/dev/README.md @@ -0,0 +1 @@ +# Development tools diff --git a/debian/deb-mock-dev/usr/share/doc/deb-mock-dev/api/README.md b/debian/deb-mock-dev/usr/share/doc/deb-mock-dev/api/README.md new file mode 100644 index 0000000..c67872c --- /dev/null +++ b/debian/deb-mock-dev/usr/share/doc/deb-mock-dev/api/README.md @@ -0,0 +1 @@ +# API documentation diff --git a/debian/deb-mock-dev/usr/share/doc/deb-mock-dev/copyright b/debian/deb-mock-dev/usr/share/doc/deb-mock-dev/copyright new file mode 100644 index 0000000..0d2de1f --- /dev/null +++ b/debian/deb-mock-dev/usr/share/doc/deb-mock-dev/copyright @@ -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 +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 +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. \ No newline at end of file diff --git a/debian/deb-mock-dev/usr/share/doc/deb-mock-dev/examples/examples/advanced-config.yaml b/debian/deb-mock-dev/usr/share/doc/deb-mock-dev/examples/examples/advanced-config.yaml new file mode 100644 index 0000000..83c9358 --- /dev/null +++ b/debian/deb-mock-dev/usr/share/doc/deb-mock-dev/examples/examples/advanced-config.yaml @@ -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 diff --git a/debian/deb-mock-dev/usr/share/doc/deb-mock-dev/examples/examples/api_usage_example.py b/debian/deb-mock-dev/usr/share/doc/deb-mock-dev/examples/examples/api_usage_example.py new file mode 100644 index 0000000..7f4a9b6 --- /dev/null +++ b/debian/deb-mock-dev/usr/share/doc/deb-mock-dev/examples/examples/api_usage_example.py @@ -0,0 +1,396 @@ +#!/usr/bin/env python3 +""" +Example usage of deb-mock API + +This script demonstrates how to use the deb-mock API for various +build environment management tasks. +""" + +import os +import sys +import tempfile +from pathlib import Path + +# Add deb-mock to Python path +sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..')) + +from deb_mock.api import MockAPIClient, MockConfigBuilder, create_client, quick_build +from deb_mock.environment_manager import EnvironmentManager, create_environment_manager +from deb_mock.config import Config + + +def example_basic_usage(): + """Example of basic API usage""" + print("=== Basic API Usage Example ===") + + # Create a configuration using the builder + config = (MockConfigBuilder() + .environment("example-env") + .architecture("amd64") + .suite("trixie") + .mirror("http://deb.debian.org/debian/") + .packages(["build-essential", "devscripts", "cmake"]) + .cache_enabled(True) + .parallel_jobs(4) + .verbose(True) + .build()) + + # Create API client + client = MockAPIClient(config) + + print(f"Created client with environment: {config.chroot_name}") + print(f"Architecture: {config.architecture}") + print(f"Suite: {config.suite}") + print(f"Mirror: {config.mirror}") + print(f"Initial packages: {config.chroot_additional_packages}") + + +def example_environment_management(): + """Example of environment management""" + print("\n=== Environment Management Example ===") + + # Create environment manager + manager = create_environment_manager() + + # Create a new environment + print("Creating environment...") + env_info = manager.create_environment( + name="test-build-env", + arch="amd64", + suite="trixie", + packages=["build-essential", "cmake", "ninja-build"] + ) + + print(f"Created environment: {env_info.name}") + print(f"Architecture: {env_info.architecture}") + print(f"Suite: {env_info.suite}") + print(f"Status: {env_info.status}") + + # List all environments + print("\nListing all environments...") + environments = manager.list_environments() + for env in environments: + print(f" - {env.name} ({env.architecture}/{env.suite})") + + # Get environment info + print(f"\nGetting info for {env_info.name}...") + info = manager.get_environment_info(env_info.name) + print(f" Status: {info.status}") + print(f" Size: {info.size} bytes") + print(f" Packages installed: {len(info.packages_installed or [])}") + + +def example_command_execution(): + """Example of command execution in environments""" + print("\n=== Command Execution Example ===") + + manager = create_environment_manager() + + # Create environment + env_info = manager.create_environment( + name="command-test-env", + arch="amd64", + suite="trixie", + packages=["build-essential"] + ) + + try: + # Execute commands + print("Executing commands in environment...") + + # List installed packages + result = manager.execute_command( + env_info.name, + ["dpkg", "-l", "|", "grep", "build-essential"], + capture_output=True + ) + print(f"Build tools check: {result.returncode == 0}") + + # Check system info + result = manager.execute_command( + env_info.name, + ["uname", "-a"], + capture_output=True + ) + print(f"System info: {result.stdout.strip()}") + + # Check available space + result = manager.execute_command( + env_info.name, + ["df", "-h", "/"], + capture_output=True + ) + print(f"Disk usage:\n{result.stdout}") + + finally: + # Cleanup + manager.remove_environment(env_info.name) + + +def example_package_building(): + """Example of package building""" + print("\n=== Package Building Example ===") + + client = create_client() + + # Create environment for building + env = client.create_environment( + name="build-env", + arch="amd64", + suite="trixie", + packages=["build-essential", "devscripts", "debhelper"] + ) + + try: + print(f"Created build environment: {env.name}") + + # Example: Build a simple package (this would need actual source) + print("Note: This example shows the API structure.") + print("In practice, you would provide a real source package path.") + + # Example build call (commented out as it needs real source) + # result = client.build_package("/path/to/package.dsc", "build-env") + # print(f"Build result: {result}") + + finally: + # Cleanup + client.remove_environment(env.name) + + +def example_context_manager(): + """Example of using context managers""" + print("\n=== Context Manager Example ===") + + manager = create_environment_manager() + + # Use environment context manager + with manager.environment("context-test-env", + arch="amd64", + suite="trixie", + packages=["build-essential"]) as env: + + print(f"Environment active: {env.is_active()}") + print(f"Environment name: {env.name}") + print(f"Architecture: {env.architecture}") + print(f"Suite: {env.suite}") + + # Environment is automatically cleaned up when exiting context + print("Environment will be cleaned up automatically") + + print("Context exited, environment cleaned up") + + +def example_parallel_building(): + """Example of parallel building""" + print("\n=== Parallel Building Example ===") + + client = create_client() + + # Example source packages (would be real paths in practice) + source_packages = [ + "/path/to/package1.dsc", + "/path/to/package2.dsc", + "/path/to/package3.dsc" + ] + + print("Parallel building example:") + print(f"Would build {len(source_packages)} packages in parallel") + print("Packages:", source_packages) + + # Example parallel build call (commented out as it needs real sources) + # results = client.build_parallel(source_packages, max_workers=2) + # print(f"Build results: {len(results)} packages processed") + + +def example_chain_building(): + """Example of chain building""" + print("\n=== Chain Building Example ===") + + client = create_client() + + # Example dependency chain (would be real paths in practice) + chain_packages = [ + "/path/to/base-package.dsc", + "/path/to/depends-on-base.dsc", + "/path/to/final-package.dsc" + ] + + print("Chain building example:") + print("Would build packages in dependency order:") + for i, pkg in enumerate(chain_packages, 1): + print(f" {i}. {pkg}") + + # Example chain build call (commented out as it needs real sources) + # results = client.build_chain(chain_packages) + # print(f"Chain build results: {len(results)} packages processed") + + +def example_artifact_collection(): + """Example of artifact collection""" + print("\n=== Artifact Collection Example ===") + + manager = create_environment_manager() + + # Create environment + env_info = manager.create_environment( + name="artifact-test-env", + arch="amd64", + suite="trixie", + packages=["build-essential"] + ) + + try: + print(f"Created environment: {env_info.name}") + + # Example artifact collection (would work with real build artifacts) + print("Artifact collection example:") + print("Would collect artifacts like:") + print(" - *.deb files") + print(" - *.changes files") + print(" - *.buildinfo files") + print(" - *.dsc files") + print(" - Source tarballs") + + # Example artifact collection call (commented out as it needs real artifacts) + # artifacts = manager.collect_artifacts(env_info.name) + # print(f"Collected {len(artifacts)} artifacts") + + finally: + # Cleanup + manager.remove_environment(env_info.name) + + +def example_performance_monitoring(): + """Example of performance monitoring""" + print("\n=== Performance Monitoring Example ===") + + client = create_client() + + # Get cache statistics + cache_stats = client.get_cache_stats() + print(f"Cache statistics: {cache_stats}") + + # Get performance summary (if available) + try: + perf_summary = client.get_performance_summary() + print(f"Performance summary: {perf_summary}") + except RuntimeError as e: + print(f"Performance monitoring not available: {e}") + + # Export metrics (if available) + try: + metrics_file = client.export_metrics() + print(f"Metrics exported to: {metrics_file}") + except RuntimeError as e: + print(f"Metrics export not available: {e}") + + +def example_error_handling(): + """Example of error handling""" + print("\n=== Error Handling Example ===") + + manager = create_environment_manager() + + # Try to get non-existent environment + try: + manager.get_environment_info("nonexistent-env") + except ValueError as e: + print(f"Expected error: {e}") + + # Try to execute command in non-existent environment + try: + manager.execute_command("nonexistent-env", ["ls"]) + except ValueError as e: + print(f"Expected error: {e}") + + # Try to remove non-existent environment + try: + manager.remove_environment("nonexistent-env") + except ValueError as e: + print(f"Expected error: {e}") + + +def example_configuration_variations(): + """Example of different configuration options""" + print("\n=== Configuration Variations Example ===") + + # Ubuntu configuration + ubuntu_config = (MockConfigBuilder() + .environment("ubuntu-jammy-amd64") + .architecture("amd64") + .suite("jammy") + .mirror("http://archive.ubuntu.com/ubuntu/") + .packages(["build-essential", "cmake"]) + .build()) + + print("Ubuntu configuration:") + print(f" Environment: {ubuntu_config.chroot_name}") + print(f" Suite: {ubuntu_config.suite}") + print(f" Mirror: {ubuntu_config.mirror}") + + # ARM64 configuration + arm64_config = (MockConfigBuilder() + .environment("debian-trixie-arm64") + .architecture("arm64") + .suite("trixie") + .mirror("http://deb.debian.org/debian/") + .packages(["crossbuild-essential-arm64"]) + .build()) + + print("\nARM64 configuration:") + print(f" Environment: {arm64_config.chroot_name}") + print(f" Architecture: {arm64_config.architecture}") + print(f" Cross-compilation packages: {arm64_config.chroot_additional_packages}") + + # Development configuration + dev_config = (MockConfigBuilder() + .environment("dev-env") + .architecture("amd64") + .suite("sid") # Debian unstable + .packages(["build-essential", "devscripts", "cmake", "ninja-build", "git"]) + .cache_enabled(True) + .parallel_jobs(8) + .verbose(True) + .debug(True) + .build()) + + print("\nDevelopment configuration:") + print(f" Environment: {dev_config.chroot_name}") + print(f" Suite: {dev_config.suite}") + print(f" Packages: {dev_config.chroot_additional_packages}") + print(f" Parallel jobs: {dev_config.parallel_jobs}") + print(f" Verbose: {dev_config.verbose}") + print(f" Debug: {dev_config.debug}") + + +def main(): + """Run all examples""" + print("deb-mock API Usage Examples") + print("=" * 50) + + try: + example_basic_usage() + example_environment_management() + example_command_execution() + example_package_building() + example_context_manager() + example_parallel_building() + example_chain_building() + example_artifact_collection() + example_performance_monitoring() + example_error_handling() + example_configuration_variations() + + print("\n" + "=" * 50) + print("All examples completed successfully!") + print("\nNote: These examples demonstrate the API structure.") + print("In practice, you would use real source packages and environments.") + + except Exception as e: + print(f"\nError running examples: {e}") + import traceback + traceback.print_exc() + + +if __name__ == "__main__": + main() diff --git a/debian/deb-mock-dev/usr/share/doc/deb-mock-dev/examples/examples/plugins/ccache_plugin.py b/debian/deb-mock-dev/usr/share/doc/deb-mock-dev/examples/examples/plugins/ccache_plugin.py new file mode 100644 index 0000000..736eb89 --- /dev/null +++ b/debian/deb-mock-dev/usr/share/doc/deb-mock-dev/examples/examples/plugins/ccache_plugin.py @@ -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 +# } +# } diff --git a/debian/deb-mock-dev/usr/share/doc/deb-mock-dev/examples/examples/wget_1.21.3.orig.tar.gz.asc b/debian/deb-mock-dev/usr/share/doc/deb-mock-dev/examples/examples/wget_1.21.3.orig.tar.gz.asc new file mode 100644 index 0000000..233cda3 --- /dev/null +++ b/debian/deb-mock-dev/usr/share/doc/deb-mock-dev/examples/examples/wget_1.21.3.orig.tar.gz.asc @@ -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----- diff --git a/debian/deb-mock-filesystem.substvars b/debian/deb-mock-filesystem.substvars new file mode 100644 index 0000000..978fc8b --- /dev/null +++ b/debian/deb-mock-filesystem.substvars @@ -0,0 +1,2 @@ +misc:Depends= +misc:Pre-Depends= diff --git a/debian/deb-mock-filesystem/DEBIAN/conffiles b/debian/deb-mock-filesystem/DEBIAN/conffiles new file mode 100644 index 0000000..1b09284 --- /dev/null +++ b/debian/deb-mock-filesystem/DEBIAN/conffiles @@ -0,0 +1 @@ +/etc/deb-mock/chroot.d/chroot.d/README.md diff --git a/debian/deb-mock-filesystem/DEBIAN/control b/debian/deb-mock-filesystem/DEBIAN/control new file mode 100644 index 0000000..8056182 --- /dev/null +++ b/debian/deb-mock-filesystem/DEBIAN/control @@ -0,0 +1,18 @@ +Package: deb-mock-filesystem +Source: mock +Version: 0.1.0-1 +Architecture: all +Maintainer: Deb-Mock Team +Installed-Size: 26 +Depends: shadow-utils +Section: devel +Priority: optional +Homepage: https://git.raines.xyz/robojerk/deb-mock +Description: Filesystem layout and chroot structure for deb-mock + This package provides the filesystem layout and chroot structure templates + for deb-mock. It includes directory structures, mount point definitions, + and filesystem configuration files needed for creating isolated build + environments. + . + This package is required by deb-mock and provides the minimal filesystem + structure needed for chroot operations. diff --git a/debian/deb-mock-filesystem/DEBIAN/md5sums b/debian/deb-mock-filesystem/DEBIAN/md5sums new file mode 100644 index 0000000..6e8421d --- /dev/null +++ b/debian/deb-mock-filesystem/DEBIAN/md5sums @@ -0,0 +1,5 @@ +ea64a10b454189d9f685f8ea986e58a0 usr/share/deb-mock/filesystem/filesystem/chroot-template.yaml +af6e6888b11e1ddbd384e987f67ad392 usr/share/deb-mock/mounts/mounts/README.md +6c2a6fdd785ed11027f91b32d5b77ca0 usr/share/deb-mock/templates/templates/README.md +d1ae06c2c12f7e3680f330d78fc2780d usr/share/doc/deb-mock-filesystem/changelog.Debian.gz +6e33bbc8d1428859f9f8b39c0e5d6010 usr/share/doc/deb-mock-filesystem/copyright diff --git a/debian/deb-mock-filesystem/etc/deb-mock/chroot.d/chroot.d/README.md b/debian/deb-mock-filesystem/etc/deb-mock/chroot.d/chroot.d/README.md new file mode 100644 index 0000000..3a5e0f4 --- /dev/null +++ b/debian/deb-mock-filesystem/etc/deb-mock/chroot.d/chroot.d/README.md @@ -0,0 +1 @@ +# Chroot configurations diff --git a/debian/deb-mock-filesystem/usr/share/deb-mock/filesystem/filesystem/chroot-template.yaml b/debian/deb-mock-filesystem/usr/share/deb-mock/filesystem/filesystem/chroot-template.yaml new file mode 100644 index 0000000..e6e5e69 --- /dev/null +++ b/debian/deb-mock-filesystem/usr/share/deb-mock/filesystem/filesystem/chroot-template.yaml @@ -0,0 +1,44 @@ +# Chroot filesystem template for deb-mock +# This file defines the basic filesystem structure for chroot environments + +filesystem: + directories: + - /bin + - /sbin + - /usr/bin + - /usr/sbin + - /usr/lib + - /usr/lib64 + - /usr/include + - /usr/share + - /var + - /tmp + - /proc + - /sys + - /dev + - /etc + - /root + - /home + - /opt + - /srv + - /media + - /mnt + + mount_points: + - source: /proc + target: /proc + type: proc + options: "nosuid,noexec,nodev" + - source: /sys + target: /sys + type: sysfs + options: "nosuid,noexec,nodev,ro" + - source: /dev + target: /dev + type: devtmpfs + options: "nosuid,strictatime,size=65536k,mode=755" + + permissions: + /root: "755" + /tmp: "1777" + /var/tmp: "1777" diff --git a/debian/deb-mock-filesystem/usr/share/deb-mock/mounts/mounts/README.md b/debian/deb-mock-filesystem/usr/share/deb-mock/mounts/mounts/README.md new file mode 100644 index 0000000..1099b5c --- /dev/null +++ b/debian/deb-mock-filesystem/usr/share/deb-mock/mounts/mounts/README.md @@ -0,0 +1 @@ +# Mount points diff --git a/debian/deb-mock-filesystem/usr/share/deb-mock/templates/templates/README.md b/debian/deb-mock-filesystem/usr/share/deb-mock/templates/templates/README.md new file mode 100644 index 0000000..c4f8830 --- /dev/null +++ b/debian/deb-mock-filesystem/usr/share/deb-mock/templates/templates/README.md @@ -0,0 +1 @@ +# Templates directory diff --git a/debian/deb-mock-filesystem/usr/share/doc/deb-mock-filesystem/copyright b/debian/deb-mock-filesystem/usr/share/doc/deb-mock-filesystem/copyright new file mode 100644 index 0000000..0d2de1f --- /dev/null +++ b/debian/deb-mock-filesystem/usr/share/doc/deb-mock-filesystem/copyright @@ -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 +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 +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. \ No newline at end of file diff --git a/debian/deb-mock-plugins.substvars b/debian/deb-mock-plugins.substvars new file mode 100644 index 0000000..978fc8b --- /dev/null +++ b/debian/deb-mock-plugins.substvars @@ -0,0 +1,2 @@ +misc:Depends= +misc:Pre-Depends= diff --git a/debian/deb-mock-plugins/DEBIAN/control b/debian/deb-mock-plugins/DEBIAN/control new file mode 100644 index 0000000..503e879 --- /dev/null +++ b/debian/deb-mock-plugins/DEBIAN/control @@ -0,0 +1,20 @@ +Package: deb-mock-plugins +Source: mock +Version: 0.1.0-1 +Architecture: all +Maintainer: Deb-Mock Team +Installed-Size: 119 +Depends: deb-mock, python3-click +Section: devel +Priority: optional +Homepage: https://git.raines.xyz/robojerk/deb-mock +Description: Extended functionality through plugins for deb-mock + This package provides built-in plugins and extended functionality for + deb-mock. It includes caching plugins, performance optimization tools, + and various utility plugins that enhance the build process. + . + Plugins include: + * Caching and optimization plugins + * Build enhancement tools + * Debugging and monitoring plugins + * Custom build hooks diff --git a/debian/deb-mock-plugins/DEBIAN/md5sums b/debian/deb-mock-plugins/DEBIAN/md5sums new file mode 100644 index 0000000..93898d1 --- /dev/null +++ b/debian/deb-mock-plugins/DEBIAN/md5sums @@ -0,0 +1,13 @@ +935e0fdb8c0984c307054aa9f9678e51 usr/lib/python3/dist-packages/deb_mock/plugins/plugins/__init__.py +7cd95eabffba99eef3c7519671a47d48 usr/lib/python3/dist-packages/deb_mock/plugins/plugins/base.py +00c95714409f0a5f2642d35e3e663833 usr/lib/python3/dist-packages/deb_mock/plugins/plugins/bind_mount.py +8fb789cbe00c162f59cf8f77d9fe764f usr/lib/python3/dist-packages/deb_mock/plugins/plugins/compress_logs.py +db2e92254fe7a264ca1847be35027117 usr/lib/python3/dist-packages/deb_mock/plugins/plugins/example_plugin.py +90a494ef3a475ebbe374eeb2ebdfb50e usr/lib/python3/dist-packages/deb_mock/plugins/plugins/hook_manager.py +f6209005cd825fb375e1d6e33eba33bc usr/lib/python3/dist-packages/deb_mock/plugins/plugins/registry.py +1927571e9253a047e2ad0d6e54eca243 usr/lib/python3/dist-packages/deb_mock/plugins/plugins/root_cache.py +67940e00d949efea9617187a117e3734 usr/lib/python3/dist-packages/deb_mock/plugins/plugins/tmpfs.py +886d15acc0ce977da6d8b75363013607 usr/share/deb-mock/plugins/plugins/cache_plugin.py +d1ae06c2c12f7e3680f330d78fc2780d usr/share/doc/deb-mock-plugins/changelog.Debian.gz +6e33bbc8d1428859f9f8b39c0e5d6010 usr/share/doc/deb-mock-plugins/copyright +3eaa7898c1431b167ee44c21524506ec usr/share/doc/deb-mock-plugins/plugins/README.md diff --git a/debian/deb-mock-plugins/usr/share/deb-mock/plugins/plugins/cache_plugin.py b/debian/deb-mock-plugins/usr/share/deb-mock/plugins/plugins/cache_plugin.py new file mode 100644 index 0000000..5d102d6 --- /dev/null +++ b/debian/deb-mock-plugins/usr/share/deb-mock/plugins/plugins/cache_plugin.py @@ -0,0 +1,57 @@ +#!/usr/bin/env python3 +""" +Cache plugin for deb-mock +Provides caching functionality for build artifacts and dependencies +""" + +from deb_mock.plugins.base import BasePlugin +from deb_mock.plugins.registry import PluginInfo +import os +import hashlib +import shutil +from pathlib import Path + +class CachePlugin(BasePlugin): + """Plugin for caching build artifacts and dependencies""" + + def __init__(self, plugin_manager, config, deb_mock): + super().__init__(plugin_manager, config, deb_mock) + self.cache_dir = Path("/var/cache/deb-mock") + self.artifact_cache = self.cache_dir / "artifacts" + self.dependency_cache = self.cache_dir / "dependencies" + + def pre_build_hook(self, environment, package_info): + """Check cache before building""" + cache_key = self._generate_cache_key(package_info) + cached_artifact = self.artifact_cache / f"{cache_key}.deb" + + if cached_artifact.exists(): + self.logger.info(f"Found cached artifact: {cached_artifact}") + return {"cached": True, "artifact": cached_artifact} + + return {"cached": False} + + def post_build_hook(self, environment, package_info, build_result): + """Cache build artifacts after successful build""" + if build_result.get("success"): + cache_key = self._generate_cache_key(package_info) + artifact_path = build_result.get("artifact_path") + + if artifact_path and os.path.exists(artifact_path): + cached_artifact = self.artifact_cache / f"{cache_key}.deb" + shutil.copy2(artifact_path, cached_artifact) + self.logger.info(f"Cached artifact: {cached_artifact}") + + def _generate_cache_key(self, package_info): + """Generate a cache key based on package information""" + key_data = f"{package_info.get('name', '')}-{package_info.get('version', '')}-{package_info.get('architecture', '')}" + return hashlib.md5(key_data.encode()).hexdigest() + +# Plugin registration +PLUGIN_INFO = PluginInfo( + name="cache", + version="1.0.0", + description="Caching plugin for build artifacts and dependencies", + author="Deb-Mock Team", + plugin_class=CachePlugin +) diff --git a/debian/deb-mock-plugins/usr/share/doc/deb-mock-plugins/copyright b/debian/deb-mock-plugins/usr/share/doc/deb-mock-plugins/copyright new file mode 100644 index 0000000..0d2de1f --- /dev/null +++ b/debian/deb-mock-plugins/usr/share/doc/deb-mock-plugins/copyright @@ -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 +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 +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. \ No newline at end of file diff --git a/debian/deb-mock-plugins/usr/share/doc/deb-mock-plugins/plugins/README.md b/debian/deb-mock-plugins/usr/share/doc/deb-mock-plugins/plugins/README.md new file mode 100644 index 0000000..6c38318 --- /dev/null +++ b/debian/deb-mock-plugins/usr/share/doc/deb-mock-plugins/plugins/README.md @@ -0,0 +1 @@ +# Plugin documentation diff --git a/debian/deb-mock.postinst.debhelper b/debian/deb-mock.postinst.debhelper new file mode 100644 index 0000000..fb6146f --- /dev/null +++ b/debian/deb-mock.postinst.debhelper @@ -0,0 +1,10 @@ + +# Automatically added by dh_python3 +if command -v py3compile >/dev/null 2>&1; then + py3compile -p deb-mock +fi +if command -v pypy3compile >/dev/null 2>&1; then + pypy3compile -p deb-mock || true +fi + +# End automatically added section diff --git a/debian/deb-mock.prerm.debhelper b/debian/deb-mock.prerm.debhelper new file mode 100644 index 0000000..ecc9521 --- /dev/null +++ b/debian/deb-mock.prerm.debhelper @@ -0,0 +1,10 @@ + +# Automatically added by dh_python3 +if command -v py3clean >/dev/null 2>&1; then + py3clean -p deb-mock +else + dpkg -L deb-mock | sed -En -e '/^(.*)\/(.+)\.py$/s,,rm "\1/__pycache__/\2".*,e' + find /usr/lib/python3/dist-packages/ -type d -name __pycache__ -empty -print0 | xargs --null --no-run-if-empty rmdir +fi + +# End automatically added section diff --git a/debian/deb-mock.substvars b/debian/deb-mock.substvars new file mode 100644 index 0000000..13de292 --- /dev/null +++ b/debian/deb-mock.substvars @@ -0,0 +1,3 @@ +python3:Depends=python3:any +misc:Depends= +misc:Pre-Depends= diff --git a/debian/deb-mock/DEBIAN/conffiles b/debian/deb-mock/DEBIAN/conffiles new file mode 100644 index 0000000..d009302 --- /dev/null +++ b/debian/deb-mock/DEBIAN/conffiles @@ -0,0 +1 @@ +/etc/deb-mock/config.yaml diff --git a/debian/deb-mock/DEBIAN/control b/debian/deb-mock/DEBIAN/control new file mode 100644 index 0000000..951f282 --- /dev/null +++ b/debian/deb-mock/DEBIAN/control @@ -0,0 +1,28 @@ +Package: deb-mock +Source: mock +Version: 0.1.0-1 +Architecture: all +Maintainer: Deb-Mock Team +Installed-Size: 444 +Depends: python3:any, python3-click (>= 8.0.0), python3-yaml (>= 6.0), python3-jinja2 (>= 3.0.0), python3-requests (>= 2.25.0), python3-psutil (>= 5.8.0), sbuild, schroot, debootstrap, systemd-container, deb-mock-filesystem, deb-mock-configs +Recommends: deb-mock-plugins, ccache, python3-pytest, python3-pytest-cov +Section: devel +Priority: optional +Homepage: https://git.raines.xyz/robojerk/deb-mock +Description: Debian package build environment manager + Deb-Mock is a low-level utility to create clean, isolated build environments + for single Debian packages. This tool is a direct functional replacement for + Fedora's Mock, adapted specifically for Debian-based ecosystems. + . + Features include: + * Isolated chroot environments for package building + * Multi-package chain building support + * Build metadata capture and storage + * Reproducible build enforcement + * Core configurations for popular distributions + * Plugin system for extensibility + * Package management within chroots + * Advanced build options and debugging tools + . + This tool is designed for developers, packagers, and CI/CD systems that need + reliable, isolated environments for building Debian packages. diff --git a/debian/deb-mock/DEBIAN/md5sums b/debian/deb-mock/DEBIAN/md5sums new file mode 100644 index 0000000..00fd661 --- /dev/null +++ b/debian/deb-mock/DEBIAN/md5sums @@ -0,0 +1,33 @@ +1be4cd929735fed97d2480393b64bebf usr/bin/mock +69eaf685cade56df0fb31bb97610dda4 usr/lib/python3/dist-packages/deb_mock/__init__.py +9c037352dcde0f707732ca8cf2151255 usr/lib/python3/dist-packages/deb_mock/api.py +c78f86fd5308a4d81f6036fc0afd00d7 usr/lib/python3/dist-packages/deb_mock/benchmarking.py +351dc51574a5284324382736e7fa0d37 usr/lib/python3/dist-packages/deb_mock/cache.py +a57e2a4384d8256c29948cd72962ced2 usr/lib/python3/dist-packages/deb_mock/chroot.py +7adb1889863eef143356544d25470a67 usr/lib/python3/dist-packages/deb_mock/cli.py +074c4e2a384c32764681443847c243b8 usr/lib/python3/dist-packages/deb_mock/config.py +7f73e949ec4e65dbae7fb6db6f2525c8 usr/lib/python3/dist-packages/deb_mock/configs/__init__.py +6fbcd9334f6d0b934875f739c0f2252d usr/lib/python3/dist-packages/deb_mock/configs/debian-bookworm-amd64.yaml +a28570c0bbf8603381aa394af6e7acf0 usr/lib/python3/dist-packages/deb_mock/configs/debian-sid-amd64.yaml +b39f830ef9ecff0107d0dc4449cb0675 usr/lib/python3/dist-packages/deb_mock/configs/debian-trixie-amd64.yaml +24d888bad86e9f74d3406b8ae2a1182c usr/lib/python3/dist-packages/deb_mock/configs/ubuntu-jammy-amd64.yaml +0ccf439247ced5fc7509a401ae8d2898 usr/lib/python3/dist-packages/deb_mock/configs/ubuntu-noble-amd64.yaml +18df474129eaa591fe13c55722fb583d usr/lib/python3/dist-packages/deb_mock/core.py +8827c56a005baa9c80caf9701bc80ca6 usr/lib/python3/dist-packages/deb_mock/environment_manager.py +b8e195d86f3e85d28901486a361a6b3c usr/lib/python3/dist-packages/deb_mock/exceptions.py +9aed2d8734757cf076f785e3c5c61e90 usr/lib/python3/dist-packages/deb_mock/metadata.py +b8b0be1770fce5cf707dc743b9ed8bed usr/lib/python3/dist-packages/deb_mock/performance.py +762306194ff291ddffb360b3231a54c9 usr/lib/python3/dist-packages/deb_mock/plugin.py +935e0fdb8c0984c307054aa9f9678e51 usr/lib/python3/dist-packages/deb_mock/plugins/__init__.py +7cd95eabffba99eef3c7519671a47d48 usr/lib/python3/dist-packages/deb_mock/plugins/base.py +00c95714409f0a5f2642d35e3e663833 usr/lib/python3/dist-packages/deb_mock/plugins/bind_mount.py +8fb789cbe00c162f59cf8f77d9fe764f usr/lib/python3/dist-packages/deb_mock/plugins/compress_logs.py +db2e92254fe7a264ca1847be35027117 usr/lib/python3/dist-packages/deb_mock/plugins/example_plugin.py +90a494ef3a475ebbe374eeb2ebdfb50e usr/lib/python3/dist-packages/deb_mock/plugins/hook_manager.py +f6209005cd825fb375e1d6e33eba33bc usr/lib/python3/dist-packages/deb_mock/plugins/registry.py +1927571e9253a047e2ad0d6e54eca243 usr/lib/python3/dist-packages/deb_mock/plugins/root_cache.py +67940e00d949efea9617187a117e3734 usr/lib/python3/dist-packages/deb_mock/plugins/tmpfs.py +8ab121204ada12a9de6ac47c856efa84 usr/lib/python3/dist-packages/deb_mock/sbuild.py +180f9991c5e35dbd9b245f7061de88be usr/lib/python3/dist-packages/deb_mock/uid_manager.py +d1ae06c2c12f7e3680f330d78fc2780d usr/share/doc/deb-mock/changelog.Debian.gz +6e33bbc8d1428859f9f8b39c0e5d6010 usr/share/doc/deb-mock/copyright diff --git a/debian/deb-mock/DEBIAN/postinst b/debian/deb-mock/DEBIAN/postinst new file mode 100755 index 0000000..8b36f99 --- /dev/null +++ b/debian/deb-mock/DEBIAN/postinst @@ -0,0 +1,27 @@ +#!/bin/sh +set -e + + # Create necessary directories + mkdir -p /var/lib/mock/chroots + mkdir -p /var/cache/mock + mkdir -p /etc/schroot/chroot.d + + # Set proper permissions + chown root:root /var/lib/mock/chroots + chmod 755 /var/lib/mock/chroots + chown root:root /var/cache/mock + chmod 755 /var/cache/mock + + # Create mock group if it doesn't exist + if ! getent group mock >/dev/null 2>&1; then + addgroup --system mock + fi + + # Add users to mock group if they exist + if getent passwd build >/dev/null 2>&1; then + usermod -a -G mock build || true + fi + + echo "mock package installed successfully." + echo "Users in the 'mock' group can use mock without sudo." + echo "To add a user to the mock group: sudo usermod -a -G mock " \ No newline at end of file diff --git a/debian/deb-mock/DEBIAN/prerm b/debian/deb-mock/DEBIAN/prerm new file mode 100755 index 0000000..dfcc5c5 --- /dev/null +++ b/debian/deb-mock/DEBIAN/prerm @@ -0,0 +1,14 @@ +#!/bin/sh +set -e + + # Remove users from mock group + if getent passwd build >/dev/null 2>&1; then + gpasswd -d build mock || true + fi + + # Remove mock group if it's empty + if getent group mock >/dev/null 2>&1; then + if [ $(getent group mock | cut -d: -f4 | tr ',' '\n' | wc -l) -eq 0 ]; then + delgroup mock || true + fi + fi \ No newline at end of file diff --git a/debian/deb-mock/etc/deb-mock/config.yaml b/debian/deb-mock/etc/deb-mock/config.yaml new file mode 100644 index 0000000..e8adde9 --- /dev/null +++ b/debian/deb-mock/etc/deb-mock/config.yaml @@ -0,0 +1,117 @@ +# deb-mock configuration file +# Debian's equivalent to Fedora's Mock build environment manager + +# Global configuration +global: + basedir: "/var/lib/deb-mock" + rootdir: "/var/lib/deb-mock/chroots" + resultdir: "/var/lib/deb-mock/results" + cache_dir: "/var/cache/deb-mock" + log_dir: "/var/log/deb-mock" + +# Default chroot configuration +defaults: + distribution: "bookworm" + architecture: "amd64" + mirror: "http://deb.debian.org/debian" + security_mirror: "http://deb.debian.org/debian-security" + updates_mirror: "http://deb.debian.org/debian" + + # Package installation + install_packages: + - "build-essential" + - "fakeroot" + - "devscripts" + - "debhelper" + - "dh-make" + - "sbuild" + - "schroot" + + # Build dependencies + build_dependencies: + - "build-essential" + - "fakeroot" + - "devscripts" + - "debhelper" + - "dh-make" + +# Chroot profiles +profiles: + bookworm-amd64: + distribution: "bookworm" + architecture: "amd64" + mirror: "http://deb.debian.org/debian" + security_mirror: "http://deb.debian.org/debian-security" + updates_mirror: "http://deb.debian.org/debian" + components: ["main", "contrib", "non-free"] + + bookworm-arm64: + distribution: "bookworm" + architecture: "arm64" + mirror: "http://deb.debian.org/debian" + security_mirror: "http://deb.debian.org/debian-security" + updates_mirror: "http://deb.debian.org/debian" + components: ["main", "contrib", "non-free"] + + sid-amd64: + distribution: "sid" + architecture: "amd64" + mirror: "http://deb.debian.org/debian" + components: ["main", "contrib", "non-free"] + +# Plugin configuration +plugins: + mount: + enabled: true + mount_points: + - source: "/proc" + target: "/proc" + type: "proc" + - source: "/sys" + target: "/sys" + type: "sysfs" + - source: "/dev" + target: "/dev" + type: "bind" + + cache: + enabled: true + root_cache: true + package_cache: true + build_cache: true + + security: + enabled: true + user_isolation: true + network_isolation: true + resource_limits: true + +# Integration settings +integration: + deb_orchestrator_url: "http://localhost:8080" + deb_compose_url: "http://localhost:8080" + + # Build tools + sbuild_path: "/usr/bin/sbuild" + schroot_path: "/usr/bin/schroot" + debootstrap_path: "/usr/sbin/debootstrap" + + # Package managers + apt_path: "/usr/bin/apt" + dpkg_path: "/usr/bin/dpkg" + +# Logging configuration +logging: + level: "INFO" + format: "text" + file: "/var/log/deb-mock/deb-mock.log" + max_size: "100MB" + max_files: 5 + +# Performance settings +performance: + parallel_downloads: 4 + max_retries: 3 + timeout: 3600 + memory_limit: "2G" + disk_limit: "10G" diff --git a/debian/deb-mock/usr/bin/mock b/debian/deb-mock/usr/bin/mock new file mode 100755 index 0000000..9ad1e04 --- /dev/null +++ b/debian/deb-mock/usr/bin/mock @@ -0,0 +1,27 @@ +#! /usr/bin/python3 +""" +mock - Debian package build environment manager +Main executable entry point +""" + +import sys +import os + +# Add the deb_mock module to the Python path +sys.path.insert(0, '/usr/lib/python3/dist-packages') +sys.path.insert(0, '/home/joe/.local/lib/python3.13/site-packages') + +# Also add current directory for development +current_dir = os.path.dirname(os.path.abspath(__file__)) +project_root = os.path.dirname(current_dir) +sys.path.insert(0, project_root) + +try: + from deb_mock.cli import main + if __name__ == '__main__': + main() +except ImportError as e: + print(f"Error importing deb_mock: {e}") + print("Please ensure mock is properly installed") + print("You can also run: python3 -m deb_mock.cli") + sys.exit(1) diff --git a/debian/deb-mock/usr/share/doc/deb-mock/copyright b/debian/deb-mock/usr/share/doc/deb-mock/copyright new file mode 100644 index 0000000..0d2de1f --- /dev/null +++ b/debian/deb-mock/usr/share/doc/deb-mock/copyright @@ -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 +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 +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. \ No newline at end of file diff --git a/debian/debhelper-build-stamp b/debian/debhelper-build-stamp new file mode 100644 index 0000000..51b4428 --- /dev/null +++ b/debian/debhelper-build-stamp @@ -0,0 +1,6 @@ +mock +mock-filesystem +mock-configs +mock-plugins +mock-dev +mock-cache diff --git a/debian/files b/debian/files new file mode 100644 index 0000000..bc97390 --- /dev/null +++ b/debian/files @@ -0,0 +1,7 @@ +mock-cache_0.1.0-1_all.deb devel optional +mock-configs_0.1.0-1_all.deb devel optional +mock-dev_0.1.0-1_all.deb devel optional +mock-filesystem_0.1.0-1_all.deb devel optional +mock-plugins_0.1.0-1_all.deb devel optional +mock_0.1.0-1_all.deb devel optional +mock_0.1.0-1_amd64.buildinfo devel optional diff --git a/debian/deb-mock-cache.install b/debian/mock-cache.install similarity index 100% rename from debian/deb-mock-cache.install rename to debian/mock-cache.install diff --git a/debian/mock-cache.substvars b/debian/mock-cache.substvars new file mode 100644 index 0000000..978fc8b --- /dev/null +++ b/debian/mock-cache.substvars @@ -0,0 +1,2 @@ +misc:Depends= +misc:Pre-Depends= diff --git a/debian/mock-cache/DEBIAN/conffiles b/debian/mock-cache/DEBIAN/conffiles new file mode 100644 index 0000000..e678dab --- /dev/null +++ b/debian/mock-cache/DEBIAN/conffiles @@ -0,0 +1 @@ +/etc/deb-mock/cache.d/cache.d/README.md diff --git a/debian/mock-cache/DEBIAN/control b/debian/mock-cache/DEBIAN/control new file mode 100644 index 0000000..bd6b775 --- /dev/null +++ b/debian/mock-cache/DEBIAN/control @@ -0,0 +1,21 @@ +Package: mock-cache +Source: mock +Version: 0.1.0-1 +Architecture: all +Maintainer: Deb-Mock Team +Installed-Size: 25 +Depends: mock, ccache +Recommends: mock-plugins +Section: devel +Priority: optional +Homepage: https://git.raines.xyz/robojerk/deb-mock +Description: Advanced caching and optimization for deb-mock + This package provides advanced caching capabilities and performance + optimization tools for deb-mock. It includes ccache integration, + build artifact caching, and various performance optimization plugins. + . + Features include: + * Compiler cache integration + * Build artifact caching + * Performance monitoring + * Optimization utilities diff --git a/debian/mock-cache/DEBIAN/md5sums b/debian/mock-cache/DEBIAN/md5sums new file mode 100644 index 0000000..e46d3f9 --- /dev/null +++ b/debian/mock-cache/DEBIAN/md5sums @@ -0,0 +1,5 @@ +85d4004c09017d1078cfb1ee034918a7 usr/bin/mock-cache-clean +b5e97ad2c2786c52db6a46fd0e6dcc99 usr/share/deb-mock/cache-plugins/cache-plugins/README.md +ae7f7a9aa354f9831386524f1a3f947b usr/share/doc/deb-mock-cache/cache/README.md +d1ae06c2c12f7e3680f330d78fc2780d usr/share/doc/mock-cache/changelog.Debian.gz +6e33bbc8d1428859f9f8b39c0e5d6010 usr/share/doc/mock-cache/copyright diff --git a/debian/mock-cache/etc/deb-mock/cache.d/cache.d/README.md b/debian/mock-cache/etc/deb-mock/cache.d/cache.d/README.md new file mode 100644 index 0000000..13a87fc --- /dev/null +++ b/debian/mock-cache/etc/deb-mock/cache.d/cache.d/README.md @@ -0,0 +1 @@ +# Cache configurations diff --git a/debian/mock-cache/usr/bin/mock-cache-clean b/debian/mock-cache/usr/bin/mock-cache-clean new file mode 100755 index 0000000..0805089 --- /dev/null +++ b/debian/mock-cache/usr/bin/mock-cache-clean @@ -0,0 +1,32 @@ +#!/bin/bash +# Cache cleaning utility for mock + +CACHE_DIR="/var/cache/mock" +ARTIFACT_CACHE="$CACHE_DIR/artifacts" +DEPENDENCY_CACHE="$CACHE_DIR/dependencies" + +case "$1" in + "clean") + echo "Cleaning mock cache..." + rm -rf "$ARTIFACT_CACHE"/* + rm -rf "$DEPENDENCY_CACHE"/* + echo "Cache cleaned successfully" + ;; + "status") + echo "Cache status:" + echo "Artifact cache: $(du -sh $ARTIFACT_CACHE 2>/dev/null || echo '0B')" + echo "Dependency cache: $(du -sh $DEPENDENCY_CACHE 2>/dev/null || echo '0B')" + ;; + "purge") + echo "Purging all mock cache..." + rm -rf "$CACHE_DIR"/* + echo "Cache purged successfully" + ;; + *) + echo "Usage: $0 {clean|status|purge}" + echo " clean - Clean build artifacts and dependencies" + echo " status - Show cache usage statistics" + echo " purge - Remove all cached data" + exit 1 + ;; +esac diff --git a/debian/mock-cache/usr/share/deb-mock/cache-plugins/cache-plugins/README.md b/debian/mock-cache/usr/share/deb-mock/cache-plugins/cache-plugins/README.md new file mode 100644 index 0000000..84830de --- /dev/null +++ b/debian/mock-cache/usr/share/deb-mock/cache-plugins/cache-plugins/README.md @@ -0,0 +1 @@ +# Cache plugins diff --git a/debian/mock-cache/usr/share/doc/deb-mock-cache/cache/README.md b/debian/mock-cache/usr/share/doc/deb-mock-cache/cache/README.md new file mode 100644 index 0000000..e4bb393 --- /dev/null +++ b/debian/mock-cache/usr/share/doc/deb-mock-cache/cache/README.md @@ -0,0 +1 @@ +# Cache documentation diff --git a/debian/mock-cache/usr/share/doc/mock-cache/copyright b/debian/mock-cache/usr/share/doc/mock-cache/copyright new file mode 100644 index 0000000..0d2de1f --- /dev/null +++ b/debian/mock-cache/usr/share/doc/mock-cache/copyright @@ -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 +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 +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. \ No newline at end of file diff --git a/debian/deb-mock-configs.install b/debian/mock-configs.install similarity index 100% rename from debian/deb-mock-configs.install rename to debian/mock-configs.install diff --git a/debian/mock-configs.substvars b/debian/mock-configs.substvars new file mode 100644 index 0000000..978fc8b --- /dev/null +++ b/debian/mock-configs.substvars @@ -0,0 +1,2 @@ +misc:Depends= +misc:Pre-Depends= diff --git a/debian/mock-configs/DEBIAN/conffiles b/debian/mock-configs/DEBIAN/conffiles new file mode 100644 index 0000000..cf721e6 --- /dev/null +++ b/debian/mock-configs/DEBIAN/conffiles @@ -0,0 +1 @@ +/etc/deb-mock/configs/default-configs/README.md diff --git a/debian/mock-configs/DEBIAN/control b/debian/mock-configs/DEBIAN/control new file mode 100644 index 0000000..a678060 --- /dev/null +++ b/debian/mock-configs/DEBIAN/control @@ -0,0 +1,19 @@ +Package: mock-configs +Source: mock +Version: 0.1.0-1 +Architecture: all +Maintainer: Deb-Mock Team +Installed-Size: 27 +Depends: mock +Section: devel +Priority: optional +Homepage: https://git.raines.xyz/robojerk/deb-mock +Description: Pre-built configurations for different distributions + This package provides pre-built configurations for various Debian and Ubuntu + distributions and architectures. It includes distribution-specific settings, + architecture-specific configurations, and default build configurations. + . + Configurations are provided for: + * Debian (bookworm, trixie, sid) + * Ubuntu (jammy, noble) + * Multiple architectures (amd64, arm64, etc.) diff --git a/debian/mock-configs/DEBIAN/md5sums b/debian/mock-configs/DEBIAN/md5sums new file mode 100644 index 0000000..1898c4e --- /dev/null +++ b/debian/mock-configs/DEBIAN/md5sums @@ -0,0 +1,8 @@ +7f73e949ec4e65dbae7fb6db6f2525c8 usr/share/deb-mock/configs/configs/__init__.py +6fbcd9334f6d0b934875f739c0f2252d usr/share/deb-mock/configs/configs/debian-bookworm-amd64.yaml +a28570c0bbf8603381aa394af6e7acf0 usr/share/deb-mock/configs/configs/debian-sid-amd64.yaml +f07c51ef116c5cd4613176a9c01a561d usr/share/deb-mock/configs/configs/debian-trixie-amd64.yaml +24d888bad86e9f74d3406b8ae2a1182c usr/share/deb-mock/configs/configs/ubuntu-jammy-amd64.yaml +0ccf439247ced5fc7509a401ae8d2898 usr/share/deb-mock/configs/configs/ubuntu-noble-amd64.yaml +d1ae06c2c12f7e3680f330d78fc2780d usr/share/doc/mock-configs/changelog.Debian.gz +6e33bbc8d1428859f9f8b39c0e5d6010 usr/share/doc/mock-configs/copyright diff --git a/debian/mock-configs/etc/deb-mock/configs/default-configs/README.md b/debian/mock-configs/etc/deb-mock/configs/default-configs/README.md new file mode 100644 index 0000000..13fa48e --- /dev/null +++ b/debian/mock-configs/etc/deb-mock/configs/default-configs/README.md @@ -0,0 +1 @@ +# Default configurations diff --git a/debian/mock-configs/usr/share/deb-mock/configs/configs/__init__.py b/debian/mock-configs/usr/share/deb-mock/configs/configs/__init__.py new file mode 100644 index 0000000..2196e28 --- /dev/null +++ b/debian/mock-configs/usr/share/deb-mock/configs/configs/__init__.py @@ -0,0 +1,50 @@ +""" +Deb-Mock Core Configurations + +This package provides default configuration files for various Debian-based Linux distributions, +similar to Mock's mock-core-configs package. +""" + +from pathlib import Path +from typing import Dict, List + +import yaml + +# Base directory for config files +CONFIGS_DIR = Path(__file__).parent + + +def get_available_configs() -> List[str]: + """Get list of available configuration names""" + configs = [] + for config_file in CONFIGS_DIR.glob("*.yaml"): + if config_file.name != "__init__.py": + configs.append(config_file.stem) + return sorted(configs) + + +def load_config(config_name: str) -> Dict: + """Load a configuration by name""" + config_file = CONFIGS_DIR / f"{config_name}.yaml" + if not config_file.exists(): + raise ValueError(f"Configuration '{config_name}' not found") + + with open(config_file, "r") as f: + return yaml.safe_load(f) + + +def list_configs() -> Dict[str, Dict]: + """List all available configurations with their details""" + configs = {} + for config_name in get_available_configs(): + try: + config = load_config(config_name) + configs[config_name] = { + "description": config.get("description", ""), + "suite": config.get("suite", ""), + "architecture": config.get("architecture", ""), + "mirror": config.get("mirror", ""), + } + except Exception: + continue + return configs diff --git a/debian/mock-configs/usr/share/deb-mock/configs/configs/debian-bookworm-amd64.yaml b/debian/mock-configs/usr/share/deb-mock/configs/configs/debian-bookworm-amd64.yaml new file mode 100644 index 0000000..d934c49 --- /dev/null +++ b/debian/mock-configs/usr/share/deb-mock/configs/configs/debian-bookworm-amd64.yaml @@ -0,0 +1,36 @@ +# Debian Bookworm (Debian 12) - AMD64 +# Equivalent to Mock's fedora-35-x86_64 config +description: "Debian Bookworm (Debian 12) - AMD64" +chroot_name: "debian-bookworm-amd64" +architecture: "amd64" +suite: "bookworm" +mirror: "http://deb.debian.org/debian/" + +# Build environment +build_env: + DEB_BUILD_OPTIONS: "parallel=4,nocheck" + DEB_BUILD_PROFILES: "nocheck" + DEB_CFLAGS_SET: "-O2" + DEB_CXXFLAGS_SET: "-O2" + DEB_LDFLAGS_SET: "-Wl,-z,defs" + +# Build options +build_options: + - "--verbose" + - "--no-run-lintian" + +# Chroot configuration +chroot_dir: "/var/lib/deb-mock/chroots" +chroot_config_dir: "/etc/schroot/chroot.d" + +# sbuild configuration +sbuild_config: "/etc/sbuild/sbuild.conf" +sbuild_log_dir: "/var/log/sbuild" + +# Output configuration +output_dir: "./output" +metadata_dir: "./metadata" +keep_chroot: false +verbose: false +debug: false + diff --git a/debian/mock-configs/usr/share/deb-mock/configs/configs/debian-sid-amd64.yaml b/debian/mock-configs/usr/share/deb-mock/configs/configs/debian-sid-amd64.yaml new file mode 100644 index 0000000..185de69 --- /dev/null +++ b/debian/mock-configs/usr/share/deb-mock/configs/configs/debian-sid-amd64.yaml @@ -0,0 +1,36 @@ +# Debian Sid (Unstable) - AMD64 +# Equivalent to Mock's fedora-rawhide-x86_64 config +description: "Debian Sid (Unstable) - AMD64" +chroot_name: "debian-sid-amd64" +architecture: "amd64" +suite: "sid" +mirror: "http://deb.debian.org/debian/" + +# Build environment +build_env: + DEB_BUILD_OPTIONS: "parallel=4,nocheck" + DEB_BUILD_PROFILES: "nocheck" + DEB_CFLAGS_SET: "-O2" + DEB_CXXFLAGS_SET: "-O2" + DEB_LDFLAGS_SET: "-Wl,-z,defs" + +# Build options +build_options: + - "--verbose" + - "--no-run-lintian" + +# Chroot configuration +chroot_dir: "/var/lib/deb-mock/chroots" +chroot_config_dir: "/etc/schroot/chroot.d" + +# sbuild configuration +sbuild_config: "/etc/sbuild/sbuild.conf" +sbuild_log_dir: "/var/log/sbuild" + +# Output configuration +output_dir: "./output" +metadata_dir: "./metadata" +keep_chroot: false +verbose: false +debug: false + diff --git a/debian/mock-configs/usr/share/deb-mock/configs/configs/debian-trixie-amd64.yaml b/debian/mock-configs/usr/share/deb-mock/configs/configs/debian-trixie-amd64.yaml new file mode 100644 index 0000000..c1b2e18 --- /dev/null +++ b/debian/mock-configs/usr/share/deb-mock/configs/configs/debian-trixie-amd64.yaml @@ -0,0 +1,55 @@ +# Debian Trixie AMD64 configuration for deb-mock +# This is a pre-built configuration for Debian Trixie on AMD64 + +environment: + name: "debian-trixie-amd64" + architecture: "amd64" + suite: "trixie" + distribution: "debian" + +mirror: + base_url: "http://deb.debian.org/debian" + components: ["main", "contrib", "non-free"] + security_url: "http://security.debian.org/debian-security" + +packages: + essential: + - "build-essential" + - "devscripts" + - "debhelper" + - "dh-python" + - "python3-setuptools" + - "python3-pytest" + - "python3-yaml" + - "python3-click" + - "python3-jinja2" + - "python3-requests" + + build_tools: + - "sbuild" + - "schroot" + - "debootstrap" + - "ccache" + - "distcc" + + development: + - "git" + - "vim" + - "nano" + - "less" + - "curl" + - "wget" + +chroot: + size: "10G" + filesystem: "ext4" + compression: true + cache_enabled: true + parallel_jobs: 4 + +build: + timeout: 3600 + memory_limit: "2G" + cpu_limit: 4 + network_enabled: true + user_namespace: true diff --git a/debian/mock-configs/usr/share/deb-mock/configs/configs/ubuntu-jammy-amd64.yaml b/debian/mock-configs/usr/share/deb-mock/configs/configs/ubuntu-jammy-amd64.yaml new file mode 100644 index 0000000..2167fad --- /dev/null +++ b/debian/mock-configs/usr/share/deb-mock/configs/configs/ubuntu-jammy-amd64.yaml @@ -0,0 +1,36 @@ +# Ubuntu Jammy (22.04 LTS) - AMD64 +# Equivalent to Mock's rhel-9-x86_64 config +description: "Ubuntu Jammy (22.04 LTS) - AMD64" +chroot_name: "ubuntu-jammy-amd64" +architecture: "amd64" +suite: "jammy" +mirror: "http://archive.ubuntu.com/ubuntu/" + +# Build environment +build_env: + DEB_BUILD_OPTIONS: "parallel=4,nocheck" + DEB_BUILD_PROFILES: "nocheck" + DEB_CFLAGS_SET: "-O2" + DEB_CXXFLAGS_SET: "-O2" + DEB_LDFLAGS_SET: "-Wl,-z,defs" + +# Build options +build_options: + - "--verbose" + - "--no-run-lintian" + +# Chroot configuration +chroot_dir: "/var/lib/deb-mock/chroots" +chroot_config_dir: "/etc/schroot/chroot.d" + +# sbuild configuration +sbuild_config: "/etc/sbuild/sbuild.conf" +sbuild_log_dir: "/var/log/sbuild" + +# Output configuration +output_dir: "./output" +metadata_dir: "./metadata" +keep_chroot: false +verbose: false +debug: false + diff --git a/debian/mock-configs/usr/share/deb-mock/configs/configs/ubuntu-noble-amd64.yaml b/debian/mock-configs/usr/share/deb-mock/configs/configs/ubuntu-noble-amd64.yaml new file mode 100644 index 0000000..1d82687 --- /dev/null +++ b/debian/mock-configs/usr/share/deb-mock/configs/configs/ubuntu-noble-amd64.yaml @@ -0,0 +1,36 @@ +# Ubuntu Noble (24.04 LTS) - AMD64 +# Equivalent to Mock's fedora-40-x86_64 config +description: "Ubuntu Noble (24.04 LTS) - AMD64" +chroot_name: "ubuntu-noble-amd64" +architecture: "amd64" +suite: "noble" +mirror: "http://archive.ubuntu.com/ubuntu/" + +# Build environment +build_env: + DEB_BUILD_OPTIONS: "parallel=4,nocheck" + DEB_BUILD_PROFILES: "nocheck" + DEB_CFLAGS_SET: "-O2" + DEB_CXXFLAGS_SET: "-O2" + DEB_LDFLAGS_SET: "-Wl,-z,defs" + +# Build options +build_options: + - "--verbose" + - "--no-run-lintian" + +# Chroot configuration +chroot_dir: "/var/lib/deb-mock/chroots" +chroot_config_dir: "/etc/schroot/chroot.d" + +# sbuild configuration +sbuild_config: "/etc/sbuild/sbuild.conf" +sbuild_log_dir: "/var/log/sbuild" + +# Output configuration +output_dir: "./output" +metadata_dir: "./metadata" +keep_chroot: false +verbose: false +debug: false + diff --git a/debian/mock-configs/usr/share/doc/mock-configs/copyright b/debian/mock-configs/usr/share/doc/mock-configs/copyright new file mode 100644 index 0000000..0d2de1f --- /dev/null +++ b/debian/mock-configs/usr/share/doc/mock-configs/copyright @@ -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 +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 +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. \ No newline at end of file diff --git a/debian/deb-mock-dev.install b/debian/mock-dev.install similarity index 100% rename from debian/deb-mock-dev.install rename to debian/mock-dev.install diff --git a/debian/mock-dev.substvars b/debian/mock-dev.substvars new file mode 100644 index 0000000..978fc8b --- /dev/null +++ b/debian/mock-dev.substvars @@ -0,0 +1,2 @@ +misc:Depends= +misc:Pre-Depends= diff --git a/debian/mock-dev/DEBIAN/control b/debian/mock-dev/DEBIAN/control new file mode 100644 index 0000000..c9d7825 --- /dev/null +++ b/debian/mock-dev/DEBIAN/control @@ -0,0 +1,19 @@ +Package: mock-dev +Source: mock +Version: 0.1.0-1 +Architecture: all +Maintainer: Deb-Mock Team +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 diff --git a/debian/mock-dev/DEBIAN/md5sums b/debian/mock-dev/DEBIAN/md5sums new file mode 100644 index 0000000..fae07b4 --- /dev/null +++ b/debian/mock-dev/DEBIAN/md5sums @@ -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 diff --git a/debian/mock-dev/usr/bin/dev/README.md b/debian/mock-dev/usr/bin/dev/README.md new file mode 100755 index 0000000..b1a8f17 --- /dev/null +++ b/debian/mock-dev/usr/bin/dev/README.md @@ -0,0 +1 @@ +# Development scripts diff --git a/debian/mock-dev/usr/include/deb-mock/include/README.md b/debian/mock-dev/usr/include/deb-mock/include/README.md new file mode 100644 index 0000000..9b92694 --- /dev/null +++ b/debian/mock-dev/usr/include/deb-mock/include/README.md @@ -0,0 +1 @@ +# Header files diff --git a/debian/mock-dev/usr/share/deb-mock/dev/dev/README.md b/debian/mock-dev/usr/share/deb-mock/dev/dev/README.md new file mode 100644 index 0000000..d661c51 --- /dev/null +++ b/debian/mock-dev/usr/share/deb-mock/dev/dev/README.md @@ -0,0 +1 @@ +# Development tools diff --git a/debian/mock-dev/usr/share/doc/deb-mock-dev/api/README.md b/debian/mock-dev/usr/share/doc/deb-mock-dev/api/README.md new file mode 100644 index 0000000..c67872c --- /dev/null +++ b/debian/mock-dev/usr/share/doc/deb-mock-dev/api/README.md @@ -0,0 +1 @@ +# API documentation diff --git a/debian/mock-dev/usr/share/doc/deb-mock-dev/examples/examples/advanced-config.yaml b/debian/mock-dev/usr/share/doc/deb-mock-dev/examples/examples/advanced-config.yaml new file mode 100644 index 0000000..83c9358 --- /dev/null +++ b/debian/mock-dev/usr/share/doc/deb-mock-dev/examples/examples/advanced-config.yaml @@ -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 diff --git a/debian/mock-dev/usr/share/doc/deb-mock-dev/examples/examples/plugins/ccache_plugin.py b/debian/mock-dev/usr/share/doc/deb-mock-dev/examples/examples/plugins/ccache_plugin.py new file mode 100644 index 0000000..736eb89 --- /dev/null +++ b/debian/mock-dev/usr/share/doc/deb-mock-dev/examples/examples/plugins/ccache_plugin.py @@ -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 +# } +# } diff --git a/debian/mock-dev/usr/share/doc/deb-mock-dev/examples/examples/wget_1.21.3.orig.tar.gz.asc b/debian/mock-dev/usr/share/doc/deb-mock-dev/examples/examples/wget_1.21.3.orig.tar.gz.asc new file mode 100644 index 0000000..233cda3 --- /dev/null +++ b/debian/mock-dev/usr/share/doc/deb-mock-dev/examples/examples/wget_1.21.3.orig.tar.gz.asc @@ -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----- diff --git a/debian/mock-dev/usr/share/doc/mock-dev/copyright b/debian/mock-dev/usr/share/doc/mock-dev/copyright new file mode 100644 index 0000000..0d2de1f --- /dev/null +++ b/debian/mock-dev/usr/share/doc/mock-dev/copyright @@ -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 +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 +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. \ No newline at end of file diff --git a/debian/deb-mock-filesystem.install b/debian/mock-filesystem.install similarity index 100% rename from debian/deb-mock-filesystem.install rename to debian/mock-filesystem.install diff --git a/debian/mock-filesystem.substvars b/debian/mock-filesystem.substvars new file mode 100644 index 0000000..978fc8b --- /dev/null +++ b/debian/mock-filesystem.substvars @@ -0,0 +1,2 @@ +misc:Depends= +misc:Pre-Depends= diff --git a/debian/mock-filesystem/DEBIAN/conffiles b/debian/mock-filesystem/DEBIAN/conffiles new file mode 100644 index 0000000..1b09284 --- /dev/null +++ b/debian/mock-filesystem/DEBIAN/conffiles @@ -0,0 +1 @@ +/etc/deb-mock/chroot.d/chroot.d/README.md diff --git a/debian/mock-filesystem/DEBIAN/control b/debian/mock-filesystem/DEBIAN/control new file mode 100644 index 0000000..f6f84d1 --- /dev/null +++ b/debian/mock-filesystem/DEBIAN/control @@ -0,0 +1,18 @@ +Package: mock-filesystem +Source: mock +Version: 0.1.0-1 +Architecture: all +Maintainer: Deb-Mock Team +Installed-Size: 26 +Depends: shadow-utils +Section: devel +Priority: optional +Homepage: https://git.raines.xyz/robojerk/deb-mock +Description: Filesystem layout and chroot structure for deb-mock + This package provides the filesystem layout and chroot structure templates + for deb-mock. It includes directory structures, mount point definitions, + and filesystem configuration files needed for creating isolated build + environments. + . + This package is required by deb-mock and provides the minimal filesystem + structure needed for chroot operations. diff --git a/debian/mock-filesystem/DEBIAN/md5sums b/debian/mock-filesystem/DEBIAN/md5sums new file mode 100644 index 0000000..cffc381 --- /dev/null +++ b/debian/mock-filesystem/DEBIAN/md5sums @@ -0,0 +1,5 @@ +ea64a10b454189d9f685f8ea986e58a0 usr/share/deb-mock/filesystem/filesystem/chroot-template.yaml +af6e6888b11e1ddbd384e987f67ad392 usr/share/deb-mock/mounts/mounts/README.md +6c2a6fdd785ed11027f91b32d5b77ca0 usr/share/deb-mock/templates/templates/README.md +d1ae06c2c12f7e3680f330d78fc2780d usr/share/doc/mock-filesystem/changelog.Debian.gz +6e33bbc8d1428859f9f8b39c0e5d6010 usr/share/doc/mock-filesystem/copyright diff --git a/debian/mock-filesystem/etc/deb-mock/chroot.d/chroot.d/README.md b/debian/mock-filesystem/etc/deb-mock/chroot.d/chroot.d/README.md new file mode 100644 index 0000000..3a5e0f4 --- /dev/null +++ b/debian/mock-filesystem/etc/deb-mock/chroot.d/chroot.d/README.md @@ -0,0 +1 @@ +# Chroot configurations diff --git a/debian/mock-filesystem/usr/share/deb-mock/filesystem/filesystem/chroot-template.yaml b/debian/mock-filesystem/usr/share/deb-mock/filesystem/filesystem/chroot-template.yaml new file mode 100644 index 0000000..e6e5e69 --- /dev/null +++ b/debian/mock-filesystem/usr/share/deb-mock/filesystem/filesystem/chroot-template.yaml @@ -0,0 +1,44 @@ +# Chroot filesystem template for deb-mock +# This file defines the basic filesystem structure for chroot environments + +filesystem: + directories: + - /bin + - /sbin + - /usr/bin + - /usr/sbin + - /usr/lib + - /usr/lib64 + - /usr/include + - /usr/share + - /var + - /tmp + - /proc + - /sys + - /dev + - /etc + - /root + - /home + - /opt + - /srv + - /media + - /mnt + + mount_points: + - source: /proc + target: /proc + type: proc + options: "nosuid,noexec,nodev" + - source: /sys + target: /sys + type: sysfs + options: "nosuid,noexec,nodev,ro" + - source: /dev + target: /dev + type: devtmpfs + options: "nosuid,strictatime,size=65536k,mode=755" + + permissions: + /root: "755" + /tmp: "1777" + /var/tmp: "1777" diff --git a/debian/mock-filesystem/usr/share/deb-mock/mounts/mounts/README.md b/debian/mock-filesystem/usr/share/deb-mock/mounts/mounts/README.md new file mode 100644 index 0000000..1099b5c --- /dev/null +++ b/debian/mock-filesystem/usr/share/deb-mock/mounts/mounts/README.md @@ -0,0 +1 @@ +# Mount points diff --git a/debian/mock-filesystem/usr/share/deb-mock/templates/templates/README.md b/debian/mock-filesystem/usr/share/deb-mock/templates/templates/README.md new file mode 100644 index 0000000..c4f8830 --- /dev/null +++ b/debian/mock-filesystem/usr/share/deb-mock/templates/templates/README.md @@ -0,0 +1 @@ +# Templates directory diff --git a/debian/mock-filesystem/usr/share/doc/mock-filesystem/copyright b/debian/mock-filesystem/usr/share/doc/mock-filesystem/copyright new file mode 100644 index 0000000..0d2de1f --- /dev/null +++ b/debian/mock-filesystem/usr/share/doc/mock-filesystem/copyright @@ -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 +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 +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. \ No newline at end of file diff --git a/debian/deb-mock-plugins.install b/debian/mock-plugins.install similarity index 100% rename from debian/deb-mock-plugins.install rename to debian/mock-plugins.install diff --git a/debian/mock-plugins.substvars b/debian/mock-plugins.substvars new file mode 100644 index 0000000..978fc8b --- /dev/null +++ b/debian/mock-plugins.substvars @@ -0,0 +1,2 @@ +misc:Depends= +misc:Pre-Depends= diff --git a/debian/mock-plugins/DEBIAN/control b/debian/mock-plugins/DEBIAN/control new file mode 100644 index 0000000..f6890ae --- /dev/null +++ b/debian/mock-plugins/DEBIAN/control @@ -0,0 +1,20 @@ +Package: mock-plugins +Source: mock +Version: 0.1.0-1 +Architecture: all +Maintainer: Deb-Mock Team +Installed-Size: 120 +Depends: mock, python3-click +Section: devel +Priority: optional +Homepage: https://git.raines.xyz/robojerk/deb-mock +Description: Extended functionality through plugins for deb-mock + This package provides built-in plugins and extended functionality for + deb-mock. It includes caching plugins, performance optimization tools, + and various utility plugins that enhance the build process. + . + Plugins include: + * Caching and optimization plugins + * Build enhancement tools + * Debugging and monitoring plugins + * Custom build hooks diff --git a/debian/mock-plugins/DEBIAN/md5sums b/debian/mock-plugins/DEBIAN/md5sums new file mode 100644 index 0000000..bdd5d13 --- /dev/null +++ b/debian/mock-plugins/DEBIAN/md5sums @@ -0,0 +1,13 @@ +935e0fdb8c0984c307054aa9f9678e51 usr/lib/python3/dist-packages/deb_mock/plugins/plugins/__init__.py +7cd95eabffba99eef3c7519671a47d48 usr/lib/python3/dist-packages/deb_mock/plugins/plugins/base.py +00c95714409f0a5f2642d35e3e663833 usr/lib/python3/dist-packages/deb_mock/plugins/plugins/bind_mount.py +8fb789cbe00c162f59cf8f77d9fe764f usr/lib/python3/dist-packages/deb_mock/plugins/plugins/compress_logs.py +db2e92254fe7a264ca1847be35027117 usr/lib/python3/dist-packages/deb_mock/plugins/plugins/example_plugin.py +90a494ef3a475ebbe374eeb2ebdfb50e usr/lib/python3/dist-packages/deb_mock/plugins/plugins/hook_manager.py +f6209005cd825fb375e1d6e33eba33bc usr/lib/python3/dist-packages/deb_mock/plugins/plugins/registry.py +1927571e9253a047e2ad0d6e54eca243 usr/lib/python3/dist-packages/deb_mock/plugins/plugins/root_cache.py +67940e00d949efea9617187a117e3734 usr/lib/python3/dist-packages/deb_mock/plugins/plugins/tmpfs.py +886d15acc0ce977da6d8b75363013607 usr/share/deb-mock/plugins/plugins/cache_plugin.py +3eaa7898c1431b167ee44c21524506ec usr/share/doc/deb-mock-plugins/plugins/README.md +d1ae06c2c12f7e3680f330d78fc2780d usr/share/doc/mock-plugins/changelog.Debian.gz +6e33bbc8d1428859f9f8b39c0e5d6010 usr/share/doc/mock-plugins/copyright diff --git a/debian/mock-plugins/usr/share/deb-mock/plugins/plugins/cache_plugin.py b/debian/mock-plugins/usr/share/deb-mock/plugins/plugins/cache_plugin.py new file mode 100644 index 0000000..5d102d6 --- /dev/null +++ b/debian/mock-plugins/usr/share/deb-mock/plugins/plugins/cache_plugin.py @@ -0,0 +1,57 @@ +#!/usr/bin/env python3 +""" +Cache plugin for deb-mock +Provides caching functionality for build artifacts and dependencies +""" + +from deb_mock.plugins.base import BasePlugin +from deb_mock.plugins.registry import PluginInfo +import os +import hashlib +import shutil +from pathlib import Path + +class CachePlugin(BasePlugin): + """Plugin for caching build artifacts and dependencies""" + + def __init__(self, plugin_manager, config, deb_mock): + super().__init__(plugin_manager, config, deb_mock) + self.cache_dir = Path("/var/cache/deb-mock") + self.artifact_cache = self.cache_dir / "artifacts" + self.dependency_cache = self.cache_dir / "dependencies" + + def pre_build_hook(self, environment, package_info): + """Check cache before building""" + cache_key = self._generate_cache_key(package_info) + cached_artifact = self.artifact_cache / f"{cache_key}.deb" + + if cached_artifact.exists(): + self.logger.info(f"Found cached artifact: {cached_artifact}") + return {"cached": True, "artifact": cached_artifact} + + return {"cached": False} + + def post_build_hook(self, environment, package_info, build_result): + """Cache build artifacts after successful build""" + if build_result.get("success"): + cache_key = self._generate_cache_key(package_info) + artifact_path = build_result.get("artifact_path") + + if artifact_path and os.path.exists(artifact_path): + cached_artifact = self.artifact_cache / f"{cache_key}.deb" + shutil.copy2(artifact_path, cached_artifact) + self.logger.info(f"Cached artifact: {cached_artifact}") + + def _generate_cache_key(self, package_info): + """Generate a cache key based on package information""" + key_data = f"{package_info.get('name', '')}-{package_info.get('version', '')}-{package_info.get('architecture', '')}" + return hashlib.md5(key_data.encode()).hexdigest() + +# Plugin registration +PLUGIN_INFO = PluginInfo( + name="cache", + version="1.0.0", + description="Caching plugin for build artifacts and dependencies", + author="Deb-Mock Team", + plugin_class=CachePlugin +) diff --git a/debian/mock-plugins/usr/share/doc/deb-mock-plugins/plugins/README.md b/debian/mock-plugins/usr/share/doc/deb-mock-plugins/plugins/README.md new file mode 100644 index 0000000..6c38318 --- /dev/null +++ b/debian/mock-plugins/usr/share/doc/deb-mock-plugins/plugins/README.md @@ -0,0 +1 @@ +# Plugin documentation diff --git a/debian/mock-plugins/usr/share/doc/mock-plugins/copyright b/debian/mock-plugins/usr/share/doc/mock-plugins/copyright new file mode 100644 index 0000000..0d2de1f --- /dev/null +++ b/debian/mock-plugins/usr/share/doc/mock-plugins/copyright @@ -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 +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 +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. \ No newline at end of file diff --git a/debian/deb-mock.install b/debian/mock.install similarity index 100% rename from debian/deb-mock.install rename to debian/mock.install diff --git a/debian/mock.postinst.debhelper b/debian/mock.postinst.debhelper new file mode 100644 index 0000000..f559a73 --- /dev/null +++ b/debian/mock.postinst.debhelper @@ -0,0 +1,10 @@ + +# Automatically added by dh_python3 +if command -v py3compile >/dev/null 2>&1; then + py3compile -p mock +fi +if command -v pypy3compile >/dev/null 2>&1; then + pypy3compile -p mock || true +fi + +# End automatically added section diff --git a/debian/mock.prerm.debhelper b/debian/mock.prerm.debhelper new file mode 100644 index 0000000..25b66f5 --- /dev/null +++ b/debian/mock.prerm.debhelper @@ -0,0 +1,10 @@ + +# Automatically added by dh_python3 +if command -v py3clean >/dev/null 2>&1; then + py3clean -p mock +else + dpkg -L mock | sed -En -e '/^(.*)\/(.+)\.py$/s,,rm "\1/__pycache__/\2".*,e' + find /usr/lib/python3/dist-packages/ -type d -name __pycache__ -empty -print0 | xargs --null --no-run-if-empty rmdir +fi + +# End automatically added section diff --git a/debian/mock.substvars b/debian/mock.substvars new file mode 100644 index 0000000..13de292 --- /dev/null +++ b/debian/mock.substvars @@ -0,0 +1,3 @@ +python3:Depends=python3:any +misc:Depends= +misc:Pre-Depends= diff --git a/debian/mock/DEBIAN/conffiles b/debian/mock/DEBIAN/conffiles new file mode 100644 index 0000000..d009302 --- /dev/null +++ b/debian/mock/DEBIAN/conffiles @@ -0,0 +1 @@ +/etc/deb-mock/config.yaml diff --git a/debian/mock/DEBIAN/control b/debian/mock/DEBIAN/control new file mode 100644 index 0000000..3d86948 --- /dev/null +++ b/debian/mock/DEBIAN/control @@ -0,0 +1,27 @@ +Package: mock +Version: 0.1.0-1 +Architecture: all +Maintainer: Deb-Mock Team +Installed-Size: 444 +Depends: python3:any, python3-click (>= 8.0.0), python3-yaml (>= 6.0), python3-jinja2 (>= 3.0.0), python3-requests (>= 2.25.0), python3-psutil (>= 5.8.0), sbuild, schroot, debootstrap, systemd-container, mock-filesystem, mock-configs +Recommends: mock-plugins, ccache, python3-pytest, python3-pytest-cov +Section: devel +Priority: optional +Homepage: https://git.raines.xyz/robojerk/deb-mock +Description: Debian package build environment manager + Deb-Mock is a low-level utility to create clean, isolated build environments + for single Debian packages. This tool is a direct functional replacement for + Fedora's Mock, adapted specifically for Debian-based ecosystems. + . + Features include: + * Isolated chroot environments for package building + * Multi-package chain building support + * Build metadata capture and storage + * Reproducible build enforcement + * Core configurations for popular distributions + * Plugin system for extensibility + * Package management within chroots + * Advanced build options and debugging tools + . + This tool is designed for developers, packagers, and CI/CD systems that need + reliable, isolated environments for building Debian packages. diff --git a/debian/mock/DEBIAN/md5sums b/debian/mock/DEBIAN/md5sums new file mode 100644 index 0000000..3ba5a2d --- /dev/null +++ b/debian/mock/DEBIAN/md5sums @@ -0,0 +1,33 @@ +1be4cd929735fed97d2480393b64bebf usr/bin/mock +69eaf685cade56df0fb31bb97610dda4 usr/lib/python3/dist-packages/deb_mock/__init__.py +9c037352dcde0f707732ca8cf2151255 usr/lib/python3/dist-packages/deb_mock/api.py +c78f86fd5308a4d81f6036fc0afd00d7 usr/lib/python3/dist-packages/deb_mock/benchmarking.py +351dc51574a5284324382736e7fa0d37 usr/lib/python3/dist-packages/deb_mock/cache.py +a57e2a4384d8256c29948cd72962ced2 usr/lib/python3/dist-packages/deb_mock/chroot.py +7adb1889863eef143356544d25470a67 usr/lib/python3/dist-packages/deb_mock/cli.py +074c4e2a384c32764681443847c243b8 usr/lib/python3/dist-packages/deb_mock/config.py +7f73e949ec4e65dbae7fb6db6f2525c8 usr/lib/python3/dist-packages/deb_mock/configs/__init__.py +6fbcd9334f6d0b934875f739c0f2252d usr/lib/python3/dist-packages/deb_mock/configs/debian-bookworm-amd64.yaml +a28570c0bbf8603381aa394af6e7acf0 usr/lib/python3/dist-packages/deb_mock/configs/debian-sid-amd64.yaml +b39f830ef9ecff0107d0dc4449cb0675 usr/lib/python3/dist-packages/deb_mock/configs/debian-trixie-amd64.yaml +24d888bad86e9f74d3406b8ae2a1182c usr/lib/python3/dist-packages/deb_mock/configs/ubuntu-jammy-amd64.yaml +0ccf439247ced5fc7509a401ae8d2898 usr/lib/python3/dist-packages/deb_mock/configs/ubuntu-noble-amd64.yaml +18df474129eaa591fe13c55722fb583d usr/lib/python3/dist-packages/deb_mock/core.py +8827c56a005baa9c80caf9701bc80ca6 usr/lib/python3/dist-packages/deb_mock/environment_manager.py +b8e195d86f3e85d28901486a361a6b3c usr/lib/python3/dist-packages/deb_mock/exceptions.py +9aed2d8734757cf076f785e3c5c61e90 usr/lib/python3/dist-packages/deb_mock/metadata.py +b8b0be1770fce5cf707dc743b9ed8bed usr/lib/python3/dist-packages/deb_mock/performance.py +762306194ff291ddffb360b3231a54c9 usr/lib/python3/dist-packages/deb_mock/plugin.py +935e0fdb8c0984c307054aa9f9678e51 usr/lib/python3/dist-packages/deb_mock/plugins/__init__.py +7cd95eabffba99eef3c7519671a47d48 usr/lib/python3/dist-packages/deb_mock/plugins/base.py +00c95714409f0a5f2642d35e3e663833 usr/lib/python3/dist-packages/deb_mock/plugins/bind_mount.py +8fb789cbe00c162f59cf8f77d9fe764f usr/lib/python3/dist-packages/deb_mock/plugins/compress_logs.py +db2e92254fe7a264ca1847be35027117 usr/lib/python3/dist-packages/deb_mock/plugins/example_plugin.py +90a494ef3a475ebbe374eeb2ebdfb50e usr/lib/python3/dist-packages/deb_mock/plugins/hook_manager.py +f6209005cd825fb375e1d6e33eba33bc usr/lib/python3/dist-packages/deb_mock/plugins/registry.py +1927571e9253a047e2ad0d6e54eca243 usr/lib/python3/dist-packages/deb_mock/plugins/root_cache.py +67940e00d949efea9617187a117e3734 usr/lib/python3/dist-packages/deb_mock/plugins/tmpfs.py +8ab121204ada12a9de6ac47c856efa84 usr/lib/python3/dist-packages/deb_mock/sbuild.py +180f9991c5e35dbd9b245f7061de88be usr/lib/python3/dist-packages/deb_mock/uid_manager.py +d1ae06c2c12f7e3680f330d78fc2780d usr/share/doc/mock/changelog.Debian.gz +6e33bbc8d1428859f9f8b39c0e5d6010 usr/share/doc/mock/copyright diff --git a/debian/mock/DEBIAN/postinst b/debian/mock/DEBIAN/postinst new file mode 100755 index 0000000..8b36f99 --- /dev/null +++ b/debian/mock/DEBIAN/postinst @@ -0,0 +1,27 @@ +#!/bin/sh +set -e + + # Create necessary directories + mkdir -p /var/lib/mock/chroots + mkdir -p /var/cache/mock + mkdir -p /etc/schroot/chroot.d + + # Set proper permissions + chown root:root /var/lib/mock/chroots + chmod 755 /var/lib/mock/chroots + chown root:root /var/cache/mock + chmod 755 /var/cache/mock + + # Create mock group if it doesn't exist + if ! getent group mock >/dev/null 2>&1; then + addgroup --system mock + fi + + # Add users to mock group if they exist + if getent passwd build >/dev/null 2>&1; then + usermod -a -G mock build || true + fi + + echo "mock package installed successfully." + echo "Users in the 'mock' group can use mock without sudo." + echo "To add a user to the mock group: sudo usermod -a -G mock " \ No newline at end of file diff --git a/debian/mock/DEBIAN/prerm b/debian/mock/DEBIAN/prerm new file mode 100755 index 0000000..dfcc5c5 --- /dev/null +++ b/debian/mock/DEBIAN/prerm @@ -0,0 +1,14 @@ +#!/bin/sh +set -e + + # Remove users from mock group + if getent passwd build >/dev/null 2>&1; then + gpasswd -d build mock || true + fi + + # Remove mock group if it's empty + if getent group mock >/dev/null 2>&1; then + if [ $(getent group mock | cut -d: -f4 | tr ',' '\n' | wc -l) -eq 0 ]; then + delgroup mock || true + fi + fi \ No newline at end of file diff --git a/debian/mock/etc/deb-mock/config.yaml b/debian/mock/etc/deb-mock/config.yaml new file mode 100644 index 0000000..e8adde9 --- /dev/null +++ b/debian/mock/etc/deb-mock/config.yaml @@ -0,0 +1,117 @@ +# deb-mock configuration file +# Debian's equivalent to Fedora's Mock build environment manager + +# Global configuration +global: + basedir: "/var/lib/deb-mock" + rootdir: "/var/lib/deb-mock/chroots" + resultdir: "/var/lib/deb-mock/results" + cache_dir: "/var/cache/deb-mock" + log_dir: "/var/log/deb-mock" + +# Default chroot configuration +defaults: + distribution: "bookworm" + architecture: "amd64" + mirror: "http://deb.debian.org/debian" + security_mirror: "http://deb.debian.org/debian-security" + updates_mirror: "http://deb.debian.org/debian" + + # Package installation + install_packages: + - "build-essential" + - "fakeroot" + - "devscripts" + - "debhelper" + - "dh-make" + - "sbuild" + - "schroot" + + # Build dependencies + build_dependencies: + - "build-essential" + - "fakeroot" + - "devscripts" + - "debhelper" + - "dh-make" + +# Chroot profiles +profiles: + bookworm-amd64: + distribution: "bookworm" + architecture: "amd64" + mirror: "http://deb.debian.org/debian" + security_mirror: "http://deb.debian.org/debian-security" + updates_mirror: "http://deb.debian.org/debian" + components: ["main", "contrib", "non-free"] + + bookworm-arm64: + distribution: "bookworm" + architecture: "arm64" + mirror: "http://deb.debian.org/debian" + security_mirror: "http://deb.debian.org/debian-security" + updates_mirror: "http://deb.debian.org/debian" + components: ["main", "contrib", "non-free"] + + sid-amd64: + distribution: "sid" + architecture: "amd64" + mirror: "http://deb.debian.org/debian" + components: ["main", "contrib", "non-free"] + +# Plugin configuration +plugins: + mount: + enabled: true + mount_points: + - source: "/proc" + target: "/proc" + type: "proc" + - source: "/sys" + target: "/sys" + type: "sysfs" + - source: "/dev" + target: "/dev" + type: "bind" + + cache: + enabled: true + root_cache: true + package_cache: true + build_cache: true + + security: + enabled: true + user_isolation: true + network_isolation: true + resource_limits: true + +# Integration settings +integration: + deb_orchestrator_url: "http://localhost:8080" + deb_compose_url: "http://localhost:8080" + + # Build tools + sbuild_path: "/usr/bin/sbuild" + schroot_path: "/usr/bin/schroot" + debootstrap_path: "/usr/sbin/debootstrap" + + # Package managers + apt_path: "/usr/bin/apt" + dpkg_path: "/usr/bin/dpkg" + +# Logging configuration +logging: + level: "INFO" + format: "text" + file: "/var/log/deb-mock/deb-mock.log" + max_size: "100MB" + max_files: 5 + +# Performance settings +performance: + parallel_downloads: 4 + max_retries: 3 + timeout: 3600 + memory_limit: "2G" + disk_limit: "10G" diff --git a/debian/mock/usr/bin/mock b/debian/mock/usr/bin/mock new file mode 100755 index 0000000..9ad1e04 --- /dev/null +++ b/debian/mock/usr/bin/mock @@ -0,0 +1,27 @@ +#! /usr/bin/python3 +""" +mock - Debian package build environment manager +Main executable entry point +""" + +import sys +import os + +# Add the deb_mock module to the Python path +sys.path.insert(0, '/usr/lib/python3/dist-packages') +sys.path.insert(0, '/home/joe/.local/lib/python3.13/site-packages') + +# Also add current directory for development +current_dir = os.path.dirname(os.path.abspath(__file__)) +project_root = os.path.dirname(current_dir) +sys.path.insert(0, project_root) + +try: + from deb_mock.cli import main + if __name__ == '__main__': + main() +except ImportError as e: + print(f"Error importing deb_mock: {e}") + print("Please ensure mock is properly installed") + print("You can also run: python3 -m deb_mock.cli") + sys.exit(1) diff --git a/debian/mock/usr/share/doc/mock/copyright b/debian/mock/usr/share/doc/mock/copyright new file mode 100644 index 0000000..0d2de1f --- /dev/null +++ b/debian/mock/usr/share/doc/mock/copyright @@ -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 +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 +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. \ No newline at end of file