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
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
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))
--- /dev/null
+#!/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
+}
+