michael@0: # michael@0: # Copyright 2005 Sun Microsystems, Inc. All rights reserved. michael@0: # Use is subject to license terms. michael@0: # michael@0: # This Source Code Form is subject to the terms of the Mozilla Public michael@0: # License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: # file, You can obtain one at http://mozilla.org/MPL/2.0/. michael@0: # michael@0: michael@0: CORE_DEPTH = ../../.. michael@0: michael@0: NAME = sun-nss michael@0: ifndef RPM_RELEASE michael@0: RPM_RELEASE = 1 michael@0: endif michael@0: VERSION = `grep NSS_VERSION $(CORE_DEPTH)/../dist/public/nss/nss.h \ michael@0: | head -1 \ michael@0: | sed -e 's/[^"]*"//' -e 's/".*//' -e 's/ .*//'` michael@0: PWD = `pwd` michael@0: BUILDROOT = $(PWD)\/$(NAME)-root michael@0: michael@0: include $(CORE_DEPTH)/coreconf/config.mk michael@0: michael@0: # Force i386 for non 64 bit build michael@0: ifneq ($(USE_64),1) michael@0: RPMTARGET = "--target=i386" michael@0: RPMLIBDIR = lib michael@0: else michael@0: RPMLIBDIR = lib64 michael@0: endif michael@0: michael@0: michael@0: publish: michael@0: $(MAKE) clean michael@0: mkdir -p SOURCES SRPMS RPMS BUILD michael@0: mkdir -p opt/sun/private/$(RPMLIBDIR) michael@0: find $(CORE_DEPTH)/../dist/$(OBJDIR)/lib -type l \ michael@0: \( -name "*.so" -o -name "*.chk" \) \ michael@0: -exec cp {} opt/sun/private/$(RPMLIBDIR) \; michael@0: rm -f opt/sun/private/$(RPMLIBDIR)/libnspr4.so \ michael@0: opt/sun/private/$(RPMLIBDIR)/libplc4.so \ michael@0: opt/sun/private/$(RPMLIBDIR)/libplds4.so \ michael@0: opt/sun/private/$(RPMLIBDIR)/libjss*.so michael@0: mkdir -p opt/sun/private/bin michael@0: (cd $(CORE_DEPTH)/../dist/$(OBJDIR)/bin && tar cphf - \ michael@0: certutil cmsutil crlutil modutil pk12util signtool \ michael@0: signver ssltap addbuiltin ) | (cd opt/sun/private/bin && tar xvfBp -) michael@0: (cd $(CORE_DEPTH)/../dist/public && tar cphf - .) \ michael@0: | (mkdir -p opt/sun/private/include && cd opt/sun/private/include && tar xvfBp -) michael@0: rm -rf opt/sun/private/include/seccmd michael@0: rm -rf opt/sun/private/include/dbm michael@0: michael@0: tar czvf $(NAME)-$(VERSION).tar.gz opt michael@0: echo "%define _topdir `pwd`" >temp.spec michael@0: sed -e "s/NAME_REPLACE/$(NAME)/" \ michael@0: -e "s/VERSION_REPLACE/$(VERSION)/" \ michael@0: -e "s/RELEASE_REPLACE/$(RPM_RELEASE)/" \ michael@0: <$(NAME).spec >>temp.spec michael@0: echo "" >>temp.spec michael@0: echo "%files" >>temp.spec michael@0: echo "%defattr(-,root,root)" >>temp.spec michael@0: echo "%dir /opt" >>temp.spec michael@0: echo "%dir /opt/sun" >>temp.spec michael@0: echo "%dir /opt/sun/private" >>temp.spec michael@0: echo "%dir /opt/sun/private/$(RPMLIBDIR)" >>temp.spec michael@0: echo "%dir /opt/sun/private/bin" >>temp.spec michael@0: find opt \( -name "*.so" -o -name "*.chk" -o -type f \ michael@0: -perm u=rwx,g=rx,o=rx \) | sed -e "s-^-/-" >>temp.spec michael@0: echo "" >>temp.spec michael@0: echo "%files devel" >>temp.spec michael@0: echo "%defattr(-,root,root)" >>temp.spec michael@0: echo "%dir /opt" >>temp.spec michael@0: echo "%dir /opt/sun" >>temp.spec michael@0: echo "%dir /opt/sun/private" >>temp.spec michael@0: echo "%dir /opt/sun/private/include" >>temp.spec michael@0: echo "%dir /opt/sun/private/include/nss" >>temp.spec michael@0: find opt -type f \( -name "*.h" \) \ michael@0: | sed -e "s-^-/-" >>temp.spec michael@0: cp $(NAME)-$(VERSION).tar.gz SOURCES michael@0: rpmbuild $(RPMTARGET) -bb temp.spec michael@0: michael@0: clean:: michael@0: rm -rf SOURCES SRPMS RPMS BUILD michael@0: rm -rf opt michael@0: rm -f temp.spec michael@0: rm -f $(NAME)-$(VERSION).tar.gz michael@0: michael@0: include $(CORE_DEPTH)/coreconf/rules.mk