summaryrefslogtreecommitdiff
path: root/buildscripts/packager.py
diff options
context:
space:
mode:
Diffstat (limited to 'buildscripts/packager.py')
-rwxr-xr-xbuildscripts/packager.py23
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))