You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

154 lines
4.7 KiB

  1. #
  2. # Copyright (C) 2006-2015 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:=squid
  9. PKG_VERSION:=4.17
  10. PKG_RELEASE:=$(AUTORELEASE)
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
  12. PKG_SOURCE_URL:=http://www2.pl.squid-cache.org/Versions/v4/ \
  13. http://www.squid-cache.org/Versions/v4/
  14. PKG_HASH:=cb928ac08c7c86b151b1c8f827abe1a84d83181a2a86e0d512286163e1e31418
  15. PKG_MAINTAINER:=Marko Ratkaj <markoratkaj@gmail.com>
  16. PKG_LICENSE:=GPL-2.0-or-later
  17. PKG_CPE_ID:=cpe:/a:squid-cache:squid
  18. PKG_FIXUP:=autoreconf
  19. PKG_INSTALL:=1
  20. PKG_BUILD_PARALLEL:=1
  21. include $(INCLUDE_DIR)/package.mk
  22. define Package/squid/Default
  23. SECTION:=net
  24. CATEGORY:=Network
  25. SUBMENU:=Web Servers/Proxies
  26. URL:=http://www.squid-cache.org/
  27. endef
  28. define Package/squid
  29. $(call Package/squid/Default)
  30. MENU:=1
  31. DEPENDS:=+libpthread +librt +libltdl +libstdcpp +libatomic +USE_GLIBC:libbsd
  32. DEPENDS+= +SQUID_use-gnutls:libgnutls +SQUID_use-openssl:libopenssl
  33. DEPENDS+= +SQUID_with-libcap:libcap
  34. DEPENDS+= +SQUID_with-nettle:libnettle
  35. DEPENDS+= +SQUID_with-expat:libexpat
  36. DEPENDS+= +SQUID_with-libxml2:libxml2
  37. USERID:=squid=137:squid=137
  38. TITLE:=full-featured Web proxy cache
  39. endef
  40. define Package/squid/description
  41. Squid is a caching proxy for the Web supporting HTTP, HTTPS, FTP, and more.
  42. It reduces bandwidth and improves response times by caching and reusing
  43. frequently-requested web pages.
  44. endef
  45. define Package/squid/config
  46. source "$(SOURCE)/Config.in"
  47. endef
  48. define Package/squid/conffiles
  49. /etc/config/squid
  50. /etc/squid/squid.conf
  51. endef
  52. define Package/squid-mod-cachemgr
  53. $(call Package/squid/Default)
  54. DEPENDS:=squid
  55. TITLE:=Web based proxy manager and reporting tool
  56. endef
  57. CONFIGURE_ARGS += \
  58. BUILDCXX=$(HOSTCXX_NOCACHE) \
  59. --config-cache \
  60. --datadir=/usr/share/squid \
  61. --libexecdir=/usr/lib/squid \
  62. --sysconfdir=/etc/squid \
  63. --enable-shared \
  64. --disable-static \
  65. --enable-delay-pools \
  66. --enable-kill-parent-hack \
  67. --enable-ssl \
  68. --enable-cache-digests \
  69. --enable-linux-netfilter \
  70. --disable-unlinkd \
  71. --enable-x-accelerator-vary \
  72. --disable-translation \
  73. --disable-auto-locale \
  74. --with-dl \
  75. --with-pthreads \
  76. --enable-epoll \
  77. --with-maxfd=2048 \
  78. --disable-ecap \
  79. --disable-external-acl-helpers \
  80. --disable-arch-native \
  81. --with-krb5-config=no \
  82. --without-mit-krb5 \
  83. --without-netfilter-conntrack \
  84. --disable-ident-lookups \
  85. $(if $(CONFIG_SQUID_auth-basic),--enable,--disable)-auth-basic \
  86. $(if $(CONFIG_SQUID_auth-digest),--enable,--disable)-auth-digest \
  87. $(if $(CONFIG_SQUID_auth-ntlm),--enable,--disable)-auth-ntlm \
  88. $(if $(CONFIG_SQUID_auth-negotiate),--enable,--disable)-auth-negotiate \
  89. $(if $(CONFIG_SQUID_enable-ipv6),--enable,--disable)-dlmalloc \
  90. $(if $(CONFIG_SQUID_enable-ipv6),--enable,--disable)-ipv6 \
  91. $(if $(CONFIG_SQUID_enable-ssl-crtd),--enable-ssl-crtd) \
  92. $(if $(CONFIG_SQUID_use-gnutls),--with,--without)-gnutls \
  93. $(if $(CONFIG_SQUID_use-gnutls),--without-openssl) \
  94. $(if $(CONFIG_SQUID_use-gnutls),,--with-openssl="$(STAGING_DIR)/usr") \
  95. $(if $(CONFIG_SQUID_enable-icmp),--enable,--disable)-icmp \
  96. $(if $(CONFIG_SQUID_enable-icap-client),--enable,--disable)-icap-client \
  97. $(if $(CONFIG_SQUID_enable-snmp),--enable,--disable)-snmp \
  98. $(if $(CONFIG_SQUID_with-libcap),--with,--without)-libcap \
  99. $(if $(CONFIG_SQUID_with-nettle),--with,--without)-nettle \
  100. $(if $(CONFIG_SQUID_with-expat),--with,--without)-expat \
  101. $(if $(CONFIG_SQUID_with-libxml2),--with,--without)-libxml2
  102. CONFIGURE_VARS += \
  103. ac_cv_header_linux_netfilter_ipv4_h=yes \
  104. ac_cv_epoll_works=yes
  105. TARGET_CFLAGS += -Wno-error
  106. TARGET_LDFLAGS += -latomic
  107. define Package/squid/install
  108. $(INSTALL_DIR) $(1)/usr/sbin
  109. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/squid $(1)/usr/sbin/
  110. $(INSTALL_DIR) $(1)/usr/lib/squid
  111. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/squid/* $(1)/usr/lib/squid/
  112. $(INSTALL_DIR) $(1)/etc/config
  113. $(INSTALL_CONF) ./files/squid.config $(1)/etc/config/squid
  114. $(INSTALL_DIR) $(1)/etc/squid
  115. $(CP) $(PKG_INSTALL_DIR)/etc/squid/* $(1)/etc/squid/
  116. $(INSTALL_CONF) ./files/squid.conf $(1)/etc/squid/
  117. $(INSTALL_DIR) $(1)/etc/init.d/
  118. $(INSTALL_BIN) ./files/squid.init $(1)/etc/init.d/squid
  119. $(INSTALL_DIR) $(1)/usr/share/squid/icons/
  120. $(CP) $(PKG_INSTALL_DIR)/usr/share/squid/icons/* $(1)/usr/share/squid/icons/
  121. $(CP) $(PKG_INSTALL_DIR)/usr/share/squid/mib.txt $(1)/usr/share/squid/
  122. $(INSTALL_DIR) $(1)/usr/share/squid/errors/templates/
  123. $(CP) $(PKG_INSTALL_DIR)/usr/share/squid/errors/templates/* $(1)/usr/share/squid/errors/templates/
  124. endef
  125. define Package/squid-mod-cachemgr/install
  126. $(INSTALL_DIR) $(1)/www/cgi-bin/
  127. $(CP) $(PKG_INSTALL_DIR)/usr/lib/squid/cachemgr.cgi $(1)/www/cgi-bin/
  128. endef
  129. $(eval $(call BuildPackage,squid))
  130. $(eval $(call BuildPackage,squid-mod-cachemgr))