archrelease: copy trunk to community-any
[ArchLinux/community.git] / maven / repos / community-any / PKGBUILD
blobe0e40cefab268d05979899181e13bd93103c8532
1 # Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
2 # Contributor: Sergej Pupykin <pupykin.s+arch@gmail.com>
3 # Contributor: William Rea <sillywilly@gmail.com>
5 pkgname=maven
6 pkgver=3.8.7
7 pkgrel=1
8 pkgdesc='Java project management and project comprehension tool'
9 url='https://maven.apache.org'
10 arch=('any')
11 license=('APACHE')
12 depends=('java-environment>=8' 'bash' 'procps-ng')
13 makedepends=('maven' 'java-environment=8')
14 backup=('opt/maven/conf/settings.xml')
15 source=(https://downloads.apache.org/maven/maven-3/${pkgver}/source/apache-maven-${pkgver}-src.tar.gz{,.asc}
16         # both bin artifacts are only used for reproducible builds from source
17         https://downloads.apache.org/maven/maven-3/${pkgver}/binaries/apache-maven-${pkgver}-bin.tar.gz{,.asc,.sha512}
18         maven.sh)
19 noextract=(apache-maven-${pkgver}-bin.tar.gz)
20 # https://www.apache.org/dist/maven/KEYS
21 validpgpkeys=(
22   '042B29E928995B9DB963C636C7CA19B7B620D787' # StephenConnolly<stephenc@apache.org>
23   'AE9E53FC28FF2AB1012273D0BF1518E0160788A2' # Karl Heinz Marbaise (ASF Key) <khmarbaise@apache.org>
24   'BBE7232D7991050B54C8EA0ADC08637CA615D22C' # Enrico Olivelli <eolivelli@apache.org>
25   'B02137D875D833D9B23392ECAE5A7FB608A0221C' # Robert Scholte <rfscholte@apache.org>
26   '6A814B1F869C2BBEAB7CB7271A2A1C94BDE89688' # Michael Osipov (Java developer) <1983-01-06@gmx.net>
28 sha256sums=('fe13478988307e3160624e2f672fc3d63c7e528e78085885ee57342d693372e5'
29             'SKIP'
30             '628b49352130d1d25d5519b1c724f0efe58b86bad55f37a694ca8f73f11e3604'
31             'SKIP'
32             'ea9877cc10162f7503fc1ef29c6d81174c3eb0aa9de7d0b4381c9a40949b4213'
33             '17d9b8efa6a922907110026273443bcc8d83e061e14ac82cb5052b483acc9b76')
35 _buildnumber() {
36   # use same build number as the binary dist but prove that our source build is
37   # identical and therefor canonical in the build() step
38   bsdtar xOf <(bsdtar xOf "${srcdir}/apache-maven-${pkgver}-bin.tar.gz" apache-maven-${pkgver}/lib/maven-core-${pkgver}.jar) \
39     org/apache/maven/messages/build.properties | grep buildNumber | cut -d= -f2 | tr -cd '[:print:]'
42 build() {
43   cd apache-maven-${pkgver}
45   export PATH="/usr/lib/jvm/java-8-openjdk/bin:${PATH}"
46   mvn package \
47     -DbuildNumber="$(_buildnumber)" \
48     -Dline.separator=$'\r\n' \
49     -Dproject.build.sourceEncoding=UTF-8 -e \
50     -Dmaven.repo.local="${srcdir}/repo" \
51     -DskipTests
53   # check reproducible builds result against upstream hashes. This way we can
54   # prove that our source build is identical and therefor canonical so we are
55   # technically free to use the static build number in our build env. On top we
56   # ensure bit by bit identical upstream signed binary dist against our variant
57   # via diff exiting non-successful on mismatch.
58   sha512sum -c <(printf "$(cat ${srcdir}/apache-maven-${pkgver}-bin.tar.gz.sha512) apache-maven/target/apache-maven-${pkgver}-bin.tar.gz")
59   diff "${srcdir}/apache-maven-${pkgver}-bin.tar.gz" apache-maven/target/apache-maven-${pkgver}-bin.tar.gz
62 check() {
63   cd apache-maven-${pkgver}
65   export PATH="/usr/lib/jvm/java-8-openjdk/bin:${PATH}"
66   mvn test \
67     -Dmaven.repo.local="${srcdir}/repo"
70 package() {
71   cd apache-maven-${pkgver}
73   install -Dm 755 ../maven.sh -t "${pkgdir}/etc/profile.d"
75   install -d "${pkgdir}/opt/maven"
76   bsdtar xf apache-maven/target/apache-maven-${pkgver}-bin.tar.gz \
77     --strip-components=1 \
78     -C "${pkgdir}/opt/maven"
80   install -d "${pkgdir}/usr/bin"
81   ln -s /opt/maven/bin/mvn "${pkgdir}/usr/bin/mvn"
82   ln -s /opt/maven/bin/mvnDebug "${pkgdir}/usr/bin/mvnDebug"
85 # vim: ts=2 sw=2 et: