File PKGBUILD of Package presage2

pkgname=presage2
pkgver=2.0.0
pkgrel=1
pkgdesc="intelligent predictive text entry system."
arch=('x86_64' 'aarch64')
url="https://github.com/sailfish-keyboard/presage"

license=('Apache-2.0 License')
makedepends=('automake'
		'make'
		'tinyxml2'
		'sqlite>=3'
		'marisa'
		'hunspell>=1.5.1'
		'cppunit')
source=("${url}/archive/$pkgver/presage-$pkgver.tar.gz"
    '0001-fix-compilation-with-Werror-format-security.patch'
    )
sha256sums=('13c96ea97d4fadf8db2ff38b3590f4c2795089ca59bbd678c6a06c269a4bb11a'
    '41acf602bea722487ff1696462d253ae0afa5f1d1ff1730f7049c75fb493b6a4'
)

prepare() {
    cd "$srcdir/presage-${pkgver}"
    patch -p1 --input="${srcdir}/0001-fix-compilation-with-Werror-format-security.patch"

}

build() {
    cd "$srcdir/presage-${pkgver}"
    autoreconf -fi
    export CFLAGS="$CFLAGS -fPIC"
    export CXXFLAGS="$CXXFLAGS -fPIC -std=c++11"
    ./configure --prefix=/usr \
    --sysconfdir=/etc \
    --disable-python-binding \
    --disable-gpresagemate \
    --disable-gprompter \
    --disable-documentation
}

package() {
    cd "$srcdir/presage-${pkgver}"
    make DESTDIR="$pkgdir" install

    mkdir -p $pkgdir/etc
    mkdir -p $pkgdir/usr/share/presage/

    cp packaging/sailfish/presage.xml $pkgdir/etc/presage.xml
    cp packaging/sailfish/database_empty.db $pkgdir/usr/share/presage/
    cp -r packaging/sailfish/database_empty $pkgdir/usr/share/presage/

    # cleanup unneeded files
    rm -rf %{pkgdir}/usr/share/presage/abbreviations_en.txt
    rm -rf %{pkgdir}/usr/share/presage/abbreviations_it.txt
    rm -rf %{pkgdir}/usr/share/presage/database_en.db
    rm -rf %{pkgdir}/usr/share/presage/database_es.db
    rm -rf %{pkgdir}/usr/share/presage/database_it.db
    rm -rf %{pkgdir}/usr/share/presage/presage.png
    rm -rf %{pkgdir}/usr/share/presage/presage.svg
    rm -rf %{pkgdir}/usr/share/presage/presage.xpm
    rm -rf %{pkgdir}/usr/share/presage/python_binding.txt
}
openSUSE Build Service is sponsored by