summaryrefslogtreecommitdiff
path: root/ceres/PKGBUILD
blob: 02dab787138cb6a9d065ae7c17ef5d86e609185a (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
47
48
49
50
51
52
53
54
55
56
57
58
# Maintainer: xengineering <me@xengineering.eu>
pkgname=ceres
pkgver=0.4.0
pkgrel=1
pkgdesc="Recipe server for your favorite dishes"
arch=('x86_64' 'aarch64')
url='https://xengineering.eu/git/ceres'
license=('AGPL')
makedepends=('coreutils' 'git' 'make' 'go')
backup=('etc/ceres/config.json')
source=("git+https://cgit.xengineering.eu/ceres#tag=$pkgver?signed"
        'ceres.service'
        'sysuser.conf'
        'ceres.tmpfile.d'
        '0001-Disable-logging-time-stamps.patch'
        '0002-Select-default-storage.patch')
sha256sums=('SKIP'
            '7b9284940f307a63547d2346e53431842d8bb3e37eb87a422948fdddd8e09a12'
            'a8c7c3d6af65bd7255b0f693430c6ba53d646123feebec9a1e37f8723c21942b'
            '5a953a802b1478dd7f7e32dbd8ac8d97946bbef0579e3cce4b87e32151855e51'
            'ee87321e1be9aa8c6fbc1f8dc0d704d6ad7de72d28d8de35d360165d9cbcd62f'
            'b58224a1fa194320e7da97a8d04f14eac2d67e48314f8ccc9ddff250aa2f40c5')

validpgpkeys=(
	'A13B258878787F943F6C68F00FD1F84233FA8900'  # xengineering <me@xengineering.eu>
)

prepare() {
	patch "${srcdir}/${pkgname}/main.go" 0001-Disable-logging-time-stamps.patch
	patch "${srcdir}/${pkgname}/default_config.json" 0002-Select-default-storage.patch
	cd "${srcdir}/${pkgname}"
	git submodule init
	git submodule update
}

build() {
	cd "${srcdir}/${pkgname}"
	export CGO_CPPFLAGS="${CPPFLAGS}"
	export CGO_CFLAGS="${CFLAGS}"
	export CGO_CXXFLAGS="${CXXFLAGS}"
	export CGO_LDFLAGS="${LDFLAGS}"
	export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -mod=readonly -modcacherw"
	go build -ldflags "-X main.version=${pkgver}" -o "build/${pkgname}" xengineering.eu/ceres
}

check() {
	cd "${srcdir}/${pkgname}"
	make tests
}

package() {
	cd "${srcdir}/${pkgname}"
	install -D -m 755 "${srcdir}/${pkgname}/build/ceres" "${pkgdir}/usr/bin/ceres"
	install -D -m 644 "${srcdir}/${pkgname}/default_config.json" "${pkgdir}/etc/ceres/config.json"
	install -D -m 644 "${srcdir}/ceres.service" "${pkgdir}/usr/lib/systemd/system/ceres.service"
	install -D -m 644 "${srcdir}/sysuser.conf" "${pkgdir}/usr/lib/sysusers.d/ceres.conf"
	install -D -m 644 "${srcdir}/ceres.tmpfile.d" "${pkgdir}/usr/lib/tmpfiles.d/ceres.conf"
}