[backfire] packages/sudo: merge r29143 (closes: #10289)
authorNicolas Thill <nico@openwrt.org>
Tue, 15 Nov 2011 01:53:51 +0000 (01:53 +0000)
committerNicolas Thill <nico@openwrt.org>
Tue, 15 Nov 2011 01:53:51 +0000 (01:53 +0000)
SVN-Revision: 29144

admin/sudo/Makefile
admin/sudo/files/sudo.init [new file with mode: 0755]

index b5038af..9e9aa1a 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2006-2010 OpenWrt.org
+# Copyright (C) 2006-2011 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=sudo
-PKG_VERSION:=1.7.4p4
+PKG_VERSION:=1.7.8p1
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.sudo.ws/sudo/dist
-PKG_MD5SUM:=55d9906535d70a1de347cd3d3550ee87
+PKG_MD5SUM:=5552b9aabc43e34bbc8dc557c098a933
 
 PKG_INSTALL:=1
 
@@ -60,6 +60,17 @@ define Package/sudo/install
        $(INSTALL_DIR) $(1)/etc/sudoers.d
        $(INSTALL_DIR) $(1)/usr/lib
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/sudo_noexec.so $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/etc/init.d
+       $(INSTALL_BIN) ./files/sudo.init $(1)/etc/init.d/sudo
+endef
+
+define Package/sudo/postinst
+#!/bin/sh
+
+[ -n "$$IPKG_INSTROOT" ] || {
+       /etc/init.d/sudo enable
+       /etc/init.d/sudo start
+}
 endef
 
 $(eval $(call BuildPackage,sudo))
diff --git a/admin/sudo/files/sudo.init b/admin/sudo/files/sudo.init
new file mode 100755 (executable)
index 0000000..9df2737
--- /dev/null
@@ -0,0 +1,11 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2011 OpenWrt.org
+
+START=99
+
+start() {
+       [ -d /var/lib/sudo ] || {
+               mkdir -m 0755 -p /var/lib/sudo
+               chmod 0700 /var/lib/sudo
+       }
+}