[packages] polipo: update to v1.0.3, add config and initscript

git-svn-id: svn://svn.openwrt.org/openwrt/packages@9238 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
nico 2007-10-10 12:54:45 +00:00
parent de6c5aa11e
commit cfb5a88573
3 changed files with 80 additions and 6 deletions

View File

@ -9,12 +9,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=polipo
PKG_VERSION:=1.0.2
PKG_RELEASE:=2
PKG_VERSION:=1.0.3
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://www.pps.jussieu.fr/~jch/software/files/$(PKG_NAME)/
PKG_MD5SUM:=2d1d8af414429e5823675a781604c70a
PKG_MD5SUM:=a0b00ca01541cf77ff3d725c27cf68bb
include $(INCLUDE_DIR)/package.mk
@ -22,7 +22,7 @@ define Package/polipo
SUBMENU:=Proxy Servers
SECTION:=net
CATEGORY:=Network
TITLE:=a caching web proxy
TITLE:=A caching web proxy
URL:=http://www.pps.jussieu.fr/~jch/software/polipo/
endef
@ -41,14 +41,19 @@ define Build/Compile
endef
define Package/polipo/conffiles
/etc/polipo/polipo.conf
/etc/config/polipo
/etc/polipo/config
endef
define Package/polipo/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/polipo $(1)/usr/sbin/
$(INSTALL_DIR) $(1)/etc/polipo
$(INSTALL_CONF) $(PKG_BUILD_DIR)/config.sample $(1)/etc/polipo/polipo.conf
$(INSTALL_CONF) $(PKG_BUILD_DIR)/config.sample $(1)/etc/polipo/config
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_DATA) ./files/polipo.config $(1)/etc/config/polipo
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/polipo.init $(1)/etc/init.d/polipo
endef
$(eval $(call BuildPackage,polipo))

View File

@ -0,0 +1,5 @@
config polipo
option enabled 0
#option config_file '/etc/polipo/config'
#option pid_file '/var/run/polipo.pid'

64
net/polipo/files/polipo.init Executable file
View File

@ -0,0 +1,64 @@
#!/bin/sh /etc/rc.common
# Copyright (C) 2007 OpenWrt.org
START=99
NAME=polipo
BIN_F=/usr/sbin/$NAME
SSD=start-stop-daemon
is_enabled() {
local cfg="$1"
config_get_bool enabled "$cfg" enabled '1'
[ $enabled -ne 0 ] || {
echo "$initscript: not enabled"
return 1
}
}
get_pid_file() {
local cfg="$1"
config_get pid_file "$cfg" pid-file
[ -n "$pid_file" ] || pid_file="/var/run/$NAME.pid"
}
get_options() {
local cfg="$1"
config_get options "$cfg" options
config_get config_file "$cfg" config_file
[ -n "$config_script" ] && append options "-c $config_file"
}
start_service() {
local cfg="$1"
is_enabled "$cfg" || return
get_pid_file "$cfg"
get_options "$cfg"
$SSD -S -p $pid_file -b -m -x $BIN_F -- $options &>/dev/null
}
stop_service() {
local cfg="$1"
is_enabled "$cfg" || return
get_pid_file "$cfg"
$SSD -K -p $pid_file &>/dev/null
}
start() {
config_load $NAME
config_foreach start_service $NAME
}
stop() {
config_load $NAME
config_foreach stop_service $NAME
}