Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | # |
michael@0 | 2 | # Copyright 2005 Sun Microsystems, Inc. All rights reserved. |
michael@0 | 3 | # Use is subject to license terms. |
michael@0 | 4 | # |
michael@0 | 5 | # This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 6 | # License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 7 | # file, You can obtain one at http://mozilla.org/MPL/2.0/. |
michael@0 | 8 | # |
michael@0 | 9 | |
michael@0 | 10 | CORE_DEPTH = ../../.. |
michael@0 | 11 | |
michael@0 | 12 | NAME = sun-nss |
michael@0 | 13 | ifndef RPM_RELEASE |
michael@0 | 14 | RPM_RELEASE = 1 |
michael@0 | 15 | endif |
michael@0 | 16 | VERSION = `grep NSS_VERSION $(CORE_DEPTH)/../dist/public/nss/nss.h \ |
michael@0 | 17 | | head -1 \ |
michael@0 | 18 | | sed -e 's/[^"]*"//' -e 's/".*//' -e 's/ .*//'` |
michael@0 | 19 | PWD = `pwd` |
michael@0 | 20 | BUILDROOT = $(PWD)\/$(NAME)-root |
michael@0 | 21 | |
michael@0 | 22 | include $(CORE_DEPTH)/coreconf/config.mk |
michael@0 | 23 | |
michael@0 | 24 | # Force i386 for non 64 bit build |
michael@0 | 25 | ifneq ($(USE_64),1) |
michael@0 | 26 | RPMTARGET = "--target=i386" |
michael@0 | 27 | RPMLIBDIR = lib |
michael@0 | 28 | else |
michael@0 | 29 | RPMLIBDIR = lib64 |
michael@0 | 30 | endif |
michael@0 | 31 | |
michael@0 | 32 | |
michael@0 | 33 | publish: |
michael@0 | 34 | $(MAKE) clean |
michael@0 | 35 | mkdir -p SOURCES SRPMS RPMS BUILD |
michael@0 | 36 | mkdir -p opt/sun/private/$(RPMLIBDIR) |
michael@0 | 37 | find $(CORE_DEPTH)/../dist/$(OBJDIR)/lib -type l \ |
michael@0 | 38 | \( -name "*.so" -o -name "*.chk" \) \ |
michael@0 | 39 | -exec cp {} opt/sun/private/$(RPMLIBDIR) \; |
michael@0 | 40 | rm -f opt/sun/private/$(RPMLIBDIR)/libnspr4.so \ |
michael@0 | 41 | opt/sun/private/$(RPMLIBDIR)/libplc4.so \ |
michael@0 | 42 | opt/sun/private/$(RPMLIBDIR)/libplds4.so \ |
michael@0 | 43 | opt/sun/private/$(RPMLIBDIR)/libjss*.so |
michael@0 | 44 | mkdir -p opt/sun/private/bin |
michael@0 | 45 | (cd $(CORE_DEPTH)/../dist/$(OBJDIR)/bin && tar cphf - \ |
michael@0 | 46 | certutil cmsutil crlutil modutil pk12util signtool \ |
michael@0 | 47 | signver ssltap addbuiltin ) | (cd opt/sun/private/bin && tar xvfBp -) |
michael@0 | 48 | (cd $(CORE_DEPTH)/../dist/public && tar cphf - .) \ |
michael@0 | 49 | | (mkdir -p opt/sun/private/include && cd opt/sun/private/include && tar xvfBp -) |
michael@0 | 50 | rm -rf opt/sun/private/include/seccmd |
michael@0 | 51 | rm -rf opt/sun/private/include/dbm |
michael@0 | 52 | |
michael@0 | 53 | tar czvf $(NAME)-$(VERSION).tar.gz opt |
michael@0 | 54 | echo "%define _topdir `pwd`" >temp.spec |
michael@0 | 55 | sed -e "s/NAME_REPLACE/$(NAME)/" \ |
michael@0 | 56 | -e "s/VERSION_REPLACE/$(VERSION)/" \ |
michael@0 | 57 | -e "s/RELEASE_REPLACE/$(RPM_RELEASE)/" \ |
michael@0 | 58 | <$(NAME).spec >>temp.spec |
michael@0 | 59 | echo "" >>temp.spec |
michael@0 | 60 | echo "%files" >>temp.spec |
michael@0 | 61 | echo "%defattr(-,root,root)" >>temp.spec |
michael@0 | 62 | echo "%dir /opt" >>temp.spec |
michael@0 | 63 | echo "%dir /opt/sun" >>temp.spec |
michael@0 | 64 | echo "%dir /opt/sun/private" >>temp.spec |
michael@0 | 65 | echo "%dir /opt/sun/private/$(RPMLIBDIR)" >>temp.spec |
michael@0 | 66 | echo "%dir /opt/sun/private/bin" >>temp.spec |
michael@0 | 67 | find opt \( -name "*.so" -o -name "*.chk" -o -type f \ |
michael@0 | 68 | -perm u=rwx,g=rx,o=rx \) | sed -e "s-^-/-" >>temp.spec |
michael@0 | 69 | echo "" >>temp.spec |
michael@0 | 70 | echo "%files devel" >>temp.spec |
michael@0 | 71 | echo "%defattr(-,root,root)" >>temp.spec |
michael@0 | 72 | echo "%dir /opt" >>temp.spec |
michael@0 | 73 | echo "%dir /opt/sun" >>temp.spec |
michael@0 | 74 | echo "%dir /opt/sun/private" >>temp.spec |
michael@0 | 75 | echo "%dir /opt/sun/private/include" >>temp.spec |
michael@0 | 76 | echo "%dir /opt/sun/private/include/nss" >>temp.spec |
michael@0 | 77 | find opt -type f \( -name "*.h" \) \ |
michael@0 | 78 | | sed -e "s-^-/-" >>temp.spec |
michael@0 | 79 | cp $(NAME)-$(VERSION).tar.gz SOURCES |
michael@0 | 80 | rpmbuild $(RPMTARGET) -bb temp.spec |
michael@0 | 81 | |
michael@0 | 82 | clean:: |
michael@0 | 83 | rm -rf SOURCES SRPMS RPMS BUILD |
michael@0 | 84 | rm -rf opt |
michael@0 | 85 | rm -f temp.spec |
michael@0 | 86 | rm -f $(NAME)-$(VERSION).tar.gz |
michael@0 | 87 | |
michael@0 | 88 | include $(CORE_DEPTH)/coreconf/rules.mk |