| 1 | ##################################################################### |
|---|
| 2 | # OpenCSW build recipe for openssh |
|---|
| 3 | # |
|---|
| 4 | # Author: Yann Rouillard <yann@pleiades.fr.eu.org> |
|---|
| 5 | # |
|---|
| 6 | # Redistribution and/or use, with or without modification, is |
|---|
| 7 | # permitted. This software is without warranty of any kind. The |
|---|
| 8 | # author(s) shall not be liable in the event that use of the |
|---|
| 9 | # software causes damage. |
|---|
| 10 | ##################################################################### |
|---|
| 11 | |
|---|
| 12 | ###### Package information ####### |
|---|
| 13 | |
|---|
| 14 | NAME = openssh |
|---|
| 15 | VERSION = 6.2p1 |
|---|
| 16 | GSSKEX_PATCH_VERSION = 6.2p1 |
|---|
| 17 | GSSKEX_PATCH_DATE = 20130502 |
|---|
| 18 | GARTYPE = v2 |
|---|
| 19 | |
|---|
| 20 | DESCRIPTION = OpenSSH Secure Shell |
|---|
| 21 | |
|---|
| 22 | define BLURB |
|---|
| 23 | OpenSSH is a FREE version of the SSH connectivity tools that technical users |
|---|
| 24 | of the Internet rely on. Users of telnet, rlogin, and ftp may not realize that |
|---|
| 25 | their password is transmitted across the Internet unencrypted, but it is. |
|---|
| 26 | OpenSSH encrypts all traffic (including passwords) to effectively eliminate |
|---|
| 27 | eavesdropping, connection hijacking, and other attacks. Additionally, OpenSSH |
|---|
| 28 | provides secure tunneling capabilities and several authentication methods, |
|---|
| 29 | and supports all SSH protocol versions. |
|---|
| 30 | endef |
|---|
| 31 | |
|---|
| 32 | |
|---|
| 33 | PACKAGES = CSWopenssh CSWopenssh-client |
|---|
| 34 | |
|---|
| 35 | CATALOGNAME_CSWopenssh = openssh |
|---|
| 36 | SPKG_DESC_CSWopenssh = OpenSSH Secure Shell server |
|---|
| 37 | BUILD_DEP_PKGS = CSWautoconf CSWlibssl-dev CSWlibz-dev |
|---|
| 38 | RUNTIME_DEP_PKGS_CSWopenssh = CSWlibssl1-0-0 CSWlibwrap1 CSWlibz1 CSWlibkrb5-3 CSWlibgssapi-krb5-2 CSWlibcom-err3 CSWopenssh-client |
|---|
| 39 | |
|---|
| 40 | OBSOLETED_BY_CSWopenssh = CSWossh |
|---|
| 41 | |
|---|
| 42 | CATALOGNAME_CSWopenssh-client = openssh_client |
|---|
| 43 | SPKG_DESC_CSWopenssh-client = OpenSSH Secure Shell client |
|---|
| 44 | RUNTIME_DEP_PKGS_CSWopenssh-client = CSWlibssl1-0-0 CSWlibz1 CSWlibgssapi-krb5-2 |
|---|
| 45 | |
|---|
| 46 | OBSOLETED_BY_CSWopenssh-client = CSWosshclient |
|---|
| 47 | |
|---|
| 48 | PACKAGING_PLATFORMS = solaris10-sparc solaris10-i386 |
|---|
| 49 | |
|---|
| 50 | PKGFILES_CSWopenssh = $(sbindir)/.* |
|---|
| 51 | PKGFILES_CSWopenssh += $(docdir)/openssh/.* |
|---|
| 52 | PKGFILES_CSWopenssh += $(mandir)/man5/sshd_config.5 |
|---|
| 53 | PKGFILES_CSWopenssh += $(mandir)/man8/sftp-server.8 |
|---|
| 54 | PKGFILES_CSWopenssh += $(mandir)/man8/sshd.8 |
|---|
| 55 | PKGFILES_CSWopenssh += $(libexecdir)/sftp-server |
|---|
| 56 | PKGFILES_CSWopenssh += $(sysconfdir)/ssh/sshd_config.CSW |
|---|
| 57 | PKGFILES_CSWopenssh += $(sysconfdir)/ssh/moduli.CSW |
|---|
| 58 | PKGFILES_CSWopenssh += $(localstatedir)/empty |
|---|
| 59 | PKGFILES_CSWopenssh += $(sysconfdir)/init.d/cswopenssh |
|---|
| 60 | PKGFILES_CSWopenssh += $(localstatedir)/svc/manifest/network/cswopenssh.xml |
|---|
| 61 | PKGFILES_CSWopenssh += $(prefix)/etc/pkg/CSWopenssh/cswusergroup |
|---|
| 62 | |
|---|
| 63 | PKGFILES_CSWopenssh-client = $(bindir)/.* |
|---|
| 64 | PKGFILES_CSWopenssh-client += $(docdir)/openssh_client/.* |
|---|
| 65 | PKGFILES_CSWopenssh-client += $(mandir)/man1/.* |
|---|
| 66 | PKGFILES_CSWopenssh-client += $(mandir)/man5/ssh_config.5 |
|---|
| 67 | PKGFILES_CSWopenssh-client += $(mandir)/man8/ssh-keysign.8 |
|---|
| 68 | PKGFILES_CSWopenssh-client += $(libexecdir)/ssh-keysign |
|---|
| 69 | PKGFILES_CSWopenssh-client += $(sysconfdir)/ssh/ssh_config.CSW |
|---|
| 70 | PKGFILES_CSWopenssh-client += $(prefix)/etc/ssh/THIS_LOCATION_IS_DEPRECATED |
|---|
| 71 | |
|---|
| 72 | PROTOTYPE_MODIFIERS = setuid |
|---|
| 73 | PROTOTYPE_FILES_setuid = $(libexecdir)/ssh-keysign |
|---|
| 74 | PROTOTYPE_PERMS_setuid = 4711 |
|---|
| 75 | |
|---|
| 76 | PRESERVECONF = $(sysconfdir)/ssh/sshd_config |
|---|
| 77 | PRESERVECONF += $(sysconfdir)/ssh/ssh_config |
|---|
| 78 | PRESERVECONF += $(sysconfdir)/ssh/moduli |
|---|
| 79 | INITSMF = $(sysconfdir)/init.d/cswopenssh |
|---|
| 80 | USERGROUP = $(prefix)/etc/pkg/CSWopenssh/cswusergroup |
|---|
| 81 | |
|---|
| 82 | MIGRATE_FILES_CSWopenssh = moduli sshd_config |
|---|
| 83 | MIGRATE_FILES_CSWopenssh += ssh_host_dsa_key ssh_host_dsa_key.pub ssh_host_rsa_key ssh_host_rsa_key.pub ssh_host_key ssh_host_key.pub |
|---|
| 84 | MIGRATE_FILES_CSWopenssh += shosts.equiv |
|---|
| 85 | MIGRATE_FILES_CSWopenssh += sshrc |
|---|
| 86 | MIGRATE_FILES_CSWopenssh-client = ssh_config |
|---|
| 87 | MIGRATE_FILES_CSWopenssh-client += ssh_known_hosts ssh_known_hosts2 |
|---|
| 88 | MIGRATE_FILES_CSWopenssh-client += ssh_prng_cmds |
|---|
| 89 | MIGRATE_SOURCE_DIR = $(prefix)/etc/ssh |
|---|
| 90 | MIGRATE_DEST_DIR = $(sysconfdir)/ssh |
|---|
| 91 | |
|---|
| 92 | CHECKPKG_OVERRIDES_CSWopenssh-client += file-with-bad-content|/usr/local|root/opt/csw/share/doc/openssh_client/INSTALL |
|---|
| 93 | CHECKPKG_OVERRIDES_CSWopenssh += file-with-bad-content|/usr/local|root/opt/csw/share/doc/openssh/INSTALL |
|---|
| 94 | CHECKPKG_OVERRIDES_CSWopenssh += file-with-bad-content|/usr/share|root/var/opt/csw/svc/manifest/network/cswopenssh.xml |
|---|
| 95 | |
|---|
| 96 | |
|---|
| 97 | |
|---|
| 98 | ###### Upstream and OpenCSW files information ####### |
|---|
| 99 | |
|---|
| 100 | MASTER_SITES = ftp://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/ http://www.sxw.org.uk/computing/patches/ |
|---|
| 101 | UPSTREAM_MASTER_SITES = ftp://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/ |
|---|
| 102 | |
|---|
| 103 | # We define upstream file regex so we can be notifed of new upstream software release |
|---|
| 104 | UFILES_REGEX = $(NAME)-(\d+(?:\.\d+)*p\d+).tar.gz |
|---|
| 105 | |
|---|
| 106 | DISTFILES = $(NAME)-$(VERSION).tar.gz |
|---|
| 107 | DISTFILES += changelog.CSW |
|---|
| 108 | DISTFILES += cswusergroup |
|---|
| 109 | |
|---|
| 110 | DISTFILES += cswopenssh sshd.smf_wrapper cswopenssh.xml |
|---|
| 111 | |
|---|
| 112 | DISTFILES += THIS_LOCATION_IS_DEPRECATED |
|---|
| 113 | |
|---|
| 114 | LICENSE = LICENCE |
|---|
| 115 | |
|---|
| 116 | # The GSSAPI key exchange patch |
|---|
| 117 | PATCHFILES = openssh-$(GSSKEX_PATCH_VERSION)-gsskex-all-$(GSSKEX_PATCH_DATE).patch |
|---|
| 118 | |
|---|
| 119 | # Prevent TIOCSCTTY from being used to avoid error: |
|---|
| 120 | # ioctl(TIOCSCTTY): Invalid argument |
|---|
| 121 | PATCHFILES += don_t_use_TIOCSCTTY.patch |
|---|
| 122 | |
|---|
| 123 | # Fix a X11 forwarding bug on machine installed with ipv6 disabled |
|---|
| 124 | # see https://bugzilla.mindrot.org/show_bug.cgi?id=1457 |
|---|
| 125 | PATCHFILES += no_x_forwarding_bug.patch |
|---|
| 126 | |
|---|
| 127 | # Force openssh to not use /var/adm/lastlog but still prints last log information |
|---|
| 128 | # Workaround to fix https://www.opencsw.org/mantis/view.php?id=4494 |
|---|
| 129 | # Bug filled upstream: https://bugzilla.mindrot.org/show_bug.cgi?id=87 |
|---|
| 130 | PATCHFILES += 0004-no-lastlog-file.patch |
|---|
| 131 | |
|---|
| 132 | # Rename the pidfile to use cswsshd.pid instead of sshd.pid in order to |
|---|
| 133 | # avoid a clash with sun native ssh pid file |
|---|
| 134 | # see https://www.opencsw.org/mantis/view.php?id=4398 |
|---|
| 135 | PATCHFILES += 0005-rename-pidfile.patch |
|---|
| 136 | |
|---|
| 137 | # documentation files to install (not a gar variable) |
|---|
| 138 | DOCFILES = CREDITS ChangeLog ChangeLog.gssapi INSTALL LICENCE OVERVIEW README README.dns |
|---|
| 139 | DOCFILES += README.platform README.privsep README.tun TODO |
|---|
| 140 | |
|---|
| 141 | # we're using conf handling class from the cswclassutils package |
|---|
| 142 | RUNTIME_DEP_PKGS += CSWcswclassutils |
|---|
| 143 | |
|---|
| 144 | |
|---|
| 145 | |
|---|
| 146 | ##### Build and installation information ##### |
|---|
| 147 | |
|---|
| 148 | CONFIGURE_ARGS = $(DIRPATHS) |
|---|
| 149 | CONFIGURE_ARGS += --with-kerberos5=$(prefix) |
|---|
| 150 | CONFIGURE_ARGS += --sysconfdir=$(sysconfdir)/ssh |
|---|
| 151 | CONFIGURE_ARGS += --with-solaris-contracts |
|---|
| 152 | CONFIGURE_ARGS += --with-pam |
|---|
| 153 | CONFIGURE_ARGS += --with-tcp-wrappers=$(prefix) |
|---|
| 154 | CONFIGURE_ARGS += --with-privsep-path=$(localstatedir)/empty |
|---|
| 155 | |
|---|
| 156 | # We don't want to use lazy load because of |
|---|
| 157 | # the chroot usage by sshd |
|---|
| 158 | EXTRA_LD_OPTIONS = -z nolazyload |
|---|
| 159 | |
|---|
| 160 | TEST_SCRIPTS = |
|---|
| 161 | |
|---|
| 162 | include gar/category.mk |
|---|
| 163 | |
|---|
| 164 | |
|---|
| 165 | # we re-run autoconf because of the GSSAPI key exchange patch |
|---|
| 166 | pre-configure: |
|---|
| 167 | cd $(WORKSRC) && autoconf |
|---|
| 168 | @$(MAKECOOKIE) |
|---|
| 169 | |
|---|
| 170 | # kr5config returns the -R/opt/csw/lib/ which is considered not valid by checkpkg |
|---|
| 171 | # manually fixing this until the bug is fixed (see https://www.opencsw.org/mantis/view.php?id=4384 ) |
|---|
| 172 | post-configure-modulated: |
|---|
| 173 | cd $(WORKSRC) && perl -pi -e 's,-R/opt/csw/lib/ ,-R/opt/csw/lib ,' Makefile |
|---|
| 174 | @$(MAKECOOKIE) |
|---|
| 175 | |
|---|
| 176 | # adding documentation files |
|---|
| 177 | pre-package: merge-config-files merge-doc-files merge-init-files merge-contrib-files merge-special-directories |
|---|
| 178 | @$(MAKECOOKIE) |
|---|
| 179 | |
|---|
| 180 | merge-contrib-files: |
|---|
| 181 | ginstall -D "$(WORKSRC_FIRSTMOD)/contrib/ssh-copy-id" "$(PKGROOT)/$(bindir)/ssh-copy-id" |
|---|
| 182 | ginstall -D "$(WORKSRC_FIRSTMOD)/contrib/ssh-copy-id.1" "$(PKGROOT)/$(mandir)/man1/ssh-copy-id.1" |
|---|
| 183 | chmod -x "$(PKGROOT)/$(mandir)/man1/ssh-copy-id.1" |
|---|
| 184 | |
|---|
| 185 | merge-init-files: |
|---|
| 186 | ginstall -D "$(WORKDIR_FIRSTMOD)/cswopenssh" "$(PKGROOT)/etc/opt/csw/init.d/cswopenssh" |
|---|
| 187 | ginstall -D "$(WORKDIR_FIRSTMOD)/cswopenssh.xml" "$(PKGROOT)/var/opt/csw/svc/manifest/network/cswopenssh.xml" |
|---|
| 188 | ginstall -D "$(WORKDIR_FIRSTMOD)/sshd.smf_wrapper" "$(PKGROOT)/opt/csw/sbin/sshd.smf_wrapper" |
|---|
| 189 | |
|---|
| 190 | merge-doc-files: |
|---|
| 191 | for DOCDIR in $(foreach _PKG,$(PACKAGES),$(call catalogname,$(_PKG))); do \ |
|---|
| 192 | ginstall -d $(PKGROOT)/$(docdir)/$$DOCDIR; \ |
|---|
| 193 | (cd $(WORKSRC_FIRSTMOD) && ginstall $(DOCFILES) $(PKGROOT)/$(docdir)/$$DOCDIR/); \ |
|---|
| 194 | (cd $(PKGROOT)/$(docdir)/$$DOCDIR && chmod -x $(DOCFILES)); \ |
|---|
| 195 | ginstall $(WORKDIR_FIRSTMOD)/changelog.CSW $(PKGROOT)/$(docdir)/$$DOCDIR/; \ |
|---|
| 196 | done |
|---|
| 197 | |
|---|
| 198 | merge-config-files: |
|---|
| 199 | # we change some default value in the server config file |
|---|
| 200 | perl -pi -e 's,/etc/ssh/,$(sysconfdir)/ssh/,g; s,/usr/libexec/,/opt/csw/libexec/,g' "$(PKGROOT)/$(sysconfdir)/ssh/sshd_config.CSW" |
|---|
| 201 | perl -pi -e 's,^ *# *UsePAM *.*,UsePAM yes,g, s,^ *# *PrintMotd *.*,PrintMotd no,g; s,^ *# *X11Forwarding *.*,X11Forwarding yes,g' "$(PKGROOT)/$(sysconfdir)/ssh/sshd_config.CSW" |
|---|
| 202 | ginstall -D "$(WORKDIR_FIRSTMOD)/cswusergroup" "$(PKGROOT)$(prefix)/etc/pkg/CSWopenssh/cswusergroup" |
|---|
| 203 | ginstall -D "$(WORKDIR_FIRSTMOD)/THIS_LOCATION_IS_DEPRECATED" "$(PKGROOT)/$(prefix)/etc/ssh/THIS_LOCATION_IS_DEPRECATED" |
|---|
| 204 | |
|---|
| 205 | merge-special-directories: |
|---|
| 206 | ginstall -d $(PKGROOT)$(localstatedir)/empty |
|---|
| 207 | ginstall -d $(PKGROOT)$(sysconfdir)/pkg/CSWopenssh |
|---|