lede-packages-rs

git clone git://archive.git.mtrnord.blog/MTRNord/lede-packages-rs.git
Log | Files | Refs | README | LICENSE

Makefile (2339B)


      1 #
      2 # Copyright (C) 2006-2015 OpenWrt.org
      3 #
      4 # This is free software, licensed under the GNU General Public License v2.
      5 # See /LICENSE for more information.
      6 #
      7 
      8 include $(TOPDIR)/rules.mk
      9 
     10 PKG_NAME:=sudo
     11 PKG_VERSION:=1.8.14p3
     12 PKG_RELEASE:=1
     13 PKG_LICENSE:=ISC
     14 PKG_LICENSE_FILES:=doc/LICENSE
     15 
     16 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
     17 PKG_SOURCE_URL:=http://www.sudo.ws/dist
     18 PKG_MD5SUM:=93dbd1e47c136179ff1b01494c1c0e75
     19 
     20 PKG_INSTALL:=1
     21 
     22 PKG_BUILD_DEPENDS:=sudo/host
     23 
     24 include $(INCLUDE_DIR)/package.mk
     25 
     26 define Package/sudo
     27   SECTION:=admin
     28   CATEGORY:=Administration
     29   TITLE:=Delegate authority to run commands
     30   URL:=http://www.sudo.ws/
     31   MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
     32 endef
     33 
     34 define Package/sudo/description
     35  Sudo (su "do") allows a system administrator to delegate authority to
     36  give certain users (or groups of users) the ability to run some (or
     37  all) commands as root or another user while providing an audit trail of
     38  the commands and their arguments.
     39 endef
     40 
     41 define Package/sudo/conffiles
     42 /etc/sudoers
     43 /etc/sudoers.d/
     44 endef
     45 
     46 CONFIGURE_ARGS+= \
     47 	--without-pam \
     48 	--disable-pam-session \
     49 	--with-editor=/bin/vi \
     50 	--without-lecture \
     51 	--disable-zlib \
     52 	--with-rundir=/var/lib/sudo \
     53 	--with-vardir=/var/lib/sudo
     54 
     55 CONFIGURE_VARS+= \
     56 	sudo_cv_uid_t_len=10 \
     57 	sudo_cv_func_unsetenv_void=no
     58 
     59 include $(INCLUDE_DIR)/host-build.mk
     60 
     61 define Host/Compile
     62 	cd $(HOST_BUILD_DIR)/lib/util; \
     63 	    $(MAKE) mksiglist; $(MAKE) mksigname
     64 endef
     65 
     66 define Host/Install
     67 	$(INSTALL_DIR) $(STAGING_DIR_HOSTPKG)/bin
     68 	$(CP) $(HOST_BUILD_DIR)/lib/util/mksig{list,name} $(STAGING_DIR_HOSTPKG)/bin/
     69 endef
     70 
     71 $(eval $(call HostBuild))
     72 
     73 define Package/sudo/install
     74 	$(INSTALL_DIR) $(1)/usr/bin
     75 	$(CP) $(PKG_INSTALL_DIR)/usr/bin/sudo $(1)/usr/bin/
     76 	chmod 4755 $(1)/usr/bin/sudo
     77 	$(INSTALL_DIR) $(1)/usr/sbin
     78 	$(CP) $(PKG_INSTALL_DIR)/usr/sbin/visudo $(1)/usr/sbin/
     79 	$(INSTALL_DIR) $(1)/etc
     80 	$(CP) $(PKG_INSTALL_DIR)/etc/sudoers $(1)/etc/
     81 	chmod 0440 $(1)/etc/sudoers
     82 	$(INSTALL_DIR) $(1)/etc/sudoers.d
     83 	$(INSTALL_DIR) $(1)/usr/lib/sudo
     84 	$(CP) $(PKG_INSTALL_DIR)/usr/lib/sudo/*.so* $(1)/usr/lib/sudo/
     85 	$(INSTALL_DIR) $(1)/etc/init.d
     86 	$(INSTALL_BIN) ./files/sudo.init $(1)/etc/init.d/sudo
     87 endef
     88 
     89 define Package/sudo/postinst
     90 #!/bin/sh
     91 
     92 [ -n "$$IPKG_INSTROOT" ] || {
     93 	/etc/init.d/sudo enable
     94 	/etc/init.d/sudo start
     95 }
     96 endef
     97 
     98 $(eval $(call BuildPackage,sudo))