Update generate-greenplum-path.sh for upgrade package
Update generate-greenplum-path.sh for upgrade package

Following the [Greenplum Server RPM Packaging Specification][0], we need
to update greenplum_path.sh file, and ensure many environment variables
set correct.

There are a few basic requirments for Greenplum Path Layer:

* greenplum-path.sh shall be installed to `${installation
  prefix}/greenplum-db-[package-version]/greenplum_path.sh`
* ${GPHOME} is set by given parameter, by default it should point to
  `%{installation prefix}/greenplum-db-devel`
* `${LD_LIBRARY_PATH}` shall be safely set to avoid a trailing colon
  (which will cause the linker to search the current directory when
  resolving shared objects)
* `${PYTHONPATH}` shall be set to `${GPHOME}/lib/python`
* `${PATH}` shall be set to `${GPHOME}/bin:${PATH}`
* If the file `${GPHOME}/etc/openssl.cnf` exists then `${OPENSSL_CONF}`
  shall be set to `${GPHOME}/etc/openssl.cnf`
* The greenplum_path.sh file shall pass [ShellCheck][1]

[0]: https://github.com/greenplum-db/greenplum-database-release/blob/master/Greenplum-Server-RPM-Packaging-Specification.md#detailed-package-behavior
[1]: https://github.com/koalaman/shellcheck

Authored-by: Tingfang Bao <38cc0dd61c2e2b344cfec0dd9c97f8c5763e5c1b@pivotal.io>
(cherry picked from commit 5150237ac884227383f9f4f94e2383450756e7da)

adam8157/gpdb,jmcatamney/gpdb,adam8157/gpdb,50wu/gpdb,greenplum-db/gpdb,greenplum-db/gpdb,lisakowen/gpdb,jmcatamney/gpdb,jmcatamney/gpdb,jmcatamney/gpdb,50wu/gpdb,50wu/gpdb,xinzweb/gpdb,adam8157/gpdb,xinzweb/gpdb,greenplum-db/gpdb,50wu/gpdb,greenplum-db/gpdb,jmcatamney/gpdb,adam8157/gpdb,50wu/gpdb,lisakowen/gpdb,lisakowen/gpdb,adam8157/gpdb,xinzweb/gpdb,jmcatamney/gpdb,greenplum-db/gpdb,50wu/gpdb,xinzweb/gpdb,xinzweb/gpdb,adam8157/gpdb,jmcatamney/gpdb,adam8157/gpdb,50wu/gpdb,greenplum-db/gpdb,adam8157/gpdb,greenplum-db/gpdb,greenplum-db/gpdb,50wu/gpdb,lisakowen/gpdb,xinzweb/gpdb,xinzweb/gpdb,xinzweb/gpdb,lisakowen/gpdb,lisakowen/gpdb,jmcatamney/gpdb,lisakowen/gpdb,lisakowen/gpdb