haproxy: Update all patches for HAProxy v1.8.14
[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.24
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:=b488557a198ecef30b7ad4011b59a66232dec2364ad956e11d8e17906c225be8
17
18 PKG_LICENSE:=ISC
19 PKG_LICENSE_FILES:=doc/LICENSE
20 PKG_CPE_ID:=cpe:/a:todd_miller:sudo
21
22 PKG_BUILD_PARALLEL:=1
23 PKG_INSTALL:=1
24
25 PKG_BUILD_DEPENDS:=sudo/host
26
27 include $(INCLUDE_DIR)/package.mk
28
29 define Package/sudo
30 SECTION:=admin
31 CATEGORY:=Administration
32 TITLE:=Delegate authority to run commands
33 URL:=https://www.sudo.ws/
34 MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
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))