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.

163 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:=4
  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/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) \
  60. BUILDCXXFLAGS=$(if $(HOST_CXXFLAGS),$(HOST_CXXFLAGS),-O2) \
  61. --config-cache \
  62. --datadir=/usr/share/squid \
  63. --libexecdir=/usr/lib/squid \
  64. --sysconfdir=/etc/squid \
  65. --enable-shared \
  66. --disable-static \
  67. --enable-delay-pools \
  68. --enable-kill-parent-hack \
  69. --enable-ssl \
  70. --enable-cache-digests \
  71. --enable-linux-netfilter \
  72. --disable-unlinkd \
  73. --enable-x-accelerator-vary \
  74. --disable-translation \
  75. --disable-auto-locale \
  76. --with-dl \
  77. --with-pthreads \
  78. --enable-epoll \
  79. --with-maxfd=2048 \
  80. --disable-ecap \
  81. --disable-external-acl-helpers \
  82. --disable-arch-native \
  83. --with-krb5-config=no \
  84. --without-mit-krb5 \
  85. --without-netfilter-conntrack \
  86. --disable-ident-lookups \
  87. $(if $(CONFIG_SQUID_auth-basic),--enable,--disable)-auth-basic \
  88. $(if $(CONFIG_SQUID_auth-digest),--enable,--disable)-auth-digest \
  89. $(if $(CONFIG_SQUID_auth-ntlm),--enable,--disable)-auth-ntlm \
  90. $(if $(CONFIG_SQUID_auth-negotiate),--enable,--disable)-auth-negotiate \
  91. $(if $(CONFIG_SQUID_enable-ipv6),--enable,--disable)-dlmalloc \
  92. $(if $(CONFIG_SQUID_enable-ipv6),--enable,--disable)-ipv6 \
  93. $(if $(CONFIG_SQUID_enable-ssl-crtd),--enable-ssl-crtd) \
  94. $(if $(CONFIG_SQUID_use-gnutls),--with,--without)-gnutls \
  95. $(if $(CONFIG_SQUID_use-gnutls),--without-openssl) \
  96. $(if $(CONFIG_SQUID_use-gnutls),,--with-openssl="$(STAGING_DIR)/usr") \
  97. $(if $(CONFIG_SQUID_enable-icmp),--enable,--disable)-icmp \
  98. $(if $(CONFIG_SQUID_enable-icap-client),--enable,--disable)-icap-client \
  99. $(if $(CONFIG_SQUID_enable-snmp),--enable,--disable)-snmp \
  100. $(if $(CONFIG_SQUID_with-libcap),--with,--without)-libcap \
  101. $(if $(CONFIG_SQUID_with-nettle),--with,--without)-nettle \
  102. $(if $(CONFIG_SQUID_with-expat),--with,--without)-expat \
  103. $(if $(CONFIG_SQUID_with-libxml2),--with,--without)-libxml2
  104. CONFIGURE_VARS += \
  105. ac_cv_header_linux_netfilter_ipv4_h=yes \
  106. ac_cv_epoll_works=yes
  107. TARGET_CFLAGS += -Wno-error
  108. TARGET_LDFLAGS += -latomic
  109. define Build/Compile
  110. +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)/lib all
  111. +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
  112. DESTDIR="$(PKG_INSTALL_DIR)" \
  113. install
  114. endef
  115. define Package/squid/install
  116. $(INSTALL_DIR) $(1)/usr/sbin
  117. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/squid $(1)/usr/sbin/
  118. $(INSTALL_DIR) $(1)/usr/lib/squid
  119. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/squid/* $(1)/usr/lib/squid/
  120. $(INSTALL_DIR) $(1)/etc/config
  121. $(INSTALL_CONF) ./files/squid.config $(1)/etc/config/squid
  122. $(INSTALL_DIR) $(1)/etc/squid
  123. $(CP) $(PKG_INSTALL_DIR)/etc/squid/* $(1)/etc/squid/
  124. $(INSTALL_CONF) ./files/squid.conf $(1)/etc/squid/
  125. $(INSTALL_DIR) $(1)/etc/init.d/
  126. $(INSTALL_BIN) ./files/squid.init $(1)/etc/init.d/squid
  127. $(INSTALL_DIR) $(1)/usr/share/squid/icons/
  128. $(CP) $(PKG_INSTALL_DIR)/usr/share/squid/icons/* $(1)/usr/share/squid/icons/
  129. $(CP) $(PKG_INSTALL_DIR)/usr/share/squid/mib.txt $(1)/usr/share/squid/
  130. $(INSTALL_DIR) $(1)/usr/share/squid/errors/templates/
  131. $(CP) $(PKG_INSTALL_DIR)/usr/share/squid/errors/templates/* $(1)/usr/share/squid/errors/templates/
  132. endef
  133. define Package/squid-mod-cachemgr/install
  134. $(INSTALL_DIR) $(1)/www/cgi-bin/
  135. $(CP) $(PKG_INSTALL_DIR)/usr/lib/squid/cachemgr.cgi $(1)/www/cgi-bin/
  136. endef
  137. $(eval $(call BuildPackage,squid))
  138. $(eval $(call BuildPackage,squid-mod-cachemgr))