PageRenderTime 18ms CodeModel.GetById 11ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 0ms

/security/nss/pkg/linux/Makefile

http://github.com/zpao/v8monkey
Makefile | 122 lines | 70 code | 9 blank | 43 comment | 5 complexity | 946ae4c0de4c69464ee6743309ad64a7 MD5 | raw file
  1#
  2# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
  3# Use is subject to license terms.
  4#
  5# ***** BEGIN LICENSE BLOCK *****
  6# Version: MPL 1.1/GPL 2.0/LGPL 2.1
  7#
  8# The contents of this file are subject to the Mozilla Public License Version
  9# 1.1 (the "License"); you may not use this file except in compliance with
 10# the License. You may obtain a copy of the License at
 11# http://www.mozilla.org/MPL/
 12#
 13# Software distributed under the License is distributed on an "AS IS" basis,
 14# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 15# for the specific language governing rights and limitations under the
 16# License.
 17#
 18# The Original Code is the Netscape security libraries.
 19#
 20# The Initial Developer of the Original Code is
 21# Netscape Communications Corporation.
 22# Portions created by the Initial Developer are Copyright (C) 1994-2000
 23# the Initial Developer. All Rights Reserved.
 24#
 25# Contributor(s):
 26#
 27# Alternatively, the contents of this file may be used under the terms of
 28# either the GNU General Public License Version 2 or later (the "GPL"), or
 29# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
 30# in which case the provisions of the GPL or the LGPL are applicable instead
 31# of those above. If you wish to allow use of your version of this file only
 32# under the terms of either the GPL or the LGPL, and not to allow others to
 33# use your version of this file under the terms of the MPL, indicate your
 34# decision by deleting the provisions above and replace them with the notice
 35# and other provisions required by the GPL or the LGPL. If you do not delete
 36# the provisions above, a recipient may use your version of this file under
 37# the terms of any one of the MPL, the GPL or the LGPL.
 38#
 39# ***** END LICENSE BLOCK *****
 40#
 41#ident	"$Id: Makefile,v 1.16 2006/12/06 21:14:54 christophe.ravel.bugs%sun.com Exp $"
 42#
 43
 44CORE_DEPTH = ../../..
 45
 46NAME        = sun-nss
 47ifndef RPM_RELEASE
 48RPM_RELEASE = 1
 49endif
 50VERSION     = `grep NSS_VERSION $(CORE_DEPTH)/../dist/public/nss/nss.h \
 51		| head -1 \
 52		| sed -e 's/[^"]*"//' -e 's/".*//' -e 's/ .*//'`
 53PWD         = `pwd`
 54BUILDROOT   = $(PWD)\/$(NAME)-root
 55
 56include $(CORE_DEPTH)/coreconf/config.mk
 57
 58# Force i386 for non 64 bit build
 59ifneq ($(USE_64),1)
 60	RPMTARGET = "--target=i386"
 61	RPMLIBDIR = lib
 62else
 63	RPMLIBDIR = lib64
 64endif
 65
 66
 67publish:
 68	$(MAKE) clean
 69	mkdir -p SOURCES SRPMS RPMS BUILD
 70	mkdir -p opt/sun/private/$(RPMLIBDIR) 
 71	find $(CORE_DEPTH)/../dist/$(OBJDIR)/lib -type l \
 72		\( -name "*.so" -o -name "*.chk" \) \
 73	-exec cp {} opt/sun/private/$(RPMLIBDIR) \;
 74	rm -f opt/sun/private/$(RPMLIBDIR)/libnspr4.so \
 75	   opt/sun/private/$(RPMLIBDIR)/libplc4.so \
 76	   opt/sun/private/$(RPMLIBDIR)/libplds4.so \
 77	   opt/sun/private/$(RPMLIBDIR)/libjss*.so
 78	mkdir -p opt/sun/private/bin
 79	(cd $(CORE_DEPTH)/../dist/$(OBJDIR)/bin && tar cphf - \
 80		certutil cmsutil crlutil modutil pk12util signtool \
 81		signver ssltap addbuiltin ) | (cd opt/sun/private/bin && tar xvfBp -)
 82	(cd $(CORE_DEPTH)/../dist/public && tar cphf - .) \
 83		| (mkdir -p opt/sun/private/include && cd opt/sun/private/include && tar xvfBp -)
 84	rm -rf opt/sun/private/include/seccmd
 85	rm -rf opt/sun/private/include/dbm
 86
 87	tar czvf $(NAME)-$(VERSION).tar.gz opt 
 88	echo "%define _topdir `pwd`" >temp.spec
 89	sed -e "s/NAME_REPLACE/$(NAME)/" \
 90		-e "s/VERSION_REPLACE/$(VERSION)/" \
 91		-e "s/RELEASE_REPLACE/$(RPM_RELEASE)/" \
 92	<$(NAME).spec >>temp.spec
 93	echo "" >>temp.spec
 94	echo "%files" >>temp.spec
 95	echo "%defattr(-,root,root)" >>temp.spec
 96	echo "%dir /opt" >>temp.spec
 97	echo "%dir /opt/sun" >>temp.spec
 98	echo "%dir /opt/sun/private" >>temp.spec
 99	echo "%dir /opt/sun/private/$(RPMLIBDIR)" >>temp.spec
100	echo "%dir /opt/sun/private/bin" >>temp.spec
101	find opt \( -name "*.so" -o -name "*.chk" -o -type f \
102		-perm u=rwx,g=rx,o=rx \) | sed -e "s-^-/-" >>temp.spec
103	echo "" >>temp.spec
104	echo "%files devel" >>temp.spec
105	echo "%defattr(-,root,root)" >>temp.spec
106	echo "%dir /opt" >>temp.spec
107	echo "%dir /opt/sun" >>temp.spec
108	echo "%dir /opt/sun/private" >>temp.spec
109	echo "%dir /opt/sun/private/include" >>temp.spec
110	echo "%dir /opt/sun/private/include/nss" >>temp.spec
111	find opt -type f \( -name "*.h" \) \
112		| sed -e "s-^-/-" >>temp.spec
113	cp $(NAME)-$(VERSION).tar.gz SOURCES
114	rpmbuild $(RPMTARGET) -bb temp.spec
115
116clean::
117	rm -rf SOURCES SRPMS RPMS BUILD
118	rm -rf opt 
119	rm -f temp.spec
120	rm -f $(NAME)-$(VERSION).tar.gz
121
122include $(CORE_DEPTH)/coreconf/rules.mk