1
0

Makefile 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #
  2. # Copyright (C) 2006-2016 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=ca-certificates
  9. PKG_VERSION:=20161130
  10. PKG_MAINTAINER:=Christian Schoenebeck <christian.schoenebeck@gmail.com>
  11. PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).tar.xz
  12. PKG_SOURCE_URL:=http://ftp.debian.org/debian/pool/main/c/ca-certificates
  13. PKG_HASH:=04bca9e142a90a834aca0311f7ced237368d71fee7bd5c9f68ef7f4611aee471
  14. PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
  15. PKG_INSTALL:=1
  16. include $(INCLUDE_DIR)/package.mk
  17. define Package/ca-certificates
  18. SECTION:=base
  19. CATEGORY:=Base system
  20. TITLE:=System CA certificates
  21. PKGARCH:=all
  22. endef
  23. define Package/ca-bundle
  24. SECTION:=base
  25. CATEGORY:=Base system
  26. TITLE:=System CA certificates as a bundle
  27. PKGARCH:=all
  28. endef
  29. define Build/Install
  30. mkdir -p \
  31. $(PKG_INSTALL_DIR)/usr/sbin \
  32. $(PKG_INSTALL_DIR)/usr/share/ca-certificates
  33. $(call Build/Install/Default,)
  34. endef
  35. define Package/ca-certificates/install
  36. $(INSTALL_DIR) $(1)/etc/ssl/certs
  37. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/ca-certificates/*/*.crt $(1)/etc/ssl/certs/
  38. for CERTFILE in `ls -1 $(1)/etc/ssl/certs`; do \
  39. HASH=`openssl x509 -hash -noout -in $(1)/etc/ssl/certs/$$$$CERTFILE` ; \
  40. SUFFIX=0 ; \
  41. while [ -h "$(1)/etc/ssl/certs/$$$$HASH.$$$$SUFFIX" ]; do \
  42. let "SUFFIX += 1" ; \
  43. done ; \
  44. $(LN) "$$$$CERTFILE" "$(1)/etc/ssl/certs/$$$$HASH.$$$$SUFFIX" ; \
  45. done
  46. endef
  47. define Package/ca-bundle/install
  48. $(INSTALL_DIR) $(1)/etc/ssl/certs
  49. cat $(PKG_INSTALL_DIR)/usr/share/ca-certificates/*/*.crt >$(1)/etc/ssl/certs/ca-certificates.crt
  50. endef
  51. $(eval $(call BuildPackage,ca-certificates))
  52. $(eval $(call BuildPackage,ca-bundle))