Makefile 2.8 KB

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