Initial commit
This commit is contained in:
commit
0c10cdf572
10 changed files with 237 additions and 0 deletions
19
.SRCINFO
Normal file
19
.SRCINFO
Normal file
|
|
@ -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
|
||||
17
.gitignore
vendored
Normal file
17
.gitignore
vendored
Normal file
|
|
@ -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
|
||||
4
.nvchecker.toml
Normal file
4
.nvchecker.toml
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
[fortune-mod-stripped]
|
||||
source = "git"
|
||||
git = "https://github.com/shlomif/fortune-mod.git"
|
||||
prefix = "fortune-mod-"
|
||||
12
LICENSE
Normal file
12
LICENSE
Normal file
|
|
@ -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.
|
||||
1
LICENSES/0BSD.txt
Symbolic link
1
LICENSES/0BSD.txt
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
../LICENSE
|
||||
15
LICENSES/BSD-4-Clause-UC.txt
Normal file
15
LICENSES/BSD-4-Clause-UC.txt
Normal file
|
|
@ -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.
|
||||
61
PKGBUILD
Normal file
61
PKGBUILD
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
# Maintainer: Christian Schendel <doppelhelix@gmail.com>
|
||||
# Contributor: Kyle Keen <keenerd@gmail.com>
|
||||
# Contributor: Kevin Piche <kevin@archlinux.org>
|
||||
# Contributor: Dale Blount <archlinux@dale.us>
|
||||
# Contributor: George Rawlinson <grawlinson@archlinux.org>
|
||||
|
||||
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:
|
||||
31
REUSE.toml
Normal file
31
REUSE.toml
Normal file
|
|
@ -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"
|
||||
65
chroot-build
Executable file
65
chroot-build
Executable file
|
|
@ -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:
|
||||
12
not-a-game.patch
Normal file
12
not-a-game.patch
Normal file
|
|
@ -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(
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue