Files
extra/torcs/PKGBUILD
2025-06-22 20:39:04 -05:00

73 lines
2.5 KiB
Bash

# Maintainer: Jesus E. <heckyel@riseup.net>
pkgname=torcs
_pkgname=$pkgname-libre
pkgver=1.3.7
_debver=$pkgver
_debrel=5
pkgrel=3
pkgdesc="A free and libre 3D racing cars simulator"
url='https://torcs.sourceforge.net'
arch=('i686' 'x86_64')
license=('LGPL-2' 'GPL-2' 'FDL-1.2' 'FAL-1.3')
provides=('torcs' 'torcs-data')
conflicts=('torcs' 'torcs-data')
depends=('freeglut' 'libpng' 'freealut' 'libxi' 'libxmu' 'libxrandr' 'libvorbis' 'glu')
makedepends=('plib' 'mesa' 'quilt')
groups=('games')
options=('!makeflags')
mksource=("https://downloads.sourceforge.net/sourceforge/${pkgname}/${pkgname}-${pkgver/_/-}.tar.bz2")
source=("https://repo.hyperbola.info:50000/sources/${_pkgname}/${_pkgname}-${pkgver}.tar.bz2"{,.sig}
"https://deb.debian.org/debian/pool/main/t/torcs/torcs_${_debver}+dfsg-${_debrel}.debian.tar.xz")
mksha512sums=('14b88624803c746b2f356fa185aca5be56b7d7e5192fede11307474100328bfaa67eafa61e84987bbad04590ae5740127e015707723df6d2c3197bb867818101')
sha512sums=('6d4f93c503a5ac423e349a337246242eda76f0e9be8322b34cc95826c18bd4eafec66329ad41ce098f3b5ebd9f96c5904af72494693e0b06cd0896d36091fbc8'
'SKIP'
'35a984f0b39f2b68c0d532fc894f42c202feba1d0ac26861c0ee7ebbdbbb8cf31c79b0f4e6be6427e6e9cd0294ee847dc3d3301774ffd5e7ffd1163ca0027dc7')
validpgpkeys=('C92BAA713B8D53D3CAE63FC9E6974752F9704456') # André Silva
mksource() {
cd "$srcdir"/$pkgname-${pkgver/_/-}
# remove non-free car models
rm -r -v data/cars/models/pw-* data/cars/models/kc-*
# remove useless stuff
find -depth -type d -name 'windows' -exec rm -r {} \; -printf 'removed %p\n'
find -depth -type d -name 'CVS' -exec rm -r {} \; -printf 'removed %p\n'
}
prepare() {
cd "$srcdir"/$pkgname-${pkgver/_/-}
if [[ ${pkgver%.*} = ${_debver%.*} ]]; then
# Debian patches
export QUILT_PATCHES=debian/patches
export QUILT_REFRESH_ARGS='-p ab --no-timestamps --no-index'
export QUILT_DIFF_ARGS='--no-timestamps'
mv "$srcdir"/debian .
quilt push -av
fi
}
build() {
cd "$srcdir"/$pkgname-${pkgver/_/-}
unset LDFLAGS
./configure \
--prefix=/usr \
--bindir=/usr/games \
--x-includes=/usr/include \
--x-libraries=/usr/lib/games
make
}
package() {
cd "$srcdir"/$pkgname-${pkgver/_/-}
make DESTDIR="$pkgdir" install
make DESTDIR="$pkgdir" datainstall
install -D -m644 Ticon.png "$pkgdir"/usr/share/pixmaps/torcs.png
install -D -m644 torcs.desktop "$pkgdir"/usr/share/applications/torcs.desktop
find "$pkgdir" -type d -exec chmod 755 {} \;
install -Dm644 COPYING debian/copyright -t "${pkgdir}/usr/share/licenses/$pkgname"
}