You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

98 lines
2.3 KiB

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