change SECTION and CATEGORY to put packages in the right place, change PKG_BUILDDEPs...
[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.2p1
13 PKG_RELEASE:=2
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:=df899194a340c933944b193477c628fa
22 PKG_CAT:=zcat
23
24 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
25 PKG_BUILDDEP:=libopenssl
26
27 include $(INCLUDE_DIR)/package.mk
28
29 define Package/openssh-client
30 SECTION:=net
31 CATEGORY:=Network
32 DEPENDS:=+libopenssl +zlib
33 TITLE:=OpenSSH client
34 DESCRIPTION:=OpenSSH client.
35 URL:=http://www.openssh.com/
36 endef
37
38 define Package/openssh-client/conffiles
39 /etc/ssh/ssh_config
40 endef
41
42 define Package/openssh-client-utils
43 SECTION:=net
44 CATEGORY:=Network
45 DEPENDS:=openssh-client
46 TITLE:=OpenSSH client utilities
47 DESCRIPTION:=OpenSSH client utilities.
48 URL:=http://www.openssh.com/
49 endef
50
51 define Package/openssh-server
52 SECTION:=net
53 CATEGORY:=Network
54 DEPENDS:=+libopenssl +zlib
55 TITLE:=OpenSSH server
56 DESCRIPTION:=OpenSSH server.
57 URL:=http://www.openssh.com/
58 endef
59
60 define Package/openssh-server/conffiles
61 /etc/ssh/sshd_config
62 endef
63
64 define Package/openssh-sftp-client
65 SECTION:=net
66 CATEGORY:=Network
67 DEPENDS:=+libopenssl +zlib
68 TITLE:=OpenSSH SFTP client
69 DESCRIPTION:=OpenSSH SFTP client.
70 URL:=http://www.openssh.com/
71 endef
72
73 define Package/openssh-sftp-server
74 SECTION:=net
75 CATEGORY:=Network
76 DEPENDS:=+libopenssl +zlib
77 TITLE:=OpenSSH SFTP server
78 DESCRIPTION:=OpenSSH SFTP server.
79 URL:=http://www.openssh.com/
80 endef
81
82 define Build/Configure
83 (cd $(PKG_BUILD_DIR); rm -f config.cache; \
84 $(TARGET_CONFIGURE_OPTS) \
85 CFLAGS="$(TARGET_CFLAGS)" \
86 CPPFLAGS="-I$(STAGING_DIR)/usr/include" \
87 LD="$(TARGET_CC)" \
88 LDFLAGS="-L$(STAGING_DIR)/usr/lib" \
89 ./configure \
90 --target=$(GNU_TARGET_NAME) \
91 --host=$(GNU_TARGET_NAME) \
92 --build=$(GNU_HOST_NAME) \
93 --program-prefix="" \
94 --program-suffix="" \
95 --prefix=/usr \
96 --exec-prefix=/usr \
97 --bindir=/usr/bin \
98 --datadir=/usr/share \
99 --includedir=/usr/include \
100 --infodir=/usr/share/info \
101 --libdir=/usr/lib \
102 --libexecdir=/usr/lib \
103 --localstatedir=/var \
104 --mandir=/usr/share/man \
105 --sbindir=/usr/sbin \
106 --sysconfdir=/etc/ssh \
107 $(DISABLE_LARGEFILE) \
108 $(DISABLE_NLS) \
109 --enable-shared \
110 --disable-static \
111 --disable-debug \
112 --disable-strip \
113 --disable-etc-default-login \
114 --disable-lastlog \
115 --disable-utmp \
116 --disable-utmpx \
117 --disable-wtmp \
118 --disable-wtmpx \
119 --without-bsd-auth \
120 --without-kerberos5 \
121 --without-pam \
122 --without-x \
123 );
124 endef
125
126 define Build/Compile
127 rm -rf $(PKG_INSTALL_DIR)
128 mkdir -p $(PKG_INSTALL_DIR)
129 $(MAKE) -C $(PKG_BUILD_DIR) \
130 DESTDIR="$(PKG_INSTALL_DIR)" \
131 all install
132 endef
133
134 define Package/openssh-client/install
135 install -m0755 -d $(1)/etc/ssh
136 chmod 0700 $(1)/etc/ssh
137 $(CP) $(PKG_INSTALL_DIR)/etc/ssh/ssh_config $(1)/etc/ssh/
138 install -m0755 -d $(1)/usr/bin
139 $(CP) $(PKG_INSTALL_DIR)/usr/bin/ssh $(1)/usr/bin/
140 $(CP) $(PKG_INSTALL_DIR)/usr/bin/scp $(1)/usr/bin/
141 endef
142
143 define Package/openssh-client-utils/install
144 install -m0755 -d $(1)/usr/bin
145 $(CP) $(PKG_INSTALL_DIR)/usr/bin/ssh-add $(1)/usr/bin/
146 $(CP) $(PKG_INSTALL_DIR)/usr/bin/ssh-agent $(1)/usr/bin/
147 $(CP) $(PKG_INSTALL_DIR)/usr/bin/ssh-keyscan $(1)/usr/bin/
148 endef
149
150 define Package/openssh-server/install
151 install -m0755 -d $(1)/etc/ssh
152 chmod 0700 $(1)/etc/ssh
153 $(CP) $(PKG_INSTALL_DIR)/etc/ssh/sshd_config $(1)/etc/ssh/
154 install -m0755 -d $(1)/etc/init.d
155 install -m0755 ./files/S50sshd $(1)/etc/init.d/
156 install -m0755 -d $(1)/usr/bin
157 $(CP) $(PKG_INSTALL_DIR)/usr/bin/ssh-keygen $(1)/usr/bin/
158 install -m0755 -d $(1)/usr/sbin
159 $(CP) $(PKG_INSTALL_DIR)/usr/sbin/sshd $(1)/usr/sbin/
160 endef
161
162 define Package/openssh-sftp-client/install
163 install -m0755 -d $(1)/usr/bin
164 $(CP) $(PKG_INSTALL_DIR)/usr/bin/sftp $(1)/usr/bin/
165 endef
166
167 define Package/openssh-sftp-server/install
168 install -m0755 -d $(1)/usr/lib
169 $(CP) $(PKG_INSTALL_DIR)/usr/lib/sftp-server $(1)/usr/lib/
170 install -m0755 -d $(1)/usr/libexec
171 ln -sf ../lib/sftp-server $(1)/usr/libexec/sftp-server
172 endef
173
174 $(eval $(call BuildPackage,openssh-client))
175 $(eval $(call BuildPackage,openssh-client-utils))
176 $(eval $(call BuildPackage,openssh-server))
177 $(eval $(call BuildPackage,openssh-sftp-client))
178 $(eval $(call BuildPackage,openssh-sftp-server))