description="High-level device independent layer for speech synthesis interface"
url="https://devel.freebsoft.org/speechd"

license="GPL2 GPL3 LGPL2.1"

packager="tnut <tnut@nutyx.org>"
contributors="Spiky"

makedepends=(texinfo intltool dotconf pulseaudio python-xdg)

name=speech-dispatcher
version=0.11.5
release=2

source=(https://github.com/brailcom/speechd/releases/download/$version/$name-$version.tar.gz)
build() {
cd $name-$version
sed -i "s/cicero //g" configure.ac
sed -i "s/sd_cicero//g" src/modules/Makefile.am

CFLAGS+=' -fcommon'

./configure --prefix=/usr \
--enable-shared \
--sysconfdir=/etc \
--without-flite
make
make DESTDIR="$PKG" install
sed -i 's|includedir=.*|includedir=${prefix}/include/speech-dispatcher|g' \
$PKG/usr/lib/pkgconfig/speech-dispatcher.pc

# Obsolets libs
rm $PKG/usr/lib/libspeechd.la
rm $PKG/usr/lib/speech-dispatcher/spd_alsa.la
rm $PKG/usr/lib/speech-dispatcher/spd_oss.la
rm $PKG/usr/lib/speech-dispatcher/spd_pulse.la

install -Dm644 COPYING.GPL-2 $PKG/usr/share/licenses/$name/COPYING.GPL-2
install -Dm644 COPYING.GPL-3 $PKG/usr/share/licenses/$name/COPYING.GPL-3
install -Dm644 COPYING.LGPL $PKG/usr/share/licenses/$name/COPYING.LGPL

}
