aboutsummaryrefslogtreecommitdiff
path: root/packages/arch/PKGBUILD
diff options
context:
space:
mode:
Diffstat (limited to 'packages/arch/PKGBUILD')
-rw-r--r--packages/arch/PKGBUILD50
1 files changed, 50 insertions, 0 deletions
diff --git a/packages/arch/PKGBUILD b/packages/arch/PKGBUILD
new file mode 100644
index 0000000..550b8c7
--- /dev/null
+++ b/packages/arch/PKGBUILD
@@ -0,0 +1,50 @@
1pkgname=shrt-git
2pkgver=0.1
3pkgrel=1
4pkgdesc="A naively simple link shortener"
5arch=('x86_64')
6url="https://github.com/MetroWind/shrt"
7license=('MIT')
8groups=()
9depends=('sqlite' 'curl' 'openssl')
10makedepends=('git' 'cmake' 'gcc')
11provides=("${pkgname%-git}")
12conflicts=("${pkgname%-git}")
13replaces=()
14backup=("etc/shrt.yaml")
15# Stripping doesn’t work with ryml.
16options=(!debug !strip)
17install=shrt.install
18source=('git+https://github.com/MetroWind/shrt.git' "sysusers-${pkgname%-git}.conf" "${pkgname%-git}.service" "${pkgname%-git}.yaml")
19noextract=()
20sha256sums=('SKIP' "1ea5c7d99be0954fb9aa6e22e7f11d485fd66d3232df3cbe3051c81e542b4bfc"
21 "1e65ce88985b19471af84a95ebf8f2d6726e6af434cd4dafd7203ad783510a0f"
22 "c91a4e0a43373e08343aba704cbd064936521decf23546a74d2d8b3f08a8e963")
23
24pkgver()
25{
26 cd "$srcdir/${pkgname%-git}"
27 printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short=7 HEAD)"
28}
29
30build()
31{
32 cd "$srcdir/${pkgname%-git}"
33 # Usually CMAKE_BUILD_TYPE is set to be “None” in a PKGBUILD. But
34 # it doesn’t work well with ryml.
35 cmake -B build \
36 -DCMAKE_BUILD_TYPE='Release' \
37 -DCMAKE_INSTALL_PREFIX='/usr' \
38 -Wno-dev .
39 cmake --build build
40}
41
42package()
43{
44 install -Dm755 -t "$pkgdir/usr/bin" "${srcdir}/${pkgname%-git}/build/${pkgname%-git}"
45 mkdir -pv "$pkgdir/var/lib/${pkgname%-git}/attachments"
46 cp -r "${srcdir}/${pkgname%-git}/"{statics,templates} "${pkgdir}/var/lib/${pkgname%-git}"
47 install -Dm644 -t "$pkgdir/etc" "${srcdir}/${pkgname%-git}.yaml"
48 install -Dm644 "${srcdir}/sysusers-${pkgname%-git}.conf" "${pkgdir}/usr/lib/sysusers.d/${pkgname%-git}.conf"
49 install -Dm644 "${srcdir}/${pkgname%-git}.service" "${pkgdir}/usr/lib/systemd/system/${pkgname%-git}.service"
50}