Skip to content

Commit

Permalink
[#93] added support to build externals on openSUSE and SLES (SUSE Lin…
Browse files Browse the repository at this point in the history
…ux Enterprise Server)
  • Loading branch information
jassigill2000 authored and trel committed Sep 3, 2020
1 parent 5252394 commit ceb8634
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
8 changes: 6 additions & 2 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,14 @@ def get_package_arch():
def get_package_type():
log = logging.getLogger(__name__)
pld = platform.linux_distribution()[0]
if pld == '':
import distro
pld = distro.linux_distribution()[0]

log.debug('linux distribution detected: {0}'.format(pld))
if pld in ['debian', 'Ubuntu']:
pt = 'deb'
elif pld in ['CentOS', 'CentOS Linux', 'Red Hat Enterprise Linux Server', 'Scientific Linux', 'openSUSE ', 'SUSE Linux Enterprise Server']:
elif pld in ['CentOS', 'CentOS Linux', 'Red Hat Enterprise Linux Server', 'Scientific Linux', 'openSUSE ', 'openSUSE Leap', 'SUSE Linux Enterprise Server', 'SLES']:
pt = 'rpm'
else:
if platform.mac_ver()[0] != '':
Expand Down Expand Up @@ -383,7 +387,7 @@ def build_package(target, build_native_package):
package_cmd.extend(['-t', get_package_type()])
package_cmd.extend(['-n', 'irods-externals-{0}'.format(package_subdirectory)])
try:
if get_package_type() == 'rpm' and v['rpm_dependencies']:
if get_package_type() == 'rpm' and v['rpm_dependencies'] and 'Centos' in platform.linux_distribution()[0].capitalize():
for d in v['rpm_dependencies']:
package_cmd.extend(['-d', d])
except KeyError:
Expand Down
11 changes: 8 additions & 3 deletions install_prerequisites.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ def main():
log.addHandler(ch)

pld = platform.linux_distribution()[0]
if pld == '':
import distro
pld = distro.linux_distribution()[0]

if pld in ['debian', 'Ubuntu']:
log.info('Detected: {0}'.format(pld))
cmd = ['sudo', 'apt-get', 'update', '-y']
Expand Down Expand Up @@ -117,11 +121,12 @@ def main():
'bzip2-devel','libcurl-devel','libmicrohttpd-devel','libxml2-devel','libtool','libuuid-devel','openssl-devel','unixODBC-devel','patchelf']
build.run_cmd(cmd, check_rc='installing prerequisites failed')

elif pld in ['openSUSE ', 'SUSE Linux Enterprise Server']:
elif pld in ['openSUSE ', 'openSUSE Leap', 'SUSE Linux Enterprise Server', 'SLES']:
log.info('Detected: {0}'.format(pld))
# get prerequisites
cmd = ['sudo','zypper','install','-y','curl','ruby-devel','makeinfo','rubygems','libopenssl-devel',
'help2man','python-devel','libbz2-devel','libcurl-devel','libxml2-devel','uuid-devel','patchelf']
cmd = ['sudo','zypper','install','-y','curl','tar','gzip','git','ruby-devel','libmicrohttpd-devel','makeinfo','rubygems',
'libopenssl-devel','rpm-build','help2man','python-devel','libbz2-devel','libcurl-devel','libxml2-devel','libtool',
'libuuid-devel','uuid-devel','unixODBC-devel','cyrus-sasl','patchelf']
build.run_cmd(cmd, check_rc='installing prerequisites failed')
else:
if platform.mac_ver()[0] != '':
Expand Down

0 comments on commit ceb8634

Please sign in to comment.