summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 9f57dbfb805ee9f239cde2cd40124c965cfc2235 (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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
# Maintainer: robertfoster

pkgname=(
    'zimbra'
    'zimbra-packages'
)
pkgbase=zimbra
pkgver=8.8.15.p5
pkgrel=1
pkgdesc="An enterprise-class email calendar and collaboration solution built for the cloud both public and private"
arch=(x86_64)
url="https://www.zimbra.com/open-source-email-overview/"
license=('CPAL')
depends=('java-runtime>=11' 'perl-data-uuid' 'perl-net-ldap-server')
makedepends=('maven' 'ant' 'java-hamcrest' 'jdk8-openjdk' 'junit' 'lsb-release' 'rsync' 'ruby')
install=
source=("https://github.com/Zimbra/zm-build/archive/$pkgver.tar.gz" # Repo list is synced with instructions/FOSS_repo_list.pl
    "git+https://github.com/Zimbra/ant-1.7.0-ziputil-patched"
    "git+https://github.com/Zimbra/ant-tar-patched"
    "git+https://github.com/Zimbra/ical4j-0.9.16-patched"
    "git+https://github.com/kohlschutter/junixsocket#tag=junixsocket-parent-2.0.4"
    "git+https://github.com/Zimbra/nekohtml-1.9.13"
    "git+https://github.com/Zimbra/java-html-sanitizer-release-20190610.1"
    "git+https://github.com/Zimbra/antisamy#branch=develop"
    "git+https://github.com/Zimbra/zm-admin-console"
    "git+https://github.com/Zimbra/zm-admin-help-common"
    "git+https://github.com/Zimbra/zm-ajax"
    "git+https://github.com/Zimbra/zm-admin-ajax"
    "git+https://github.com/Zimbra/zm-amavis"
    "git+https://github.com/Zimbra/zm-aspell"
    "git+https://github.com/Zimbra/zm-bulkprovision-admin-zimlet"
    "git+https://github.com/Zimbra/zm-bulkprovision-store"
    "git+https://github.com/Zimbra/zm-certificate-manager-admin-zimlet"
    "git+https://github.com/Zimbra/zm-certificate-manager-store"
    "git+https://github.com/Zimbra/zm-charset"
    "git+https://github.com/Zimbra/zm-clam-scanner-store"
    "git+https://github.com/Zimbra/zm-clientuploader-admin-zimlet"
    "git+https://github.com/Zimbra/zm-clientuploader-store"
    "git+https://github.com/Zimbra/zm-core-utils"
    "git+https://github.com/Zimbra/zm-db-conf"
    "git+https://github.com/Zimbra/zm-dnscache"
    "git+https://github.com/Zimbra/zm-downloads"
    "git+https://github.com/Zimbra/zm-freshclam"
    "git+https://github.com/Zimbra/zm-help"
    "git+https://github.com/Zimbra/zm-helptooltip-zimlet"
    "git+https://github.com/Zimbra/zm-jetty-conf"
    "git+https://github.com/Zimbra/zm-jython"
    "git+https://github.com/Zimbra/zm-launcher"
    "git+https://github.com/Zimbra/zm-ldap-utilities"
    "git+https://github.com/Zimbra/zm-ldap-utils-store"
    "git+https://github.com/Zimbra/zm-licenses"
    "git+https://github.com/Zimbra/zm-mailbox"
    "git+https://github.com/Zimbra/zm-migration-tools"
    "git+https://github.com/Zimbra/zm-mta"
    "git+https://github.com/Zimbra/zm-nginx-conf"
    "git+https://github.com/Zimbra/zm-nginx-lookup-store"
    "git+https://github.com/Zimbra/zm-openid-consumer-store"
    "git+https://github.com/Zimbra/zm-pkg-tool"
    "git+https://github.com/Zimbra/zm-postfix"
    "git+https://github.com/Zimbra/zm-proxy-config-admin-zimlet"
    "git+https://github.com/Zimbra/zm-ssdb-ephemeral-store"
    "git+https://github.com/Zimbra/zm-taglib"
    "git+https://github.com/Zimbra/zm-timezones"
    "git+https://github.com/Zimbra/zm-versioncheck-admin-zimlet"
    "git+https://github.com/Zimbra/zm-versioncheck-store"
    "git+https://github.com/Zimbra/zm-versioncheck-utilities"
    "git+https://github.com/Zimbra/zm-viewmail-admin-zimlet"
    "git+https://github.com/Zimbra/zm-web-client"
    "git+https://github.com/Zimbra/zm-webclient-portal-example"
    "git+https://github.com/Zimbra/zm-zcs"
    "git+https://github.com/Zimbra/zm-zcs-lib"
    "git+https://github.com/Zimbra/zm-zimlets"
    "git+https://github.com/Zimbra/zm-oauth-social"
    "git+https://github.com/Zimbra/zm-gql"
#    "packages::git+https://github.com/Zimbra/packages#branch=bugfix/ZCS-6172"
    "zimbra.sysusers"
    "zimbra.tmpfiles"
    "localconfig.xml"
)
noextract=()

# Zimbra Configuration Variables
_buildno=3869
_buildtype="FOSS"
_major=`echo "${pkgver}" | cut -d'.' -f1`
_micro=`echo "${pkgver}" | cut -d'.' -f3`
_minor=`echo "${pkgver}" | cut -d'.' -f2`
_os="Arch"
_ostag="urolling"
_rc="GA"
_release="JOULES"
_releaseno="${pkgver%.*}"
_timestamp=`date +'%Y%m%d'`

prepare() {
    cd "$srcdir"
    
    # Bypass build.pl git checkout
    sed -i 's/Checkout($all_repos)/#Checkout($all_repos)/g' \
    "zm-build-$pkgver"/build.pl
    
    # Bypass deb generation
    sed -i 's/Die("Unknown PACKAGING format");/print("Arch Linux PACKAGING format\n");/g' \
    zm-pkg-tool/pkg-build.pl
    sed -i 's/return "deb"/return "tar.xz"/g' \
    zm-pkg-tool/pkg-build.pl
    sed -i '/echo "OS not supported./{n;s/.*//}' \
    "zm-build-$pkgver"/instructions/bundling-scripts/utils.sh
    
    # Fix zimbra-package-stub RELEASE descriptors
    mkdir -p zimbra-package-stub/version
    echo "${_major}" > zimbra-package-stub/version/MAJOR
    echo "${_minor}" > zimbra-package-stub/version/MINOR
    echo "${_micro}_${_rc}" > zimbra-package-stub/version/MICRO
}

build() {
    cd "$srcdir/zm-build-$pkgver"
    
    # Set JDK 8 as runtime
    export JAVA_HOME=/usr/lib/jvm/java-8-openjdk
    export JAVA_PATH=/usr/lib/jvm/java-8-openjdk/bin
    
    # Let's build for real now
    ./build.pl -build-no=${_buildno} --build-ts=${_timestamp} \
    --build-release=${_release} --build-release-no=${_releaseno} \
    --build-os=${_os} --build-release-candidate=${_rc} --build-type=${_buildtype} \
    --build-arch=$CARCH --pkg-os-tag=${_ostag} \
    --build-thirdparty-server=files.zimbra.com --no-interactive \
    --build-prod-flag --disable-bundle --ant-options="-DskipTests=1"
}

package_zimbra() {
    cd "$srcdir"
    cd .staging/${_os}-${_release}-${_major}${_minor}${_micro}-${_timestamp}-${_buildtype}-${_buildno}
    find . -type d -name "opt" -exec rsync -av {} "$pkgdir" \;
    find . -type d -name "opt" | xargs rm -rf
    find . -type d -name "etc" -exec rsync -av {} "$pkgdir" \;
    find . -type d -name "etc" | xargs rm -rf
    rsync -av "$srcdir/zm-mailbox/build/stage/zimbra-common-core-jar/opt" "$pkgdir"
    chmod 750 -R $pkgdir/etc/sudoers.d
    chmod +x $pkgdir/opt/zimbra/bin/*
    
    # systemd
    #	install -D -m644 "${srcdir}/zimbra.service" -t "${pkgdir}/usr/lib/systemd/system"
    install -D -m644 "${srcdir}/zimbra.sysusers" "${pkgdir}/usr/lib/sysusers.d/zimbra.conf"
    install -D -m644 "${srcdir}/zimbra.tmpfiles" "${pkgdir}/usr/lib/tmpfiles.d/zimbra.conf"

    # Using a pregenerated localconfig.xml to set JRE
    install -D -m644 "${srcdir}/localconfig.xml" "${pkgdir}/opt/zimbra/conf/localconfig.xml"
}

package_zimbra-packages() {
    cd "$srcdir"
}
md5sums=('0be0a8118803e607245bbd66404fd58c'
         'SKIP'
         'SKIP'
         'SKIP'
         'SKIP'
         'SKIP'
         'SKIP'
         'SKIP'
         'SKIP'
         'SKIP'
         'SKIP'
         'SKIP'
         'SKIP'
         'SKIP'
         'SKIP'
         'SKIP'
         'SKIP'
         'SKIP'
         'SKIP'
         'SKIP'
         'SKIP'
         'SKIP'
         'SKIP'
         'SKIP'
         'SKIP'
         'SKIP'
         'SKIP'
         'SKIP'
         'SKIP'
         'SKIP'
         'SKIP'
         'SKIP'
         'SKIP'
         'SKIP'
         'SKIP'
         'SKIP'
         'SKIP'
         'SKIP'
         'SKIP'
         'SKIP'
         'SKIP'
         'SKIP'
         'SKIP'
         'SKIP'
         'SKIP'
         'SKIP'
         'SKIP'
         'SKIP'
         'SKIP'
         'SKIP'
         'SKIP'
         'SKIP'
         'SKIP'
         'SKIP'
         'SKIP'
         'SKIP'
         'SKIP'
         'SKIP'
         '21b3bdbcb2d23357104122df3de217b5'
         '84ad300287d602d4d6b2601748ddbaac'
         '66f2930f13484ae782a162e8e7da28c1')