first commit
[scm/bb/meta-tizen.git] / recipes-tizen / openssh / openssh.inc
1 DESCRIPTION = "Secure Shell Client and Server (Remote Login Program)"
2 HOMEPAGE = "http://www.openssh.com/"
3 SECTION = "System/Network"
4 LICENSE = "BSD-3-Clause and MIT"
5
6 SRC_URI = ""
7
8 S = "${WORKDIR}/git"
9
10 PROVIDES = ""
11
12 #PROVIDES by openssh 
13 PROVIDES += "openssh"
14 RPROVIDES_openssh += "openssh"
15
16 RDEPENDS = ""
17 #RDEPENDS of openssh (${PN})
18 RDEPENDS_${PN} += "coreutils"
19 RDEPENDS_${PN} += "pam-modules-extra"
20 RDEPENDS_${PN} += "/usr/bin/netstat"
21 RDEPENDS_${PN} += "pwdutils"
22
23
24 DEPENDS = ""
25 #DEPENDS of openssh 
26 DEPENDS += "systemd"
27 DEPENDS += "autoconf-native"
28 DEPENDS += "pam-devel"
29 DEPENDS += "openssl-devel"
30
31 do_patch() {
32  chmod -Rf a+rX,u+w,g-w,o-w ${S}
33  #setup -q 
34  cp ${S}/packaging/openssh.manifest .
35  
36  
37 }
38
39 do_configure() {
40 }
41
42 do_compile() {
43  LANG=C
44  export LANG
45  unset DISPLAY
46  CFLAGS="-O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables" ; export CFLAGS ; 
47  CXXFLAGS="${CXXFLAGS:--O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables}" ; export CXXFLAGS ; 
48  FFLAGS="${FFLAGS:--O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -I%_fmoddir}" ; export FFLAGS ; 
49  LD_AS_NEEDED=1; export LD_AS_NEEDED ; 
50  
51  autoreconf -fiv
52  PIEFLAGS="-fpie"
53  export CFLAGS="-O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables $PIEFLAGS -fstack-protector"
54  export CXXFLAGS="-O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables $PIEFLAGS -fstack-protector"
55  export LDFLAGS="-pie"
56  
57    CFLAGS="${CFLAGS:--O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables}" ; export CFLAGS ; 
58    CXXFLAGS="${CXXFLAGS:--O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables}" ; export CXXFLAGS ; 
59    FFLAGS="${FFLAGS:--O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -I%_fmoddir}" ; export FFLAGS ; 
60    autotools_do_configure --build=${TARGET_SYS} --host=${HOST_SYS} \
61          --target=x86_64-tizen-linux \
62          --program-prefix= \
63          --prefix=/usr \
64          --exec-prefix=/usr \
65          --bindir=/usr/bin \
66          --sbindir=/usr/sbin \
67          --sysconfdir=/etc \
68          --datadir=/usr/share \
69          --includedir=/usr/include \
70          --libdir=/usr/lib \
71          --libexecdir=/usr/libexec \
72          --localstatedir=/var \
73          --sharedstatedir=/usr/com \
74          --mandir=/usr/share/man \
75          --infodir=/usr/share/info \
76      --with-ssl-engine \
77      --sysconfdir=/etc/ssh \
78      --libexecdir=/usr/libexec/ssh \
79      --with-pam \
80      --with-privsep-path=/var/lib/empty \
81      --with-sandbox=rlimit \
82      --disable-strip \
83      --with-xauth=/usr/bin/xauth \
84      --target=x86_64-tizen-linux
85  make -j16
86  
87  
88  
89 }
90
91 do_install() {
92  echo export RPM_BUILD_ROOT=${D}
93  LANG=C
94  export LANG
95  unset DISPLAY
96  rm -rf ${D} 
97  mkdir -p ${D} 
98  
99  make DESTDIR=${D}/ install
100  install -d -m 755 ${D}/etc/pam.d
101  install -d -m 755 ${D}/var/lib/sshd
102  install -m 644 ${S}/packaging/sshd.pamd ${D}/etc/pam.d/sshd
103  # install shell script to automate the process of adding your public key to a remote machine
104  install -m 755 contrib/ssh-copy-id ${D}/usr/bin
105  install -m 644 contrib/ssh-copy-id.1 ${D}/usr/share/man/man1
106  sed -e "s,@LIBEXEC@,/usr/libexec,g" < ${S}/packaging/ssh-askpass > ${D}/usr/libexec/ssh/ssh-askpass
107  rm -f ${D}/usr/share/Ssh.bin
108  sed -i -e s@/usr/libexec@/usr/libexec@g ${D}/etc/ssh/sshd_config
109  
110  install -D -m 0755 ${S}/packaging/sshd-gen-keys-start ${D}/usr/sbin/sshd-gen-keys-start
111  # systemd
112  install -D -m 0644 ${S}/packaging/sshd.service ${D}/lib/systemd/system/sshd.service
113  install -D -m 0644 ${S}/packaging/sshd.socket ${D}/lib/systemd/system/sshd.socket
114  install -D -m 0644 ${S}/packaging/sshd@.service ${D}/lib/systemd/system/sshd@.service
115  
116  mkdir -p ${D}//lib/systemd/system/sockets.target.wants
117  ln -s ../sshd.socket ${D}//lib/systemd/system/sockets.target.wants/sshd.socket
118  
119  rm -rf ${D}//usr/share/man/cat*
120  rm -rf ${D}//usr/share/man/man*
121  
122  
123  
124  
125 }
126
127 PACKAGES = ""
128 PACKAGES += "openssh"
129
130 openssh_files = ""
131 openssh_files += "openssh.manifest"
132 #Remove rpm attribut "%attr(755,root,root)"
133 openssh_files += "/var/lib/sshd"
134 openssh_files += "/usr/bin/scp"
135 openssh_files += "/usr/bin/sftp"
136 openssh_files += "/usr/bin/slogin"
137 openssh_files += "/usr/bin/ssh-*"
138 openssh_files += "/usr/sbin/*"
139 openssh_files += "/usr/sbin/sshd-gen-keys-start"
140 openssh_files += "/lib/systemd/system/sshd.service"
141 openssh_files += "/lib/systemd/system/sshd@.service"
142 openssh_files += "/lib/systemd/system/sockets.target.wants/*.socket"
143 openssh_files += "/lib/systemd/system/sshd.socket"
144
145 FILES_${PN} = "${openssh_files}"
146
147 PKG_openssh= "openssh"
148
149 require openssh-extraconf.inc