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.

99 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.7p2
  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:=28b5ee725dbf89a7852f42f309ca877d2810a9531b4eecfe59f3a84b6b4afca8
  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. --disable-openssl \
  46. --with-rundir=/var/lib/sudo \
  47. --with-vardir=/var/lib/sudo
  48. CONFIGURE_VARS += \
  49. sudo_cv_uid_t_len=10 \
  50. sudo_cv_func_unsetenv_void=no
  51. define Host/Compile
  52. cd $(HOST_BUILD_DIR)/lib/util; \
  53. $(MAKE) mksiglist; $(MAKE) mksigname
  54. endef
  55. define Host/Install
  56. $(INSTALL_DIR) $(STAGING_DIR_HOSTPKG)/bin
  57. $(CP) $(HOST_BUILD_DIR)/lib/util/mksig{list,name} $(STAGING_DIR_HOSTPKG)/bin/
  58. endef
  59. define Package/sudo/install
  60. $(INSTALL_DIR) \
  61. $(1)/etc/{init.d,sudoers.d} \
  62. $(1)/usr/{bin,sbin} \
  63. $(1)/usr/lib/sudo
  64. $(CP) $(PKG_INSTALL_DIR)/usr/bin/sudo $(1)/usr/bin/
  65. chmod 4755 $(1)/usr/bin/sudo
  66. $(CP) $(PKG_INSTALL_DIR)/usr/sbin/visudo $(1)/usr/sbin/
  67. $(CP) $(PKG_INSTALL_DIR)/etc/sudoers $(1)/etc/
  68. chmod 0440 $(1)/etc/sudoers
  69. $(CP) $(PKG_INSTALL_DIR)/usr/lib/sudo/*.so* $(1)/usr/lib/sudo/
  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 HostBuild))
  80. $(eval $(call BuildPackage,sudo))