summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorWilliam Gathoye2019-09-14 00:32:42 +0200
committerWilliam Gathoye2019-09-14 01:35:27 +0200
commitd2da11d984e3857376171cfa54f530145dc3794a (patch)
tree483a8ba5c26431af0bc1f6c330523331e6ca5048 /PKGBUILD
parent83d79d16e6609da0489302c735e77251650c2232 (diff)
downloadaur-d2da11d984e3857376171cfa54f530145dc3794a.tar.gz
Update build process to latest master
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD66
1 files changed, 40 insertions, 26 deletions
diff --git a/PKGBUILD b/PKGBUILD
index d6623b0a4b28..2d2d8c28d02b 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,17 +2,17 @@
pkgname=mattermost-git
_pkgname="${pkgname%-git}"
-pkgver=5.1.0.r358.g7a758eae7
+pkgver=5.15.0.rc4.r11506
pkgrel=1
pkgdesc="Open source Slack-alternative in Golang and React"
arch=('i686' 'x86_64' 'arm' 'armv6h' 'armv7h' 'aarch64')
-url="https://mattermost.com"
+url='https://mattermost.com'
license=('AGPL' 'Apache')
-makedepends=('git' 'go-pie' 'libpng12' 'npm')
-# Experiencing issues with gifsicle. Using system tool instead.
-if [ "$CARCH" != 'x86_64' ]; then
- makedepends+=('gifsicle')
+makedepends=('git' 'go-pie' 'npm')
+# Experiencing issues with gifsicle and mozjpeg on non x64 architectures.
+if [ "${CARCH}" != 'x86_64' ]; then
+ makedepends+=('gifsicle' 'mozjpeg')
fi
provides=('mattermost')
conflicts=('mattermost')
@@ -35,13 +35,14 @@ source=(
"mattermost-ldflags.patch"
"${_pkgname}.service"
"${_pkgname}.sysusers"
- "${_pkgname}.tmpfiles")
+ "${_pkgname}.tmpfiles"
+)
sha512sums=(
'SKIP'
'SKIP'
- 'ac952eae873aa09ba7bdf1e7abc618f0dc6982fa85df298261ab71ccf71f66c95846dade400e05d731f2c5ee2c6f4332d6f78d737026c9f098f1e03f419bee00'
- 'cd02b3da86869117554c3c53a657a4b46989ea533b7b47c24fb642ffbd182ce6ecfb16a8ddde3af4d5e8cff0ab41a932753129662e126994e1ad5912545e6eb4'
- 'b95bf2c0d840d0e85baebc1051c872056fa4990d263334fecc7b11d96085cb65a69dd866f18889e209336028f17c02152c13a92d2be1c21848939f22203439f0'
+ '5b761c5715387e6abf3afbe653de218b9a45708d7ffbc699856f53cc3e62760fbd0ce175615f36a4b9090182705c3343d07fca72d12275411080ab516cee3eeb'
+ '6fc1b41f1ddcc44dab3e1f6bc15b7566e7c33132346b7eb0bc91d9709b4cec89ae969a57a57b6097c75868af21f438c2affda5ba1507f485c8689ab8004efd70'
+ 'f08d88fd91e91c8b9996cf33699f4a70d69c8c01783cf7add4781ee3c9c6596839e44c5c39f0ff39a836c6d87544eef179f51de0b037ec7f91f86bac8e24d7cc'
'e3ffcf4b86e2ecc7166c1abf92cd4de23d81bad405db0121e513a8d81fea05eec9dd508141b14b208c4c13fbc347c56f01ed91326faa01e872ecdedcc18718f9')
# Using the most recent un-annotated tag reachable from the last commit
@@ -50,8 +51,12 @@ sha512sums=(
# src.: http://stackoverflow.com/a/7979255/3514658
pkgver() {
cd "${srcdir}"/src/github.com/${_pkgname}/${_pkgname}-server
- git describe --long --tags | \
- sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
+ # Git command 1: Get latest tag from all branches. e.g.: 5.15.0.rc4
+ # Git command 2: Get latest commit number of the branch. e.g.: 11506
+ printf "%s.r%s" \
+ $(git describe --tags $(git rev-list --tags --max-count=1) | \
+ sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g') \
+ "$(git rev-list --count HEAD)"
}
prepare() {
@@ -70,8 +75,8 @@ prepare() {
rm -f ${_pkgname}-webapp
# Create the directory structure to match Go namespaces
- ln -s "$srcdir"/${_pkgname}-server ${_pkgname}-server
- ln -s "$srcdir"/${_pkgname}-webapp ${_pkgname}-webapp
+ ln -s "${srcdir}"/${_pkgname}-server ${_pkgname}-server
+ ln -s "${srcdir}"/${_pkgname}-webapp ${_pkgname}-webapp
cd ${_pkgname}-server
# Pass Arch Linux's Go compilation flags to Mattermost in order to take
@@ -84,6 +89,7 @@ prepare() {
# The configuration isn't available at this time yet, modify the default.
sed -r -i build/release.mk \
+ -e 's!config/config.json!config/default.json!' \
-e 's/\$\(DIST_PATH\)\/config\/config.json/\$\(DIST_PATH\)\/config\/default.json/'
# The Go programming language only supports 8 instruction sets, therefore
@@ -104,28 +110,37 @@ prepare() {
;;
esac
+ # Patch go dependencies
+ sed -r -i go.mod \
+ -e "/replace/,//d"
+
# Remove platform specific lines from the Makefile from the line beginning
# with that statement to the end of file (we do not care of the additional
# file copy, nor the tar compression defined below the file).
- sed '/# ----- PLATFORM SPECIFIC -----/,//d' -i ./build/release.mk
+ sed '/# Download prepackaged plugins/,//d' -i ./build/release.mk
# Enforce build hash to Arch Linux (Enterprise hash is already set to
- # none), instead of the official git hash value.
+ # none), instead of the official git hash value and use an ISO 8601
+ # inspired compilation date format without any letter format (only use
+ # numbers).
sed -r -i Makefile \
- -e "s/^(\s*)BUILD_HASH(_ENTERPRISE)? =.*/\1BUILD_HASH\2 = ${pkgver}-${pkgrel} Arch Linux \(${CARCH}\)/" \
- -e 's/-X (.*)(\$\(BUILD_HASH(_ENTERPRISE)?\))(.*)/-X '\''\1\2'\''\4/'
- cd "${srcdir}/${_pkgname}-webapp"
+ -e "s/^(\s*)BUILD_HASH =.*/\1BUILD_HASH = ${pkgver}-${pkgrel} Arch Linux \(${CARCH}\)/" \
+ -e 's/BUILD_DATE = \$\(shell date -u\)/BUILD_DATE = \$(shell date -u +'"'"'%Y-%m-%d %H:%M:%S'"'"')/'
+
+ # Enforce build hash to Arch Linux as well for the field corresponding to
+ # the webapp.
+ cd "${srcdir}"/${_pkgname}-webapp
sed -r -i webpack.config.js \
-e "s/^(\s*)COMMIT_HASH:(.*),$/\1COMMIT_HASH: JSON.stringify\(\"${pkgver}-${pkgrel} Arch Linux \(${CARCH}\)\"\),/"
# Link against system gifsicle
- if [ "$CARCH" != 'x86_64' ]; then
- gifsicleNpm="${srcdir}/${_pkgname}-webapp/node_modules/gifsicle/vendor/gifsicle"
+ if [ "${CARCH}" != 'x86_64' ]; then
+ gifsicleNpm="${srcdir}"/${_pkgname}-webapp/node_modules/gifsicle/vendor/gifsicle
gifsicleNpm="${gifsicleNpm//\//\\/}"
gifsicleSystem="$(which gifsicle)"
gifsicleSystem="${gifsicleSystem//\//\\/}"
sed -r -i Makefile \
- -e "s/(\t*)npm install(.*)/\0\n\1rm \"$gifsicleNpm\"\n\tln -s \"$gifsicleSystem\" \"$gifsicleNpm\"/"
+ -e "s/(\t*)npm install(.*)/\0\n\trm \"${gifsicleNpm}\"\n\tln -s \"${gifsicleSystem}\" \"${gifsicleNpm}\"/"
fi
}
@@ -135,7 +150,7 @@ build() {
cd "${srcdir}"/src/github.com/${_pkgname}/${_pkgname}-server
# Prevent the build to crash when some dependencies are not met or
- # outdated. This clean the webapp as well (cf. mattermost-server/Makefile,
+ # outdated. This cleans the webapp as well (cf. mattermost-server/Makefile,
# clean target).
make clean
GOPATH="${srcdir}" BUILD_NUMBER=${pkgver}-${pkgrel} make build-linux
@@ -149,7 +164,6 @@ package() {
install -dm755 \
"${pkgdir}"/usr/bin \
"${pkgdir}"/usr/share/webapps \
- "${pkgdir}"/var/log/${_pkgname} \
"${pkgdir}"/etc/webapps \
"${pkgdir}"/usr/share/doc/${_pkgname}
@@ -172,8 +186,8 @@ package() {
mv NOTICE.txt README.md "${pkgdir}"/usr/share/doc/${_pkgname}
cd "${srcdir}"
- install -Dm755 "bin/${_pkgname}" "${pkgdir}/usr/share/webapps/${_pkgname}/bin/${_pkgname}"
- ln -s "/usr/share/webapps/${_pkgname}/bin/${_pkgname}" "${pkgdir}/usr/bin/${_pkgname}"
+ install -Dm755 bin/${_pkgname} "${pkgdir}"/usr/share/webapps/${_pkgname}/bin/${_pkgname}
+ ln -s /usr/share/webapps/${_pkgname}/bin/${_pkgname} "${pkgdir}"/usr/bin/${_pkgname}
install -Dm644 ${_pkgname}.service -t "${pkgdir}"/usr/lib/systemd/system/
install -Dm644 ${_pkgname}.sysusers "${pkgdir}"/usr/lib/sysusers.d/${_pkgname}.conf
install -Dm644 ${_pkgname}.tmpfiles "${pkgdir}"/usr/lib/tmpfiles.d/${_pkgname}.conf