Bläddra i källkod

- Upgrade to OpenSSH 3.0p1 - Remove ScanSSH (now an own package) - Use "rpmtool config" for more reliable editing of /etc/pam.conf - Add PCRE regex support

Ralf S. Engelschall 24 år sedan
förälder
incheckning
cae52ec14c
1 ändrade filer med 68 tillägg och 93 borttagningar
  1. 68 93
      openssh/openssh.spec

+ 68 - 93
openssh/openssh.spec

@@ -22,9 +22,6 @@
 ##  SUCH DAMAGE.
 ##
 
-%define       V_openssh  2.9.9p2
-%define       V_scanssh  1.55
-
 #   package information
 Name:         openssh
 Summary:      Secure Shell (SSH)
@@ -34,21 +31,20 @@ Packager:     The OpenPKG Project
 Distribution: OpenPKG [EXP]
 Group:        Cryptography
 License:      BSD
-Version:      %{V_openssh}
+Version:      3.0p1
 Release:      %{l_branch}.0
 
 #   list of sources
-Source0:      ftp://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-%{V_openssh}.tar.gz
-Source1:      http://www.monkey.org/~provos/scanssh-%{V_scanssh}.tar.gz
-Source2:      rc.openssh
-Source3:      sshd_config
-Source4:      ssh_config
+Source0:      ftp://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-%{version}.tar.gz
+Source1:      rc.openssh
+Source2:      sshd_config
+Source3:      ssh_config
 
 #   build information
 Prefix:       %{l_prefix}
 BuildRoot:    %{l_buildroot}
-BuildPreReq:  OpenPKG, openpkg >= 0.9-20011025.0, perl, openssl, zlib, skey, libpcap
-PreReq:       OpenPKG, openpkg >= 0.9-20011025.0
+BuildPreReq:  OpenPKG, openpkg >= 0.9-20011107.0, perl, openssl, zlib, skey, pcre
+PreReq:       OpenPKG, openpkg >= 0.9-20011107.0
 AutoReq:      no
 AutoReqProv:  no
 
@@ -64,60 +60,48 @@ AutoReqProv:  no
     algorithms to separate libraries (OpenSSL).
 
 %prep
-    %setup0 -q -c -n openssh-%{version}
-    %setup1 -q -T -D -a 1
+    %setup0 -q
 
 %build
-    ( cd openssh-%{V_openssh}
-      #   configure source tree
-      CC="%{l_cc}" \
-      CFLAGS="%{l_cflags -O} -I%{l_prefix}/include" \
-      LDFLAGS="-L%{l_prefix}/lib" \
-      LIBS="-lcrypt" \
-      ./configure \
-          --prefix=%{l_prefix} \
-          --sbindir=%{l_prefix}/bin \
-          --mandir=%{l_prefix}/man \
-          --infodir=%{l_prefix}/info \
-          --sysconfdir=%{l_prefix}/etc/openssh \
-          --libexecdir=%{l_prefix}/libexec/openssh \
-          --localstatedir=%{l_prefix}/var/openssh \
-          --with-pid-dir=%{l_prefix}/var/openssh \
-          --with-ssl-dir=%{l_prefix} \
-          --with-skey=%{l_prefix} \
-          --with-ipv4-default \
-          --with-md5-passwords \
-          --with-pam \
-          --without-kerberos4 \
-          --disable-suid-ssh \
-          --without-rsh \
-          --with-default-path=%{l_prefix}/bin:/bin:/usr/bin:/usr/local/bin
+    #   configure source tree
+    CC="%{l_cc}" \
+    CFLAGS="%{l_cflags -O} -I%{l_prefix}/include" \
+    LDFLAGS="-L%{l_prefix}/lib" \
+    LIBS="-lcrypt" \
+    ./configure \
+        --prefix=%{l_prefix} \
+        --sbindir=%{l_prefix}/bin \
+        --mandir=%{l_prefix}/man \
+        --infodir=%{l_prefix}/info \
+        --sysconfdir=%{l_prefix}/etc/openssh \
+        --libexecdir=%{l_prefix}/libexec/openssh \
+        --localstatedir=%{l_prefix}/var/openssh \
+        --with-pid-dir=%{l_prefix}/var/openssh \
+        --with-ssl-dir=%{l_prefix} \
+        --with-skey=%{l_prefix} \
+        --with-zlib=%{l_prefix} \
+        --with-pcre=%{l_prefix} \
+        --with-ipv4-default \
+        --with-md5-passwords \
+        --with-pam \
+        --without-smartcard \
+        --without-kerberos4 \
+        --disable-suid-ssh \
+        --without-rsh \
+        --with-mantype=man \
+        --with-default-path=%{l_prefix}/bin:/bin:/usr/bin:/usr/local/bin
   
-      #   build package
-      %{l_make} %{l_mflags -O}
-    )
-    ( cd scanssh
-      CC="%{l_cc}" \
-      CFLAGS="%{l_cflags -O} -I%{l_prefix}/include/openssl -I%{l_prefix}/include" \
-      LDFLAGS="-L%{l_prefix}/lib" \
-      ./configure \
-          --prefix=%{l_prefix}
-      %{l_make} %{l_mflags -O}
-    )
+    #   build package
+    %{l_make} %{l_mflags -O}
 
 %install
     rm -rf $RPM_BUILD_ROOT
 
-    ( cd openssh-%{V_openssh}
-      #   perform standard installation procedure of OpenSSH
-      %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
-    )
-    ( cd scanssh
-      #   perform standard installation procedure of ScanSSH
-      %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
-    )
+    #   perform standard installation procedure of OpenSSH
+    %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
 
     #   strip down installation tree
+    rm -rf $RPM_BUILD_ROOT%{l_prefix}/share
     rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/slogin
     rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man1/slogin.1
     strip $RPM_BUILD_ROOT%{l_prefix}/bin/* 2> /dev/null || true
@@ -174,47 +158,38 @@ AutoReqProv:  no
 
     #   add PAM configuration entry
     if [ -f /etc/pam.conf ]; then
-        check=`grep "^#<OpenPKG prefix=$RPM_INSTALL_PREFIX pkg=openssh>" /etc/pam.conf`
-        if [ ".$check" = . ]; then
-            ( echo "#<OpenPKG prefix=$RPM_INSTALL_PREFIX pkg=openssh>"
-              case "%{l_target}" in
-                  *-freebsd* ) 
-                      echo "sshd auth     sufficient pam_skey.so"
-                      echo "sshd auth     required   pam_unix.so   try_first_pass"
-                      echo "sshd account  required   pam_unix.so"
-                      echo "sshd password required   pam_permit.so"
-                      echo "sshd session  required   pam_permit.so"
-                      ;;
-                  *-linux* ) 
-                      echo "sshd auth     required /lib/security/pam_unix_auth.so shadow nodelay"
-                      echo "sshd auth     required /lib/security/pam_nologin.so"
-                      echo "sshd account  required /lib/security/pam_unix_acct.so"
-                      echo "sshd password required /lib/security/pam_unix_passwd.so shadow nullok use_authtok" 
-                      echo "sshd session  required /lib/security/pam_unix_session.so" 
-                      echo "sshd session  required /lib/security/pam_limits.so"
-                      ;;
-                  *-solaris* ) 
-                      echo "sshd auth     required /usr/lib/security/pam_unix.so try_first_pass"
-                      echo "sshd account  required /usr/lib/security/pam_unix.so"
-                      echo "sshd password required /usr/lib/security/pam_unix.so" 
-                      echo "sshd session  required /usr/lib/security/pam_unix.so" 
-                      ;;
-              esac
-              echo "#</OpenPKG>"
-            ) >>/etc/pam.conf
-        fi
+        ( case "%{l_target}" in
+              *-freebsd* ) 
+                  echo "sshd auth     sufficient pam_skey.so"
+                  echo "sshd auth     required   pam_unix.so   try_first_pass"
+                  echo "sshd account  required   pam_unix.so"
+                  echo "sshd password required   pam_permit.so"
+                  echo "sshd session  required   pam_permit.so"
+                  ;;
+              *-linux* ) 
+                  echo "sshd auth     required /lib/security/pam_unix_auth.so shadow nodelay"
+                  echo "sshd auth     required /lib/security/pam_nologin.so"
+                  echo "sshd account  required /lib/security/pam_unix_acct.so"
+                  echo "sshd password required /lib/security/pam_unix_passwd.so shadow nullok use_authtok" 
+                  echo "sshd session  required /lib/security/pam_unix_session.so" 
+                  echo "sshd session  required /lib/security/pam_limits.so"
+                  ;;
+              *-solaris* ) 
+                  echo "sshd auth     required /usr/lib/security/pam_unix.so try_first_pass"
+                  echo "sshd account  required /usr/lib/security/pam_unix.so"
+                  echo "sshd password required /usr/lib/security/pam_unix.so" 
+                  echo "sshd session  required /usr/lib/security/pam_unix.so" 
+                  ;;
+          esac
+        ) |\
+        $RPM_INSTALL_PREFIX/sbin/rpmtool config \
+            -a -s -i "$RPM_INSTALL_PREFIX:openssh" /etc/pam.conf
     fi
 
 %preun
     #   remove PAM configuration entry
     if [ -f /etc/pam.conf ]; then
-        check=`grep "^#<OpenPKG prefix=$RPM_INSTALL_PREFIX pkg=openssh>" /etc/pam.conf`
-        if [ ".$check" != . ]; then
-            prefix=`echo $RPM_INSTALL_PREFIX | sed -e 's;/;\\/;g'`
-            cp /etc/pam.conf /etc/pam.conf.tmp && \
-            sed -e "/^#<OpenPKG prefix=$prefix pkg=openssh>/,/^#<\\/OpenPKG>/d" \
-            </etc/pam.conf.tmp >/etc/pam.conf && \
-            rm -f /etc/pam.conf.tmp
-        fi
+        $RPM_INSTALL_PREFIX/sbin/rpmtool config \
+            -r -s -i "$RPM_INSTALL_PREFIX:openssh" /etc/pam.conf
     fi