1
0

Makefile 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. #
  2. # Copyright (C) 2006-2016 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:=privoxy
  9. PKG_VERSION:=3.0.26
  10. PKG_RELEASE:=2
  11. PKG_SOURCE:=privoxy-$(PKG_VERSION)-stable-src.tar.gz
  12. PKG_SOURCE_URL:=@SF/ijbswa
  13. PKG_MD5SUM:=8a1c842112ccea68c19b7ceb4a0e999f
  14. PKG_BUILD_DIR:=$(BUILD_DIR)/privoxy-$(PKG_VERSION)-stable
  15. PKG_FIXUP:=autoreconf
  16. PKG_INSTALL:=1
  17. PKG_LICENSE:=GPL-2.0
  18. PKG_LICENSE_FILES:=LICENSE
  19. PKG_MAINTAINER:=Christian Schoenebeck <christian.schoenebeck@gmail.com>
  20. PKG_CONFIG_DEPENDS:= \
  21. CONFIG_IPV6 \
  22. \
  23. CONFIG_PRIVOXY_disable-pthread \
  24. CONFIG_PRIVOXY_disable-dynamic-pcre \
  25. CONFIG_PRIVOXY_disable-zlib \
  26. \
  27. CONFIG_PRIVOXY_disable-toggle \
  28. CONFIG_PRIVOXY_disable-force \
  29. CONFIG_PRIVOXY_disable-fast-redirects \
  30. CONFIG_PRIVOXY_disable-stats \
  31. CONFIG_PRIVOXY_enable-ie-images \
  32. CONFIG_PRIVOXY_disable-image-blocking \
  33. CONFIG_PRIVOXY_disable-acl-support \
  34. CONFIG_PRIVOXY_disable-trust-files \
  35. CONFIG_PRIVOXY_disable-editor \
  36. CONFIG_PRIVOXY_enable-no-gifs \
  37. CONFIG_PRIVOXY_enable-graceful-termination \
  38. CONFIG_PRIVOXY_enable-extended-host-patterns \
  39. CONFIG_PRIVOXY_enable-external-filters \
  40. CONFIG_PRIVOXY_enable-accept-filter \
  41. CONFIG_PRIVOXY_enable-strptime-sanity-checks \
  42. CONFIG_PRIVOXY_enable-compression
  43. include $(INCLUDE_DIR)/package.mk
  44. define Package/$(PKG_NAME)
  45. SECTION:=net
  46. CATEGORY:=Network
  47. SUBMENU:=Web Servers/Proxies
  48. TITLE:=Privoxy WEB Proxy
  49. URL:=http://www.privoxy.org/
  50. USERID:=privoxy=8118:privoxy=8118
  51. MENU:=1
  52. DEPENDS:=+!PRIVOXY_no_pcre:libpcre +!PRIVOXY_no_pthread:libpthread +!PRIVOXY_no_zlib:zlib
  53. endef
  54. # shown in LuCI package description
  55. define Package/$(PKG_NAME)/description
  56. $(TITLE) - Homepage: www.privoxy.org
  57. endef
  58. # shown in make menuconfig <Help>
  59. define Package/$(PKG_NAME)/config
  60. help
  61. Privoxy is a web proxy with advanced filtering capabilities for protecting
  62. privacy, modifying web page content, managing cookies, controlling access,
  63. and removing ads, banners, pop-ups and other obnoxious Internet junk.
  64. Privoxy has a very flexible configuration and can be customized to suit
  65. individual needs and tastes.
  66. Privoxy has application for both stand-alone systems and multi-user networks.
  67. Run as : $(USERID)
  68. Version: $(PKG_VERSION)-$(PKG_RELEASE)
  69. Home : $(URL)
  70. $(PKG_MAINTAINER)
  71. source "$(SOURCE)/Config.in"
  72. endef
  73. CONFIGURE_ARGS += \
  74. --sysconfdir=/etc/privoxy \
  75. $(if $(CONFIG_IPV6),,--disable-ipv6-support) \
  76. \
  77. $(if $(CONFIG_PRIVOXY_disable-pthread),--disable-pthread) \
  78. $(if $(CONFIG_PRIVOXY_disable-dynamic-pcre),--disable-dynamic-pcre) \
  79. $(if $(CONFIG_PRIVOXY_disable-zlib),--disable-zlib) \
  80. \
  81. $(if $(CONFIG_PRIVOXY_disable-toggle),--disable-toggle) \
  82. $(if $(CONFIG_PRIVOXY_disable-force),--disable-force) \
  83. $(if $(CONFIG_PRIVOXY_disable-fast-redirects),--disable-fast-redirects) \
  84. $(if $(CONFIG_PRIVOXY_disable-stats),--disable-stats) \
  85. $(if $(CONFIG_PRIVOXY_enable-ie-images),--enable-ie-images) \
  86. $(if $(CONFIG_PRIVOXY_disable-image-blocking),--disable-image-blocking) \
  87. $(if $(CONFIG_PRIVOXY_disable-acl-support),--disable-acl-support) \
  88. $(if $(CONFIG_PRIVOXY_disable-trust-files),--disable-trust-files) \
  89. $(if $(CONFIG_PRIVOXY_disable-editor),--disable-editor) \
  90. $(if $(CONFIG_PRIVOXY_enable-no-gifs),--enable-no-gifs) \
  91. $(if $(CONFIG_PRIVOXY_enable-graceful-termination),--enable-graceful-termination) \
  92. $(if $(CONFIG_PRIVOXY_enable-extended-host-patterns),--enable-extended-host-patterns) \
  93. $(if $(CONFIG_PRIVOXY_enable-external-filters),--enable-external-filters) \
  94. $(if $(CONFIG_PRIVOXY_enable-accept-filter),--enable-accept-filter) \
  95. $(if $(CONFIG_PRIVOXY_enable-strptime-sanity-checks),--enable-strptime-sanity-checks) \
  96. $(if $(CONFIG_PRIVOXY_enable-compression),--enable-compression)
  97. # needed otherwise errors during compile
  98. MAKE_FLAGS:=
  99. define Package/$(PKG_NAME)/conffiles
  100. /etc/config/privoxy
  101. /etc/privoxy/user.action
  102. /etc/privoxy/user.filter
  103. /etc/privoxy/user.trust
  104. endef
  105. define Package/$(PKG_NAME)/preinst
  106. #!/bin/sh
  107. [ -n "$${IPKG_INSTROOT}" ] && exit 0 # if run within buildroot exit
  108. # stop service if PKG_UPGRADE
  109. [ "$${PKG_UPGRADE}" = "1" ] && /etc/init.d/privoxy stop >/dev/null 2>&1
  110. exit 0 # suppress errors from stop command
  111. endef
  112. define Package/$(PKG_NAME)/install
  113. if [ -f $(PKG_INSTALL_DIR)/etc/privoxy/trust ]; then \
  114. mv -f $(PKG_INSTALL_DIR)/etc/privoxy/trust $(PKG_INSTALL_DIR)/etc/privoxy/user.trust; \
  115. fi
  116. if [ -f $(PKG_INSTALL_DIR)/etc/privoxy/config ]; then \
  117. rm -f $(PKG_INSTALL_DIR)/etc/privoxy/config; \
  118. fi
  119. $(INSTALL_DIR) \
  120. $(1)/usr/sbin\
  121. $(1)/etc/privoxy/templates
  122. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/privoxy $(1)/usr/sbin/
  123. find $(PKG_INSTALL_DIR)/etc/privoxy/templates -maxdepth 1 -type f \
  124. -exec $(INSTALL_DATA) -t $(1)/etc/privoxy/templates {} \;
  125. find $(PKG_INSTALL_DIR)/etc/privoxy -maxdepth 1 -type f \
  126. -exec install -m0664 -t $(1)/etc/privoxy {} \;
  127. $(INSTALL_DIR) \
  128. $(1)/lib/upgrade/keep.d \
  129. $(1)/etc/init.d \
  130. $(1)/etc/hotplug.d/iface \
  131. $(1)/etc/config
  132. $(INSTALL_DATA) ./files/privoxy.upgrade $(1)/lib/upgrade/keep.d/privoxy
  133. $(INSTALL_BIN) ./files/privoxy.init $(1)/etc/init.d/privoxy
  134. $(INSTALL_BIN) ./files/privoxy.hotplug $(1)/etc/hotplug.d/iface/95-privoxy
  135. $(INSTALL_CONF) ./files/privoxy.config $(1)/etc/config/privoxy
  136. endef
  137. define Package/$(PKG_NAME)/postinst
  138. #!/bin/sh
  139. grep -i privoxy $${IPKG_INSTROOT}/etc/services >/dev/null 2>&1 || \
  140. echo -e "privoxy\t8118" >> $${IPKG_INSTROOT}/etc/services
  141. endef
  142. $(eval $(call BuildPackage,$(PKG_NAME)))