blob: da79ea45292f46ca70844e4791cb7c0c0017aa1a (
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
59
60
61
62
63
|
# Maintainer: drakkan <nicola.murino at gmail dot com>
# Contributor: drakkan <nicola.murino at gmail dot com>
pkgname=sftpgo
pkgver=2.6.3
pkgrel=1
pkgdesc='Full-featured and highly configurable SFTP, HTTP/S, FTP/S and WebDAV server - S3, Google Cloud Storage, Azure Blob'
arch=('i686' 'x86_64' 'aarch64')
url="https://github.com/drakkan/${pkgname}"
license=('AGPLv3')
depends=('libcap')
makedepends=('gcc' 'git' 'go' 'gzip')
optdepends=(
"postgresql: to use PostgreSQL provider"
"mariadb: to use MySQL provider"
"cockroachdb: to use CockroachDB provider"
)
backup=("etc/${pkgname}/sftpgo.json")
install=${pkgname}.install
source=("git+https://github.com/drakkan/${pkgname}#tag=v${pkgver}"
"sftpgo.json"
"sftpgo.sysusers")
sha256sums=('SKIP'
'9137b31f66ae0400029472e39f53cadb8acd6644bebf921d1a4c4d1ef94408eb'
'44658210043f805057c2e4b473653637a91204e4da17954b08081292c72edcb8')
_uid_sftpgo=315
_gid_sftpgo=315
build() {
cd "${pkgname}"
go build -trimpath -tags nopgxregisterdefaulttypes,unixcrypt,disable_grpc_modules -ldflags "-s -w -X github.com/drakkan/sftpgo/v2/internal/version.commit=`git describe --always --abbrev=8 --dirty` -X github.com/drakkan/sftpgo/v2/internal/version.date=`date --utc +%FT%TZ`" -o sftpgo
./sftpgo gen completion bash > sftpgo-completion.bash
./sftpgo gen man -d man1
gzip man1/*
}
package() {
cd "${pkgname}"
install -Dm 755 sftpgo "$pkgdir/usr/bin/${pkgname}"
install -Dm 644 init/${pkgname}.service -t "${pkgdir}/usr/lib/systemd/system"
install -dm750 -o ${_uid_sftpgo} -g ${_gid_sftpgo} "${pkgdir}/etc/${pkgname}"
install -dm750 -o ${_uid_sftpgo} -g ${_gid_sftpgo} "${pkgdir}/etc/${pkgname}/env.d"
install -Dm 640 -o ${_uid_sftpgo} -g ${_gid_sftpgo} "$srcdir/sftpgo.json" -t "${pkgdir}/etc/${pkgname}"
install -dm750 -o ${_uid_sftpgo} -g ${_gid_sftpgo} "${pkgdir}/var/lib/${pkgname}"
install -dm750 -o ${_uid_sftpgo} -g ${_gid_sftpgo} "${pkgdir}/srv/${pkgname}"
install -d "${pkgdir}/usr/share/${pkgname}"
cp -r templates "${pkgdir}/usr/share/${pkgname}/"
cp -r static "${pkgdir}/usr/share/${pkgname}/"
cp -r openapi "${pkgdir}/usr/share/${pkgname}/"
install -Dm 644 "$srcdir/sftpgo.json" "${pkgdir}/usr/share/doc/${pkgname}/sftpgo.json.default"
echo "For documentation please take a look here:" > "${pkgdir}"/usr/share/doc/${pkgname}/README
echo "" >> "${pkgdir}"/usr/share/doc/${pkgname}/README
echo "https://github.com/drakkan/sftpgo/blob/v${pkgver}/README.md" >> "${pkgdir}"/usr/share/doc/${pkgname}/README
install -Dm 644 LICENSE "$pkgdir"/usr/share/licenses/${pkgname}/LICENSE
install -Dm 644 NOTICE "$pkgdir"/usr/share/licenses/${pkgname}/NOTICE
install -Dm 644 sftpgo-completion.bash "${pkgdir}/usr/share/bash-completion/completions/sftpgo"
install -d "${pkgdir}/usr/share/man"
cp -r man1 "${pkgdir}/usr/share/man/"
install -Dm 644 "$srcdir/${pkgname}.sysusers" "${pkgdir}/usr/lib/sysusers.d/${pkgname}.conf"
}
# vim:set ts=2 sw=2 et:
|