6e291b4b59b443a534c699bc998642fc5f86f9a5
[openwrt/svn-archive/archive.git] / net / openssh / Makefile
1 #
2 # Copyright (C) 2006 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 # $Id$
8
9 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=openssh
12 PKG_VERSION:=4.5p1
13 PKG_RELEASE:=1
14
15 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
16 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
17 PKG_SOURCE_URL:=ftp://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/ \
18 ftp://openbsd.wiretapped.net/pub/OpenBSD/OpenSSH/portable/ \
19 ftp://ftp.belnet.be/packages/openbsd/OpenSSH/portable/ \
20 ftp://ftp.de.openbsd.org/pub/unix/OpenBSD/OpenSSH/portable/
21 PKG_MD5SUM:=6468c339886f78e8a149b88f695839dd
22 PKG_CAT:=zcat
23
24 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
25
26 PKG_BUILD_DEPENDS:=libopenssl
27
28 include $(INCLUDE_DIR)/package.mk
29
30 define Package/openssh-client
31 SECTION:=net
32 CATEGORY:=Network
33 DEPENDS:=+libopenssl +zlib
34 TITLE:=OpenSSH client
35 DESCRIPTION:=OpenSSH client.
36 URL:=http://www.openssh.com/
37 endef
38
39 define Package/openssh-client/conffiles
40 /etc/ssh/ssh_config
41 endef
42
43 define Package/openssh-client-utils
44 SECTION:=net
45 CATEGORY:=Network
46 DEPENDS:=openssh-client
47 TITLE:=OpenSSH client utilities
48 DESCRIPTION:=OpenSSH client utilities.
49 URL:=http://www.openssh.com/
50 endef
51
52 define Package/openssh-server
53 SECTION:=net
54 CATEGORY:=Network
55 DEPENDS:=+libopenssl +zlib
56 TITLE:=OpenSSH server
57 DESCRIPTION:=OpenSSH server.
58 URL:=http://www.openssh.com/
59 endef
60
61 define Package/openssh-server/conffiles
62 /etc/ssh/sshd_config
63 endef
64
65 define Package/openssh-sftp-client
66 SECTION:=net
67 CATEGORY:=Network
68 DEPENDS:=+libopenssl +zlib
69 TITLE:=OpenSSH SFTP client
70 DESCRIPTION:=OpenSSH SFTP client.
71 URL:=http://www.openssh.com/
72 endef
73
74 define Package/openssh-sftp-server
75 SECTION:=net
76 CATEGORY:=Network
77 DEPENDS:=
78 TITLE:=OpenSSH SFTP server
79 DESCRIPTION:=OpenSSH SFTP server.
80 URL:=http://www.openssh.com/
81 endef
82
83 define Build/Configure
84 (cd $(PKG_BUILD_DIR); rm -f config.cache; \
85 $(TARGET_CONFIGURE_OPTS) \
86 CFLAGS="$(TARGET_CFLAGS)" \
87 CPPFLAGS="-I$(STAGING_DIR)/usr/include" \
88 LD="$(TARGET_CC)" \
89 LDFLAGS="-L$(STAGING_DIR)/usr/lib" \
90 ./configure \
91 --target=$(GNU_TARGET_NAME) \
92 --host=$(GNU_TARGET_NAME) \
93 --build=$(GNU_HOST_NAME) \
94 --program-prefix="" \
95 --program-suffix="" \
96 --prefix=/usr \
97 --exec-prefix=/usr \
98 --bindir=/usr/bin \
99 --datadir=/usr/share \
100 --includedir=/usr/include \
101 --infodir=/usr/share/info \
102 --libdir=/usr/lib \
103 --libexecdir=/usr/lib \
104 --localstatedir=/var \
105 --mandir=/usr/share/man \
106 --sbindir=/usr/sbin \
107 --sysconfdir=/etc/ssh \
108 $(DISABLE_LARGEFILE) \
109 $(DISABLE_NLS) \
110 --enable-shared \
111 --disable-static \
112 --disable-debug \
113 --disable-strip \
114 --disable-etc-default-login \
115 --disable-lastlog \
116 --disable-utmp \
117 --disable-utmpx \
118 --disable-wtmp \
119 --disable-wtmpx \
120 --without-bsd-auth \
121 --without-kerberos5 \
122 --without-pam \
123 --without-x \
124 );
125 endef
126
127 define Build/Compile
128 rm -rf $(PKG_INSTALL_DIR)
129 mkdir -p $(PKG_INSTALL_DIR)
130 $(MAKE) -C $(PKG_BUILD_DIR) \
131 DESTDIR="$(PKG_INSTALL_DIR)" \
132 LIBS="" \
133 sftp-server
134 $(MAKE) -C $(PKG_BUILD_DIR) \
135 DESTDIR="$(PKG_INSTALL_DIR)" \
136 all install
137 endef
138
139 define Package/openssh-client/install
140 $(INSTALL_DIR) $(1)/etc/ssh
141 chmod 0700 $(1)/etc/ssh
142 $(CP) $(PKG_INSTALL_DIR)/etc/ssh/ssh_config $(1)/etc/ssh/
143 $(INSTALL_DIR) $(1)/usr/bin
144 $(CP) $(PKG_INSTALL_DIR)/usr/bin/ssh $(1)/usr/bin/
145 $(CP) $(PKG_INSTALL_DIR)/usr/bin/scp $(1)/usr/bin/
146 endef
147
148 define Package/openssh-client-utils/install
149 $(INSTALL_DIR) $(1)/usr/bin
150 $(CP) $(PKG_INSTALL_DIR)/usr/bin/ssh-add $(1)/usr/bin/
151 $(CP) $(PKG_INSTALL_DIR)/usr/bin/ssh-agent $(1)/usr/bin/
152 $(CP) $(PKG_INSTALL_DIR)/usr/bin/ssh-keyscan $(1)/usr/bin/
153 endef
154
155 define Package/openssh-server/install
156 $(INSTALL_DIR) $(1)/etc/ssh
157 chmod 0700 $(1)/etc/ssh
158 $(CP) $(PKG_INSTALL_DIR)/etc/ssh/sshd_config $(1)/etc/ssh/
159 $(INSTALL_DIR) $(1)/etc/init.d
160 $(INSTALL_BIN) ./files/sshd.init $(1)/etc/init.d/sshd
161 $(INSTALL_DIR) $(1)/usr/bin
162 $(CP) $(PKG_INSTALL_DIR)/usr/bin/ssh-keygen $(1)/usr/bin/
163 $(INSTALL_DIR) $(1)/usr/sbin
164 $(CP) $(PKG_INSTALL_DIR)/usr/sbin/sshd $(1)/usr/sbin/
165 endef
166
167 define Package/openssh-sftp-client/install
168 $(INSTALL_DIR) $(1)/usr/bin
169 $(CP) $(PKG_INSTALL_DIR)/usr/bin/sftp $(1)/usr/bin/
170 endef
171
172 define Package/openssh-sftp-server/install
173 $(INSTALL_DIR) $(1)/usr/lib
174 $(CP) $(PKG_INSTALL_DIR)/usr/lib/sftp-server $(1)/usr/lib/
175 $(INSTALL_DIR) $(1)/usr/libexec
176 ln -sf ../lib/sftp-server $(1)/usr/libexec/sftp-server
177 endef
178
179 $(eval $(call BuildPackage,openssh-client))
180 $(eval $(call BuildPackage,openssh-client-utils))
181 $(eval $(call BuildPackage,openssh-server))
182 $(eval $(call BuildPackage,openssh-sftp-client))
183 $(eval $(call BuildPackage,openssh-sftp-server))