46 lines
1.6 KiB
Plaintext
46 lines
1.6 KiB
Plaintext
# Description: display a random quotation from a database
|
|
# URL: https://www.shlomifish.org/open-source/projects/fortune-mod/
|
|
# Maintainer: John McQuah, jmcquah at disroot dot org
|
|
# Depends on: recode
|
|
|
|
name=fortune-mod
|
|
version=3.8.0
|
|
release=1
|
|
source=(https://www.shlomifish.org/open-source/projects/$name/arcs/$name-$version.tar.xz \
|
|
http://www.splitbrain.org/_media/projects/fortunes/fortune-simpsons-chalkboard.tgz \
|
|
http://www.splitbrain.org/_media/projects/fortunes/fortune-discworld.tgz \
|
|
http://www.schwarzvogel.de/pkgs/kernelcookies-8.tar.gz \
|
|
http://crux.nu/files/distfiles/fortune-mod-prog-style.tar.gz )
|
|
|
|
build() {
|
|
cd $name-$version
|
|
|
|
# change the install path from /usr/games to /usr/bin
|
|
L=$(grep -n "fortune/fortune.c" CMakeLists.txt |head -n 1 |cut -f 1 -d ":")
|
|
M=$((L+1))
|
|
sed -i "${M}s/games/bin/" CMakeLists.txt
|
|
|
|
# proceed as usual with the cmake build
|
|
cmake -B build -DCMAKE_INSTALL_PREFIX="/usr/" \
|
|
-S ../$name-$version \
|
|
-DNO_OFFENSIVE=OFF \
|
|
-DLOCALDIR=/usr/share/games/fortune \
|
|
-DLOCALODIR=/usr/share/games/fortune/off \
|
|
-DCOOKIEDIR=/usr/share/games/fortune \
|
|
-DOCOOKIEDIR=/usr/share/games/fortune/off
|
|
cmake --build build
|
|
DESTDIR=$PKG cmake --install build
|
|
|
|
find $PKG -name "*.u8" -exec rm -f '{}' +
|
|
|
|
# fortune-discworld makes the following data file superfluous
|
|
rm $PKG/usr/share/games/fortune/pratchett*
|
|
|
|
cd $SRC
|
|
for cookie in */prog-style */discworld */chalkboard */kernelcookies
|
|
do
|
|
[ -f $cookie.dat ] || $PKG/usr/bin/strfile $cookie $cookie.dat
|
|
install -m 644 "$cookie"{,.dat} $PKG/usr/share/games/fortune/
|
|
done
|
|
}
|