summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 035a9e5105656a481c3f535fcf57902b22100bfa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# Maintainer: Vadim Yanitskiy <fixeria@osmocom.org>

_hgname=gsm-codec-lib
pkgname="freecalypso-${_hgname}"
pkgver=r2
pkgrel=3
pkgdesc="FreeCalypso GSM codec libraries and utilities"
arch=('x86_64' 'i686')
url="https://www.freecalypso.org/hg/${_hgname}"
license=('custom')
groups=('freecalypso')
depends=('gsm')
conflicts=("${pkgname}-hg")
_tarname="${_hgname}-${pkgver}"
source=("https://www.freecalypso.org/pub/GSM/codecs/${_tarname}.tar.bz2")
sha256sums=('9e6bd1c3e99aa42b448706562262966371c9e9fb4f910c4f3d1bf662c2085449')

prepare() {
	cd "${_tarname}"
	files=$(grep -Rl "#include <gsm.h>")
	sed -i "s#include <gsm.h>#include <gsm/gsm.h>#" $files
}

build() {
	cd "${_tarname}"
	make
}

package() {
	cd "${_tarname}"

	install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
	install -d "${pkgdir}/usr/share/doc/${pkgname}"
	cp -r doc/* "${pkgdir}/usr/share/doc/${pkgname}/"

	# DESTDIR is not respected, use INSTALL_PREFIX and INSTBIN instead
	make INSTALL_PREFIX="${pkgdir}/usr" install-lib
	make INSTBIN="${pkgdir}/opt/freecalypso/bin" install-utils

	# For the sake of consistency with the 'gsm' package, move all header files
	# to '/usr/include/gsm'.  This problem was discussed here:
	# https://www.freecalypso.org/pipermail/community/2023-September/000892.html
	# https://www.freecalypso.org/pipermail/community/2023-September/000895.html
	install -d "${pkgdir}/usr/include/gsm"
	mv ${pkgdir}/usr/include/*.h "${pkgdir}/usr/include/gsm/"
}