commit 0c10cdf5723a6d99ce302d2711fdaf937fc3a06a Author: Christian Schendel Date: Mon Sep 1 09:20:39 2025 +0200 Initial commit diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 0000000..aca0adc --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,19 @@ +pkgbase = fortune-mod-stripped + pkgdesc = The Fortune Cookie Program from BSD games - without cookies + pkgver = 3.24.0 + pkgrel = 4 + url = https://github.com/shlomif/fortune-mod + arch = x86_64 + license = BSD-4-Clause + makedepends = cmake + makedepends = rinutils + depends = glibc + depends = recode + provides = fortune-mod + conflicts = fortune-mod + source = https://github.com/shlomif/fortune-mod/releases/download/fortune-mod-3.24.0/fortune-mod-3.24.0.tar.xz + source = not-a-game.patch + b2sums = 378a2cee3317510d1b826a801d60b4c1aee69777a26861990435b888813d01ba46d4125d2cb588046e88009ddff0b38fc9d8b56672b6a016384b700e629cbade + b2sums = 208eb3cac94709a8b046c0eb48f41d81db7ffd93a778f509d759f364b48f616d3f13b964be31e5b84c6d60bff2342e201a1105ebdbe5d262ec2f74ab9631357b + +pkgname = fortune-mod-stripped diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a8267d1 --- /dev/null +++ b/.gitignore @@ -0,0 +1,17 @@ +# Ignore everything +* + +# But not these files... +!.gitignore +!PKGBUILD +!.SRCINFO +!LICENSE +!chroot-build +!.nvchecker.toml +!/keys +!/keys/pgp +!/keys/pgp/*.asc +!/LICENSES +!/LICENSES/*.txt +!REUSE.toml +!*.patch diff --git a/.nvchecker.toml b/.nvchecker.toml new file mode 100644 index 0000000..6d1f52d --- /dev/null +++ b/.nvchecker.toml @@ -0,0 +1,4 @@ +[fortune-mod-stripped] +source = "git" +git = "https://github.com/shlomif/fortune-mod.git" +prefix = "fortune-mod-" 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/LICENSES/BSD-4-Clause-UC.txt b/LICENSES/BSD-4-Clause-UC.txt new file mode 100644 index 0000000..69edbe3 --- /dev/null +++ b/LICENSES/BSD-4-Clause-UC.txt @@ -0,0 +1,15 @@ +BSD-4-Clause (University of California-Specific) + +Copyright [various years] The Regents of the University of California. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +3. All advertising materials mentioning features or use of this software must display the following acknowledgement: This product includes software developed by the University of California, Berkeley and its contributors. + +4. Neither the name of the University nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 0000000..f6292f3 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,61 @@ +# Maintainer: Christian Schendel +# Contributor: Kyle Keen +# Contributor: Kevin Piche +# Contributor: Dale Blount +# Contributor: George Rawlinson + +pkgname=fortune-mod-stripped +_pkgname=fortune-mod +pkgdesc='The Fortune Cookie Program from BSD games - without cookies' +pkgver=3.24.0 +pkgrel=3 +url='https://github.com/shlomif/fortune-mod' +arch=(x86_64) +license=(BSD-4-Clause) +makedepends=( + cmake + rinutils +) +depends=( + glibc + recode +) +provides=("$_pkgname") +conflicts=("$_pkgname") +source=( + "$url/releases/download/$_pkgname-$pkgver/$_pkgname-$pkgver.tar.xz" + 'not-a-game.patch' +) +b2sums=('378a2cee3317510d1b826a801d60b4c1aee69777a26861990435b888813d01ba46d4125d2cb588046e88009ddff0b38fc9d8b56672b6a016384b700e629cbade' + '208eb3cac94709a8b046c0eb48f41d81db7ffd93a778f509d759f364b48f616d3f13b964be31e5b84c6d60bff2342e201a1105ebdbe5d262ec2f74ab9631357b') + +prepare() { + cd "$_pkgname-$pkgver" + patch -p1 -i ../not-a-game.patch +} + +build() { + local cmake_options=( + -B build + -S "$_pkgname-$pkgver" + -D CMAKE_INSTALL_PREFIX=/usr + -D NO_OFFENSIVE=ON + -D LOCALDIR=/usr/share/fortune + -D COOKIEDIR=/usr/share/fortune + ) + cmake "${cmake_options[@]}" + cmake --build build +} + +package() { + DESTDIR="$pkgdir" cmake --install build + + # This is the stripped down version. It does not include any cookies. + rm -f "$pkgdir/usr/share/fortune/"* + + # license + install -Dm0644 -t "$pkgdir/usr/share/licenses/$pkgname" \ + "$_pkgname-$pkgver/COPYING.txt" +} + +# vim: set ft=sh ts=4 sw=4 et: diff --git a/REUSE.toml b/REUSE.toml new file mode 100644 index 0000000..fd8a8f5 --- /dev/null +++ b/REUSE.toml @@ -0,0 +1,31 @@ +version = 1 + +[[annotations]] +path = [ + "PKGBUILD", + "README.md", + "keys/**", + ".SRCINFO", + ".nvchecker.toml", + ".gitignore", + "*.install", + "*.sysusers", + "*.tmpfiles", + "*.logrotate", + "*.pam", + "*.service", + "*.socket", + "*.timer", + "*.desktop", + "*.hook", +] +SPDX-FileCopyrightText = "Arch Linux contributors" +SPDX-License-Identifier = "0BSD" + + +[[annotations]] +path = [ + "not-a-game.patch", +] +SPDX-FileCopyrightText = "fortune-mod contributors" +SPDX-License-Identifier = "BSD-4-Clause-UC" 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: diff --git a/not-a-game.patch b/not-a-game.patch new file mode 100644 index 0000000..395b8b1 --- /dev/null +++ b/not-a-game.patch @@ -0,0 +1,12 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -154,7 +154,7 @@ ENDMACRO() + my_exe( + "fortune" + "fortune/fortune.c" +- "games" ++ "bin" + ) + my_exe( + +