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.

97 lines
2.3 KiB

  1. #
  2. # Copyright (C) 2006-2014 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.11p2
  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/sudo/dist
  15. PKG_MD5SUM:=84012b4871b6c775c957cd310d5bad87
  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. endef
  35. CONFIGURE_ARGS+= \
  36. --without-pam \
  37. --disable-pam-session \
  38. --with-editor=/bin/vi \
  39. --without-lecture \
  40. --disable-zlib \
  41. --with-rundir=/var/lib/sudo \
  42. --with-vardir=/var/lib/sudo
  43. CONFIGURE_VARS+= \
  44. sudo_cv_uid_t_len=10 \
  45. sudo_cv_func_unsetenv_void=no
  46. include $(INCLUDE_DIR)/host-build.mk
  47. define Host/Compile
  48. cd $(HOST_BUILD_DIR)/lib/util; \
  49. $(MAKE) mksiglist; $(MAKE) mksigname
  50. endef
  51. define Host/Install
  52. $(INSTALL_DIR) $(STAGING_DIR_HOST)/bin
  53. $(CP) $(HOST_BUILD_DIR)/lib/util/mksig{list,name} $(STAGING_DIR_HOST)/bin/
  54. endef
  55. $(eval $(call HostBuild))
  56. define Package/sudo/install
  57. $(INSTALL_DIR) $(1)/usr/bin
  58. $(CP) $(PKG_INSTALL_DIR)/usr/bin/sudo $(1)/usr/bin/
  59. chmod 4755 $(1)/usr/bin/sudo
  60. $(INSTALL_DIR) $(1)/usr/sbin
  61. $(CP) $(PKG_INSTALL_DIR)/usr/sbin/visudo $(1)/usr/sbin/
  62. $(INSTALL_DIR) $(1)/etc
  63. $(CP) $(PKG_INSTALL_DIR)/etc/sudoers $(1)/etc/
  64. chmod 0440 $(1)/etc/sudoers
  65. $(INSTALL_DIR) $(1)/etc/sudoers.d
  66. $(INSTALL_DIR) $(1)/usr/lib/sudo
  67. $(CP) $(PKG_INSTALL_DIR)/usr/lib/sudo/*.so* $(1)/usr/lib/sudo/
  68. $(INSTALL_DIR) $(1)/etc/init.d
  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 BuildPackage,sudo))