diff options
author | Deposite Pirate | 2018-09-16 18:48:36 +0200 |
---|---|---|
committer | Deposite Pirate | 2018-09-16 18:48:36 +0200 |
commit | d150a5f3e462fa7fe194a805a4aa0076f4d03ab9 (patch) | |
tree | ce5e44d69c5f3175bfdbd1e3717b52c5dcca5638 /network/openssh/openssh.build | |
parent | f29d3519ce073ec30f99754d93304324f7f26d65 (diff) |
Add ports.
Diffstat (limited to 'network/openssh/openssh.build')
-rwxr-xr-x | network/openssh/openssh.build | 122 |
1 files changed, 122 insertions, 0 deletions
diff --git a/network/openssh/openssh.build b/network/openssh/openssh.build new file mode 100755 index 0000000..1d55520 --- /dev/null +++ b/network/openssh/openssh.build @@ -0,0 +1,122 @@ +#!/bin/bash +# +# Maintainer: Deposite Pirate <ofni.sknuplatem@etaripd> + +source /usr/src/ports/Build/build.sh + +NAME=openssh +VERSION=6.2p1 +BUILD=1 +DEPENDS=('openssl >= 1.0.1e-1' 'tcpip >= 20130209-1') + +# Description + +cat > ${PKG}/install/slack-desc <<EOF +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. Line +# up the first '|' above the ':' following the base package name, and the '|' +# on the right side marks the last column you can put a character in. You must +# make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':'. + +$(padd)|-----handy-ruler------------------------------------------------------| +${NAME}: openssh (Secure Shell daemon and clients) +${NAME}: +${NAME}: ssh (Secure Shell) is a program for logging into a remote machine and +${NAME}: for executing commands on a remote machine. It is intended to +${NAME}: replace rlogin and rsh, and provide secure encrypted communications +${NAME}: between two untrusted hosts over an insecure network. sshd (SSH +${NAME}: Daemon) is the daemon program for ssh. OpenSSH is based on the last +${NAME}: free version of Tatu Ylonen's SSH, further enhanced and cleaned up by +${NAME}: Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos, Theo de Raadt, +${NAME}: and Dug Song. It has a homepage at http://www.openssh.com +${NAME}: +EOF + +cat >> ${PKG}/install/doinst.sh <<EOF +#!/bin/sh + +config() { + NEW="\$1" + OLD="\$(dirname \$NEW)/\$(basename \$NEW .new)" + # If there's no config file by that name, mv it over: + if [ ! -r \$OLD ]; then + mv \$NEW \$OLD + elif [ "\$(cat \$OLD | md5sum)" = "\$(cat \$NEW | md5sum)" ]; then + # toss the redundant copy + rm \$NEW + fi + # Otherwise, we leave the .new copy for the admin to consider... +} + +config etc/ssh/ssh_config.new +config etc/ssh/sshd_config.new +config etc/rc.d/rc.sshd.new + +# If the sshd user/group/shadow don't exist, add them: + +if ! grep -q "^sshd:" etc/passwd ; then + echo "sshd:x:33:33:sshd:/:" >> etc/passwd +fi + +if ! grep -q "^sshd:" etc/group ; then + echo "sshd::33:sshd" >> etc/group +fi + +if ! grep -q "^sshd:" etc/shadow ; then + echo "sshd:*:9797:0:::::" >> etc/shadow +fi + +# Add a btmp file to store login failure if one doesn't exist: + +if [ ! -r var/log/btmp ]; then + ( cd var/log ; umask 077 ; touch btmp ) +fi +EOF + +# Sources + +SRCNAME[0]=${NAME} +SRCVERS[0]=${VERSION} +SRCPACK[0]=http://ftp.belnet.be/pub/OpenBSD/OpenSSH/portable/${SRCNAME[0]}-${SRCVERS[0]}.tar.gz + +build0() +{ +#FIXME: PAM +CFLAGS="${FLAGS}" CXXFLAGS="${FLAGS}" \ +./configure \ + --build="${ARCH}-slackware-linux" \ + --prefix="${SYS_DIR[usr]}" \ + --mandir="${SYS_DIR[man]}" \ + --sysconfdir="${SYS_DIR[etc]}/ssh" \ + --libdir="${SYS_DIR[lib]}" \ + --libexecdir="${SYS_DIR[lib]}/exec" \ + --localstatedir="${SYS_DIR[var]}" \ + --without-pam \ + --with-xauth="${SYS_DIR[bin]}/xauth" \ + --with-pid-dir="${SYS_DIR[run]}/sshd" \ + --with-default-path="/usr/local/sbin:/usr/sbin:/usr/local/bin:/usr/bin" \ + --with-md5-passwords \ + --with-tcp-wrappers \ + --with-privsep-user=sshd \ + --with-privsep-path="${SYS_DIR[var]}/empty" +make ${JOBS} +make install DESTDIR="${PKG}" +doc CREDITS README.{dns,privsep,tun} +changelog ChangeLog +license LICENCE +install.dir ${PKG}${SYS_DIR[var]}/empty +install.dir ${PKG}${SYS_DIR[etc]}/{rc.d,tmpfiles.d} +install.bin rc.sshd.new ${PKG}${SYS_DIR[etc]}/rc.d +install.dat sshd.conf.tmpfilesd ${PKG}${SYS_DIR[etc]}/tmpfiles.d/sshd.conf +install.bin contrib/ssh-copy-id ${PKG}${SYS_DIR[bin]} +install.man contrib/ssh-copy-id.1 ${PKG}${SYS_DIR[man]}/man1 +install.dir ${PKG}${SYS_DIR[systemdsystemunitdir]} +install.cfg systemd/* ${PKG}${SYS_DIR[systemdsystemunitdir]} +( + cd ${PKG}${SYS_DIR[etc]}/ssh + rm -f ssh_host*key.* + mv ssh_config ssh_config.new + mv sshd_config sshd_config.new +) +} |