+%systemd_reload
+
+%triggerpostun server -- %{name}-server < 6.2p1-1
+cp -f %{_sysconfdir}/sshd_config{,.rpmorig}
+sed -i -e 's#AuthorizedKeysCommandRunAs#AuthorizedKeysCommandUser##g' %{_sysconfdir}/sshd_config
+
+%triggerpostun server -- %{name}-server < 2:5.9p1-8
+# lpk.patch to ldap.patch
+if grep -qE '^(UseLPK|Lpk)' %{_sysconfdir}/sshd_config; then
+ echo >&2 "Migrating LPK patch to LDAP patch"
+ cp -f %{_sysconfdir}/sshd_config{,.rpmorig}
+ %{__sed} -i -e '
+ # disable old configs
+ # just UseLPK/LkpLdapConf supported for now
+ s/^\s*UseLPK/## Obsolete &/
+ s/^\s*Lpk/## Obsolete &/
+ # Enable new ones, assumes /etc/ldap.conf defaults, see HOWTO.ldap-keys
+ /UseLPK/iAuthorizedKeysCommand %{_libexecdir}/ssh-ldap-wrapper
+ ' %{_sysconfdir}/sshd_config
+ if [ ! -x /bin/systemd_booted ] || ! /bin/systemd_booted; then
+ /bin/systemctl try-restart sshd.service || :
+ else
+ %service -q sshd reload
+ fi
+fi
+%systemd_trigger sshd.service
+if [ -x /bin/systemd_booted ] && /bin/systemd_booted; then
+%banner %{name}-server -e << EOF
+!!!!!!!!!!!!!!!!!!!!!!! WARNING !!!!!!!!!!!!!!!!!!!!!!!!!
+! Native systemd support for sshd has been installed. !
+! Restarting sshd.service with systemctl WILL kill all !
+! active ssh sessions (daemon as such will be started). !
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+EOF
+fi