This repository has been archived by the owner on Jan 31, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
squid.mk
100 lines (82 loc) · 3.02 KB
/
squid.mk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# squid.mk
# Jose Luis Duran June 2009
#
# Squid is a caching proxy for the Web supporting HTTP, HTTPS, FTP, and more.
# It reduces bandwidth and improves response times by caching and reusing
# frequently-requested web pages. Squid has extensive access controls and
# makes a great server accelerator.
#
# To make squid:
# $ make -f squid.mk squid-package
include rules.mk
SQUID_VERSION=2.7.STABLE9
SQUID_SITE=http://www.squid-cache.org/Versions/v2/2.7
SQUID_SOURCE=squid-$(SQUID_VERSION).tar.gz
SQUID_DIR=$(BUILD_DIR)/squid-$(SQUID_VERSION)
TARGET_DIR=$(BUILD_DIR)/tmp/squid/ipkg/squid
PKG_NAME:=squid
PKG_VERSION:=$(SQUID_VERSION)
PKG_RELEASE:=1
PKG_BUILD_DIR:=$(BUILD_DIR)/tmp/squid
STAGING_INC=$(STAGING_DIR)/usr/include
SQUID_CFLAGS=-g -mfdpic -mfast-fp -ffast-math -D__FIXED_PT__ \
-D__BLACKFIN__ -I$(STAGING_INC)
SQUID_LDFLAGS=-mfdpic
SQUID_CONFIGURE_OPTS=--host=bfin-linux-uclibc --prefix=$(STAGING_DIR) \
CFLAGS="$(SQUID_CFLAGS)" LDFLAGS="$(SQUID_LDFLAGS)"
$(DL_DIR)/$(SQUID_SOURCE):
mkdir -p dl
wget -P $(DL_DIR) $(SQUID_SITE)/$(SQUID_SOURCE)
$(SQUID_DIR)/.unpacked: $(DL_DIR)/$(SQUID_SOURCE)
tar -xvzf $(DL_DIR)/$(SQUID_SOURCE)
touch $(SQUID_DIR)/.unpacked
$(SQUID_DIR)/.configured: $(SQUID_DIR)/.unpacked
cd $(SQUID_DIR); ./configure $(SQUID_CONFIGURE_OPTS)
touch $(SQUID_DIR)/.configured
squid: $(SQUID_DIR)/.configured
cd $(SQUID_DIR); make
make -C $(SQUID_DIR) CC=bfin-linux-uclibc-gcc \
COPTS='' \
BINDIR=/bin DESTDIR=$(TARGET_DIR) install
#mkdir -p $(TARGET_DIR)/var/lib/misc
#mkdir -p $(TARGET_DIR)/etc/init.d
#rm -rf $(TARGET_DIR)/usr
#cp -f $(SQUID_DIR)/squid.conf.example $(TARGET_DIR)/etc/squid.conf
#cp files/squid.init $(TARGET_DIR)/etc/init.d/squid
#chmod u+x $(TARGET_DIR)/etc/init.d/squid
touch $(PKG_BUILD_DIR)/.built
all: squid
squid-dirclean:
rm -rf $(SQUID_DIR)
rm -rf $(TOPDIR)/tmp/$(PKG_NAME)
#--------------------------------------------------------------------------
# CREATING PACKAGE
#--------------------------------------------------------------------------
define Package/$(PKG_NAME)
SECTION:=net
CATEGORY:=Network
TITLE:=Dnsmasq
DESCRIPTION:=\
Dnsmasq is a lightweight, easy to configure DNS forwarder and \\\
DHCP server. It is designed to provide DNS, and optionally DHCP, \\\
to a small network. It can serve the names of local machines \\\
which are not in the global DNS. The DHCP server integrates with \\\
the DNS server and allows machines with DHCP-allocated addresses \\\
to appear in the DNS with names configured either in each host \\\
or in a central configuration file. Dnsmasq supports static and \\\
dynamic DHCP leases and BOOTP/TFTP/PXE for network booting of \\\
diskless machines.
URL:=http://thekelleys.org.uk/squid/doc.html
endef
# post installation
define Package/$(PKG_NAME)/postinst
#!/bin/sh
/etc/init.d/squid enable
endef
# pre-remove
define Package/$(PKG_NAME)/prerm
#!/bin/sh
/etc/init.d/squid disable
endef
$(eval $(call BuildPackage,$(PKG_NAME)))
squid-package: squid $(PACKAGE_DIR)/$(PKG_NAME)_$(VERSION)_$(PKGARCH).ipk