diff options
author | Sam Kleinman <samk@10gen.com> | 2016-10-11 20:14:31 -0400 |
---|---|---|
committer | Sam Kleinman <samk@10gen.com> | 2016-10-25 11:59:21 -0400 |
commit | 00aed802dd912f39f842a59e9df36eb3792b77a6 (patch) | |
tree | f9d8c215a016b3fb94b563ed9ea9a6d16ece6a9f /buildscripts/packager.py | |
parent | 1e6fe6df6941e97c73db086e6ec7ebb24bc7dec9 (diff) | |
download | mongo-00aed802dd912f39f842a59e9df36eb3792b77a6.tar.gz |
SERVER-25368: add native systemd support for rhel7 and suse12
Diffstat (limited to 'buildscripts/packager.py')
-rwxr-xr-x | buildscripts/packager.py | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/buildscripts/packager.py b/buildscripts/packager.py index 97c3a95f275..43e411114f3 100755 --- a/buildscripts/packager.py +++ b/buildscripts/packager.py @@ -646,13 +646,30 @@ def make_rpm(distro, build_os, arch, spec, srcdir): suffix=spec.suffix() sdir=setupdir(distro, build_os, arch, spec) - # Use special suse init script if we're building for SUSE + specfile = srcdir + "rpm/mongodb%s.spec" % suffix + + # The Debian directory is here for the manpages so we we need to remove the service file + # from it so that RPM packages don't end up with the Debian file. + os.unlink(sdir + "debian/mongod.service") + + # Swap out systemd files, different systemd spec files, and init scripts as needed based on + # underlying os version. Arranged so that new distros moving forward automatically use + # systemd. Note: the SUSE init packages use a different init script than then other RPM + # distros. # - if distro.name() == "suse": + if distro.name() == "suse" and distro.repo_os_version(build_os) in ("10", "11"): os.unlink(sdir+"rpm/init.d-mongod") os.link(sdir+"rpm/init.d-mongod.suse", sdir+"rpm/init.d-mongod") - specfile=srcdir+"rpm/mongodb%s.spec" % suffix + os.unlink(specfile) + os.link(specfile.replace(".spec", "-init.spec"), specfile) + elif distro.name() == "rhel" and distro.repo_os_version(build_os) in ("5", "6"): + os.unlink(specfile) + os.link(specfile.replace(".spec", "-init.spec"), specfile) + elif distro.name() == "amazon": + os.unlink(specfile) + os.link(specfile.replace(".spec", "-init.spec"), specfile) + topdir=ensure_dir('%s/rpmbuild/%s/' % (os.getcwd(), build_os)) for subdir in ["BUILD", "RPMS", "SOURCES", "SPECS", "SRPMS"]: ensure_dir("%s/%s/" % (topdir, subdir)) |