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.

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