diff options
| author | Woodpecker CI <emmett1.2miligrams@protonmail.com> | 2026-06-02 15:54:43 +0000 |
|---|---|---|
| committer | Woodpecker CI <emmett1.2miligrams@protonmail.com> | 2026-06-02 15:54:43 +0000 |
| commit | 33f64c85077822ded7798ce76035a66cacd90301 (patch) | |
| tree | 27a3d1c6ae79730d388a9c794f89662572c5f866 | |
| parent | a6d13786445f20aab87f43d18d3581b895a0af71 (diff) | |
| download | alicelinux-33f64c85077822ded7798ce76035a66cacd90301.tar.gz alicelinux-33f64c85077822ded7798ce76035a66cacd90301.zip | |
Woodpecker CI 7d266fc1171fb55f8758d5170d40e5032058163e [SKIP CI]
| -rw-r--r-- | docs/apkg_helpers.html | 238 | ||||
| -rw-r--r-- | docs/bootloader.html | 242 | ||||
| -rw-r--r-- | docs/index.html | 4 | ||||
| -rw-r--r-- | docs/install.html | 4 | ||||
| -rw-r--r-- | docs/networking.html | 4 | ||||
| -rw-r--r-- | docs/packagemanager.html | 4 | ||||
| -rw-r--r-- | docs/using_autils.html | 353 | ||||
| -rw-r--r-- | docs/writing_abuild.html | 367 | ||||
| -rw-r--r-- | ports.html | 4 |
9 files changed, 1218 insertions, 2 deletions
diff --git a/docs/apkg_helpers.html b/docs/apkg_helpers.html new file mode 100644 index 00000000..cc56ebee --- /dev/null +++ b/docs/apkg_helpers.html @@ -0,0 +1,238 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="UTF-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <title>Alice Linux - docs</title> + <link rel="icon" type="image/svg+xml" href="/files/favicon.svg"> + <style> + :root { + color-scheme: dark; + --bg: #0d0d0d; + --bg-alt: #141414; + --bg-code: #1a1a1a; + --fg: #e0e0e0; + --fg-dim: #888; + --accent: #a8a8a8; + --accent-hover: #e0e0e0; + --border: #222; + } + * { margin: 0; padding: 0; box-sizing: border-box; } + body { + font-family: "Terminus", "Monaco", "Cascadia Code", "Fira Code", "JetBrains Mono", "SF Mono", Consolas, monospace; + font-size: 15px; + line-height: 1.6; + max-width: 88ch; + margin: 0 auto; + padding: 2em 1.5em; + background: var(--bg); + color: var(--fg); + -webkit-font-smoothing: antialiased; + } + h1, h2, h3, h4 { font-weight: 600; line-height: 1.3; } + h1 { font-size: 1.75rem; margin-bottom: 0.6em; } + h2 { font-size: 1.3rem; margin: 1.6em 0 0.5em; } + h3 { font-size: 1.1rem; margin: 1.4em 0 0.4em; } + h4 { font-size: 1rem; margin: 1.2em 0 0.3em; } + p { margin: 0 0 1em; } + a { + color: var(--accent); + text-decoration: none; + } + a:hover { color: var(--accent-hover); text-decoration: underline; } + nav { margin-bottom: 1.5em; } + nav a { color: var(--fg-dim); font-size: 0.9em; } + nav a:hover { color: var(--accent); } + nav span { color: var(--border); margin: 0 0.3em; } + hr { + border: 0; + border-top: 1px solid var(--border); + margin: 1.5em 0; + } + pre, code { font-family: "SF Mono", "Cascadia Code", "Fira Code", "JetBrains Mono", Consolas, monospace; font-size: 0.9em; } + code { + background: var(--bg-code); + padding: 0.15em 0.4em; + border-radius: 3px; + color: #c0c0c0; + } + pre { + background: var(--bg-code); + border: 1px solid var(--border); + border-radius: 4px; + padding: 1em; + overflow-x: auto; + margin: 1em 0; + line-height: 1.45; + } + pre code { + background: none; + padding: 0; + border-radius: 0; + } + img { + display: block; + max-width: 100%; + height: auto; + margin: 1em 0; + border-radius: 4px; + } + blockquote { + margin: 1em 0; + padding-left: 1em; + border-left: 3px solid var(--border); + color: var(--fg-dim); + } + table { + width: 100%; + border-collapse: collapse; + margin: 1em 0; + } + th, td { + padding: 0.5em 0.6em; + text-align: left; + border-bottom: 1px solid var(--border); + } + th { + font-weight: 600; + border-bottom-color: #333; + } + tr:last-child td { border-bottom: none; } + ul, ol { margin: 0 0 1em 1.5em; } + li { margin-bottom: 0.3em; } + input, button, textarea { font: inherit; color: inherit; } + .ports-toolbar { + display: flex; + flex-wrap: wrap; + gap: 0.5em; + margin-bottom: 1em; + } + .ports-toolbar button { + background: none; + border: none; + border-bottom: 2px solid transparent; + padding: 0.3em 0; + cursor: pointer; + color: var(--fg-dim); + font-size: 0.9em; + } + .ports-toolbar button.active { + color: var(--accent); + border-bottom-color: var(--accent); + } + .ports-toolbar button:hover { color: var(--fg); } + .ports-toolbar input { + flex: 1 1 18em; + min-width: 0; + background: var(--bg-alt); + border: 1px solid var(--border); + border-radius: 3px; + padding: 0.4em 0.6em; + } + .ports-toolbar input:focus { outline: none; border-color: var(--accent); } + .ports-count { margin-bottom: 0.8em; color: var(--fg-dim); font-size: 0.9em; } + #commits { list-style: none; margin: 0; } + #commits li { + padding: 0.8em 0; + border-bottom: 1px solid var(--border); + display: flex; + align-items: flex-start; + gap: 0.8em; + } + #commits li:last-child { border-bottom: none; } + .commit-hash { + font-family: "SF Mono", "Cascadia Code", "Fira Code", "JetBrains Mono", Consolas, monospace; + font-size: 0.8em; + color: var(--fg-dim); + white-space: nowrap; + min-width: 7em; + } + .commit-msg { flex: 1; word-break: break-word; } + .commit-meta { + font-size: 0.85em; + color: var(--fg-dim); + white-space: nowrap; + text-align: right; + min-width: 9em; + } + #commits-loading { + text-align: center; + padding: 1.5em; + color: var(--fg-dim); + display: none; + } + #commits-error { + text-align: center; + padding: 1em; + color: #e77; + display: none; + } + .dl-table td:nth-child(1) { width: 60%; } + .dl-table td:nth-child(2) { width: 15%; text-align: right; } + .dl-table td:nth-child(3) { width: 25%; white-space: nowrap; } + .dl-empty { color: var(--fg-dim); font-style: italic; } + </style> +</head> +<body> +<div class="centered-wrapper"> + <nav> + <a href="/">home</a><span> / </span><a href="/docs">docs</a><span> / </span><a href="/ports.html">ports</a><span> / </span><a href="/commits.html">commits</a><span> / </span><a href="/download.html">download</a><span> / </span><a href="/development.html">development</a><span> / </span><a href="/community.html">community</a><span> / </span><a href="/donate.html">donate</a> + </nav> + <hr> +<a href="/docs/"><- back to docs</a> + +<h1>apkg helper scripts</h1> +<p>autils includes several helper scripts that work alongside <code>apkg</code> for package inspection, cleanup, and maintenance. See <code>man <program></code> for full details on each command.</p> +<h2>apkg-chroot</h2> +<p>Enter a chroot environment with virtual filesystems mounted. Useful for building packages or performing system maintenance inside an alternative root.</p> +<pre><code class="language-sh">apkg-chroot /mnt/alice # launch interactive shell +apkg-chroot /mnt/alice apkg -i mypkg # run a command inside the chroot +</code></pre> +<p>Must be run as root. Mounts <code>/dev</code>, <code>/proc</code>, <code>/sys</code>, <code>/run</code>, copies <code>/etc/resolv.conf</code>, and cleans up all mounts on exit.</p> +<h2>apkg-clean</h2> +<p>List stale <code>.spm</code> package files and orphaned source tarballs that are no longer referenced by any current package recipe. Pipe to <code>xargs rm</code> to actually clean up.</p> +<pre><code class="language-sh">apkg-clean # list all unreferenced files +apkg-clean -p # list only stale packages +apkg-clean -s # list only stale sources +apkg-clean | xargs rm # remove them +</code></pre> +<h2>apkg-deps</h2> +<p>Show runtime library dependencies of an installed package. Uses <code>ldd</code> to find shared libraries needed by the package's binaries, then maps those libraries back to the packages that provide them.</p> +<pre><code class="language-sh">apkg-deps mypkg +</code></pre> +<p>Useful for discovering implicit runtime dependencies not listed in the formal <code>depends</code> file. Excludes the package itself and base system packages (gcc, musl, binutils, glibc).</p> +<h2>apkg-foreign</h2> +<p>List installed packages that are not found in any configured repository. These may have been installed from an external source or had their recipes removed.</p> +<pre><code class="language-sh">apkg-foreign +</code></pre> +<p>Takes no arguments; outputs one package name per line.</p> +<h2>apkg-genabuild</h2> +<p>Scaffold a new package recipe from a source URL. Parses the name and version from the URL and creates a directory with skeleton <code>abuild</code> and <code>info</code> files.</p> +<pre><code class="language-sh">apkg-genabuild https://example.com/mypkg-1.2.3.tar.gz +apkg-genabuild https://github.com/user/repo/archive/v1.0.tar.gz myname +</code></pre> +<p>Special handling for GitHub tag archives, PyPI packages (prefixes <code>python-</code>), and CPAN packages (prefixes <code>perl-</code>). An optional second argument overrides the derived package name.</p> +<h2>apkg-orphan</h2> +<p>List orphan packages: packages that are installed and exist in a repository, but have no other installed package depending on them. These may be safe to remove.</p> +<pre><code class="language-sh">apkg-orphan +</code></pre> +<p>Takes no arguments; outputs one package name per line.</p> +<h2>apkg-purge</h2> +<p>Remove a package and all its dependencies that are no longer needed by any other installed package. This is a "deep" removal compared to <code>apkg -r</code> which only removes the specified package.</p> +<pre><code class="language-sh">apkg-purge mypkg # dry-run: show what would be removed +apkg-purge -p mypkg # actually purge from the system +</code></pre> +<h2>apkg-redundantdeps</h2> +<p>Find redundant entries in <code>depends</code> files. A dependency is redundant if another listed dependency already pulls it in transitively.</p> +<pre><code class="language-sh">apkg-redundantdeps mypkg # check one package +apkg-redundantdeps # check all packages +apkg-redundantdeps -f mypkg # fix by removing redundant entries +apkg-redundantdeps -f # fix all packages +</code></pre> + +<a href="/docs/"><- back to docs</a> + <hr> + <p style="color: var(--fg-dim); font-size: 0.85em;">Copyright © Alice Linux, 2024-2026</p> +</div> +</body> +</html> diff --git a/docs/bootloader.html b/docs/bootloader.html new file mode 100644 index 00000000..debd8c6f --- /dev/null +++ b/docs/bootloader.html @@ -0,0 +1,242 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="UTF-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <title>Alice Linux - docs</title> + <link rel="icon" type="image/svg+xml" href="/files/favicon.svg"> + <style> + :root { + color-scheme: dark; + --bg: #0d0d0d; + --bg-alt: #141414; + --bg-code: #1a1a1a; + --fg: #e0e0e0; + --fg-dim: #888; + --accent: #a8a8a8; + --accent-hover: #e0e0e0; + --border: #222; + } + * { margin: 0; padding: 0; box-sizing: border-box; } + body { + font-family: "Terminus", "Monaco", "Cascadia Code", "Fira Code", "JetBrains Mono", "SF Mono", Consolas, monospace; + font-size: 15px; + line-height: 1.6; + max-width: 88ch; + margin: 0 auto; + padding: 2em 1.5em; + background: var(--bg); + color: var(--fg); + -webkit-font-smoothing: antialiased; + } + h1, h2, h3, h4 { font-weight: 600; line-height: 1.3; } + h1 { font-size: 1.75rem; margin-bottom: 0.6em; } + h2 { font-size: 1.3rem; margin: 1.6em 0 0.5em; } + h3 { font-size: 1.1rem; margin: 1.4em 0 0.4em; } + h4 { font-size: 1rem; margin: 1.2em 0 0.3em; } + p { margin: 0 0 1em; } + a { + color: var(--accent); + text-decoration: none; + } + a:hover { color: var(--accent-hover); text-decoration: underline; } + nav { margin-bottom: 1.5em; } + nav a { color: var(--fg-dim); font-size: 0.9em; } + nav a:hover { color: var(--accent); } + nav span { color: var(--border); margin: 0 0.3em; } + hr { + border: 0; + border-top: 1px solid var(--border); + margin: 1.5em 0; + } + pre, code { font-family: "SF Mono", "Cascadia Code", "Fira Code", "JetBrains Mono", Consolas, monospace; font-size: 0.9em; } + code { + background: var(--bg-code); + padding: 0.15em 0.4em; + border-radius: 3px; + color: #c0c0c0; + } + pre { + background: var(--bg-code); + border: 1px solid var(--border); + border-radius: 4px; + padding: 1em; + overflow-x: auto; + margin: 1em 0; + line-height: 1.45; + } + pre code { + background: none; + padding: 0; + border-radius: 0; + } + img { + display: block; + max-width: 100%; + height: auto; + margin: 1em 0; + border-radius: 4px; + } + blockquote { + margin: 1em 0; + padding-left: 1em; + border-left: 3px solid var(--border); + color: var(--fg-dim); + } + table { + width: 100%; + border-collapse: collapse; + margin: 1em 0; + } + th, td { + padding: 0.5em 0.6em; + text-align: left; + border-bottom: 1px solid var(--border); + } + th { + font-weight: 600; + border-bottom-color: #333; + } + tr:last-child td { border-bottom: none; } + ul, ol { margin: 0 0 1em 1.5em; } + li { margin-bottom: 0.3em; } + input, button, textarea { font: inherit; color: inherit; } + .ports-toolbar { + display: flex; + flex-wrap: wrap; + gap: 0.5em; + margin-bottom: 1em; + } + .ports-toolbar button { + background: none; + border: none; + border-bottom: 2px solid transparent; + padding: 0.3em 0; + cursor: pointer; + color: var(--fg-dim); + font-size: 0.9em; + } + .ports-toolbar button.active { + color: var(--accent); + border-bottom-color: var(--accent); + } + .ports-toolbar button:hover { color: var(--fg); } + .ports-toolbar input { + flex: 1 1 18em; + min-width: 0; + background: var(--bg-alt); + border: 1px solid var(--border); + border-radius: 3px; + padding: 0.4em 0.6em; + } + .ports-toolbar input:focus { outline: none; border-color: var(--accent); } + .ports-count { margin-bottom: 0.8em; color: var(--fg-dim); font-size: 0.9em; } + #commits { list-style: none; margin: 0; } + #commits li { + padding: 0.8em 0; + border-bottom: 1px solid var(--border); + display: flex; + align-items: flex-start; + gap: 0.8em; + } + #commits li:last-child { border-bottom: none; } + .commit-hash { + font-family: "SF Mono", "Cascadia Code", "Fira Code", "JetBrains Mono", Consolas, monospace; + font-size: 0.8em; + color: var(--fg-dim); + white-space: nowrap; + min-width: 7em; + } + .commit-msg { flex: 1; word-break: break-word; } + .commit-meta { + font-size: 0.85em; + color: var(--fg-dim); + white-space: nowrap; + text-align: right; + min-width: 9em; + } + #commits-loading { + text-align: center; + padding: 1.5em; + color: var(--fg-dim); + display: none; + } + #commits-error { + text-align: center; + padding: 1em; + color: #e77; + display: none; + } + .dl-table td:nth-child(1) { width: 60%; } + .dl-table td:nth-child(2) { width: 15%; text-align: right; } + .dl-table td:nth-child(3) { width: 25%; white-space: nowrap; } + .dl-empty { color: var(--fg-dim); font-style: italic; } + </style> +</head> +<body> +<div class="centered-wrapper"> + <nav> + <a href="/">home</a><span> / </span><a href="/docs">docs</a><span> / </span><a href="/ports.html">ports</a><span> / </span><a href="/commits.html">commits</a><span> / </span><a href="/download.html">download</a><span> / </span><a href="/development.html">development</a><span> / </span><a href="/community.html">community</a><span> / </span><a href="/donate.html">donate</a> + </nav> + <hr> +<a href="/docs/"><- back to docs</a> + +<h1>Bootloader</h1> +<p>This document covers installing and configuring the two bootloaders available in Alice Linux: Limine and GRUB.</p> +<h2>Limine</h2> +<p>Limine is a modern, lightweight bootloader supporting BIOS and UEFI.</p> +<p>Install the package:</p> +<pre><code># apkg -I limine +</code></pre> +<h3>BIOS</h3> +<p>Deploy Limine to the target disk:</p> +<pre><code># limine bios-install /dev/sdX +</code></pre> +<h3>UEFI</h3> +<p>Copy the Limine EFI executable to the EFI system partition:</p> +<pre><code># mkdir -p /boot/EFI/BOOT +# cp /usr/share/limine/BOOTX64.EFI /boot/EFI/BOOT +</code></pre> +<h3>Configuration</h3> +<p>Create <code>/boot/limine.conf</code>:</p> +<pre><code>timeout: 5 + +/Alice Linux + protocol: linux + kernel_path: boot():/vmlinuz + cmdline: root=/dev/sda2 rw loglevel=3 quiet + module_path: boot():/initrd-linux +</code></pre> +<p>Use <code>boot()</code> to reference the partition where <code>/boot</code> resides, or specify the partition directly with <code>uuid()</code> or a path like <code>hd(0,2)</code>.</p> +<p>For full configuration options, see the <a href="https://github.com/limine-bootloader/limine/blob/trunk/CONFIG.md">Limine documentation</a>.</p> +<h2>GRUB</h2> +<p>GRUB is the GNU Grand Unified Bootloader, supporting UEFI on x86_64 only.</p> +<p>Install the package:</p> +<pre><code># apkg -I grub +</code></pre> +<h3>Install</h3> +<p>Install GRUB for UEFI (requires the EFI system partition mounted at <code>/boot</code>):</p> +<pre><code># grub-install --target=x86_64-efi --efi-directory=/boot +</code></pre> +<h3>Configuration</h3> +<p>Generate the GRUB configuration file:</p> +<pre><code># grub-mkconfig -o /boot/grub/grub.cfg +</code></pre> +<p>GRUB settings are controlled by <code>/etc/default/grub</code>. Key options:</p> +<ul> +<li><strong><code>GRUB_DEFAULT</code></strong>: Default menu entry (default: <code>0</code>)</li> +<li><strong><code>GRUB_TIMEOUT</code></strong>: Seconds before booting the default entry (default: <code>5</code>)</li> +<li><strong><code>GRUB_CMDLINE_LINUX_DEFAULT</code></strong>: Kernel command line arguments</li> +<li><strong><code>GRUB_GFXMODE</code></strong>: Framebuffer resolution (default: <code>auto</code>)</li> +<li><strong><code>GRUB_DISABLE_OS_PROBER</code></strong>: Disable probing for other operating systems (default: enabled for security)</li> +</ul> +<p>After editing <code>/etc/default/grub</code>, regenerate the config:</p> +<pre><code># grub-mkconfig -o /boot/grub/grub.cfg +</code></pre> + +<a href="/docs/"><- back to docs</a> + <hr> + <p style="color: var(--fg-dim); font-size: 0.85em;">Copyright © Alice Linux, 2024-2026</p> +</div> +</body> +</html> diff --git a/docs/index.html b/docs/index.html index c204516b..5ba0e91b 100644 --- a/docs/index.html +++ b/docs/index.html @@ -183,9 +183,13 @@ <p>This section covers the main parts of <strong>Alice Linux</strong>: installation, package management, networking, service supervision, etc.</p> <ul> +<li><a href="./apkg_helpers.html">apkg helper scripts</a></li> +<li><a href="./bootloader.html">Bootloader</a></li> <li><a href="./install.html">Install Alice</a></li> <li><a href="./networking.html">Networking</a></li> <li><a href="./packagemanager.html">Package Manager</a></li> +<li><a href="./using_autils.html">Using autils</a></li> +<li><a href="./writing_abuild.html">Writing an abuild recipe</a></li> </ul> <hr> <p style="color: var(--fg-dim); font-size: 0.85em;">Copyright © Alice Linux, 2024-2026</p> diff --git a/docs/install.html b/docs/install.html index 51063424..c04cae3a 100644 --- a/docs/install.html +++ b/docs/install.html @@ -179,6 +179,8 @@ <a href="/">home</a><span> / </span><a href="/docs">docs</a><span> / </span><a href="/ports.html">ports</a><span> / </span><a href="/commits.html">commits</a><span> / </span><a href="/download.html">download</a><span> / </span><a href="/development.html">development</a><span> / </span><a href="/community.html">community</a><span> / </span><a href="/donate.html">donate</a> </nav> <hr> +<a href="/docs/"><- back to docs</a> + <h1>Install Alice</h1> <p>Here is a guide to installing Alice Linux on your computer using the chroot method. You can do this from your existing Linux distribution or from a live environment, such as Alice Live or another Linux distribution. Make sure your chosen environment has the necessary partitioning tools, filesystem tools, and extraction tools.</p> <h2>Get Alice rootfs tarball</h2> @@ -389,6 +391,8 @@ Create a symlink from <code>/etc/sv/<service></code> to <code>/var/service <li>Use <code>revdep</code> to scan for broken libraries and binaries after system upgrades and package removals. You can use <code>revdep -v</code> to print out missing required libraries, and use <code>apkg -f -u $(revdep)</code> to scan and rebuild broken packages.</li> <li>Run <code>updateconf</code> to update config files in <code>/etc</code> after package upgrades.</li> </ul> + +<a href="/docs/"><- back to docs</a> <hr> <p style="color: var(--fg-dim); font-size: 0.85em;">Copyright © Alice Linux, 2024-2026</p> </div> diff --git a/docs/networking.html b/docs/networking.html index 324ea4f9..d641a353 100644 --- a/docs/networking.html +++ b/docs/networking.html @@ -179,6 +179,8 @@ <a href="/">home</a><span> / </span><a href="/docs">docs</a><span> / </span><a href="/ports.html">ports</a><span> / </span><a href="/commits.html">commits</a><span> / </span><a href="/download.html">download</a><span> / </span><a href="/development.html">development</a><span> / </span><a href="/community.html">community</a><span> / </span><a href="/donate.html">donate</a> </nav> <hr> +<a href="/docs/"><- back to docs</a> + <h1>Networking</h1> <p>This document describes how to configure networking on <strong>Alice Linux</strong> using <code>eiwd</code>/<code>wpa_supplicant</code> + <code>udhcpc</code>/<code>dhcpcd</code>.</p> <hr /> @@ -309,6 +311,8 @@ DisablePeriodicScan=true # ln -s /etc/sv/wpa_supplicant /var/service # ln -s /etc/sv/udhcpc /var/service </code></pre> + +<a href="/docs/"><- back to docs</a> <hr> <p style="color: var(--fg-dim); font-size: 0.85em;">Copyright © Alice Linux, 2024-2026</p> </div> diff --git a/docs/packagemanager.html b/docs/packagemanager.html index 076a0141..af1e1b6c 100644 --- a/docs/packagemanager.html +++ b/docs/packagemanager.html @@ -179,6 +179,8 @@ <a href="/">home</a><span> / </span><a href="/docs">docs</a><span> / </span><a href="/ports.html">ports</a><span> / </span><a href="/commits.html">commits</a><span> / </span><a href="/download.html">download</a><span> / </span><a href="/development.html">development</a><span> / </span><a href="/community.html">community</a><span> / </span><a href="/donate.html">donate</a> </nav> <hr> +<a href="/docs/"><- back to docs</a> + <h1>Package Manager</h1> <p>In Alice, two package manager are used, <a href="https://codeberg.org/emmett1/spm">spm</a> and <a href="https://codeberg.org/emmett1/autils">autils</a>. And why two package manager? <code>spm</code> was written for generic package manager for linux distribution. And <code>autils</code> is written specifically for <code>Alice</code> and requires <code>spm</code> in order to install, remove and update packages while managing conflicts. The command <code>apkg</code> (part of <code>autils</code>) is used to fetch and build packages from ports and their <code>abuild</code> files.</p> <h2>spm</h2> @@ -483,6 +485,8 @@ $ apkg-redundantdeps (remove redundant dependencies for depends list) $ apkg-redundantdeps -f </code></pre> + +<a href="/docs/"><- back to docs</a> <hr> <p style="color: var(--fg-dim); font-size: 0.85em;">Copyright © Alice Linux, 2024-2026</p> </div> diff --git a/docs/using_autils.html b/docs/using_autils.html new file mode 100644 index 00000000..55fdc805 --- /dev/null +++ b/docs/using_autils.html @@ -0,0 +1,353 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="UTF-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <title>Alice Linux - docs</title> + <link rel="icon" type="image/svg+xml" href="/files/favicon.svg"> + <style> + :root { + color-scheme: dark; + --bg: #0d0d0d; + --bg-alt: #141414; + --bg-code: #1a1a1a; + --fg: #e0e0e0; + --fg-dim: #888; + --accent: #a8a8a8; + --accent-hover: #e0e0e0; + --border: #222; + } + * { margin: 0; padding: 0; box-sizing: border-box; } + body { + font-family: "Terminus", "Monaco", "Cascadia Code", "Fira Code", "JetBrains Mono", "SF Mono", Consolas, monospace; + font-size: 15px; + line-height: 1.6; + max-width: 88ch; + margin: 0 auto; + padding: 2em 1.5em; + background: var(--bg); + color: var(--fg); + -webkit-font-smoothing: antialiased; + } + h1, h2, h3, h4 { font-weight: 600; line-height: 1.3; } + h1 { font-size: 1.75rem; margin-bottom: 0.6em; } + h2 { font-size: 1.3rem; margin: 1.6em 0 0.5em; } + h3 { font-size: 1.1rem; margin: 1.4em 0 0.4em; } + h4 { font-size: 1rem; margin: 1.2em 0 0.3em; } + p { margin: 0 0 1em; } + a { + color: var(--accent); + text-decoration: none; + } + a:hover { color: var(--accent-hover); text-decoration: underline; } + nav { margin-bottom: 1.5em; } + nav a { color: var(--fg-dim); font-size: 0.9em; } + nav a:hover { color: var(--accent); } + nav span { color: var(--border); margin: 0 0.3em; } + hr { + border: 0; + border-top: 1px solid var(--border); + margin: 1.5em 0; + } + pre, code { font-family: "SF Mono", "Cascadia Code", "Fira Code", "JetBrains Mono", Consolas, monospace; font-size: 0.9em; } + code { + background: var(--bg-code); + padding: 0.15em 0.4em; + border-radius: 3px; + color: #c0c0c0; + } + pre { + background: var(--bg-code); + border: 1px solid var(--border); + border-radius: 4px; + padding: 1em; + overflow-x: auto; + margin: 1em 0; + line-height: 1.45; + } + pre code { + background: none; + padding: 0; + border-radius: 0; + } + img { + display: block; + max-width: 100%; + height: auto; + margin: 1em 0; + border-radius: 4px; + } + blockquote { + margin: 1em 0; + padding-left: 1em; + border-left: 3px solid var(--border); + color: var(--fg-dim); + } + table { + width: 100%; + border-collapse: collapse; + margin: 1em 0; + } + th, td { + padding: 0.5em 0.6em; + text-align: left; + border-bottom: 1px solid var(--border); + } + th { + font-weight: 600; + border-bottom-color: #333; + } + tr:last-child td { border-bottom: none; } + ul, ol { margin: 0 0 1em 1.5em; } + li { margin-bottom: 0.3em; } + input, button, textarea { font: inherit; color: inherit; } + .ports-toolbar { + display: flex; + flex-wrap: wrap; + gap: 0.5em; + margin-bottom: 1em; + } + .ports-toolbar button { + background: none; + border: none; + border-bottom: 2px solid transparent; + padding: 0.3em 0; + cursor: pointer; + color: var(--fg-dim); + font-size: 0.9em; + } + .ports-toolbar button.active { + color: var(--accent); + border-bottom-color: var(--accent); + } + .ports-toolbar button:hover { color: var(--fg); } + .ports-toolbar input { + flex: 1 1 18em; + min-width: 0; + background: var(--bg-alt); + border: 1px solid var(--border); + border-radius: 3px; + padding: 0.4em 0.6em; + } + .ports-toolbar input:focus { outline: none; border-color: var(--accent); } + .ports-count { margin-bottom: 0.8em; color: var(--fg-dim); font-size: 0.9em; } + #commits { list-style: none; margin: 0; } + #commits li { + padding: 0.8em 0; + border-bottom: 1px solid var(--border); + display: flex; + align-items: flex-start; + gap: 0.8em; + } + #commits li:last-child { border-bottom: none; } + .commit-hash { + font-family: "SF Mono", "Cascadia Code", "Fira Code", "JetBrains Mono", Consolas, monospace; + font-size: 0.8em; + color: var(--fg-dim); + white-space: nowrap; + min-width: 7em; + } + .commit-msg { flex: 1; word-break: break-word; } + .commit-meta { + font-size: 0.85em; + color: var(--fg-dim); + white-space: nowrap; + text-align: right; + min-width: 9em; + } + #commits-loading { + text-align: center; + padding: 1.5em; + color: var(--fg-dim); + display: none; + } + #commits-error { + text-align: center; + padding: 1em; + color: #e77; + display: none; + } + .dl-table td:nth-child(1) { width: 60%; } + .dl-table td:nth-child(2) { width: 15%; text-align: right; } + .dl-table td:nth-child(3) { width: 25%; white-space: nowrap; } + .dl-empty { color: var(--fg-dim); font-style: italic; } + </style> +</head> +<body> +<div class="centered-wrapper"> + <nav> + <a href="/">home</a><span> / </span><a href="/docs">docs</a><span> / </span><a href="/ports.html">ports</a><span> / </span><a href="/commits.html">commits</a><span> / </span><a href="/download.html">download</a><span> / </span><a href="/development.html">development</a><span> / </span><a href="/community.html">community</a><span> / </span><a href="/donate.html">donate</a> + </nav> + <hr> +<a href="/docs/"><- back to docs</a> + +<h1>Using autils</h1> +<p>autils is a collection of POSIX shell scripts for source-based package management on Alice Linux.</p> +<p>For full command details, see the man pages: <code>man apkg</code>, <code>man reposync</code>, etc.</p> +<h2>Installation</h2> +<pre><code class="language-sh">make install +</code></pre> +<p>This installs all scripts to <code>/usr/bin</code> and man pages to <code>/usr/share/man/man8</code>. Override with:</p> +<pre><code class="language-sh">make install DESTDIR=/tmp/root PREFIX=/usr/local +</code></pre> +<h2>Core concepts</h2> +<p>The package manager, <strong>apkg</strong>, builds packages from source using <code>abuild</code> recipe files and installs them as <code>.spm</code> packages via the <strong>spm</strong>(8) backend. Package recipes live in git repositories referenced by the <code>APKG_REPO</code> environment variable.</p> +<p>Configuration is done through environment variables: there is no config file.</p> +<h2>Basic usage</h2> +<h3>Building a package</h3> +<p>From inside a recipe directory:</p> +<pre><code class="language-sh">cd /path/to/repo/mypkg +apkg +</code></pre> +<p>This fetches sources, verifies checksums, builds, and creates a <code>.spm</code> in <code>$APKG_PACKAGE_DIR</code>.</p> +<h3>Installing and upgrading</h3> +<pre><code class="language-sh">apkg -i mypkg # build and install +apkg -i # same, from inside the recipe directory +apkg -I firefox # install with automatic dependency resolution +apkg -u mypkg # upgrade (rebuild and reinstall) +apkg -f mypkg # force rebuild even if .spm already exists +apkg -o mypkg # download sources only, don't build +</code></pre> +<h3>Removing packages</h3> +<pre><code class="language-sh">apkg -r mypkg # remove a package +apkg-purge mypkg # show what would be removed (dry-run) +apkg-purge -p mypkg # remove package and its unneeded dependencies +</code></pre> +<h3>Searching and listing</h3> +<pre><code class="language-sh">apkg -s icon # search packages by name pattern +apkg -s -v icon # search with version info +apkg -a # list all installed packages +apkg -a -v # list installed packages with versions +apkg -S libpng.so # find which package owns a file +apkg -l # list outdated packages on the system +</code></pre> +<h3>Dependency queries</h3> +<pre><code class="language-sh">apkg -d mypkg # list direct dependencies of a package +apkg -D mypkg # list all dependencies recursively, in install order +apkg -j mypkg # list packages that depend on mypkg +</code></pre> +<h3>System upgrade</h3> +<pre><code class="language-sh">apkg -U +</code></pre> +<p>This checks all installed packages for outdated versions, resolves the full dependency tree, installs any new packages, then upgrades existing ones. Set <code>APKG_NOPROMPT=1</code> to skip the confirmation prompt (useful for scripting). Packages listed in <code>APKG_MASK</code> are skipped.</p> +<h3>Checksums and file lists</h3> +<pre><code class="language-sh">apkg -g mypkg # regenerate .shasum file +apkg -k mypkg # regenerate .files list from the .spm +</code></pre> +<h3>Triggers</h3> +<p>After installing or upgrading packages, apkg can refresh system caches:</p> +<pre><code class="language-sh">apkg -t # run triggers for all installed packages +apkg -t mypkg # run only triggers relevant to mypkg +</code></pre> +<p>Triggers include: fontconfig cache, GDK-Pixbuf loaders, GIO modules, GSettings schemas, GTK input method modules, icon theme cache, udev hardware database, X font indices, desktop MIME cache, and shared MIME database. Each trigger only fires if the package actually provides files that need it.</p> +<h2>Helper scripts</h2> +<h3>Package inspection</h3> +<pre><code class="language-sh">apkg-deps mypkg # show runtime library dependencies (via ldd) +apkg-foreign # list installed packages not found in any repo +apkg-orphan # list packages with no dependents installed +</code></pre> +<h3>Cleanup</h3> +<pre><code class="language-sh">apkg-clean # list stale .spm and source files +apkg-clean | xargs rm # actually remove them +apkg-clean -p # list only stale packages +apkg-clean -s # list only stale sources +</code></pre> +<h3>Dependency maintenance</h3> +<pre><code class="language-sh">apkg-redundantdeps mypkg # find transitive deps listed explicitly +apkg-redundantdeps # check all packages +apkg-redundantdeps -f mypkg # fix by removing redundant entries +</code></pre> +<h3>Scaffolding</h3> +<pre><code class="language-sh">apkg-genabuild https://example.com/pkg-1.2.3.tar.gz +apkg-genabuild https://github.com/user/repo/archive/v1.0.tar.gz +</code></pre> +<p>Derives <code>name</code> and <code>version</code> from the URL and creates a directory with a skeleton <code>abuild</code>. Recognizes GitHub tag archives, PyPI packages (prefixes <code>python-</code>), and CPAN packages (prefixes <code>perl-</code>). An optional second argument overrides the name.</p> +<h2>Standalone utilities</h2> +<h3>revdep: find broken library links</h3> +<p>Scans system binaries and libraries for missing shared library dependencies. Run after major upgrades, especially those with library version bumps.</p> +<pre><code class="language-sh">revdep # plain output +revdep -v # verbose progress +</code></pre> +<p><strong>Note:</strong> revdep only reports problems; it does not rebuild anything. Use <code>apkg -f</code> to rebuild affected packages.</p> +<h3>updateconf: merge .new config files</h3> +<p>When packages are upgraded, new default config files are installed with a <code>.new</code> suffix to avoid overwriting local changes. Run <code>updateconf</code> as root to interactively handle them:</p> +<pre><code class="language-sh">updateconf +</code></pre> +<p>For each <code>.new</code> file it shows a diff and prompts:</p> +<ul> +<li><strong>U</strong>: update: replace current with new</li> +<li><strong>D</strong>: discard: delete the <code>.new</code> file, keep current</li> +<li><strong>E</strong>: edit: open current file in <code>$EDITOR</code> (default: <code>vi</code>)</li> +<li><strong>K</strong>: keep: leave both files as-is</li> +</ul> +<h3>reposync: sync git repositories</h3> +<p>Syncs git-based package repos using <code>REPOSYNC_*</code> environment variables:</p> +<pre><code class="language-sh">export REPOSYNC_CORE="https://codeberg.org/emmett1/alicelinux.git|main|/var/lib/alicelinux" +export REPOSYNC_EXTRA="https://codeberg.org/emmett1/extra.git|main|/var/lib/alicelinux/extra" +reposync +</code></pre> +<p>Options:</p> +<ul> +<li><strong><code>-n</code></strong>: dry-run</li> +<li><strong><code>-l</code></strong>: log to <code>/var/log/reposync.log</code></li> +<li><strong><code>-f</code></strong>: force fresh clones</li> +<li><strong><code>-h</code></strong>: help</li> +</ul> +<h2>Working in a chroot</h2> +<pre><code class="language-sh">apkg-chroot /mnt/alice # enter interactive shell +apkg-chroot /mnt/alice apkg -i mypkg # run apkg inside chroot +</code></pre> +<p>Mounts <code>/dev</code>, <code>/proc</code>, <code>/sys</code>, <code>/run</code>, copies <code>/etc/resolv.conf</code>, and cleans up on exit. Must be run as root.</p> +<h2>Environment variables</h2> +<h3>Core paths</h3> +<ul> +<li><strong><code>APKG_REPO</code></strong> (default: <code>$PWD</code>): Space-separated repo directories, searched in order</li> +<li><strong><code>APKG_PACKAGE_DIR</code></strong> (default: <code>$PWD</code>): Where built <code>.spm</code> files are stored</li> +<li><strong><code>APKG_SOURCE_DIR</code></strong> (default: <code>$PWD</code>): Source tarball cache</li> +<li><strong><code>APKG_WORK_DIR</code></strong> (default: <code>$PWD</code>): Build working tree (extraction + fakeroot)</li> +<li><strong><code>APKG_ROOT</code></strong> (default: <code>/</code>): Alternative install root</li> +</ul> +<h3>Build behavior</h3> +<ul> +<li><strong><code>APKG_NOPROMPT</code></strong>: Skip confirmation prompt in <code>-I</code> and <code>-U</code></li> +<li><strong><code>APKG_KEEP_WORKDIR</code></strong>: Keep build tree on failure (for debugging)</li> +<li><strong><code>APKG_ALIAS</code></strong>: Dependency substitution: <code>real:alias</code> pairs (e.g. <code>openssl:libressl</code>)</li> +<li><strong><code>APKG_MASK</code></strong>: Packages to skip during <code>-l</code> and <code>-U</code></li> +</ul> +<h3>Logging</h3> +<ul> +<li><strong><code>APKG_LOG</code></strong>: Enable build logging</li> +<li><strong><code>APKG_LOG_DIR</code></strong>: Directory for log files (filename: <code>$name.log</code>)</li> +</ul> +<h3>Compiler</h3> +<ul> +<li><strong><code>CFLAGS</code></strong>, <strong><code>CXXFLAGS</code></strong>: Compiler flags (used by cmake builds)</li> +<li><strong><code>CROSS_COMPILE</code></strong>: Prefix for <code>strip</code> (e.g. <code>x86_64-linux-musl-</code>)</li> +</ul> +<h2>Common workflows</h2> +<h3>Building and installing a new package</h3> +<pre><code class="language-sh">cd $APKG_REPO +apkg-genabuild https://example.com/mypkg-1.0.tar.gz +cd mypkg +# edit abuild as needed, add depends file +apkg -I mypkg +</code></pre> +<h3>Full system maintenance</h3> +<pre><code class="language-sh">reposync # sync repos +apkg -U # system upgrade +revdep # check for broken libraries +updateconf # merge config files +apkg-clean | xargs rm # clean up stale files +apkg-orphan # review packages to potentially remove +</code></pre> +<h3>Debugging a failed build</h3> +<pre><code class="language-sh">APKG_KEEP_WORKDIR=1 apkg -f mypkg +# inspect $APKG_WORK_DIR/apkg-src-mypkg and apkg-pkg-mypkg +</code></pre> + +<a href="/docs/"><- back to docs</a> + <hr> + <p style="color: var(--fg-dim); font-size: 0.85em;">Copyright © Alice Linux, 2024-2026</p> +</div> +</body> +</html> diff --git a/docs/writing_abuild.html b/docs/writing_abuild.html new file mode 100644 index 00000000..3dd20471 --- /dev/null +++ b/docs/writing_abuild.html @@ -0,0 +1,367 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="UTF-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <title>Alice Linux - docs</title> + <link rel="icon" type="image/svg+xml" href="/files/favicon.svg"> + <style> + :root { + color-scheme: dark; + --bg: #0d0d0d; + --bg-alt: #141414; + --bg-code: #1a1a1a; + --fg: #e0e0e0; + --fg-dim: #888; + --accent: #a8a8a8; + --accent-hover: #e0e0e0; + --border: #222; + } + * { margin: 0; padding: 0; box-sizing: border-box; } + body { + font-family: "Terminus", "Monaco", "Cascadia Code", "Fira Code", "JetBrains Mono", "SF Mono", Consolas, monospace; + font-size: 15px; + line-height: 1.6; + max-width: 88ch; + margin: 0 auto; + padding: 2em 1.5em; + background: var(--bg); + color: var(--fg); + -webkit-font-smoothing: antialiased; + } + h1, h2, h3, h4 { font-weight: 600; line-height: 1.3; } + h1 { font-size: 1.75rem; margin-bottom: 0.6em; } + h2 { font-size: 1.3rem; margin: 1.6em 0 0.5em; } + h3 { font-size: 1.1rem; margin: 1.4em 0 0.4em; } + h4 { font-size: 1rem; margin: 1.2em 0 0.3em; } + p { margin: 0 0 1em; } + a { + color: var(--accent); + text-decoration: none; + } + a:hover { color: var(--accent-hover); text-decoration: underline; } + nav { margin-bottom: 1.5em; } + nav a { color: var(--fg-dim); font-size: 0.9em; } + nav a:hover { color: var(--accent); } + nav span { color: var(--border); margin: 0 0.3em; } + hr { + border: 0; + border-top: 1px solid var(--border); + margin: 1.5em 0; + } + pre, code { font-family: "SF Mono", "Cascadia Code", "Fira Code", "JetBrains Mono", Consolas, monospace; font-size: 0.9em; } + code { + background: var(--bg-code); + padding: 0.15em 0.4em; + border-radius: 3px; + color: #c0c0c0; + } + pre { + background: var(--bg-code); + border: 1px solid var(--border); + border-radius: 4px; + padding: 1em; + overflow-x: auto; + margin: 1em 0; + line-height: 1.45; + } + pre code { + background: none; + padding: 0; + border-radius: 0; + } + img { + display: block; + max-width: 100%; + height: auto; + margin: 1em 0; + border-radius: 4px; + } + blockquote { + margin: 1em 0; + padding-left: 1em; + border-left: 3px solid var(--border); + color: var(--fg-dim); + } + table { + width: 100%; + border-collapse: collapse; + margin: 1em 0; + } + th, td { + padding: 0.5em 0.6em; + text-align: left; + border-bottom: 1px solid var(--border); + } + th { + font-weight: 600; + border-bottom-color: #333; + } + tr:last-child td { border-bottom: none; } + ul, ol { margin: 0 0 1em 1.5em; } + li { margin-bottom: 0.3em; } + input, button, textarea { font: inherit; color: inherit; } + .ports-toolbar { + display: flex; + flex-wrap: wrap; + gap: 0.5em; + margin-bottom: 1em; + } + .ports-toolbar button { + background: none; + border: none; + border-bottom: 2px solid transparent; + padding: 0.3em 0; + cursor: pointer; + color: var(--fg-dim); + font-size: 0.9em; + } + .ports-toolbar button.active { + color: var(--accent); + border-bottom-color: var(--accent); + } + .ports-toolbar button:hover { color: var(--fg); } + .ports-toolbar input { + flex: 1 1 18em; + min-width: 0; + background: var(--bg-alt); + border: 1px solid var(--border); + border-radius: 3px; + padding: 0.4em 0.6em; + } + .ports-toolbar input:focus { outline: none; border-color: var(--accent); } + .ports-count { margin-bottom: 0.8em; color: var(--fg-dim); font-size: 0.9em; } + #commits { list-style: none; margin: 0; } + #commits li { + padding: 0.8em 0; + border-bottom: 1px solid var(--border); + display: flex; + align-items: flex-start; + gap: 0.8em; + } + #commits li:last-child { border-bottom: none; } + .commit-hash { + font-family: "SF Mono", "Cascadia Code", "Fira Code", "JetBrains Mono", Consolas, monospace; + font-size: 0.8em; + color: var(--fg-dim); + white-space: nowrap; + min-width: 7em; + } + .commit-msg { flex: 1; word-break: break-word; } + .commit-meta { + font-size: 0.85em; + color: var(--fg-dim); + white-space: nowrap; + text-align: right; + min-width: 9em; + } + #commits-loading { + text-align: center; + padding: 1.5em; + color: var(--fg-dim); + display: none; + } + #commits-error { + text-align: center; + padding: 1em; + color: #e77; + display: none; + } + .dl-table td:nth-child(1) { width: 60%; } + .dl-table td:nth-child(2) { width: 15%; text-align: right; } + .dl-table td:nth-child(3) { width: 25%; white-space: nowrap; } + .dl-empty { color: var(--fg-dim); font-style: italic; } + </style> +</head> +<body> +<div class="centered-wrapper"> + <nav> + <a href="/">home</a><span> / </span><a href="/docs">docs</a><span> / </span><a href="/ports.html">ports</a><span> / </span><a href="/commits.html">commits</a><span> / </span><a href="/download.html">download</a><span> / </span><a href="/development.html">development</a><span> / </span><a href="/community.html">community</a><span> / </span><a href="/donate.html">donate</a> + </nav> + <hr> +<a href="/docs/"><- back to docs</a> + +<h1>Writing an abuild recipe</h1> +<p>An <code>abuild</code> file is a POSIX shell snippet that tells apkg how to build a package. The directory containing it must have the same name as the package.</p> +<p>See <code>man apkg</code> for full details on all options and environment variables, and <code>man apkg-genabuild</code> for the recipe scaffolding tool.</p> +<p>To quickly scaffold a new recipe from a source URL, use <code>apkg-genabuild</code>:</p> +<pre><code class="language-sh">apkg-genabuild https://example.com/mypkg-1.2.3.tar.gz +</code></pre> +<p>This creates the directory and a skeleton <code>abuild</code> with <code>name</code>, <code>version</code>, <code>release</code>, and <code>source</code> already populated.</p> +<h2>Directory structure</h2> +<pre><code>mypkg/ + abuild - package recipe (required) + info - package metadata template (description, homepage, license, maintainer) + depends - dependency list, one per line (optional) + preinstall - script run before the package is built (optional) + postinstall - script run after the package is installed (optional) + .shasum - source checksums, auto-generated (regenerate with `apkg -g`) + .files - package file list, auto-generated (regenerate with `apkg -k`) +</code></pre> +<h2>Minimal recipe</h2> +<pre><code class="language-sh">name=mypkg +version=1.2.3 +release=1 +source="https://example.com/$name-$version.tar.gz" +</code></pre> +<h3>Required variables</h3> +<ul> +<li><strong><code>name</code></strong>: package name. Must match the directory name exactly.</li> +<li><strong><code>version</code></strong>: upstream version string. Use the <code>$name</code> and <code>$version</code> variables in the source URL so updates are easier.</li> +<li><strong><code>release</code></strong>: an incrementing integer starting at 1. Reset to 1 when <code>version</code> changes. Bump when the package needs a rebuild without a source change.</li> +</ul> +<h2>Source formats</h2> +<p>The <code>source</code> variable accepts a whitespace-separated list. Five formats are supported:</p> +<ul> +<li><strong><code>https://example.com/pkg-1.0.tar.gz</code></strong>: A remote URL, downloaded with curl</li> +<li><strong><code>mypkg-1.0.tar.gz::https://example.com/v1.0.tar.gz</code></strong>: Custom local filename for a remote URL</li> +<li><strong><code>https://example.com/pkg.tar.gz::noextract</code></strong>: Download but do not unpack</li> +<li><strong><code>my-file</code></strong>: A local file in the recipe directory (not downloaded)</li> +<li>(empty): Create a meta/dummy package with only <code>/usr</code></li> +</ul> +<p>Multiple sources can be specified:</p> +<pre><code class="language-sh">source="https://example.com/$name-$version.tar.gz + fix-build.patch + default-config::noextract" +</code></pre> +<p>If <code>source</code> is empty, apkg creates a dummy package: useful for meta packages that exist only to pull in dependencies.</p> +<h2>Optional variables</h2> +<h3>Build control</h3> +<ul> +<li><strong><code>build_type</code></strong>: force a specific build system instead of auto-detection. One of: <code>meson_build</code>, <code>configure_build</code>, <code>cmake_build</code>, <code>python_build</code>, <code>perlmodule_build</code>, <code>makefile_build</code>.</li> +<li><strong><code>build_dir</code></strong>: subdirectory within the extracted source tree to enter before building. Useful when a tarball extracts into a differently-named directory.</li> +<li><strong><code>build_opt</code></strong>: extra flags appended to the build system command. The defaults (<code>--prefix=/usr</code>, <code>--sysconfdir=/etc</code>, etc.) are always included; this adds on top.</li> +<li><strong><code>skip_patch</code></strong>: set to <code>1</code> to skip automatic patch application. Use this if you need to call <code>apply_patch</code> manually from <code>build()</code>.</li> +<li><strong><code>patch_opt</code></strong>: options for <code>patch(1)</code>. Default: <code>-p1</code>.</li> +</ul> +<h3>Package content control</h3> +<ul> +<li><strong><code>keep_static</code></strong>: set to keep <code>*.a</code> static libraries (removed by default).</li> +<li><strong><code>keep_libtool</code></strong>: set to keep <code>*.la</code> libtool archives (removed by default).</li> +<li><strong><code>keep_locale</code></strong>: set to keep locale files in <code>/usr/share/locale</code> and <code>/usr/lib/locale</code>.</li> +<li><strong><code>keep_doc</code></strong>: set to keep documentation in <code>/usr/share/doc</code> and <code>/usr/doc</code>.</li> +<li><strong><code>no_strip</code></strong>: set to skip ELF binary and library stripping.</li> +</ul> +<h3>Runit services</h3> +<ul> +<li><strong><code>sv</code></strong>: service files to install into <code>/etc/sv</code>. Accepts: +<ul> +<li><code>run</code> → <code>/etc/sv/$name/run</code></li> +<li><code>finish</code> → <code>/etc/sv/$name/finish</code></li> +<li><code><name>.run</code> → <code>/etc/sv/<name>/run</code></li> +<li><code><name>.finish</code> → <code>/etc/sv/<name>/finish</code></li> +<li><code><name>.<ext></code> → <code>/etc/sv/<name>/<ext></code></li> +</ul> +</li> +</ul> +<pre><code class="language-sh">sv="run finish mydaemon.run mydaemon.finish" +</code></pre> +<h2>Build hooks</h2> +<h3>Custom build function</h3> +<p>If a <code>build()</code> function is defined, it completely replaces the auto-detected build system. Two variables are available:</p> +<ul> +<li><strong><code>$SRC</code></strong>: where sources were extracted</li> +<li><strong><code>$PKG</code></strong>: the fakeroot directory where files must be installed</li> +</ul> +<p>Several <code>DESTDIR</code>-style variables are pre-exported: <code>DESTDIR</code>, <code>DEST_DIR</code>, <code>INSTALLROOT</code>, <code>install_root</code>, <code>INSTALL_ROOT</code>.</p> +<pre><code class="language-sh">build() { + cd "$SRC/$name-$version" + ./configure --prefix=/usr --sysconfdir=/etc + make + make DESTDIR="$PKG" install +} +</code></pre> +<p><code>build()</code> runs with <code>set -ex</code>, so the script exits on any error and prints each command.</p> +<h3>Pre/post build hooks</h3> +<p>Without a <code>build()</code> function, you can use <code>prebuild()</code> and <code>postbuild()</code>:</p> +<pre><code class="language-sh">prebuild() { + sed -i 's/broken/fixed/g' src/whatever.c +} + +postbuild() { + mv "$PKG/usr/bin/wrongname" "$PKG/usr/bin/rightname" +} +</code></pre> +<p>The execution order is: <code>prebuild()</code> → auto-detected build system → <code>postbuild()</code>.</p> +<h2>Build system auto-detection</h2> +<p>When no <code>build()</code> is defined and no <code>build_type</code> is set, apkg checks for these files in order:</p> +<ol> +<li><code>meson.build</code>: meson with LTO, PIE, <code>wrap_mode=nodownload</code>, <code>buildtype=plain</code></li> +<li><code>configure</code>: autotools <code>./configure --prefix=/usr --sysconfdir=/etc ...</code></li> +<li><code>CMakeLists.txt</code>: cmake with <code>Release</code> build type, prefers ninja</li> +<li><code>setup.py</code>: <code>python3 setup.py build && install --root=$PKG</code></li> +<li><code>Makefile.PL</code>: <code>perl Makefile.PL && make && make install</code></li> +<li><code>Makefile</code> / <code>makefile</code> / <code>GNUmakefile</code>: raw make with standard variables</li> +</ol> +<p>The exact flags for each build system are documented in <code>doc/defaultbuildopts</code>.</p> +<h2>Post-build processing</h2> +<p>After compilation, apkg automatically:</p> +<ul> +<li>Compresses man pages (man1–man8 only, gzip) and info pages</li> +<li>Removes common conflict files: <code>fonts.dir</code>, <code>fonts.scale</code>, <code>perllocal.pod</code>, <code>charset.alias</code></li> +<li>Removes static libraries (<code>*.a</code>), libtool archives (<code>*.la</code>), locales, and docs unless the corresponding <code>keep_*</code> variable is set</li> +<li>Strips ELF binaries (<code>--strip-all</code>), shared objects (<code>--strip-unneeded</code>), and static archives (<code>--strip-debug</code>) unless <code>no_strip</code> is set</li> +<li>Installs runit service files from the <code>sv</code> variable</li> +</ul> +<h2>The info file</h2> +<p><code>apkg-genabuild</code> creates an <code>info</code> file alongside the <code>abuild</code> with package metadata:</p> +<pre><code>description: +homepage: +license: +maintainer: name <name at mail dot com> +</code></pre> +<p>Fill in each field as appropriate. The <code>maintainer</code> line uses the format <code>name <email></code>.</p> +<h2>The depends file</h2> +<p>One dependency per line. Lines starting with <code>#</code> are comments. Dependencies are just package names: no version constraints.</p> +<pre><code># Direct dependencies of mypkg +zlib +libpng +freetype +</code></pre> +<p>Dependencies are recursive: when installing with <code>-I</code>, apkg will resolve the full tree. Only list direct dependencies; transitive ones are handled automatically. Use <code>apkg-redundantdeps</code> to find and clean up transitive entries.</p> +<h2>preinstall / postinstall scripts</h2> +<p>These are optional executable scripts in the recipe directory:</p> +<ul> +<li><strong><code>preinstall</code></strong>: runs before the package is built (only during <code>apkg -i</code> or <code>apkg -u</code>). Good for pre-flight checks or preparing the system.</li> +<li><strong><code>postinstall</code></strong>: runs after the package is installed or upgraded. Good for one-time setup that can't be done at build time.</li> +</ul> +<p>If <code>APKG_ROOT</code> is set (alternative install root), these scripts run inside a chroot.</p> +<h2>Checksums and file lists</h2> +<ul> +<li><strong><code>.shasum</code></strong>: sha3sum of each source file, auto-generated on first build. Regenerate with <code>apkg -g <pkg></code>.</li> +<li><strong><code>.files</code></strong>: sorted list of every file in the built <code>.spm</code>, auto-generated after packaging. Regenerate with <code>apkg -k <pkg></code>. Used by <code>apkg -S</code> for file search.</li> +</ul> +<h2>Complete example</h2> +<pre><code class="language-sh">name=hello +version=2.12.1 +release=1 +source="https://ftp.gnu.org/gnu/hello/$name-$version.tar.gz" + +build() { + cd "$SRC/$name-$version" + ./configure --prefix=/usr + make + make DESTDIR="$PKG" install +} +</code></pre> +<p>With a <code>depends</code> file:</p> +<pre><code>zlib +</code></pre> +<p>With a <code>postinstall</code> script:</p> +<pre><code class="language-sh">#!/bin/sh +echo "hello was installed!" +</code></pre> +<h2>Tips</h2> +<ul> +<li>Use <code>apkg-genabuild <url></code> to scaffold a recipe from a source URL quickly.</li> +<li>Use <code>$name</code> and <code>$version</code> in source URLs so bumping the version only requires changing two variables.</li> +<li>Patches (<code>.patch</code> / <code>.diff</code> files) listed in <code>source</code> are applied automatically with <code>patch -p1</code> before the build. Use <code>patch_opt</code> to change the strip level.</li> +<li>Set <code>APKG_KEEP_WORKDIR=1</code> in your environment to inspect the build tree when debugging a failed build.</li> +</ul> + +<a href="/docs/"><- back to docs</a> + <hr> + <p style="color: var(--fg-dim); font-size: 0.85em;">Copyright © Alice Linux, 2024-2026</p> +</div> +</body> +</html> @@ -191,7 +191,7 @@ <table id="ports-table"> <thead><tr><th>repo</th><th>name</th><th>version</th><th>dependencies</th></tr></thead> <tbody> -<tr data-repo="core"><td>core</td><td><a href="https://codeberg.org/emmett1/alicelinux/src/branch/main/repos/core/autils">autils</a></td><td>0.2-1</td><td></td></tr> +<tr data-repo="core"><td>core</td><td><a href="https://codeberg.org/emmett1/alicelinux/src/branch/main/repos/core/autils">autils</a></td><td>0.1-1</td><td></td></tr> <tr data-repo="core"><td>core</td><td><a href="https://codeberg.org/emmett1/alicelinux/src/branch/main/repos/core/b3sum">b3sum</a></td><td>1.3.1-1</td><td></td></tr> <tr data-repo="core"><td>core</td><td><a href="https://codeberg.org/emmett1/alicelinux/src/branch/main/repos/core/baselayout">baselayout</a></td><td>1-1</td><td></td></tr> <tr data-repo="core"><td>core</td><td><a href="https://codeberg.org/emmett1/alicelinux/src/branch/main/repos/core/bison">bison</a></td><td>3.8.2-1</td><td></td></tr> @@ -209,7 +209,7 @@ <tr data-repo="core"><td>core</td><td><a href="https://codeberg.org/emmett1/alicelinux/src/branch/main/repos/core/make">make</a></td><td>4.4.1-1</td><td></td></tr> <tr data-repo="core"><td>core</td><td><a href="https://codeberg.org/emmett1/alicelinux/src/branch/main/repos/core/musl">musl</a></td><td>1.2.6-2</td><td></td></tr> <tr data-repo="core"><td>core</td><td><a href="https://codeberg.org/emmett1/alicelinux/src/branch/main/repos/core/patch">patch</a></td><td>2.8-1</td><td></td></tr> -<tr data-repo="core"><td>core</td><td><a href="https://codeberg.org/emmett1/alicelinux/src/branch/main/repos/core/spm">spm</a></td><td>0.1-1</td><td></td></tr> +<tr data-repo="core"><td>core</td><td><a href="https://codeberg.org/emmett1/alicelinux/src/branch/main/repos/core/spm">spm</a></td><td>20250626-1</td><td></td></tr> <tr data-repo="core"><td>core</td><td><a href="https://codeberg.org/emmett1/alicelinux/src/branch/main/repos/core/xz">xz</a></td><td>5.8.3-1</td><td></td></tr> <tr data-repo="core"><td>core</td><td><a href="https://codeberg.org/emmett1/alicelinux/src/branch/main/repos/core/zlib-ng">zlib-ng</a></td><td>2.3.3-1</td><td></td></tr> <tr data-repo="core"><td>core</td><td><a href="https://codeberg.org/emmett1/alicelinux/src/branch/main/repos/core/zstd">zstd</a></td><td>1.5.7-1</td><td></td></tr> |