sudo: updated to 1.8.13
[feed/packages.git] / admin / sudo / Makefile
1 #
2 # Copyright (C) 2006-2015 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=sudo
11 PKG_VERSION:=1.8.13
12 PKG_RELEASE:=1
13 PKG_LICENSE:=ISC
14 PKG_LICENSE_FILES:=doc/LICENSE
15
16 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
17 PKG_SOURCE_URL:=http://www.sudo.ws/sudo/dist
18 PKG_MD5SUM:=f61577ec330ad1bd504c0e2eec6ea2d8
19
20 PKG_INSTALL:=1
21
22 PKG_BUILD_DEPENDS:=sudo/host
23
24 include $(INCLUDE_DIR)/package.mk
25
26 define Package/sudo
27 SECTION:=admin
28 CATEGORY:=Administration
29 TITLE:=Delegate authority to run commands
30 URL:=http://www.sudo.ws/
31 MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
32 endef
33
34 define Package/sudo/description
35 Sudo (su "do") allows a system administrator to delegate authority to
36 give certain users (or groups of users) the ability to run some (or
37 all) commands as root or another user while providing an audit trail of
38 the commands and their arguments.
39 endef
40
41 define Package/sudo/conffiles
42 /etc/sudoers
43 endef
44
45 CONFIGURE_ARGS+= \
46 --without-pam \
47 --disable-pam-session \
48 --with-editor=/bin/vi \
49 --without-lecture \
50 --disable-zlib \
51 --with-rundir=/var/lib/sudo \
52 --with-vardir=/var/lib/sudo
53
54 CONFIGURE_VARS+= \
55 sudo_cv_uid_t_len=10 \
56 sudo_cv_func_unsetenv_void=no
57
58 include $(INCLUDE_DIR)/host-build.mk
59
60 define Host/Compile
61 cd $(HOST_BUILD_DIR)/lib/util; \
62 $(MAKE) mksiglist; $(MAKE) mksigname
63 endef
64
65 define Host/Install
66 $(INSTALL_DIR) $(STAGING_DIR_HOST)/bin
67 $(CP) $(HOST_BUILD_DIR)/lib/util/mksig{list,name} $(STAGING_DIR_HOST)/bin/
68 endef
69
70 $(eval $(call HostBuild))
71
72 define Package/sudo/install
73 $(INSTALL_DIR) $(1)/usr/bin
74 $(CP) $(PKG_INSTALL_DIR)/usr/bin/sudo $(1)/usr/bin/
75 chmod 4755 $(1)/usr/bin/sudo
76 $(INSTALL_DIR) $(1)/usr/sbin
77 $(CP) $(PKG_INSTALL_DIR)/usr/sbin/visudo $(1)/usr/sbin/
78 $(INSTALL_DIR) $(1)/etc
79 $(CP) $(PKG_INSTALL_DIR)/etc/sudoers $(1)/etc/
80 chmod 0440 $(1)/etc/sudoers
81 $(INSTALL_DIR) $(1)/etc/sudoers.d
82 $(INSTALL_DIR) $(1)/usr/lib/sudo
83 $(CP) $(PKG_INSTALL_DIR)/usr/lib/sudo/*.so* $(1)/usr/lib/sudo/
84 $(INSTALL_DIR) $(1)/etc/init.d
85 $(INSTALL_BIN) ./files/sudo.init $(1)/etc/init.d/sudo
86 endef
87
88 define Package/sudo/postinst
89 #!/bin/sh
90
91 [ -n "$$IPKG_INSTROOT" ] || {
92 /etc/init.d/sudo enable
93 /etc/init.d/sudo start
94 }
95 endef
96
97 $(eval $(call BuildPackage,sudo))