Add Linux RPM packaging a la Kirk. NSPRPUB_RELEASE_4_1_BRANCH NSPR_4_1_6_RTM
authorsaul.edwards%sun.com
Mon, 01 Dec 2003 20:25:56 +0000
branchNSPRPUB_RELEASE_4_1_BRANCH
changeset 2991 6f90ca987351bb780beec4abecfd5be336727f8c
parent 2896 01c00c96448efaf5e5709365b8af7d7648c30afc (current diff)
parent 2897 b4e512ed1bd3c37232dd63b9e6b29e4e8de4256d (diff)
child 3008 1184f8c086d8020f00e3d2d9168a46fa21d10f75
push idunknown
push userunknown
push dateunknown
Add Linux RPM packaging a la Kirk.
Makefile
pkg/Makefile
pkg/linux/Makefile
--- a/Makefile
+++ b/Makefile
@@ -117,16 +117,14 @@ endif
 	chmod 664 $(MDIST)/$(MOD_NAME)/$(BUILD_NUMBER)/imports.df; \
 	cd $(OBJDIR_NAME); \
 	cp -f mdbinary.jar $(MDIST)/$(MOD_NAME)/$(BUILD_NUMBER)/$(OBJDIR_NAME); \
 	chmod 664 $(MDIST)/$(MOD_NAME)/$(BUILD_NUMBER)/$(OBJDIR_NAME)/mdbinary.jar; \
 	cd include; \
 	cp -f mdheader.jar $(MDIST)/$(MOD_NAME)/$(BUILD_NUMBER)/$(OBJDIR_NAME); \
 	chmod 664 $(MDIST)/$(MOD_NAME)/$(BUILD_NUMBER)/$(OBJDIR_NAME)/mdheader.jar
 
-solarispkg:
-	@echo Making Solaris packages.
-	rm -rf pkg/$(OBJDIR)
-	cp -r pkg/solaris pkg/$(OBJDIR)
-	$(MAKE) -C pkg/$(OBJDIR) publish
+package:
+	@echo "cd pkg/; $(MAKE) publish"
+	$(MAKE) -C pkg/ publish
 
 depend:
 	@echo "NSPR20 has no dependencies.  Skipped."
new file mode 100644
--- /dev/null
+++ b/pkg/Makefile
@@ -0,0 +1,55 @@
+# 
+# The contents of this file are subject to the Mozilla Public
+# License Version 1.1 (the "License"); you may not use this file
+# except in compliance with the License. You may obtain a copy of
+# the License at http://www.mozilla.org/MPL/
+# 
+# Software distributed under the License is distributed on an "AS
+# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+# implied. See the License for the specific language governing
+# rights and limitations under the License.
+# 
+# The Original Code is the Netscape Portable Runtime (NSPR).
+# 
+# The Initial Developer of the Original Code is Netscape
+# Communications Corporation.  Portions created by Netscape are 
+# Copyright (C) 1998-2000 Netscape Communications Corporation.  All
+# Rights Reserved.
+# 
+# Contributor(s):
+# 
+# Alternatively, the contents of this file may be used under the
+# terms of the GNU General Public License Version 2 or later (the
+# "GPL"), in which case the provisions of the GPL are applicable 
+# instead of those above.  If you wish to allow use of your 
+# version of this file only under the terms of the GPL and not to
+# allow others to use your version of this file under the MPL,
+# indicate your decision by deleting the provisions above and
+# replace them with the notice and other provisions required by
+# the GPL.  If you do not delete the provisions above, a recipient
+# may use your version of this file under either the MPL or the
+# GPL.
+# 
+
+#! gmake
+
+MOD_DEPTH	= ..
+
+include $(MOD_DEPTH)/config/config.mk
+
+publish:
+ifeq ($(OS_TARGET),Linux)
+	rm -rf $(OBJDIR)
+	cp -r linux $(OBJDIR)
+	$(MAKE) -C $(OBJDIR) publish
+endif
+ifeq ($(OS_TARGET),SunOS)
+	rm -rf $(OBJDIR)
+	cp -r solaris $(OBJDIR)
+	$(MAKE) -C $(OBJDIR) publish
+endif
+
+clean::
+	rm -rf $(OBJDIR)
+
+include $(MOD_DEPTH)/config/rules.mk
new file mode 100644
--- /dev/null
+++ b/pkg/linux/Makefile
@@ -0,0 +1,37 @@
+#
+# Copyright 2002 Sun Microsystems, Inc.  All rights reserved.
+# Use is subject to license terms.
+#
+#ident  "$Id$"
+#
+
+MOD_DEPTH = ../..
+
+NAME	= sun-nspr
+RELEASE	= 1
+VERSION	= `grep PR_VERSION \
+	    $(MOD_DEPTH)/../dist/$(OBJDIR_NAME)/include/prinit.h \
+		| sed -e 's/"$$//' -e 's/.*"//' -e 's/ .*//'`
+
+include $(MOD_DEPTH)/config/config.mk
+
+publish:
+	$(MAKE) clean
+	mkdir -p SOURCES SRPMS RPMS BUILD
+	(cd $(MOD_DEPTH)/../dist/$(OBJDIR_NAME)/lib && tar cphf - .) \
+	 | (mkdir -p usr/lib/mps && cd usr/lib/mps && tar xvfBp -)
+	(cd $(MOD_DEPTH)/../dist/$(OBJDIR_NAME)/include && tar cphf - .) \
+	 | (mkdir -p usr/include/mps/nspr && cd usr/include/mps/nspr && tar xvfBp -)
+	tar czvf SOURCES/$(NAME)-$(VERSION).tar.gz usr
+	echo "%define name $(NAME)" >$(NAME).spec
+	echo "%define version $(VERSION)" >>$(NAME).spec
+	echo "%define release $(RELEASE)" >>$(NAME).spec
+	echo "%define buildroot `pwd`/$(NAME)-root" >>$(NAME).spec
+	echo "%define _topdir `pwd`" >>$(NAME).spec
+	cat ../linux/$(NAME).spec >>$(NAME).spec
+	rpm -ba $(NAME).spec
+
+clean:
+	rm -rf SOURCES SRPMS RPMS BUILD
+	rm -rf RPMS SRPMS usr
+	rm -f $(NAME)-$(VERSION).tar.gz