2008-02-12 12:28:19 +00:00
|
|
|
#
|
|
|
|
# Copyright (C) 2006,2008 OpenWrt.org
|
2006-07-24 18:14:09 +00:00
|
|
|
#
|
|
|
|
# This is free software, licensed under the GNU General Public License v2.
|
|
|
|
# See /LICENSE for more information.
|
|
|
|
#
|
|
|
|
|
|
|
|
include $(TOPDIR)/rules.mk
|
|
|
|
|
|
|
|
PKG_NAME:=openssh
|
2011-05-10 14:29:29 +00:00
|
|
|
PKG_VERSION:=5.8p2
|
2011-02-06 13:03:37 +00:00
|
|
|
PKG_RELEASE:=1
|
2006-07-24 18:14:09 +00:00
|
|
|
|
|
|
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
|
|
|
PKG_SOURCE_URL:=ftp://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/ \
|
|
|
|
ftp://openbsd.wiretapped.net/pub/OpenBSD/OpenSSH/portable/ \
|
2008-06-19 04:28:09 +00:00
|
|
|
ftp://ftp.belnet.be/packages/openbsd/OpenSSH/portable/ \
|
|
|
|
ftp://ftp.de.openbsd.org/pub/unix/OpenBSD/OpenSSH/portable/
|
2011-05-10 14:29:29 +00:00
|
|
|
PKG_MD5SUM:=0541579adf9d55abb15ef927048d372e
|
2006-07-24 18:14:09 +00:00
|
|
|
|
2007-01-22 17:33:10 +00:00
|
|
|
PKG_BUILD_DEPENDS:=libopenssl
|
2006-07-24 18:14:09 +00:00
|
|
|
|
|
|
|
include $(INCLUDE_DIR)/package.mk
|
|
|
|
|
2011-02-12 12:57:31 +00:00
|
|
|
define Package/openssh/Default
|
2006-07-24 18:14:09 +00:00
|
|
|
SECTION:=net
|
|
|
|
CATEGORY:=Network
|
2011-02-12 11:36:41 +00:00
|
|
|
DEPENDS:=+libopenssl +zlib +libgcc
|
2011-02-12 12:57:31 +00:00
|
|
|
TITLE:=OpenSSH
|
2010-10-16 11:23:19 +00:00
|
|
|
MAINTAINER:=Peter Wagner <tripolar@gmx.at>
|
2006-07-24 18:14:09 +00:00
|
|
|
URL:=http://www.openssh.com/
|
2008-04-13 12:06:07 +00:00
|
|
|
SUBMENU:=SSH
|
2006-07-24 18:14:09 +00:00
|
|
|
endef
|
|
|
|
|
2011-02-12 12:57:31 +00:00
|
|
|
define Package/openssh-client
|
|
|
|
$(call Package/openssh/Default)
|
|
|
|
TITLE+= client
|
|
|
|
endef
|
|
|
|
|
2007-10-14 04:32:56 +00:00
|
|
|
define Package/openssh-client/description
|
|
|
|
OpenSSH client.
|
|
|
|
endef
|
|
|
|
|
2006-07-24 18:14:09 +00:00
|
|
|
define Package/openssh-client/conffiles
|
|
|
|
/etc/ssh/ssh_config
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/openssh-client-utils
|
2011-02-12 12:57:31 +00:00
|
|
|
$(call Package/openssh/Default)
|
2011-02-12 16:37:40 +00:00
|
|
|
DEPENDS+= +openssh-client +openssh-keygen
|
2011-02-12 12:57:31 +00:00
|
|
|
TITLE+= client utilities
|
2006-07-24 18:14:09 +00:00
|
|
|
endef
|
|
|
|
|
2007-10-14 04:32:56 +00:00
|
|
|
define Package/openssh-client-utils/description
|
|
|
|
OpenSSH client utilities.
|
|
|
|
endef
|
|
|
|
|
2010-03-09 11:51:55 +00:00
|
|
|
define Package/openssh-keygen
|
2011-02-12 12:57:31 +00:00
|
|
|
$(call Package/openssh/Default)
|
2011-02-12 16:31:50 +00:00
|
|
|
TITLE+= keygen
|
2010-03-09 11:51:55 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/openssh-keygen/description
|
|
|
|
OpenSSH keygen.
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/openssh-server
|
2011-02-12 12:57:31 +00:00
|
|
|
$(call Package/openssh/Default)
|
2011-02-12 16:31:50 +00:00
|
|
|
DEPENDS+= +openssh-keygen
|
2011-02-12 12:57:31 +00:00
|
|
|
TITLE+= server
|
2006-07-24 18:14:09 +00:00
|
|
|
endef
|
|
|
|
|
2007-10-14 04:32:56 +00:00
|
|
|
define Package/openssh-server/description
|
|
|
|
OpenSSH server.
|
|
|
|
endef
|
|
|
|
|
2006-07-24 18:14:09 +00:00
|
|
|
define Package/openssh-server/conffiles
|
|
|
|
/etc/ssh/sshd_config
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/openssh-sftp-client
|
2011-02-12 12:57:31 +00:00
|
|
|
$(call Package/openssh/Default)
|
|
|
|
TITLE+= SFTP client
|
2006-07-24 18:14:09 +00:00
|
|
|
endef
|
|
|
|
|
2007-10-14 04:32:56 +00:00
|
|
|
define Package/openssh-sftp-client/description
|
|
|
|
OpenSSH SFTP client.
|
|
|
|
endef
|
|
|
|
|
2006-07-24 18:14:09 +00:00
|
|
|
define Package/openssh-sftp-server
|
2011-02-12 12:57:31 +00:00
|
|
|
$(call Package/openssh/Default)
|
2011-02-12 11:36:41 +00:00
|
|
|
DEPENDS:=+libgcc
|
2011-02-12 12:57:31 +00:00
|
|
|
TITLE+= SFTP server
|
2006-07-24 18:14:09 +00:00
|
|
|
endef
|
|
|
|
|
2007-10-14 04:32:56 +00:00
|
|
|
define Package/openssh-sftp-server/description
|
|
|
|
OpenSSH SFTP server.
|
|
|
|
endef
|
|
|
|
|
2008-08-05 21:56:14 +00:00
|
|
|
CONFIGURE_ARGS+= \
|
|
|
|
$(DISABLE_NLS) \
|
|
|
|
--sysconfdir=/etc/ssh \
|
2008-07-30 14:16:45 +00:00
|
|
|
--enable-shared \
|
|
|
|
--disable-static \
|
|
|
|
--disable-debug \
|
|
|
|
--disable-strip \
|
|
|
|
--disable-etc-default-login \
|
|
|
|
--disable-lastlog \
|
|
|
|
--disable-utmp \
|
|
|
|
--disable-utmpx \
|
|
|
|
--disable-wtmp \
|
|
|
|
--disable-wtmpx \
|
|
|
|
--without-bsd-auth \
|
|
|
|
--without-kerberos5 \
|
|
|
|
--without-pam \
|
|
|
|
--without-x
|
|
|
|
|
|
|
|
ifneq ($(CONFIG_SSP_SUPPORT),y)
|
2008-08-05 21:56:14 +00:00
|
|
|
CONFIGURE_ARGS += \
|
2008-07-30 14:16:45 +00:00
|
|
|
--without-stackprotect
|
|
|
|
endif
|
2008-08-05 21:56:14 +00:00
|
|
|
|
|
|
|
CONFIGURE_VARS += LD="$(TARGET_CC)"
|
2006-07-24 18:14:09 +00:00
|
|
|
|
|
|
|
define Build/Compile
|
2006-11-09 16:57:26 +00:00
|
|
|
$(MAKE) -C $(PKG_BUILD_DIR) \
|
|
|
|
DESTDIR="$(PKG_INSTALL_DIR)" \
|
|
|
|
LIBS="" \
|
|
|
|
sftp-server
|
2006-07-24 18:14:09 +00:00
|
|
|
$(MAKE) -C $(PKG_BUILD_DIR) \
|
|
|
|
DESTDIR="$(PKG_INSTALL_DIR)" \
|
2008-08-05 21:56:14 +00:00
|
|
|
STRIP_OPT="" \
|
2006-07-24 18:14:09 +00:00
|
|
|
all install
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/openssh-client/install
|
2006-11-23 00:29:07 +00:00
|
|
|
$(INSTALL_DIR) $(1)/etc/ssh
|
2006-07-24 18:14:09 +00:00
|
|
|
chmod 0700 $(1)/etc/ssh
|
|
|
|
$(CP) $(PKG_INSTALL_DIR)/etc/ssh/ssh_config $(1)/etc/ssh/
|
2006-11-23 00:29:07 +00:00
|
|
|
$(INSTALL_DIR) $(1)/usr/bin
|
2007-12-09 18:59:01 +00:00
|
|
|
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ssh $(1)/usr/bin/
|
|
|
|
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/scp $(1)/usr/bin/
|
2006-07-24 18:14:09 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/openssh-client-utils/install
|
2006-11-23 00:29:07 +00:00
|
|
|
$(INSTALL_DIR) $(1)/usr/bin
|
2010-03-09 11:51:55 +00:00
|
|
|
$(INSTALL_BIN) $(foreach bin,add agent keyscan keysign,$(PKG_BUILD_DIR)/ssh-$(bin)) $(1)/usr/bin/
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/openssh-keygen/install
|
|
|
|
$(INSTALL_DIR) $(1)/usr/bin
|
|
|
|
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ssh-keygen $(1)/usr/bin/
|
2006-07-24 18:14:09 +00:00
|
|
|
endef
|
|
|
|
|
2010-03-09 11:51:55 +00:00
|
|
|
|
2006-07-24 18:14:09 +00:00
|
|
|
define Package/openssh-server/install
|
2006-11-23 00:29:07 +00:00
|
|
|
$(INSTALL_DIR) $(1)/etc/ssh
|
2006-07-24 18:14:09 +00:00
|
|
|
chmod 0700 $(1)/etc/ssh
|
|
|
|
$(CP) $(PKG_INSTALL_DIR)/etc/ssh/sshd_config $(1)/etc/ssh/
|
2006-11-23 00:29:07 +00:00
|
|
|
$(INSTALL_DIR) $(1)/etc/init.d
|
|
|
|
$(INSTALL_BIN) ./files/sshd.init $(1)/etc/init.d/sshd
|
|
|
|
$(INSTALL_DIR) $(1)/usr/sbin
|
2007-12-09 18:59:01 +00:00
|
|
|
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/sshd $(1)/usr/sbin/
|
2006-07-24 18:14:09 +00:00
|
|
|
endef
|
|
|
|
|
2007-05-14 19:21:47 +00:00
|
|
|
define Package/openssh-server/postinst
|
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
name=sshd
|
2010-04-18 15:12:46 +00:00
|
|
|
id=22
|
2007-05-14 19:21:47 +00:00
|
|
|
|
2009-12-05 01:07:01 +00:00
|
|
|
if [ -z "$$(grep ^\\$${name}: $${IPKG_INSTROOT}/etc/group)" ]; then
|
2007-05-14 19:21:47 +00:00
|
|
|
echo "adding group $$name to /etc/group"
|
2009-12-05 01:07:01 +00:00
|
|
|
echo "$${name}:x:$${id}:" >> $${IPKG_INSTROOT}/etc/group
|
2007-05-14 19:21:47 +00:00
|
|
|
fi
|
|
|
|
|
2009-12-05 01:07:01 +00:00
|
|
|
if [ -z "$$(grep ^\\$${name}: $${IPKG_INSTROOT}/etc/passwd)" ]; then
|
2007-05-14 19:21:47 +00:00
|
|
|
echo "adding user $$name to /etc/passwd"
|
|
|
|
echo "$${name}:x:$${id}:$${id}:$${name}:/var/empty/.$${name}:/bin/false" >> $${IPKG_INSTROOT}/etc/passwd
|
|
|
|
fi
|
|
|
|
endef
|
|
|
|
|
2006-07-24 18:14:09 +00:00
|
|
|
define Package/openssh-sftp-client/install
|
2006-11-23 00:29:07 +00:00
|
|
|
$(INSTALL_DIR) $(1)/usr/bin
|
2007-12-09 18:59:01 +00:00
|
|
|
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/sftp $(1)/usr/bin/
|
2006-07-24 18:14:09 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/openssh-sftp-server/install
|
2006-11-23 00:29:07 +00:00
|
|
|
$(INSTALL_DIR) $(1)/usr/lib
|
2006-07-24 18:14:09 +00:00
|
|
|
$(CP) $(PKG_INSTALL_DIR)/usr/lib/sftp-server $(1)/usr/lib/
|
2006-11-23 00:29:07 +00:00
|
|
|
$(INSTALL_DIR) $(1)/usr/libexec
|
2006-07-24 18:14:09 +00:00
|
|
|
ln -sf ../lib/sftp-server $(1)/usr/libexec/sftp-server
|
|
|
|
endef
|
|
|
|
|
|
|
|
$(eval $(call BuildPackage,openssh-client))
|
|
|
|
$(eval $(call BuildPackage,openssh-client-utils))
|
2010-03-09 11:51:55 +00:00
|
|
|
$(eval $(call BuildPackage,openssh-keygen))
|
2006-07-24 18:14:09 +00:00
|
|
|
$(eval $(call BuildPackage,openssh-server))
|
|
|
|
$(eval $(call BuildPackage,openssh-sftp-client))
|
|
|
|
$(eval $(call BuildPackage,openssh-sftp-server))
|