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.9.5p2
  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:=539e2ef43c8a55026697fb0474ab6a925a11206b5aa58710cb42a0e1c81f0978
  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. PKG_BUILD_DEPENDS:=sudo/host
  21. include $(INCLUDE_DIR)/package.mk
  22. include $(INCLUDE_DIR)/host-build.mk
  23. define Package/sudo
  24. SECTION:=admin
  25. CATEGORY:=Administration
  26. TITLE:=Delegate authority to run commands
  27. URL:=https://www.sudo.ws/
  28. endef
  29. define Package/sudo/description
  30. Sudo (su "do") allows a system administrator to delegate authority to
  31. give certain users (or groups of users) the ability to run some (or
  32. all) commands as root or another user while providing an audit trail of
  33. the commands and their arguments.
  34. endef
  35. define Package/sudo/conffiles
  36. /etc/sudoers
  37. /etc/sudoers.d/
  38. endef
  39. CONFIGURE_ARGS += \
  40. --without-pam \
  41. --disable-pam-session \
  42. --with-editor=/bin/vi \
  43. --without-lecture \
  44. --disable-zlib \
  45. --with-rundir=/var/lib/sudo \
  46. --with-vardir=/var/lib/sudo
  47. CONFIGURE_VARS += \
  48. sudo_cv_uid_t_len=10 \
  49. sudo_cv_func_unsetenv_void=no
  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. define Package/sudo/install
  59. $(INSTALL_DIR) \
  60. $(1)/etc/{init.d,sudoers.d} \
  61. $(1)/usr/{bin,sbin} \
  62. $(1)/usr/lib/sudo
  63. $(CP) $(PKG_INSTALL_DIR)/usr/bin/sudo $(1)/usr/bin/
  64. chmod 4755 $(1)/usr/bin/sudo
  65. $(CP) $(PKG_INSTALL_DIR)/usr/sbin/visudo $(1)/usr/sbin/
  66. $(CP) $(PKG_INSTALL_DIR)/etc/sudoers $(1)/etc/
  67. chmod 0440 $(1)/etc/sudoers
  68. $(CP) $(PKG_INSTALL_DIR)/usr/lib/sudo/*.so* $(1)/usr/lib/sudo/
  69. $(INSTALL_BIN) ./files/sudo.init $(1)/etc/init.d/sudo
  70. endef
  71. define Package/sudo/postinst
  72. #!/bin/sh
  73. [ -n "$$IPKG_INSTROOT" ] || {
  74. /etc/init.d/sudo enable
  75. /etc/init.d/sudo start
  76. }
  77. endef
  78. $(eval $(call HostBuild))
  79. $(eval $(call BuildPackage,sudo))