/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. CORE_DEPTH = ../../..
  44. NAME = sun-nss
  45. ifndef RPM_RELEASE
  46. RPM_RELEASE = 1
  47. endif
  48. VERSION = `grep NSS_VERSION $(CORE_DEPTH)/../dist/public/nss/nss.h \
  49. | head -1 \
  50. | sed -e 's/[^"]*"//' -e 's/".*//' -e 's/ .*//'`
  51. PWD = `pwd`
  52. BUILDROOT = $(PWD)\/$(NAME)-root
  53. include $(CORE_DEPTH)/coreconf/config.mk
  54. # Force i386 for non 64 bit build
  55. ifneq ($(USE_64),1)
  56. RPMTARGET = "--target=i386"
  57. RPMLIBDIR = lib
  58. else
  59. RPMLIBDIR = lib64
  60. endif
  61. publish:
  62. $(MAKE) clean
  63. mkdir -p SOURCES SRPMS RPMS BUILD
  64. mkdir -p opt/sun/private/$(RPMLIBDIR)
  65. find $(CORE_DEPTH)/../dist/$(OBJDIR)/lib -type l \
  66. \( -name "*.so" -o -name "*.chk" \) \
  67. -exec cp {} opt/sun/private/$(RPMLIBDIR) \;
  68. rm -f opt/sun/private/$(RPMLIBDIR)/libnspr4.so \
  69. opt/sun/private/$(RPMLIBDIR)/libplc4.so \
  70. opt/sun/private/$(RPMLIBDIR)/libplds4.so \
  71. opt/sun/private/$(RPMLIBDIR)/libjss*.so
  72. mkdir -p opt/sun/private/bin
  73. (cd $(CORE_DEPTH)/../dist/$(OBJDIR)/bin && tar cphf - \
  74. certutil cmsutil crlutil modutil pk12util signtool \
  75. signver ssltap addbuiltin ) | (cd opt/sun/private/bin && tar xvfBp -)
  76. (cd $(CORE_DEPTH)/../dist/public && tar cphf - .) \
  77. | (mkdir -p opt/sun/private/include && cd opt/sun/private/include && tar xvfBp -)
  78. rm -rf opt/sun/private/include/seccmd
  79. rm -rf opt/sun/private/include/dbm
  80. tar czvf $(NAME)-$(VERSION).tar.gz opt
  81. echo "%define _topdir `pwd`" >temp.spec
  82. sed -e "s/NAME_REPLACE/$(NAME)/" \
  83. -e "s/VERSION_REPLACE/$(VERSION)/" \
  84. -e "s/RELEASE_REPLACE/$(RPM_RELEASE)/" \
  85. <$(NAME).spec >>temp.spec
  86. echo "" >>temp.spec
  87. echo "%files" >>temp.spec
  88. echo "%defattr(-,root,root)" >>temp.spec
  89. echo "%dir /opt" >>temp.spec
  90. echo "%dir /opt/sun" >>temp.spec
  91. echo "%dir /opt/sun/private" >>temp.spec
  92. echo "%dir /opt/sun/private/$(RPMLIBDIR)" >>temp.spec
  93. echo "%dir /opt/sun/private/bin" >>temp.spec
  94. find opt \( -name "*.so" -o -name "*.chk" -o -type f \
  95. -perm u=rwx,g=rx,o=rx \) | sed -e "s-^-/-" >>temp.spec
  96. echo "" >>temp.spec
  97. echo "%files devel" >>temp.spec
  98. echo "%defattr(-,root,root)" >>temp.spec
  99. echo "%dir /opt" >>temp.spec
  100. echo "%dir /opt/sun" >>temp.spec
  101. echo "%dir /opt/sun/private" >>temp.spec
  102. echo "%dir /opt/sun/private/include" >>temp.spec
  103. echo "%dir /opt/sun/private/include/nss" >>temp.spec
  104. find opt -type f \( -name "*.h" \) \
  105. | sed -e "s-^-/-" >>temp.spec
  106. cp $(NAME)-$(VERSION).tar.gz SOURCES
  107. rpmbuild $(RPMTARGET) -bb temp.spec
  108. clean::
  109. rm -rf SOURCES SRPMS RPMS BUILD
  110. rm -rf opt
  111. rm -f temp.spec
  112. rm -f $(NAME)-$(VERSION).tar.gz
  113. include $(CORE_DEPTH)/coreconf/rules.mk