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.

86 lines
2.0 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.9.8p2
  10. PKG_RELEASE:=$(AUTORELEASE)
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  12. PKG_SOURCE_URL:=https://www.sudo.ws/dist
  13. PKG_HASH:=9e3b8b8da7def43b6e60c257abe80467205670fd0f7c081de1423c414b680f2d
  14. PKG_MAINTAINER:=Alexandru Ardelean <ardeleanalex@gmail.com>
  15. PKG_LICENSE:=ISC
  16. PKG_LICENSE_FILES:=doc/LICENSE
  17. PKG_CPE_ID:=cpe:/a:todd_miller:sudo
  18. PKG_INSTALL:=1
  19. PKG_BUILD_PARALLEL:=1
  20. include $(INCLUDE_DIR)/package.mk
  21. define Package/sudo
  22. SECTION:=admin
  23. CATEGORY:=Administration
  24. TITLE:=Delegate authority to run commands
  25. URL:=https://www.sudo.ws/
  26. endef
  27. define Package/sudo/description
  28. Sudo (su "do") allows a system administrator to delegate authority to
  29. give certain users (or groups of users) the ability to run some (or
  30. all) commands as root or another user while providing an audit trail of
  31. the commands and their arguments.
  32. endef
  33. define Package/sudo/conffiles
  34. /etc/sudoers
  35. /etc/sudoers.d/
  36. endef
  37. CONFIGURE_ARGS += \
  38. --without-pam \
  39. --disable-pam-session \
  40. --with-editor=/bin/vi \
  41. --without-lecture \
  42. --disable-zlib \
  43. --disable-openssl \
  44. --with-rundir=/var/lib/sudo \
  45. --with-vardir=/var/lib/sudo
  46. CONFIGURE_VARS += \
  47. sudo_cv_uid_t_len=10 \
  48. sudo_cv_func_unsetenv_void=no
  49. define Package/sudo/install
  50. $(INSTALL_DIR) \
  51. $(1)/etc/{init.d,sudoers.d} \
  52. $(1)/usr/{bin,sbin} \
  53. $(1)/usr/lib/sudo
  54. $(CP) $(PKG_INSTALL_DIR)/usr/bin/sudo $(1)/usr/bin/
  55. chmod 4755 $(1)/usr/bin/sudo
  56. $(CP) $(PKG_INSTALL_DIR)/usr/sbin/visudo $(1)/usr/sbin/
  57. $(CP) $(PKG_INSTALL_DIR)/etc/sudoers $(1)/etc/
  58. chmod 0440 $(1)/etc/sudoers
  59. $(CP) $(PKG_INSTALL_DIR)/usr/lib/sudo/*.so* $(1)/usr/lib/sudo/
  60. $(INSTALL_BIN) ./files/sudo.init $(1)/etc/init.d/sudo
  61. endef
  62. define Package/sudo/postinst
  63. #!/bin/sh
  64. [ -n "$$IPKG_INSTROOT" ] || {
  65. /etc/init.d/sudo enable
  66. /etc/init.d/sudo start
  67. }
  68. endef
  69. $(eval $(call BuildPackage,sudo))