Add debian packaging files

This commit is contained in:
2025-12-31 22:43:06 +00:00
parent eeff7b20e0
commit c1ca631cf4
11 changed files with 418 additions and 21 deletions

115
build.sh
View File

@@ -30,35 +30,108 @@ done
cd ..
# If we are compiling on Linux check if we are on Arch Linux and then create the Arch Linux package as well
# If we are compiling on Linux, create distro-specific packages
if [[ ${OS_NAME} == Linux ]]; then
OS_RELEASE=`pcregrep -o1 -e "^ID=(?<distro_id>\w+)" /etc/os-release`
if [[ ${OS_RELEASE} != arch && ${OS_RELEASE} != cachyos ]]; then
exit 0
# Build Arch Linux package
if [[ ${OS_RELEASE} == arch || ${OS_RELEASE} == cachyos ]]; then
echo "Building Arch Linux package..."
tar --exclude-vcs --exclude="*/bin" --exclude="*/obj" --exclude="build" --exclude="pkg/pacman/*/*.tar.xz" \
--exclude="pkg/pacman/*/src" --exclude="pkg/pacman/*/pkg" --exclude="pkg/pacman/*/*.tar" \
--exclude="pkg/pacman/*/*.asc" --exclude="*.user" --exclude=".idea" --exclude=".vs" --exclude=".vscode" \
--exclude="build.iso" --exclude=".DS_Store" -cvf pkg/pacman/stable/aaru-src-${AARU_VERSION}.tar .
mv .glogalconfig .globalconfig.bak
cd pkg/pacman/stable
xz -v9e aaru-src-${AARU_VERSION}.tar
gpg --armor --detach-sign aaru-src-${AARU_VERSION}.tar.xz
cp PKGBUILD PKGBUILD.bak
echo -e \\n >> PKGBUILD
makepkg -g >> PKGBUILD
makepkg
mv PKGBUILD.bak PKGBUILD
mv aaru-src-${AARU_VERSION}.tar.xz aaru-src-${AARU_VERSION}.tar.xz.asc ../../../build
cd ../../..
mv .globalconfig.bak .globalconfig
mv pkg/pacman/stable/*.pkg.tar.zst build/ 2>/dev/null || true
fi
tar --exclude-vcs --exclude="*/bin" --exclude="*/obj" --exclude="build" --exclude="pkg/pacman/*/*.tar.xz" \
--exclude="pkg/pacman/*/src" --exclude="pkg/pacman/*/pkg" --exclude="pkg/pacman/*/*.tar" \
--exclude="pkg/pacman/*/*.asc" --exclude="*.user" --exclude=".idea" --exclude=".vs" --exclude=".vscode" \
--exclude="build.iso" --exclude=".DS_Store" -cvf pkg/pacman/stable/aaru-src-${AARU_VERSION}.tar .
mv .glogalconfig .globalconfig.bak
cd pkg/pacman/stable
xz -v9e aaru-src-${AARU_VERSION}.tar
gpg --armor --detach-sign aaru-src-${AARU_VERSION}.tar.xz
cp PKGBUILD PKGBUILD.bak
echo -e \\n >> PKGBUILD
makepkg -g >> PKGBUILD
makepkg
mv PKGBUILD.bak PKGBUILD
mv aaru-src-${AARU_VERSION}.tar.xz aaru-src-${AARU_VERSION}.tar.xz.asc ../../../build
cd ../../..
mv .globalconfig.bak .globalconfig
# Build Debian packages for all architectures (on any distro if tools are available)
if command -v dpkg-buildpackage &> /dev/null; then
echo "Building Debian packages for all architectures..."
# Create a temporary debian directory symlink for building
if [ ! -L debian ]; then
ln -s pkg/debian debian
fi
# Determine which tool to use
if command -v debuild &> /dev/null; then
BUILD_CMD="debuild"
echo "Using debuild to build Debian packages"
else
BUILD_CMD="dpkg-buildpackage"
echo "Using dpkg-buildpackage to build Debian packages"
fi
# Build for all three architectures
for arch in amd64 arm64 armhf; do
echo ""
echo "========================================"
echo "Building Debian package for ${arch}..."
echo "========================================"
# Build the package
if [ "$BUILD_CMD" == "debuild" ]; then
debuild -a ${arch} -us -uc -b 2>&1 | tee build/debian-build-${arch}.log || {
echo "WARNING: Debian package build for ${arch} failed, but continuing..."
pkg/debian/rules clean 2>/dev/null || true
continue
}
else
dpkg-buildpackage -a ${arch} -us -uc -b 2>&1 | tee build/debian-build-${arch}.log || {
echo "WARNING: Debian package build for ${arch} failed, but continuing..."
pkg/debian/rules clean 2>/dev/null || true
continue
}
fi
# Move generated packages to build directory
if [ -f ../aaru_*_${arch}.deb ]; then
mv ../aaru_*_${arch}.deb build/ 2>/dev/null || true
echo "✓ Debian package for ${arch} moved to build directory"
fi
# Clean up build artifacts
mv ../*.changes build/ 2>/dev/null || true
mv ../*.buildinfo build/ 2>/dev/null || true
rm -f ../*.dsc 2>/dev/null || true
# Clean between builds
if [ -f pkg/debian/rules ]; then
pkg/debian/rules clean 2>/dev/null || true
fi
done
# Remove temporary symlink
rm -f debian 2>/dev/null || true
echo ""
echo "========================================"
echo "Debian package build summary:"
ls -lh build/aaru_*.deb 2>/dev/null || echo "No .deb files found"
echo "========================================"
else
if [[ ${OS_RELEASE} == debian || ${OS_RELEASE} == ubuntu || ${OS_RELEASE} == linuxmint || ${OS_RELEASE} == pop || ${OS_RELEASE} == elementary ]]; then
echo "dpkg-buildpackage not found, skipping Debian package build"
echo "Install with: sudo apt-get install dpkg-dev debhelper"
elif [[ ${OS_RELEASE} == arch || ${OS_RELEASE} == cachyos ]]; then
echo "dpkg-buildpackage not found, skipping Debian package build"
echo "Install with: sudo pacman -S dpkg debhelper fakeroot"
fi
fi
fi
mv pkg/pacman/stable/*.pkg.tar.zst build/
# Remove stray files from published folders
rm -R Aaru/bin/*/net10.0/*/publish/BuildHost-net* Aaru/bin/*/net10.0/*/publish/*.xml Aaru/bin/*/net10.0/*/publish/*.pdb

19
pkg/debian/changelog Normal file
View File

@@ -0,0 +1,19 @@
aaru (6.0.0~alpha17-1) bookworm; urgency=medium
* New upstream alpha release 6.0.0-alpha.17
* Migration to .NET 10.0
* Enhanced media preservation features
* Improved filesystem support
* Bug fixes and performance improvements
* Built for Debian 12 (Bookworm) and Ubuntu 24.04 LTS (Noble)
* Compatible with Debian 12+, Ubuntu 24.04+, and derivatives
* Multi-architecture support (amd64, arm64, armhf)
-- Natalia Portillo <claunia@claunia.com> Tue, 31 Dec 2024 12:00:00 +0000
aaru (5.3.2-1) unstable; urgency=medium
* Initial Debian package release
-- Natalia Portillo <claunia@claunia.com> Mon, 01 Jan 2024 12:00:00 +0000

2
pkg/debian/compat Normal file
View File

@@ -0,0 +1,2 @@
13

39
pkg/debian/control Normal file
View File

@@ -0,0 +1,39 @@
Source: aaru
Section: utils
Priority: optional
Maintainer: Natalia Portillo <claunia@claunia.com>
Standards-Version: 4.6.2
Homepage: https://www.aaru.app
Vcs-Git: https://github.com/aaru-dps/Aaru.git
Vcs-Browser: https://github.com/aaru-dps/Aaru
Rules-Requires-Root: no
Package: aaru
Architecture: amd64 arm64 armhf
Depends: ${shlibs:Depends}, ${misc:Depends},
libicu74 | libicu72 | libicu71 | libicu70 | libicu69 | libicu68 | libicu67,
libkrb5-3,
libunwind8,
libssl3 | libssl1.1,
zlib1g
Description: Disc image management and creation tool for Debian 12+ and Ubuntu 24.04+
Aaru (named after the Egyptian paradise where the righteous dwell eternally)
is the ultimate Data Preservation Suite — your all-in-one solution for digital
media preservation and archival.
.
This package is built for Debian 12 (Bookworm), Ubuntu 24.04 LTS (Noble),
and compatible distributions.
.
Aaru is designed to assist you through the entire workflow of digital media
preservation — from the initial creation of disk images (commonly called
"dumping") all the way through long-term archival storage.
.
Key features include:
* Media dumping from various drives (magnetic, optical, flash, tapes)
* Hardware flexibility with ATA, ATAPI, SCSI, USB, FireWire support
* Image management (identify, compare, convert formats)
* Filesystem analysis and extraction
* Archive and game package support
* Both CLI and GUI interfaces
* AaruFormat archival format with comprehensive metadata

71
pkg/debian/copyright Normal file
View File

@@ -0,0 +1,71 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: Aaru
Upstream-Contact: Natalia Portillo <claunia@claunia.com>
Source: https://github.com/aaru-dps/Aaru
Files: *
Copyright: 2011-2026 Natalia Portillo <claunia@claunia.com>
License: GPL-3.0+
Files: Aaru.Checksums/* Aaru.Compression/* Aaru.Helpers/*
Copyright: 2011-2026 Natalia Portillo <claunia@claunia.com>
License: LGPL-2.1+
Files: Aaru.CommonTypes/*
Copyright: 2011-2026 Natalia Portillo <claunia@claunia.com>
License: MIT
License: GPL-3.0+
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
.
This package is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
.
On Debian systems, the complete text of the GNU General
Public License version 3 can be found in "/usr/share/common-licenses/GPL-3".
License: LGPL-2.1+
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
.
On Debian systems, the complete text of the GNU Lesser General
Public License version 2.1 can be found in "/usr/share/common-licenses/LGPL-2.1".
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.

3
pkg/debian/install Normal file
View File

@@ -0,0 +1,3 @@
# Additional files to install (handled by rules file)
# This file is kept for compatibility but installation is done in rules

34
pkg/debian/postinst Executable file
View File

@@ -0,0 +1,34 @@
#!/bin/sh
set -e
case "$1" in
configure)
# Update icon cache
if which gtk-update-icon-cache >/dev/null 2>&1; then
gtk-update-icon-cache -q -t -f /usr/share/icons/hicolor || true
fi
# Update MIME database
if which update-mime-database >/dev/null 2>&1; then
update-mime-database /usr/share/mime || true
fi
# Update desktop database
if which update-desktop-database >/dev/null 2>&1; then
update-desktop-database -q || true
fi
;;
abort-upgrade|abort-remove|abort-deconfigure)
;;
*)
echo "postinst called with unknown argument \`$1'" >&2
exit 1
;;
esac
#DEBHELPER#
exit 0

34
pkg/debian/postrm Executable file
View File

@@ -0,0 +1,34 @@
#!/bin/sh
set -e
case "$1" in
remove|purge|upgrade|disappear)
# Update icon cache
if which gtk-update-icon-cache >/dev/null 2>&1; then
gtk-update-icon-cache -q -t -f /usr/share/icons/hicolor || true
fi
# Update MIME database
if which update-mime-database >/dev/null 2>&1; then
update-mime-database /usr/share/mime || true
fi
# Update desktop database
if which update-desktop-database >/dev/null 2>&1; then
update-desktop-database -q || true
fi
;;
failed-upgrade|abort-install|abort-upgrade)
;;
*)
echo "postrm called with unknown argument \`$1'" >&2
exit 1
;;
esac
#DEBHELPER#
exit 0

102
pkg/debian/rules Executable file
View File

@@ -0,0 +1,102 @@
#!/usr/bin/make -f
export DH_VERBOSE = 1
export DOTNET_CLI_TELEMETRY_OPTOUT = 1
export DOTNET_SKIP_FIRST_TIME_EXPERIENCE = 1
# Determine target architecture (supports cross-compilation)
DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
DEB_BUILD_ARCH ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH)
DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
# Map Debian architecture to .NET Runtime Identifier
ifeq ($(DEB_HOST_ARCH),amd64)
DOTNET_RID = linux-x64
else ifeq ($(DEB_HOST_ARCH),arm64)
DOTNET_RID = linux-arm64
else ifeq ($(DEB_HOST_ARCH),armhf)
DOTNET_RID = linux-arm
else
$(error Unsupported architecture: $(DEB_HOST_ARCH))
endif
# Detect if we're cross-compiling
ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
IS_CROSS = yes
$(info Cross-compiling from $(DEB_BUILD_ARCH) to $(DEB_HOST_ARCH))
$(info Using .NET RID: $(DOTNET_RID))
else
IS_CROSS = no
endif
AARU_VERSION = 6.0.0-alpha.17
NETCORE_TARGET = net10.0
%:
dh $@ --without autoreconf
override_dh_auto_clean:
dotnet clean Aaru/Aaru.csproj || true
dh_auto_clean
override_dh_auto_build:
cd Aaru && dotnet publish -f $(NETCORE_TARGET) -c Release \
--self-contained -r $(DOTNET_RID) \
-p:PublishSingleFile=true \
-p:IncludeNativeLibrariesForSelfExtract=true \
-p:EnableCompressionInSingleFile=true
override_dh_auto_install:
# Install main binary
install -D -m 0755 Aaru/bin/Release/$(NETCORE_TARGET)/$(DOTNET_RID)/publish/aaru \
debian/aaru/opt/Aaru/aaru
# Install documentation
install -D -m 0644 README.md debian/aaru/opt/Aaru/README.md
install -D -m 0644 Changelog.md debian/aaru/opt/Aaru/Changelog.md
install -D -m 0644 CONTRIBUTING.md debian/aaru/opt/Aaru/CONTRIBUTING.md
install -D -m 0644 LICENSE debian/aaru/opt/Aaru/LICENSE
install -D -m 0644 LICENSE.MIT debian/aaru/opt/Aaru/LICENSE.MIT
install -D -m 0644 LICENSE.LGPL debian/aaru/opt/Aaru/LICENSE.LGPL
# Install MIME type
install -D -m 0644 Aaru/aaruformat.xml \
debian/aaru/usr/share/mime/packages/aaruformat.xml
# Install desktop file
install -D -m 0644 Aaru/aaru.desktop \
debian/aaru/usr/share/applications/aaru.desktop
# Install icons
install -D -m 0644 icons/32x32/aaru.png \
debian/aaru/usr/share/icons/hicolor/32x32/apps/aaru.png
install -D -m 0644 icons/64x64/aaru.png \
debian/aaru/usr/share/icons/hicolor/64x64/apps/aaru.png
install -D -m 0644 icons/128x128/aaru.png \
debian/aaru/usr/share/icons/hicolor/128x128/apps/aaru.png
install -D -m 0644 icons/256x256/aaru.png \
debian/aaru/usr/share/icons/hicolor/256x256/apps/aaru.png
install -D -m 0644 icons/512x512/aaru.png \
debian/aaru/usr/share/icons/hicolor/512x512/apps/aaru.png
# Create symlink in /usr/bin
install -d debian/aaru/usr/bin
ln -sf /opt/Aaru/aaru debian/aaru/usr/bin/aaru
override_dh_auto_test:
# Skip tests for now
true
override_dh_strip:
# Don't strip .NET binaries
true
override_dh_makeshlibs:
# Skip makeshlibs - this is a self-contained .NET app with no shared libraries
true
override_dh_shlibdeps:
# Skip shlib deps as this is a self-contained .NET app
true

2
pkg/debian/source/format Normal file
View File

@@ -0,0 +1,2 @@
3.0 (native)

18
pkg/debian/source/options Normal file
View File

@@ -0,0 +1,18 @@
tar-ignore = ".git"
tar-ignore = ".github"
tar-ignore = ".vs"
tar-ignore = ".vscode"
tar-ignore = ".idea"
tar-ignore = ".fleet"
tar-ignore = "*.user"
tar-ignore = ".DS_Store"
tar-ignore = "bin"
tar-ignore = "obj"
tar-ignore = "build"
tar-ignore = "nupkgs"
tar-ignore = "BenchmarkDotNet.Artifacts"
tar-ignore = "pkg/pacman/*/pkg"
tar-ignore = "pkg/pacman/*/*.tar*"
tar-ignore = "pkg/pacman/*/*.asc"
tar-ignore = "pkg/pacman/*/src"