2
# @(#)GNUmakefile 1.7 06/11/01
4
# Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
5
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
7
# This code is free software; you can redistribute it and/or modify it
8
# under the terms of the GNU General Public License version 2 only, as
9
# published by the Free Software Foundation. Sun designates this
10
# particular file as subject to the "Classpath" exception as provided
11
# by Sun in the LICENSE file that accompanied this code.
13
# This code is distributed in the hope that it will be useful, but WITHOUT
14
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16
# version 2 for more details (a copy is included in the LICENSE file that
17
# accompanied this code).
19
# You should have received a copy of the GNU General Public License version
20
# 2 along with this work; if not, write to the Free Software Foundation,
21
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
23
# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
24
# CA 95054 USA or visit www.sun.com if you need additional information or
28
# @(#)GNUmakefile 1.7 06/11/01
29
# Install for JavaHelp.
30
# This is a linux RPM GNUmakefile
34
TEMP_DIR=/tmp/rpm-$(JH_NAME)
41
INSTALL=$(PKGNAME)/install
42
RELOC=$(PKGNAME)/reloc
44
OWNERGROUP=$(shell id | cut -f2 -d'(' | cut -f1 -d')') $(shell groups | cut -f1 -d' ')
45
PKGPATH=$(PWD)/$(PKGNAME)
64
all: copy prep-RPM build-RPM
67
dirs: $(J2SE) $(OPT) $(DJH)
69
package: $(PKGPATH) pkginfo proto
72
$(ECHO) ### Removing old javahelp directories
74
$(MKDIR) -p $(TEMP_DIR)
76
$(ECHO) ### Copying over the jh2.0 image for use with RPM
77
$(CD) .. ;$(TAR) cf - jh$(JH_VERSION) | ( cd $(TEMP_DIR) ; $(TAR) xfBp -)
78
### $(MV) $(TEMP_DIR)/jh$(JH_VERSION) $(TEMP_DIR)/$(JH_NAME)$(JH_VERSION)
79
$(MKDIR) $(TEMP_DIR)/packages
80
$(MV) $(TEMP_DIR)/jh$(JH_VERSION) $(TEMP_DIR)/packages/javax.help-$(JH_VERSION)
81
$(FIND) $(TEMP_DIR) -name "*.bat" -print -exec $(RM) {} \;
82
### $(CD) $(TEMP_DIR) ; $(TAR) cf $(JH_NAME)$(JH_VERSION).tar $(JH_NAME)$(JH_VERSION)
83
$(CD) $(TEMP_DIR) ; $(TAR) cf $(JH_NAME)$(JH_VERSION).tar packages
96
@#subtle: override the sourcedir so that we don't have to copy
97
@# large binaries around.
98
@# $(ECHO) "%_sourcedir $(ABS_OUTPUTDIR)" >> $(RPM_MACROFILE)
99
@# $(ECHO) "%_sourcedir $(TEMP_DIR)" >> $(HOME)/.rpmmacros_jh
100
@# $(ECHO) "%_builddir $(TEMP_DIR)/BUILD" >> $(RPM_MACROFILE)
101
@# $(ECHO) "%_rpmdir $(TEMP_DIR)" >> $(RPM_MACROFILE)
103
@# generate the gen-rpm-jh.spec file
105
$(ECHO) milestone is $(MILESTONE)
106
$(ECHO) ### generate the gen-rpm-jh.spec file
107
$(ECHO) " " >> $(TEMP_DIR)/gen-rpm-jh.spec
108
$(ECHO) "%define _builddir $(TEMP_DIR)" >> $(TEMP_DIR)/gen-rpm-jh.spec
109
$(ECHO) "%define _sourcedir $(TEMP_DIR)" >> $(TEMP_DIR)/gen-rpm-jh.spec
110
$(ECHO) "%define _rpmdir $(TEMP_DIR)" >> $(TEMP_DIR)/gen-rpm-jh.spec
111
$(ECHO) "%define _tmppath $(TEMP_DIR)" >> $(TEMP_DIR)/gen-rpm-jh.spec
112
$(ECHO) "%define jh_prefix /usr/java" >> $(TEMP_DIR)/gen-rpm-jh.spec
113
$(ECHO) "%define jh_tarfile javahelp$(VERSION).tar" >> $(TEMP_DIR)/gen-rpm-jh.spec
114
$(ECHO) "%define arch i586" >> $(TEMP_DIR)/gen-rpm-jh.spec
115
$(ECHO) "%define jh_dir packages/javax.help-$(JH_VERSION)" >> $(TEMP_DIR)/gen-rpm-jh.spec
116
$(ECHO) "%define jh_name $(JH_NAME)" >> $(TEMP_DIR)/gen-rpm-jh.spec
117
$(ECHO) "%define jh_version $(JH_VERSION)" >> $(TEMP_DIR)/gen-rpm-jh.spec
118
@# $(ECHO) "%define packed_jars \"$(JRE_PACKED_JARS)\"" >> $(TEMP_DIR)/gen-rpm-jh.spec
119
$(ECHO) " " >> $(TEMP_DIR)/gen-rpm-jh.spec
120
$(ECHO) "Name: sun-$(JH_NAME)" >> $(TEMP_DIR)/gen-rpm-jh.spec
121
$(ECHO) "Summary: JavaHelp Runtime/Development Environment" >> $(TEMP_DIR)/gen-rpm-jh.spec
122
$(ECHO) "Version: %{jh_version}" >> $(TEMP_DIR)/gen-rpm-jh.spec
123
$(ECHO) "Release: fcs" >> $(TEMP_DIR)/gen-rpm-jh.spec
124
$(ECHO) "Copyright: 1994-2004 Sun Microsystems, Inc." >> $(TEMP_DIR)/gen-rpm-jh.spec
125
$(ECHO) "Group: Java Software Engineering" >> $(TEMP_DIR)/gen-rpm-jh.spec
126
@# $(ECHO) "Provides: jaxp_parser_impl, xml-commons-apis" >> $(TEMP_DIR)/gen-rpm-jh.spec
127
$(ECHO) "Requires: glibc >= 2.1.2-11, sh-utils >= 2.0-1, fileutils >= 4.0-8, gawk >= 3.0.4-1, textutils >= 2.0-2" >> $(TEMP_DIR)/gen-rpm-jh.spec
128
$(ECHO) "AutoReqProv: no" >> $(TEMP_DIR)/gen-rpm-jh.spec
129
$(ECHO) "Url: http://java.sun.com/products/javahelp" >> $(TEMP_DIR)/gen-rpm-jh.spec
130
$(ECHO) "Vendor: Sun Microsystems, Inc." >> $(TEMP_DIR)/gen-rpm-jh.spec
131
$(ECHO) "Source: $(JH_NAME)$(JH_VERSION).tar" >> $(TEMP_DIR)/gen-rpm-jh.spec
132
$(ECHO) "Packager: Java Software <http://java.sun.com/docs/forms/javahelp-sendusmail.html>" >> \
133
$(TEMP_DIR)/gen-rpm-jh.spec
134
@###$(ECHO) "Buildroot: $(TEMP_DIR)/rpm-root" >> $(TEMP_DIR)/gen-rpm-jh.spec
135
$(ECHO) "Buildroot: $(TEMP_DIR)" >> $(TEMP_DIR)/gen-rpm-jh.spec
136
$(ECHO) "Prefix: %{jre_prefix}" >> $(TEMP_DIR)/gen-rpm-jh.spec
137
$(ECHO) " " >> $(TEMP_DIR)/gen-rpm-jh.spec
138
$(ECHO) "%description" >> $(TEMP_DIR)/gen-rpm-jh.spec
139
$(ECHO) -n "The JavaHelp Runtime/Development Environment consists of JavaHelp " >> $(TEMP_DIR)/gen-rpm-jh.spec
140
@# $(ECHO) -n "virtual machine, the Java platform core classes, " >> $(TEMP_DIR)/gen-rpm-jh.spec
141
@# $(ECHO) -n "and supporting files. It is the runtime part of " >> $(TEMP_DIR)/gen-rpm-jh.spec
142
$(ECHO) " " >> $(TEMP_DIR)/gen-rpm-jh.spec
144
@# add the rest of the template to the spec file...
146
$(CAT) rpm-jh.spec >> $(TEMP_DIR)/gen-rpm-jh.spec
150
@# rpm wants to put the .rpm file the _rpmdir/{arch} directory.
152
@######-$(MKDIR) $(TEMP_DIR)
153
@# on RH8 rpm builds as user 'rpm'
154
$(CHMOD) 777 $(TEMP_DIR)
156
@# generate the rpm file...
158
$(RPM) -bb --buildroot $(TEMP_DIR) --rmsource --target $(NATIVE_ARCH)-Sun-Linux $(TEMP_DIR)/gen-rpm-jh.spec
160
@# rename the generated .rpm file to the name we want
162
@# -$(MV) $(OUTPUTDIR)/$(NATIVE_ARCH)/$(TEMP_JRE_RPMFILE_NAME) \
163
@# $(OUTPUTDIR)/$(NATIVE_ARCH)/$(JRE_SHORT_BUNDLE_NAME).rpm
167
@# not being zipped right now.
169
@# zip it up for inclusion in self-extracting zip...
171
$(RM) $(OUTPUTDIR)/$(NATIVE_ARCH)/temp.rpm $(TEMP_DIR)/temp.bin
172
$(CD) $(OUTPUTDIR)/$(NATIVE_ARCH) ; \
173
$(ZIPEXE) -qryn nothing temp.rpm $(JRE_SHORT_BUNDLE_NAME).rpm
175
@# combine the self-extractor and .rpm.zip into a single binary...
177
$(CAT) $(UNZIPSFX) $(OUTPUTDIR)/$(NATIVE_ARCH)/temp.rpm > $(TEMP_DIR)/temp.bin
178
$(SFX2SH) $(TEMP_DIR)/temp.bin \
179
$(JRE_IMAGE_DIR)/LICENSE \
180
$(OUTPUTDIR)/$(NATIVE_ARCH)/$(JRE_SHORT_BUNDLE_NAME)-rpm.sh \
181
$(JRE_NODOTVERSION) \
182
$(OUTPUTDIR)/$(JRE_TEMPORARY_DIR) \
183
"$(JRE_PACKED_JARS)" \
187
$(MV) $(OUTPUTDIR)/$(NATIVE_ARCH)/$(JRE_SHORT_BUNDLE_NAME).rpm $(BIN_BUNDLEDIR)/$(JRE_BUNDLE_NAME).rpm
188
$(MV) $(OUTPUTDIR)/$(NATIVE_ARCH)/$(JRE_SHORT_BUNDLE_NAME)-rpm.sh $(BIN_BUNDLEDIR)/$(JRE_BUNDLE_NAME)-rpm.sh
190
@# remove the intermediate files...
192
$(RM) $(TEMP_DIR)/temp.bin
193
$(RM) -r $(OUTPUTDIR)/$(NATIVE_ARCH)
194
$(RM) -r $(OUTPUTDIR)/$(JRE_TEMPORARY_DIR)
195
$(RM) $(OUTPUTDIR)/$(JRE_BUNDLE_NAME).bin $(OUTPUTDIR)/$(JRE_BUNDLE_NAME).zip
198
$(RM) $(TEMP_DIR)/gen-rpm-jh.spec $(RPM_MACROFILE)
199
$(RM) -r $(TEMP_DIR)/BUILD $(TEMP_DIR)/RPMS
200
$(RM) $(OUTPUTDIR)/$(JRE_RPM_TARFILE)
201
$(RM) $(OUTPUTDIR)/$(ARCH)/$(JRE_SHORT_BUNDLE_NAME).rpm
202
$(RM) $(OUTPUTDIR)/$(ARCH)/temp.rpm $(TEMP_DIR)/temp.bin
203
$(RM) $(OUTPUTDIR)/$(ARCH)/$(JRE_SHORT_BUNDLE_NAME)-rpm.sh
204
$(RM) $(BIN_BUNDLEDIR)/$(JRE_BUNDLE_NAME).rpm
205
$(RM) $(BIN_BUNDLEDIR)/$(JRE_BUNDLE_NAME)-rpm.sh
206
$(RM) -r $(OUTPUTDIR)/$(ARCH)