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.

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