security/nss/pkg/linux/Makefile

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/security/nss/pkg/linux/Makefile	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,88 @@
     1.4 +#
     1.5 +# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
     1.6 +# Use is subject to license terms.
     1.7 +#
     1.8 +# This Source Code Form is subject to the terms of the Mozilla Public
     1.9 +# License, v. 2.0. If a copy of the MPL was not distributed with this
    1.10 +# file, You can obtain one at http://mozilla.org/MPL/2.0/.
    1.11 +#
    1.12 +
    1.13 +CORE_DEPTH = ../../..
    1.14 +
    1.15 +NAME        = sun-nss
    1.16 +ifndef RPM_RELEASE
    1.17 +RPM_RELEASE = 1
    1.18 +endif
    1.19 +VERSION     = `grep NSS_VERSION $(CORE_DEPTH)/../dist/public/nss/nss.h \
    1.20 +		| head -1 \
    1.21 +		| sed -e 's/[^"]*"//' -e 's/".*//' -e 's/ .*//'`
    1.22 +PWD         = `pwd`
    1.23 +BUILDROOT   = $(PWD)\/$(NAME)-root
    1.24 +
    1.25 +include $(CORE_DEPTH)/coreconf/config.mk
    1.26 +
    1.27 +# Force i386 for non 64 bit build
    1.28 +ifneq ($(USE_64),1)
    1.29 +	RPMTARGET = "--target=i386"
    1.30 +	RPMLIBDIR = lib
    1.31 +else
    1.32 +	RPMLIBDIR = lib64
    1.33 +endif
    1.34 +
    1.35 +
    1.36 +publish:
    1.37 +	$(MAKE) clean
    1.38 +	mkdir -p SOURCES SRPMS RPMS BUILD
    1.39 +	mkdir -p opt/sun/private/$(RPMLIBDIR) 
    1.40 +	find $(CORE_DEPTH)/../dist/$(OBJDIR)/lib -type l \
    1.41 +		\( -name "*.so" -o -name "*.chk" \) \
    1.42 +	-exec cp {} opt/sun/private/$(RPMLIBDIR) \;
    1.43 +	rm -f opt/sun/private/$(RPMLIBDIR)/libnspr4.so \
    1.44 +	   opt/sun/private/$(RPMLIBDIR)/libplc4.so \
    1.45 +	   opt/sun/private/$(RPMLIBDIR)/libplds4.so \
    1.46 +	   opt/sun/private/$(RPMLIBDIR)/libjss*.so
    1.47 +	mkdir -p opt/sun/private/bin
    1.48 +	(cd $(CORE_DEPTH)/../dist/$(OBJDIR)/bin && tar cphf - \
    1.49 +		certutil cmsutil crlutil modutil pk12util signtool \
    1.50 +		signver ssltap addbuiltin ) | (cd opt/sun/private/bin && tar xvfBp -)
    1.51 +	(cd $(CORE_DEPTH)/../dist/public && tar cphf - .) \
    1.52 +		| (mkdir -p opt/sun/private/include && cd opt/sun/private/include && tar xvfBp -)
    1.53 +	rm -rf opt/sun/private/include/seccmd
    1.54 +	rm -rf opt/sun/private/include/dbm
    1.55 +
    1.56 +	tar czvf $(NAME)-$(VERSION).tar.gz opt 
    1.57 +	echo "%define _topdir `pwd`" >temp.spec
    1.58 +	sed -e "s/NAME_REPLACE/$(NAME)/" \
    1.59 +		-e "s/VERSION_REPLACE/$(VERSION)/" \
    1.60 +		-e "s/RELEASE_REPLACE/$(RPM_RELEASE)/" \
    1.61 +	<$(NAME).spec >>temp.spec
    1.62 +	echo "" >>temp.spec
    1.63 +	echo "%files" >>temp.spec
    1.64 +	echo "%defattr(-,root,root)" >>temp.spec
    1.65 +	echo "%dir /opt" >>temp.spec
    1.66 +	echo "%dir /opt/sun" >>temp.spec
    1.67 +	echo "%dir /opt/sun/private" >>temp.spec
    1.68 +	echo "%dir /opt/sun/private/$(RPMLIBDIR)" >>temp.spec
    1.69 +	echo "%dir /opt/sun/private/bin" >>temp.spec
    1.70 +	find opt \( -name "*.so" -o -name "*.chk" -o -type f \
    1.71 +		-perm u=rwx,g=rx,o=rx \) | sed -e "s-^-/-" >>temp.spec
    1.72 +	echo "" >>temp.spec
    1.73 +	echo "%files devel" >>temp.spec
    1.74 +	echo "%defattr(-,root,root)" >>temp.spec
    1.75 +	echo "%dir /opt" >>temp.spec
    1.76 +	echo "%dir /opt/sun" >>temp.spec
    1.77 +	echo "%dir /opt/sun/private" >>temp.spec
    1.78 +	echo "%dir /opt/sun/private/include" >>temp.spec
    1.79 +	echo "%dir /opt/sun/private/include/nss" >>temp.spec
    1.80 +	find opt -type f \( -name "*.h" \) \
    1.81 +		| sed -e "s-^-/-" >>temp.spec
    1.82 +	cp $(NAME)-$(VERSION).tar.gz SOURCES
    1.83 +	rpmbuild $(RPMTARGET) -bb temp.spec
    1.84 +
    1.85 +clean::
    1.86 +	rm -rf SOURCES SRPMS RPMS BUILD
    1.87 +	rm -rf opt 
    1.88 +	rm -f temp.spec
    1.89 +	rm -f $(NAME)-$(VERSION).tar.gz
    1.90 +
    1.91 +include $(CORE_DEPTH)/coreconf/rules.mk

mercurial