commit 5f2de264e229a38a0e4919a572bb0ea33334e871 Author: Christian Schendel Date: Tue Oct 14 05:02:42 2025 +0200 initial commit diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 0000000..d07ff95 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,11 @@ +pkgbase = dalci-appstream-data + pkgdesc = dalci application database for AppStream-based software centers + pkgver = 20251014 + pkgrel = 1 + url = https://repo.doppelhelix.net + arch = any + license = LicenseRef-custom + source = appstream-data.tar.gz + b2sums = 242a22a6b15b05ab87f69bcba9e0b0fc433ed819073a9cf31e6149e894f04e4ebdd731e781869d5124f7b1d30217def1b69bf3788b890b7e621a8c21aabc1a24 + +pkgname = dalci-appstream-data diff --git a/.nvchecker.toml b/.nvchecker.toml new file mode 100644 index 0000000..0ed1f2d --- /dev/null +++ b/.nvchecker.toml @@ -0,0 +1,2 @@ +[dalci-appstream-data] +source = "manual" diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..b87c5e4 --- /dev/null +++ b/LICENSE @@ -0,0 +1,12 @@ +Copyright Arch Linux Contributors + +Permission to use, copy, modify, and/or distribute this software for +any purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED “AS IS” AND THE AUTHOR DISCLAIMS ALL +WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES +OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE +FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY +DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN +AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT +OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/LICENSES/0BSD.txt b/LICENSES/0BSD.txt new file mode 120000 index 0000000..ea5b606 --- /dev/null +++ b/LICENSES/0BSD.txt @@ -0,0 +1 @@ +../LICENSE \ No newline at end of file diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 0000000..a4d6b1f --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,33 @@ +# Maintainer: Christian Schendel + +pkgname=dalci-appstream-data +pkgver=20251014 +pkgrel=1 +pkgdesc='dalci application database for AppStream-based software centers' +arch=(any) +url='https://repo.doppelhelix.net' +license=( + LicenseRef-custom +) +depends=() +makedepends=() +source=( + "appstream-data.tar.gz" +) +b2sums=('242a22a6b15b05ab87f69bcba9e0b0fc433ed819073a9cf31e6149e894f04e4ebdd731e781869d5124f7b1d30217def1b69bf3788b890b7e621a8c21aabc1a24') + +package() { + mkdir -p "$pkgdir"/usr/share/swcatalog/{icons/archlinux-arch-{dalci,dalci-3rdparty}/{48x48,64x64,128x128},xml} + for _repo in dalci dalci-3rdparty; do + tar -xzf $_repo/icons-48x48.tar.gz \ + -C "$pkgdir"/usr/share/swcatalog/icons/archlinux-arch-$_repo/48x48 + tar -xzf $_repo/icons-64x64.tar.gz \ + -C "$pkgdir"/usr/share/swcatalog/icons/archlinux-arch-$_repo/64x64 + tar -xzf $_repo/icons-128x128.tar.gz \ + -C "$pkgdir"/usr/share/swcatalog/icons/archlinux-arch-$_repo/128x128 + install -m644 $_repo/Components-x86_64.xml.gz \ + "$pkgdir"/usr/share/swcatalog/xml/$_repo.xml.gz + done +} + +# vim: set ts=4 sw=4 et: diff --git a/README.md b/README.md new file mode 100644 index 0000000..d862bb9 --- /dev/null +++ b/README.md @@ -0,0 +1,14 @@ +**GENERATING METADATA** + +1) Customize the `asgen-config.json` configuration file (don't rename it!): + - `ArchiveRoot` should point to a directory containing a checkout of the binary repos. + - `Backend` should be `archlinux` for alpm based packages. + - In `Suites`, `sections` is a list with the repositories that should be indexed. + - See https://github.com/ximion/appstream-generator/blob/master/docs/asgen-config.md for other options. +2) Run `appstream-generator process arch` (Replace `arch` by the suite name configured in asgen-config.json) + +**PACKAGING** + +4) `Components-${arch}.xml.gz` files should be renamed to include the repo name and installed to `/usr/share/swcatalog/xml/`. + +5) `Icons-${size}.tar.gz` should be decompressed and installed to `/usr/share/swcatalog/icons/`. diff --git a/REUSE.toml b/REUSE.toml new file mode 100644 index 0000000..77e2a61 --- /dev/null +++ b/REUSE.toml @@ -0,0 +1,24 @@ +version = 1 + +[[annotations]] +path = [ + "PKGBUILD", + "README.md", + "keys/**", + ".SRCINFO", + ".nvchecker.toml", + "*.install", + "*.sysusers", + "*.tmpfiles", + "*.logrotate", + "*.pam", + "*.service", + "*.socket", + "*.timer", + "*.desktop", + "*.hook", + "asgen-config.json", + "upload", +] +SPDX-FileCopyrightText = "Arch Linux contributors" +SPDX-License-Identifier = "0BSD" diff --git a/appstream-data.tar.gz b/appstream-data.tar.gz new file mode 100644 index 0000000..df79abc Binary files /dev/null and b/appstream-data.tar.gz differ diff --git a/asgen-config.json b/asgen-config.json new file mode 100644 index 0000000..08e65a9 --- /dev/null +++ b/asgen-config.json @@ -0,0 +1,19 @@ +{ +"ProjectName": "ArchLinux", +"ArchiveRoot": "/srv/ftp/", +"Backend": "archlinux", +"Features": + { + "validateMetainfo": true, + "createScreenshotsStore": false, + "noDownloads": true + }, +"Suites": + { + "arch": + { + "sections": ["core", "extra", "multilib"], + "architectures": ["x86_64"] + } + } +} diff --git a/chroot-build b/chroot-build new file mode 100755 index 0000000..f69cac8 --- /dev/null +++ b/chroot-build @@ -0,0 +1,65 @@ +#!/bin/bash + +# SPDX-FileCopyrightText: Christian Schendel +# SPDX-License-Identifier: 0BSD + +set -euo pipefail +use_tmpfs=true +CHROOT="/tmp/mkarchroot" + +check_available_ram() { + if [ "$(awk '/^MemAvailable:/ { print $2; }' /proc/meminfo)" -lt 50000 ]; then + use_tmpfs=false + fi +} + +create_chroot_directory() { + if [ $use_tmpfs ]; then + sudo mount --mkdir -t tmpfs -o defaults,size=20G tmpfs $CHROOT + else + sudo mkdir -p "$CHROOT" + fi +} + +create_chroot_environment() { + if [[ ! -d "$CHROOT/root" ]]; then + mkarchroot -M ~/.config/pacman/makepkg.conf "$CHROOT/root" base-devel + fi +} + +build_package(){ + arch-nspawn "$CHROOT/root" pacman -Syu + if makechrootpkg -c -r "$CHROOT" -- -Asf . ; then + makepkg --printsrcinfo >.SRCINFO + else + delete_chroot_environment && echo -e "\n\e[1;31m==> BUILD FAILED: \e[1;37m$CHROOT removed\e[0m " && exit 1 + fi +} + +sign_package(){ + PACKAGE="$(makepkg --packagelist)" + gpg --use-agent --output "$PACKAGE.sig" --detach-sign "$PACKAGE" +} + +delete_chroot_environment() { + if [ "$(stat -f --format=%T "$CHROOT")" == "btrfs" ]; then + { + sudo btrfs subvolume delete "$CHROOT/root/var/lib/portables" + sudo btrfs subvolume delete "$CHROOT/root/var/lib/machines" + sudo btrfs subvolume delete "$CHROOT/root" + sudo rm -Rf $CHROOT + } >>/dev/null 2>&1 + elif [ "$(stat -f --format=%T "$CHROOT")" == "tmpfs" ]; then + sudo umount -f $CHROOT + fi + sudo rm -Rf $CHROOT +} + +check_available_ram +create_chroot_directory +create_chroot_environment +build_package +sign_package +delete_chroot_environment + +# vim: set ts=4 sw=4 et: