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.

162 lines
5.0 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.6
  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:=015bade5d3a4905142c4c605df5c4216471e3d8338079955e0e44b0ae0303d41
  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_BUILD_PARALLEL:=1
  20. PKG_INSTALL:=1
  21. PKG_FIXUP:=autoreconf
  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/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) \
  59. BUILDCXXFLAGS=$(if $(HOST_CXXFLAGS),$(HOST_CXXFLAGS),-O2) \
  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 Build/Compile
  109. +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)/lib all
  110. +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
  111. DESTDIR="$(PKG_INSTALL_DIR)" \
  112. install
  113. endef
  114. define Package/squid/install
  115. $(INSTALL_DIR) $(1)/usr/sbin
  116. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/squid $(1)/usr/sbin/
  117. $(INSTALL_DIR) $(1)/usr/lib/squid
  118. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/squid/* $(1)/usr/lib/squid/
  119. $(INSTALL_DIR) $(1)/etc/config
  120. $(INSTALL_CONF) ./files/squid.config $(1)/etc/config/squid
  121. $(INSTALL_DIR) $(1)/etc/squid
  122. $(CP) $(PKG_INSTALL_DIR)/etc/squid/* $(1)/etc/squid/
  123. $(INSTALL_CONF) ./files/squid.conf $(1)/etc/squid/
  124. $(INSTALL_DIR) $(1)/etc/init.d/
  125. $(INSTALL_BIN) ./files/squid.init $(1)/etc/init.d/squid
  126. $(INSTALL_DIR) $(1)/usr/share/squid/icons/
  127. $(CP) $(PKG_INSTALL_DIR)/usr/share/squid/icons/* $(1)/usr/share/squid/icons/
  128. $(CP) $(PKG_INSTALL_DIR)/usr/share/squid/mib.txt $(1)/usr/share/squid/
  129. $(INSTALL_DIR) $(1)/usr/share/squid/errors/templates/
  130. $(CP) $(PKG_INSTALL_DIR)/usr/share/squid/errors/templates/* $(1)/usr/share/squid/errors/templates/
  131. endef
  132. define Package/squid-mod-cachemgr/install
  133. $(INSTALL_DIR) $(1)/www/cgi-bin/
  134. $(CP) $(PKG_INSTALL_DIR)/usr/lib/squid/cachemgr.cgi $(1)/www/cgi-bin/
  135. endef
  136. $(eval $(call BuildPackage,squid))
  137. $(eval $(call BuildPackage,squid-mod-cachemgr))