diff options
author | William Gathoye | 2019-09-14 00:32:42 +0200 |
---|---|---|
committer | William Gathoye | 2019-09-14 01:35:27 +0200 |
commit | d2da11d984e3857376171cfa54f530145dc3794a (patch) | |
tree | 483a8ba5c26431af0bc1f6c330523331e6ca5048 | |
parent | 83d79d16e6609da0489302c735e77251650c2232 (diff) | |
download | aur-d2da11d984e3857376171cfa54f530145dc3794a.tar.gz |
Update build process to latest master
-rw-r--r-- | .SRCINFO | 9 | ||||
-rw-r--r-- | PKGBUILD | 66 | ||||
-rw-r--r-- | mattermost-ldflags.patch | 31 | ||||
-rw-r--r-- | mattermost.service | 2 | ||||
-rw-r--r-- | mattermost.sysusers | 2 |
5 files changed, 68 insertions, 42 deletions
@@ -1,6 +1,6 @@ pkgbase = mattermost-git pkgdesc = Open source Slack-alternative in Golang and React - pkgver = 5.1.0.r358.g7a758eae7 + pkgver = 5.15.0.rc4.r11506 pkgrel = 1 url = https://mattermost.com arch = i686 @@ -13,7 +13,6 @@ pkgbase = mattermost-git license = Apache makedepends = git makedepends = go-pie - makedepends = libpng12 makedepends = npm optdepends = mariadb: SQL server storage optdepends = percona-server: SQL server storage @@ -29,9 +28,9 @@ pkgbase = mattermost-git source = mattermost.tmpfiles sha512sums = SKIP sha512sums = SKIP - sha512sums = ac952eae873aa09ba7bdf1e7abc618f0dc6982fa85df298261ab71ccf71f66c95846dade400e05d731f2c5ee2c6f4332d6f78d737026c9f098f1e03f419bee00 - sha512sums = cd02b3da86869117554c3c53a657a4b46989ea533b7b47c24fb642ffbd182ce6ecfb16a8ddde3af4d5e8cff0ab41a932753129662e126994e1ad5912545e6eb4 - sha512sums = b95bf2c0d840d0e85baebc1051c872056fa4990d263334fecc7b11d96085cb65a69dd866f18889e209336028f17c02152c13a92d2be1c21848939f22203439f0 + sha512sums = 5b761c5715387e6abf3afbe653de218b9a45708d7ffbc699856f53cc3e62760fbd0ce175615f36a4b9090182705c3343d07fca72d12275411080ab516cee3eeb + sha512sums = 6fc1b41f1ddcc44dab3e1f6bc15b7566e7c33132346b7eb0bc91d9709b4cec89ae969a57a57b6097c75868af21f438c2affda5ba1507f485c8689ab8004efd70 + sha512sums = f08d88fd91e91c8b9996cf33699f4a70d69c8c01783cf7add4781ee3c9c6596839e44c5c39f0ff39a836c6d87544eef179f51de0b037ec7f91f86bac8e24d7cc sha512sums = e3ffcf4b86e2ecc7166c1abf92cd4de23d81bad405db0121e513a8d81fea05eec9dd508141b14b208c4c13fbc347c56f01ed91326faa01e872ecdedcc18718f9 pkgname = mattermost-git @@ -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 diff --git a/mattermost-ldflags.patch b/mattermost-ldflags.patch index 2f863a0ff9b8..43e47c03b57d 100644 --- a/mattermost-ldflags.patch +++ b/mattermost-ldflags.patch @@ -1,11 +1,24 @@ ---- a/Makefile -+++ b/Makefile -@@ -48,6 +48,7 @@ GOFLAGS ?= $(GOFLAGS:) +--- src/mattermost-server-5.12.0/Makefile 2019-06-14 21:13:52.000000000 +0200 ++++ src/mattermost-server-5.12.0/Makefile.new 2019-07-01 03:04:42.875342812 +0200 +@@ -49,11 +49,20 @@ + GOFLAGS ?= $(GOFLAGS:) GO=go DELVE=dlv - GO_LINKER_FLAGS ?= -ldflags \ -- "-X github.com/mattermost/mattermost-server/model.BuildNumber=$(BUILD_NUMBER)\ -+ "-linkmode external -extldflags '$(LDFLAGS)' -s -w \ -+ -X github.com/mattermost/mattermost-server/model.BuildNumber=$(BUILD_NUMBER)\ - -X 'github.com/mattermost/mattermost-server/model.BuildDate=$(BUILD_DATE)'\ - -X github.com/mattermost/mattermost-server/model.BuildHash=$(BUILD_HASH)\ +-LDFLAGS += -X "github.com/mattermost/mattermost-server/model.BuildNumber=$(BUILD_NUMBER)" ++ ++# We need to use the second flavour of makefile variables and use a dedicated ++# variable here, otherwise this will cause an infinite loop. ++# src.: https://www.gnu.org/software/make/manual/make.html#Flavors ++LDFLAGS_MATTERMOST := $(LDFLAGS) ++LDFLAGS = -X "github.com/mattermost/mattermost-server/model.BuildNumber=$(BUILD_NUMBER)" + LDFLAGS += -X "github.com/mattermost/mattermost-server/model.BuildDate=$(BUILD_DATE)" + LDFLAGS += -X "github.com/mattermost/mattermost-server/model.BuildHash=$(BUILD_HASH)" + LDFLAGS += -X "github.com/mattermost/mattermost-server/model.BuildHashEnterprise=$(BUILD_HASH_ENTERPRISE)" + LDFLAGS += -X "github.com/mattermost/mattermost-server/model.BuildEnterpriseReady=$(BUILD_ENTERPRISE_READY)" ++# The link mode needs to be at the end of the LDFLAGS statement otherwise the ++# build pieces of info won't be populated to the about dialog in the app. ++LDFLAGS += -linkmode external -extldflags '$(LDFLAGS_MATTERMOST)' -s -w ++ + GO_MAJOR_VERSION = $(shell $(GO) version | cut -c 14- | cut -d' ' -f1 | cut -d'.' -f1) + GO_MINOR_VERSION = $(shell $(GO) version | cut -c 14- | cut -d' ' -f1 | cut -d'.' -f2) + MINIMUM_SUPPORTED_GO_MAJOR_VERSION = 1 diff --git a/mattermost.service b/mattermost.service index 82de14a3f7cf..774da69c3da3 100644 --- a/mattermost.service +++ b/mattermost.service @@ -8,7 +8,7 @@ Type=simple User=mattermost Group=mattermost ExecStart=mattermost -WorkingDirectory=/usr/share/webapps/mattermost/bin/ +WorkingDirectory=/usr/share/webapps/mattermost/ Restart=on-failure PrivateTmp=false diff --git a/mattermost.sysusers b/mattermost.sysusers index 8d67eacdca11..0ba36a115132 100644 --- a/mattermost.sysusers +++ b/mattermost.sysusers @@ -1 +1 @@ -u mattermost - "mattemost user" +u mattermost - "mattermost user" |