forked from AdrianTM/mx-snapshot
-
-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathPKGBUILD
More file actions
102 lines (85 loc) · 4.37 KB
/
Copy pathPKGBUILD
File metadata and controls
102 lines (85 loc) · 4.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# Maintainer: Adrian <adrian@mxlinux.org>
pkgname=mx-snapshot
pkgver=${PKGVER:-26.07.1}
pkgrel=1
pkgdesc="A tool for creating live ISO images from running systems"
arch=('x86_64' 'i686')
url="https://mxlinux.org"
license=('GPL3')
# openssl: installed-to-live-arch hashes the demo/root passwords with
# `openssl passwd -6` in reset-accounts mode (python3 is the fallback).
# syslinux: provides isohdpfx.bin, needed for make_isohybrid=yes (the
# shipped default) to actually produce a BIOS/USB-hybrid ISO.
depends=('qt6-base' 'polkit' 'squashfs-tools' 'xorriso' 'mx-iso-template-arch' 'lsb-release' 'openssl'
'syslinux')
optdepends=('paru: install gazelle-installer from the AUR when missing'
'xdg-user-dirs: resolve localized Documents/Downloads/etc. paths for exclusions')
makedepends=('cmake' 'ninja' 'qt6-tools')
conflicts=('mx-remaster-live-files')
replaces=('mx-remaster-live-files')
provides=('mx-remaster-live-files=1.0.0')
# /etc/mx-snapshot.conf and the exclude list are meant to be user-edited;
# without this, pacman would overwrite local changes on every upgrade.
backup=('etc/mx-snapshot.conf' 'etc/mx-snapshot-exclude.list')
source=()
sha256sums=()
build() {
cd "${startdir}"
# Arch packaging is intentionally GUI-only.
# iso-snapshot-cli is a Debian-only deliverable: on Debian it ships in its
# own .deb so headless / CI workflows can install just the CLI tool. On
# Arch we don't build it and don't install its scripts, polkit policies,
# or rules. If you need a CLI build for development, override with
# `-DBUILD_CLI=ON` via makepkg's CFLAGS/options or build directly with
# cmake.
cmake -G Ninja \
-B build \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DARCH_BUILD=ON \
-DBUILD_GUI=ON \
-DBUILD_CLI=OFF
cmake --build build --parallel
}
package() {
cd "${startdir}"
install -Dm755 build/mx-snapshot "${pkgdir}/usr/bin/mx-snapshot"
install -dm755 "${pkgdir}/usr/share/mx-snapshot/locale"
install -Dm644 build/*.qm "${pkgdir}/usr/share/mx-snapshot/locale/" 2>/dev/null || true
# Arch packaging is GUI-only (BUILD_CLI=OFF above); install scripts only
# under /usr/share/mx-snapshot/, not /usr/share/iso-snapshot-cli/.
install -dm755 "${pkgdir}/usr/share/mx-snapshot/scripts"
cp -a scripts-arch/* "${pkgdir}/usr/share/mx-snapshot/scripts/"
install -dm755 "${pkgdir}/usr/lib/mx-snapshot"
install -Dm755 build/helper "${pkgdir}/usr/lib/mx-snapshot/helper"
install -Dm755 polkit/snapshot-lib "${pkgdir}/usr/lib/mx-snapshot/snapshot-lib"
# GUI-only: install only the mx-snapshot policies. The iso-snapshot-cli
# policies would be inert without the CLI binary on this distro.
install -dm755 "${pkgdir}/usr/share/polkit-1/actions"
for policy in polkit/*mx-snapshot*.policy; do
install -Dm644 "$policy" "${pkgdir}/usr/share/polkit-1/actions/$(basename "$policy")"
done
install -Dm644 mx-snapshot.desktop "${pkgdir}/usr/share/applications/mx-snapshot.desktop"
install -Dm644 icons/mx-snapshot.png "${pkgdir}/usr/share/icons/hicolor/64x64/apps/mx-snapshot.png"
install -Dm644 icons/mx-snapshot.svg "${pkgdir}/usr/share/icons/hicolor/scalable/apps/mx-snapshot.svg"
install -Dm644 icons/mx-snapshot.png "${pkgdir}/usr/share/pixmaps/mx-snapshot.png"
install -Dm644 mx-snapshot.conf "${pkgdir}/etc/mx-snapshot.conf"
install -Dm644 mx-snapshot-exclude-arch.list "${pkgdir}/etc/mx-snapshot-exclude.list"
install -dm755 "${pkgdir}/usr/share/excludes"
install -Dm644 mx-snapshot-exclude-arch.list "${pkgdir}/usr/share/excludes/mx-snapshot-exclude.list"
install -Dm644 manual/mx-snapshot.8 "${pkgdir}/usr/share/man/man8/mx-snapshot.8"
install -dm755 "${pkgdir}/usr/share/doc/mx-snapshot"
if [ -d docs ]; then
cp -r docs/* "${pkgdir}/usr/share/doc/mx-snapshot/" 2>/dev/null || true
fi
# Install live-files (replaces mx-remaster-live-files package)
install -dm755 "${pkgdir}/usr/share/live-files"
cp -a live-files/files live-files/general-files "${pkgdir}/usr/share/live-files/"
ln -s /usr/lib/libostree/grub2-15_ostree \
"${pkgdir}/usr/share/live-files/files/etc/grub.d/15_ostree"
# Install changelog
if [ -f debian/changelog ]; then
gzip -c debian/changelog > "${pkgdir}/usr/share/doc/mx-snapshot/changelog.gz"
fi
}