forked from fedora-java/javapackages
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install
executable file
·235 lines (187 loc) · 7.48 KB
/
install
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
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
#!/bin/bash
# Copyright (c) 2013-2017 Red Hat, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the
# distribution.
# 3. Neither the name of Red Hat nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# Authors: Mikolaj Izdebski <[email protected]>
set -e
if ! test -f config.status; then
echo config.status does not exist. Run configure first. >&2
exit 1
fi
. ./config.status
DEST=${DEST:-${RPM_BUILD_ROOT}}
DEST=${DEST:-${PWD}/root}
rm -rf "${DEST}"
dir()
{
install -d -m 755 "${DEST}/${1}"
echo "%dir ${1}"
}
link()
{
install -d -m 755 "${DEST}/"$(dirname "${2}")
ln -sf "${1}" "${DEST}/${2}"
echo "${2}"
}
inst()
{
install -d -m 755 "${DEST}/${3}"
install -p -m 644 "${2}" "${DEST}/${3}/${4}"
echo "${1} ${3}/${4:-$(basename "${2}")}"
}
inst_data() { inst "%attr(0644,root,root)" "${@}"; }
inst_exec() { inst "%attr(0755,root,root)" "${@}"; }
inst_config() { inst "%config(noreplace)" "${@}"; }
inst_doc() {
echo "%doc ${1}"
}
exec >files-filesystem
dir "${javaconfdir}"
dir "${javaconfdir}/security"
dir "${javaconfdir}/security/security.d"
dir "${jvmdir}"
dir "${jvmprivdir}"
dir "${jvmlibdir}"
dir "${jvmdatadir}"
dir "${jvmsysconfdir}"
dir "${jvmcommonlibdir}"
dir "${jvmcommondatadir}"
dir "${jvmcommonsysconfdir}"
dir "${javadir}"
dir "${jnidir}"
dir "${javadocdir}"
dir "${mavenpomdir}"
dir "${ivyxmldir}"
dir "${datadir}/maven-metadata"
dir "${prefix}/lib/eclipse"
dir "${prefix}/lib/eclipse/features"
dir "${prefix}/lib/eclipse/plugins"
dir "${prefix}/lib/eclipse/dropins"
dir "${prefix}/lib/eclipse/droplets"
dir "${datadir}/eclipse"
dir "${datadir}/eclipse/dropins"
dir "${datadir}/eclipse/droplets"
inst_data macros.d/macros.javapackages-filesystem "${rpmmacrodir}"
exec >files-tools
dir "${m2home}"
dir "${javadir}-utils"
dir "${rpmconfigdir}"
inst_exec target/build-classpath "${bindir}"
inst_exec target/build-classpath-directory "${bindir}"
inst_exec target/build-jar-repository "${bindir}"
inst_exec target/check-binary-files "${bindir}"
inst_exec target/clean-binary-files "${bindir}"
inst_exec target/create-jar-links "${bindir}"
inst_exec target/diff-jars "${bindir}"
inst_exec target/find-jar "${bindir}"
inst_exec target/rebuild-jar-repository "${bindir}"
inst_exec target/shade-jar "${bindir}"
inst_config etc/font.properties "${javaconfdir}"
inst_config target/java.conf "${javaconfdir}"
inst_config target/eclipse.conf "${javaconfdir}"
inst_data target/java-functions "${javadir}-utils"
inst_exec java-utils/java-wrapper "${javadir}-utils"
inst_data target/macros.jpackage "${rpmmacrodir}"
inst_data target/build-classpath.1 "${mandir}/man1"
inst_data target/build-jar-repository.1 "${mandir}/man1"
inst_data man/diff-jars.1 "${mandir}/man1"
inst_data target/rebuild-jar-repository.1 "${mandir}/man1"
inst_data target/shade-jar.1 "${mandir}/man1"
inst_data target/find-jar.1 "${mandir}/man1"
inst_data configs/configuration.xml "${m2home}"
if [ -z "$pyinterpreter" ]; then
exit 0
fi
exec >files-common
inst_exec target/abs2rel "${bindir}"
inst_exec target/xmvn-builddep "${bindir}"
link "${bindir}/abs2rel" "${javadir}-utils/abs2rel.sh"
inst_data java-utils/pom_editor.py "${javadir}-utils"
inst_data java-utils/request-artifact.py "${javadir}-utils"
inst_data java-utils/builddep.py "${javadir}-utils"
inst_data java-utils/mvn_alias.py "${javadir}-utils"
inst_data java-utils/mvn_artifact.py "${javadir}-utils"
inst_data java-utils/mvn_build.py "${javadir}-utils"
inst_data java-utils/mvn_compat_version.py "${javadir}-utils"
inst_data java-utils/mvn_config.py "${javadir}-utils"
inst_data java-utils/mvn_file.py "${javadir}-utils"
inst_data java-utils/mvn_package.py "${javadir}-utils"
inst_data target/macros.fjava "${rpmmacrodir}"
inst_data target/abs2rel.1 "${mandir}/man1"
inst_data target/mvn_alias.7 "${mandir}/man7"
inst_data target/mvn_artifact.7 "${mandir}/man7"
inst_data target/mvn_build.7 "${mandir}/man7"
inst_data target/mvn_compat_version.7 "${mandir}/man7"
inst_data target/mvn_config.7 "${mandir}/man7"
inst_data target/mvn_file.7 "${mandir}/man7"
inst_data target/mvn_install.7 "${mandir}/man7"
inst_data target/mvn_package.7 "${mandir}/man7"
inst_data target/pom_add_dep.7 "${mandir}/man7"
inst_data target/pom_add_parent.7 "${mandir}/man7"
inst_data target/pom_add_plugin.7 "${mandir}/man7"
inst_data target/pom_disable_module.7 "${mandir}/man7"
inst_data target/pom_xpath_disable.7 "${mandir}/man7"
inst_data target/pom_remove_dep.7 "${mandir}/man7"
inst_data target/pom_remove_parent.7 "${mandir}/man7"
inst_data target/pom_remove_plugin.7 "${mandir}/man7"
inst_data target/pom_change_dep.7 "${mandir}/man7"
inst_data target/pom_set_parent.7 "${mandir}/man7"
inst_data target/pom_xpath_inject.7 "${mandir}/man7"
inst_data target/pom_xpath_remove.7 "${mandir}/man7"
inst_data target/pom_xpath_replace.7 "${mandir}/man7"
inst_data target/pom_xpath_set.7 "${mandir}/man7"
exec >files-compat
inst_data java-utils/install_pom.py "${javadir}-utils"
inst_data java-utils/maven_depmap.py "${javadir}-utils"
inst_data target/macros.javapackages-compat "${rpmmacrodir}"
exec >files-generators
dir "${rpmconfigdir}/fileattrs"
inst_exec target/maven.prov "${rpmconfigdir}" maven.prov
inst_exec target/maven.req "${rpmconfigdir}" maven.req
inst_exec target/osgi.prov "${rpmconfigdir}" osgi.prov
inst_exec target/osgi.req "${rpmconfigdir}" osgi.req
inst_exec target/javadoc.req "${rpmconfigdir}" javadoc.req
inst_data target/maven.attr "${rpmconfigdir}/fileattrs" maven.attr
inst_data target/osgi.attr "${rpmconfigdir}/fileattrs" osgi.attr
inst_data target/javadoc.attr "${rpmconfigdir}/fileattrs" javadoc.attr
inst_config etc/javapackages-config.json "${javaconfdir}"
exec >files-maven
# Nothing
exec >files-ivy
dir "${sysconfdir}/ivy"
inst_data configs/ivy-local-classpath "${sysconfdir}/ant.d"
inst_data configs/ivysettings.xml "${sysconfdir}/ivy"
exec >files-gradle
inst_exec target/gradle-local "${bindir}"
inst_data gradle/init.gradle "${datadir}/gradle-local"
inst_data target/gradle_build.7 "${mandir}/man7"
exec >files-python
(cd ./python && "${pyinterpreter}" setup.py install -O1 --skip-build --prefix "${prefix}" --root "${DEST}") >&2
echo "${prefix}/lib/python*/site-packages/javapackages"
echo "${prefix}/lib/python*/site-packages/javapackages-*.egg-info"