archrelease: copy trunk to community-any
[ArchLinux/community.git] / minio / repos / community-x86_64 / PKGBUILD
blob68974c827e2863484d427c1454cda7a384c3e89c
1 # Maintainer: Sven-Hendrik Haase <svenstaro@archlinux.org>
2 # Contributor: Frederik Schwan <frederik dot schwan at linux dot com>
3 # Contributor: Daniel Maslowski <info@orangecms.org>
5 pkgname=minio
6 pkgver=2023.04.20
7 _timever=T17:56:55Z
8 _pkgver="${pkgver//./-}${_timever//:/-}"
9 pkgrel=1
10 pkgdesc='Object storage server compatible with Amazon S3'
11 arch=('x86_64')
12 url='https://minio.io'
13 license=('AGPL3')
14 depends=('glibc')
15 makedepends=('go' 'git')
16 options=('!strip')
17 source=(git+https://github.com/minio/minio.git#tag=RELEASE.${_pkgver}
18         minio.conf
19         minio.service
20         minio.sysusers)
21 backup=('etc/minio/minio.conf')
22 sha512sums=('SKIP'
23             '9fb09d19af9d7a00e4680cd92d208ddd44ce52328f6efee68d7ee47f591cbe77ee88ce139a677bcf8836de0643de18c6c7c4005d50b0056f9b861c3d595e5233'
24             'f4df8e50618712b6e5f62e2674eca4430ef17ef003426bd83ea6b427da4e0fb519589cc14547b08db4b4a0de114488920071295a680b0c1cb5fd508d31576190'
25             '7e4617aed266cf48a2ff9b0e80e31641d998537c78d2c56ce97b828cfc77d96dbf64728d4235dac7382d6e5b201388bef6722959302de5e2298d93f4ec1e0e63')
27 build() {
28   export CGO_LDFLAGS="${LDFLAGS}"
29   export CGO_CFLAGS="${CFLAGS}"
30   export CGO_CPPFLAGS="${CPPFLAGS}"
31   export CGO_CXXFLAGS="${CXXFLAGS}"
32   export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -mod=readonly -modcacherw"
34   cd minio
36   sed -i "s/Version.*/Version = \"${pkgver//./-}${_timever}\"/g" cmd/build-constants.go
37   sed -i "s/ReleaseTag.*/ReleaseTag = \"RELEASE.${_pkgver}\"/g" cmd/build-constants.go
38   sed -i "s/CommitID.*/CommitID = \"$(git rev-parse HEAD)\"/g" cmd/build-constants.go
40   go build .
43 package() {
44   install -dm750 -o 103 -g 103 "${pkgdir}/srv/minio"
45   install -dm750 -o 103 -g 103 "${pkgdir}/var/lib/minio"
47   install -Dm755 minio/minio "${pkgdir}/usr/bin/minio"
48   install -Dm600 "${srcdir}/minio.conf" "${pkgdir}/etc/minio/minio.conf"
49   install -Dm644 "${srcdir}/minio.service" "${pkgdir}/usr/lib/systemd/system/minio.service"
50   install -Dm644 "${srcdir}/minio.sysusers" "${pkgdir}/usr/lib/sysusers.d/minio.conf"