~vcs-imports/xena/trunk

« back to all changes in this revision

Viewing changes to ext/src/javahelp/jhMaster/JavaHelp/linuxRPM/.svn/text-base/GNUmakefile.svn-base

  • Committer: matthewoliver
  • Date: 2009-12-10 03:18:07 UTC
  • Revision ID: vcs-imports@canonical.com-20091210031807-l086qguzdlljtkl9
Merged Xena Testing into Xena Stable for the Xena 5 release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#
 
2
# @(#)GNUmakefile       1.7 06/11/01
 
3
 
4
# Copyright (c) 2006 Sun Microsystems, Inc.  All Rights Reserved.
 
5
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 
6
 
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.
 
12
 
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).
 
18
 
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.
 
22
 
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
 
25
# have any questions.
 
26
#
 
27
 
 
28
# @(#)GNUmakefile       1.7 06/11/01
 
29
# Install for JavaHelp.
 
30
# This is a linux RPM GNUmakefile
 
31
 
 
32
JH_NAME=javahelp
 
33
JH_VERSION=2.0
 
34
TEMP_DIR=/tmp/rpm-$(JH_NAME)
 
35
NATIVE_ARCH=i586
 
36
JH_VERSION=2.0
 
37
PKGNAME=SUNWjhrt
 
38
J2SE=j2se
 
39
OPT=j2se/opt
 
40
DJH=j2se/opt/javahelp
 
41
INSTALL=$(PKGNAME)/install
 
42
RELOC=$(PKGNAME)/reloc
 
43
PWD=$(shell pwd)
 
44
OWNERGROUP=$(shell id | cut -f2  -d'(' | cut -f1 -d')') $(shell groups | cut -f1 -d' ')
 
45
PKGPATH=$(PWD)/$(PKGNAME)
 
46
 
 
47
JD=../$(JH_NAME)
 
48
TOP=..
 
49
PKGTOP=.
 
50
 
 
51
CAT=/bin/cat
 
52
CD=cd
 
53
CHMOD=/bin/chmod
 
54
CP=/bin/cp -p -f
 
55
ECHO=echo
 
56
MKDIR=/bin/mkdir -p
 
57
RM=/bin/rm -f
 
58
RPM=/usr/bin/rpmbuild
 
59
TAR=/bin/tar
 
60
FIND=/usr/bin/find
 
61
MV=/bin/mv -f
 
62
JAR=jar
 
63
 
 
64
all: copy prep-RPM build-RPM 
 
65
        echo DONE with RPM!
 
66
 
 
67
dirs: $(J2SE) $(OPT) $(DJH)
 
68
 
 
69
package: $(PKGPATH) pkginfo proto
 
70
 
 
71
copy:
 
72
        $(ECHO) ### Removing old javahelp directories
 
73
        $(RM) -r $(TEMP_DIR)
 
74
        $(MKDIR) -p $(TEMP_DIR)
 
75
        pwd
 
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
 
84
 
 
85
 
 
86
clobber:
 
87
        $(RM) -rf j2se
 
88
        $(RM) -rf $(PKGNAME)
 
89
        $(RM) -rf prototype
 
90
        $(RM) -rf pkginfo
 
91
 
 
92
 
 
93
 
 
94
prep-RPM:
 
95
 
 
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)
 
102
        @#
 
103
        @# generate the gen-rpm-jh.spec file
 
104
        @#
 
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
 
143
        @#
 
144
        @# add the rest of the template to the spec file...
 
145
        @#
 
146
        $(CAT) rpm-jh.spec >> $(TEMP_DIR)/gen-rpm-jh.spec
 
147
 
 
148
build-RPM:
 
149
        @#
 
150
        @# rpm wants to put the .rpm file the _rpmdir/{arch} directory.
 
151
        @#
 
152
        @######-$(MKDIR) $(TEMP_DIR)
 
153
        @# on RH8 rpm builds as user 'rpm'
 
154
        $(CHMOD) 777  $(TEMP_DIR)
 
155
        @# 
 
156
        @# generate the rpm file...
 
157
        @#
 
158
        $(RPM) -bb --buildroot $(TEMP_DIR) --rmsource --target $(NATIVE_ARCH)-Sun-Linux $(TEMP_DIR)/gen-rpm-jh.spec
 
159
        @#
 
160
        @# rename the generated .rpm file to the name we want 
 
161
        @#
 
162
        @# -$(MV) $(OUTPUTDIR)/$(NATIVE_ARCH)/$(TEMP_JRE_RPMFILE_NAME) \
 
163
        @#              $(OUTPUTDIR)/$(NATIVE_ARCH)/$(JRE_SHORT_BUNDLE_NAME).rpm
 
164
        @#
 
165
 
 
166
zip-RPM:
 
167
        @# not being zipped right now.
 
168
        @#
 
169
        @# zip it up for inclusion in self-extracting zip...
 
170
        @#
 
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
 
174
        @# 
 
175
        @# combine the self-extractor and .rpm.zip into a single binary...
 
176
        @#
 
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)" \
 
184
                  $(PLATFORM) \
 
185
                  " " \
 
186
                  "RPM"
 
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
 
189
        @# 
 
190
        @# remove the intermediate files...
 
191
        @#
 
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
 
196
 
 
197
jh-rpm-clobber:
 
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)
 
207