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.

158 lines
4.9 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.4
  10. PKG_RELEASE:=1
  11. PKG_LICENSE:=GPL-2.0
  12. PKG_MAINTAINER:=Marko Ratkaj <marko.ratkaj@sartura.hr>
  13. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
  14. PKG_SOURCE_URL:=http://www3.us.squid-cache.org/Versions/v4/ \
  15. http://www2.pl.squid-cache.org/Versions/v4/ \
  16. http://www.squid-cache.org/Versions/v4/
  17. PKG_HASH:=4905e6da7f5574d2583ba36f398bb062a12d51e70d67035078b6e85b09e9ee82
  18. PKG_BUILD_PARALLEL:=1
  19. PKG_INSTALL:=1
  20. PKG_FIXUP:=autoreconf
  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/squid/squid.conf
  50. endef
  51. define Package/squid-mod-cachemgr
  52. $(call Package/squid/Default)
  53. DEPENDS:=squid
  54. TITLE:=Web based proxy manager and reporting tool
  55. endef
  56. CONFIGURE_ARGS += \
  57. BUILDCXX=$(HOSTCXX) \
  58. BUILDCXXFLAGS=$(if $(HOST_CXXFLAGS),$(HOST_CXXFLAGS),-O2) \
  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. define Build/Compile
  106. +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)/lib all
  107. +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
  108. DESTDIR="$(PKG_INSTALL_DIR)" \
  109. install
  110. endef
  111. define Package/squid/install
  112. $(INSTALL_DIR) $(1)/usr/sbin
  113. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/squid $(1)/usr/sbin/
  114. $(INSTALL_DIR) $(1)/usr/lib/squid
  115. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/squid/* $(1)/usr/lib/squid/
  116. $(INSTALL_DIR) $(1)/etc/config
  117. $(INSTALL_CONF) ./files/squid.config $(1)/etc/config/squid
  118. $(INSTALL_DIR) $(1)/etc/squid
  119. $(CP) $(PKG_INSTALL_DIR)/etc/squid/* $(1)/etc/squid/
  120. $(INSTALL_CONF) ./files/squid.conf $(1)/etc/squid/
  121. $(INSTALL_DIR) $(1)/etc/init.d/
  122. $(INSTALL_BIN) ./files/squid.init $(1)/etc/init.d/squid
  123. $(INSTALL_DIR) $(1)/usr/share/squid/icons/
  124. $(CP) $(PKG_INSTALL_DIR)/usr/share/squid/icons/* $(1)/usr/share/squid/icons/
  125. $(CP) $(PKG_INSTALL_DIR)/usr/share/squid/mib.txt $(1)/usr/share/squid/
  126. $(INSTALL_DIR) $(1)/usr/share/squid/errors/templates/
  127. $(CP) $(PKG_INSTALL_DIR)/usr/share/squid/errors/templates/* $(1)/usr/share/squid/errors/templates/
  128. endef
  129. define Package/squid-mod-cachemgr/install
  130. $(INSTALL_DIR) $(1)/www/cgi-bin/
  131. $(CP) $(PKG_INSTALL_DIR)/usr/lib/squid/cachemgr.cgi $(1)/www/cgi-bin/
  132. endef
  133. $(eval $(call BuildPackage,squid))
  134. $(eval $(call BuildPackage,squid-mod-cachemgr))