Bug 189501: added support for building Linux RPMs. The patch and new files
authorwtc%netscape.com
Tue, 04 Feb 2003 01:45:28 +0000
changeset 2681 7374b0c6966612590c28feda2a193b75d6c3ff70
parent 2678 9ef6a5056a8763550a72ea4b9d2da6127032b91e
child 2685 ec4d363c68099dd5f6cdd9e7e8cfd06aa6f93ba7
push idunknown
push userunknown
push dateunknown
bugs189501
Bug 189501: added support for building Linux RPMs. The patch and new files are contributed by Kirk Erickson <kirk.erickson@sun.com>. Modified Files: Makefile.in configure configure.in Added Files: pkg/Makefile.in pkg/linux/Makefile.in pkg/linux/sun-nspr.spec
Makefile.in
configure
configure.in
pkg/Makefile.in
pkg/linux/Makefile.in
pkg/linux/sun-nspr.spec
--- a/Makefile.in
+++ b/Makefile.in
@@ -137,14 +137,14 @@ endif
 	chmod 664 $(MDIST)/$(MOD_NAME)/$(BUILD_NUMBER)/imports.df; \
 	cd $(OBJDIR_NAME); \
 	cp -f mdbinary.jar $(MDIST)/$(MOD_NAME)/$(BUILD_NUMBER)/$(RELEASE_OBJDIR_NAME); \
 	chmod 664 $(MDIST)/$(MOD_NAME)/$(BUILD_NUMBER)/$(RELEASE_OBJDIR_NAME)/mdbinary.jar; \
 	cd include; \
 	cp -f mdheader.jar $(MDIST)/$(MOD_NAME)/$(BUILD_NUMBER)/$(RELEASE_OBJDIR_NAME); \
 	chmod 664 $(MDIST)/$(MOD_NAME)/$(BUILD_NUMBER)/$(RELEASE_OBJDIR_NAME)/mdheader.jar
 
-solarispkg:
-	@echo Making Solaris packages.
-	$(MAKE) -C pkg/solaris publish
+package:
+	@echo "cd pkg; $(MAKE) publish"
+	$(MAKE) -C pkg publish
 
 depend:
 	@echo "NSPR20 has no dependencies.  Skipped."
--- a/configure
+++ b/configure
@@ -5582,16 +5582,18 @@ config/nsprincl.mk
 config/nsprincl.sh
 config/nspr-config
 lib/Makefile 
 lib/ds/Makefile 
 lib/libc/Makefile 
 lib/libc/include/Makefile 
 lib/libc/src/Makefile 
 lib/tests/Makefile
+pkg/Makefile
+pkg/linux/Makefile
 pkg/solaris/Makefile
 pkg/solaris/SUNWpr/Makefile
 pkg/solaris/SUNWprx/Makefile
 pr/Makefile 
 pr/include/Makefile 
 pr/include/md/Makefile 
 pr/include/obsolete/Makefile 
 pr/include/private/Makefile 
@@ -5616,20 +5618,16 @@ elif test -n "$USE_PTHREADS"; then
 elif test -n "$USE_BTHREADS"; then
     MAKEFILES="$MAKEFILES pr/src/bthreads/Makefile"
 fi
 
 if test -n "$USE_CPLUS"; then
     MAKEFILES="$MAKEFILES pr/src/cplus/Makefile pr/src/cplus/tests/Makefile"
 fi
 
-if test ! -d pkg; then
-    mkdir pkg
-fi
-
 trap '' 1 2 15
 cat > confcache <<\EOF
 # This file is a shell script that caches the results of configure
 # tests run on this system so they can be shared between configure
 # scripts and configure runs.  It is not useful on other systems.
 # If it contains results you don't want to keep, you may remove or edit it.
 #
 # By default, configure uses ./config.cache as the cache file,
--- a/configure.in
+++ b/configure.in
@@ -2436,16 +2436,18 @@ config/nsprincl.mk
 config/nsprincl.sh
 config/nspr-config
 lib/Makefile 
 lib/ds/Makefile 
 lib/libc/Makefile 
 lib/libc/include/Makefile 
 lib/libc/src/Makefile 
 lib/tests/Makefile
+pkg/Makefile
+pkg/linux/Makefile
 pkg/solaris/Makefile
 pkg/solaris/SUNWpr/Makefile
 pkg/solaris/SUNWprx/Makefile
 pr/Makefile 
 pr/include/Makefile 
 pr/include/md/Makefile 
 pr/include/obsolete/Makefile 
 pr/include/private/Makefile 
@@ -2473,15 +2475,9 @@ elif test -n "$USE_PTHREADS"; then
 elif test -n "$USE_BTHREADS"; then
     MAKEFILES="$MAKEFILES pr/src/bthreads/Makefile"
 fi
 
 if test -n "$USE_CPLUS"; then
     MAKEFILES="$MAKEFILES pr/src/cplus/Makefile pr/src/cplus/tests/Makefile"
 fi
 
-dnl There is no pkg/Makefile.in, so AC_OUTPUT won't create the pkg directory
-dnl for us.
-if test ! -d pkg; then
-    mkdir pkg
-fi
-
 AC_OUTPUT([$MAKEFILES], [chmod +x config/nspr-config])
new file mode 100644
--- /dev/null
+++ b/pkg/Makefile.in
@@ -0,0 +1,54 @@
+# 
+# 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	= ..
+topsrcdir	= @top_srcdir@
+srcdir		= @srcdir@
+VPATH		= @srcdir@
+
+include $(MOD_DEPTH)/config/autoconf.mk
+
+DIRS = 
+ifeq ($(OS_TARGET),Linux)
+DIRS = linux
+endif
+ifeq ($(OS_TARGET),SunOS)
+DIRS = solaris
+endif
+
+publish::
+	+$(LOOP_OVER_DIRS)
+
+include $(topsrcdir)/config/rules.mk
new file mode 100644
--- /dev/null
+++ b/pkg/linux/Makefile.in
@@ -0,0 +1,46 @@
+#
+# Copyright 2002 Sun Microsystems, Inc.  All rights reserved.
+# Use is subject to license terms.
+#
+#ident	"$Id$"
+#
+
+MOD_DEPTH = ../..
+topsrcdir   = @top_srcdir@
+srcdir	    = @srcdir@
+VPATH	    = @srcdir@
+
+NAME        = sun-nspr
+RELEASE     = 1
+VERSION     = $(MOD_MAJOR_VERSION).$(MOD_MINOR_VERSION).$(MOD_REVISION_VERSION)
+SOURCE      = $(NAME)-$(VERSION).tar.gz
+RPM         = $(NAME)-$(VERSION)-$(RELEASE).i386.rpm
+SRPM        = $(NAME)-$(VERSION)-$(RELEASE).src.rpm
+TOPDIR      = /usr/src/redhat
+
+include $(MOD_DEPTH)/config/autoconf.mk
+
+all::
+publish:
+	$(MAKE) clean
+	mkdir -p usr/lib/mps
+	cp -L $(MOD_DEPTH)/dist/lib/* usr/lib/mps
+	mkdir -p usr/include/mps
+	cp -Lr $(MOD_DEPTH)/dist/include/* usr/include/mps
+	tar czvf $(SOURCE) usr
+	echo "%define name $(NAME)" >$(NAME).spec
+	echo "%define version $(VERSION)" >>$(NAME).spec
+	echo "%define release $(RELEASE)" >>$(NAME).spec
+
+	cat $(srcdir)/$(NAME).spec >>$(NAME).spec
+	cp $(SOURCE) $(TOPDIR)/SOURCES
+	rpm -ba $(NAME).spec
+	if [ ! -d RPMS ] ; then mkdir -p RPMS ; fi
+	if [ ! -d SRPMS ] ; then mkdir -p SRPMS ; fi
+	cp -v $(TOPDIR)/RPMS/i386/$(NAME)-* RPMS
+	cp -v $(TOPDIR)/SRPMS/$(NAME)-* SRPMS
+
+clean:
+	rm -rf $(TOPDIR)/BUILD/$(NAME)
+	rm -rf RPMS SRPMS usr
+	rm -f $(SOURCE)
new file mode 100644
--- /dev/null
+++ b/pkg/linux/sun-nspr.spec
@@ -0,0 +1,119 @@
+Summary: Netscape Portable Runtime
+Name: %{name}
+Vendor: Sun Microsystems
+Version: %{version}
+Release: %{release}
+Copyright: MPL
+Group: System Environment/Base
+Source: %{name}-%{version}.tar.gz
+ExclusiveOS: Linux
+BuildRoot: /var/tmp/%{name}-root
+        
+%description
+
+NSPR provides platform independence for non-GUI operating system
+facilities. These facilities include threads, thread synchronization,
+normal file and network I/O, interval timing and calendar time, basic
+memory management (malloc and free) and shared library linking. 
+
+See: http://www.mozilla.org/projects/nspr/about-nspr.html
+
+%package devel
+Summary: Development Libraries for the Netscape Portable Runtime
+Group: Development/Libraries
+Requires: %{name} = %{version}-%{release}
+
+%description devel
+Header files for doing development with the Netscape Portable Runtime.
+
+%prep
+%setup -c
+
+%build
+
+%install
+rm -rf $RPM_BUILD_ROOT
+mkdir $RPM_BUILD_ROOT
+cd $RPM_BUILD_ROOT
+tar xvzf $RPM_SOURCE_DIR/%{name}-%{version}.tar.gz
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(-,root,root)
+%dir /usr
+%dir /usr/lib
+%dir /usr/lib/mps
+/usr/lib/mps/libnspr4.so
+/usr/lib/mps/libplc4.so
+/usr/lib/mps/libplds4.so
+
+%files devel
+%defattr(-,root,root)
+/usr/lib/mps/libnspr4.a
+/usr/lib/mps/libplc4.a
+/usr/lib/mps/libplds4.a
+%dir /usr
+%dir /usr/include
+%dir /usr/include/mps
+/usr/include/mps/nspr/private/pprio.h
+/usr/include/mps/nspr/private/pprthred.h
+/usr/include/mps/nspr/private/prpriv.h
+/usr/include/mps/nspr/prcpucfg.h
+/usr/include/mps/nspr/obsolete/pralarm.h
+/usr/include/mps/nspr/obsolete/probslet.h
+/usr/include/mps/nspr/obsolete/protypes.h
+/usr/include/mps/nspr/obsolete/prsem.h
+/usr/include/mps/nspr/nspr.h
+/usr/include/mps/nspr/pratom.h
+/usr/include/mps/nspr/prbit.h
+/usr/include/mps/nspr/prclist.h
+/usr/include/mps/nspr/prcmon.h
+/usr/include/mps/nspr/prcountr.h
+/usr/include/mps/nspr/prcvar.h
+/usr/include/mps/nspr/prdtoa.h
+/usr/include/mps/nspr/prenv.h
+/usr/include/mps/nspr/prerr.h
+/usr/include/mps/nspr/prerror.h
+/usr/include/mps/nspr/prinet.h
+/usr/include/mps/nspr/prinit.h
+/usr/include/mps/nspr/prinrval.h
+/usr/include/mps/nspr/prio.h
+/usr/include/mps/nspr/pripcsem.h
+/usr/include/mps/nspr/prlink.h
+/usr/include/mps/nspr/prlock.h
+/usr/include/mps/nspr/prlog.h
+/usr/include/mps/nspr/prlong.h
+/usr/include/mps/nspr/prmem.h
+/usr/include/mps/nspr/prmon.h
+/usr/include/mps/nspr/prmwait.h
+/usr/include/mps/nspr/prnetdb.h
+/usr/include/mps/nspr/prolock.h
+/usr/include/mps/nspr/prpdce.h
+/usr/include/mps/nspr/prprf.h
+/usr/include/mps/nspr/prproces.h
+/usr/include/mps/nspr/prrng.h
+/usr/include/mps/nspr/prrwlock.h
+/usr/include/mps/nspr/prshma.h
+/usr/include/mps/nspr/prshm.h
+/usr/include/mps/nspr/prsystem.h
+/usr/include/mps/nspr/prthread.h
+/usr/include/mps/nspr/prtime.h
+/usr/include/mps/nspr/prtpool.h
+/usr/include/mps/nspr/prtrace.h
+/usr/include/mps/nspr/prtypes.h
+/usr/include/mps/nspr/prvrsion.h
+/usr/include/mps/nspr/prwin16.h
+/usr/include/mps/nspr/plarenas.h
+/usr/include/mps/nspr/plarena.h
+/usr/include/mps/nspr/plhash.h
+/usr/include/mps/nspr/plbase64.h
+/usr/include/mps/nspr/plerror.h
+/usr/include/mps/nspr/plgetopt.h
+/usr/include/mps/nspr/plresolv.h
+/usr/include/mps/nspr/plstr.h
+
+%changelog
+* Sat Jan 18 2003 Kirk Erickson <kirk.erickson@sun.com>
+- http://bugzilla.mozilla.org/show_bug.cgi?id=189501