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