04813699b328ede0228d6a4036846d5451b57963
[packages.git] / net / privoxy / Makefile
1 #
2 # Copyright (C) 2006 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 # $Id$
8
9 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=privoxy
12 PKG_VERSION:=3.0.3
13 PKG_RELEASE:=1
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-stable-src.tar.gz
16 PKG_SOURCE_URL:=@SF/ijbswa
17 PKG_MD5SUM:=b0710be8af09409bfb03f52523a17010
18 PKG_CAT:=zcat
19
20 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)-stable
21 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
22
23 include $(INCLUDE_DIR)/package.mk
24
25 define Package/privoxy
26   SECTION:=net
27   CATEGORY:=Network
28   DEPENDS:=+libpcre +libpthread
29   TITLE:=web proxy with advanced filtering capabilities
30   DESCRIPTION:=\
31         Privoxy is a web proxy with advanced filtering capabilities for \\\
32         protecting privacy, modifying web page content, managing cookies, \\\
33         controlling access, and removing ads, banners, pop-ups and other \\\
34         obnoxious Internet junk. Privoxy has a very flexible configuration \\\
35         and can be customized to suit individual needs and tastes. Privoxy \\\
36         has application for both stand-alone systems and multi-user networks.
37   URL:=http://www.privoxy.org/
38 endef
39
40 define Build/Configure
41   (cd $(PKG_BUILD_DIR); rm -rf config.{cache,status} ; \
42                 autoheader && autoconf && \
43                 $(TARGET_CONFIGURE_OPTS) \
44                 CFLAGS="$(strip $(TARGET_CFLAGS))" \
45                 CPPFLAGS="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include" \
46                 LDFLAGS="-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib" \
47                 ./configure \
48                   --target=$(GNU_TARGET_NAME) \
49                   --host=$(GNU_TARGET_NAME) \
50                   --build=$(GNU_HOST_NAME) \
51                   --program-prefix="" \
52                   --program-suffix="" \
53                   --prefix=/usr \
54                   --exec-prefix=/usr \
55                   --bindir=/usr/bin \
56                   --datadir=/usr/share \
57                   --includedir=/usr/include \
58                   --infodir=/usr/share/info \
59                   --libdir=/usr/lib \
60                   --libexecdir=/usr/lib \
61                   --localstatedir=/var \
62                   --mandir=/usr/share/man \
63                   --sbindir=/usr/sbin \
64                   --sysconfdir=/etc \
65                   $(DISABLE_NLS) \
66                   --disable-static \
67         );
68 endef
69
70 define Build/Compile    
71         $(MAKE) -C $(PKG_BUILD_DIR) \
72                 SPECIAL_CFLAGS="-pthread -L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib"
73         mkdir -p $(PKG_INSTALL_DIR)
74         $(MAKE) -C $(PKG_BUILD_DIR) \
75                 DESTDIR="$(PKG_INSTALL_DIR)" \
76                 install
77 endef
78
79 define Package/privoxy/install  
80         $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/privoxy  $(1)/etc/init.d
81         $(CP) $(PKG_INSTALL_DIR)/usr/sbin/privoxy $(1)/usr/sbin/
82         $(CP) ./files/$(PKG_NAME).config $(1)/etc/privoxy/config
83         $(CP) $(PKG_BUILD_DIR)/default.filter $(1)/etc/privoxy/
84         $(INSTALL_BIN) ./files/$(PKG_NAME).init $(1)/etc/init.d/$(PKG_NAME)
85 endef
86
87 $(eval $(call BuildPackage,privoxy))