2 # Copyright 2005 Sun Microsystems, Inc. All rights reserved.
3 # Use is subject to license terms.
5 # ***** BEGIN LICENSE BLOCK *****
6 # Version: MPL 1.1/GPL 2.0/LGPL 2.1
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/
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
18 # The Original Code is the Netscape security libraries.
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.
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.
39 # ***** END LICENSE BLOCK *****
41 #ident "$Id: Makefile,v 1.16 2006/12/06 21:14:54 christophe.ravel.bugs%sun.com Exp $"
50 VERSION
= `grep NSS_VERSION $(CORE_DEPTH)/../dist/public/nss/nss.h \
52 | sed -e 's/[^"]*"//' -e 's/".*//' -e 's/ .*//'`
54 BUILDROOT
= $(PWD
)\
/$(NAME
)-root
56 include $(CORE_DEPTH
)/coreconf
/config.mk
58 # Force i386 for non 64 bit build
60 RPMTARGET
= "--target=i386"
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
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
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
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
117 rm -rf SOURCES SRPMS RPMS BUILD
120 rm -f
$(NAME
)-$(VERSION
).
tar.gz
122 include $(CORE_DEPTH
)/coreconf
/rules.mk