mirror of
https://github.com/mongodb/mongo.git
synced 2024-12-01 01:21:03 +01:00
SERVER-11077 Debian Enterprise packaging
This is a minimal change to support Debian, almost identical to Ubuntu packaging and Community Debian packaging.
This commit is contained in:
parent
4c208580ad
commit
82feb98aae
@ -13,8 +13,8 @@ repodir=/var/www-enterprise/repo.consolidated
|
|||||||
|
|
||||||
gpg_recip='<richard@10gen.com>'
|
gpg_recip='<richard@10gen.com>'
|
||||||
|
|
||||||
stable_branch="2.4"
|
stable_branch="2.6"
|
||||||
unstable_branch="2.5"
|
unstable_branch="2.7"
|
||||||
|
|
||||||
echo "Using directory: $repodir"
|
echo "Using directory: $repodir"
|
||||||
|
|
||||||
@ -72,7 +72,7 @@ echo
|
|||||||
for debian_dir in "$repodir"/apt/ubuntu "$repodir"/apt/debian
|
for debian_dir in "$repodir"/apt/ubuntu "$repodir"/apt/debian
|
||||||
do
|
do
|
||||||
cd "$debian_dir"
|
cd "$debian_dir"
|
||||||
for section_dir in $(find dists -type d -name multiverse)
|
for section_dir in $(find dists -type d -name multiverse -o name main)
|
||||||
do
|
do
|
||||||
for arch_dir in "$section_dir"/{binary-i386,binary-amd64}
|
for arch_dir in "$section_dir"/{binary-i386,binary-amd64}
|
||||||
do
|
do
|
||||||
@ -111,6 +111,7 @@ done
|
|||||||
# /var/www-enterprise/repo.consolidated/yum/redhat/5/mongodb-enterprise/unstable -> 2.5
|
# /var/www-enterprise/repo.consolidated/yum/redhat/5/mongodb-enterprise/unstable -> 2.5
|
||||||
# /var/www-enterprise/repo.consolidated/yum/redhat/6/mongodb-enterprise/unstable -> 2.5
|
# /var/www-enterprise/repo.consolidated/yum/redhat/6/mongodb-enterprise/unstable -> 2.5
|
||||||
# /var/www-enterprise/repo.consolidated/apt/ubuntu/dists/precise/mongodb-enterprise/unstable -> 2.5
|
# /var/www-enterprise/repo.consolidated/apt/ubuntu/dists/precise/mongodb-enterprise/unstable -> 2.5
|
||||||
|
# /var/www-enterprise/repo.consolidated/apt/debian/dists/wheezy/mongodb-enterprise/unstable -> 2.5
|
||||||
#
|
#
|
||||||
for unstable_branch_dir in "$repodir"/yum/redhat/*/*/$unstable_branch "$repodir"/apt/debian/dists/*/*/$unstable_branch "$repodir"/apt/ubuntu/dists/*/*/$unstable_branch
|
for unstable_branch_dir in "$repodir"/yum/redhat/*/*/$unstable_branch "$repodir"/apt/debian/dists/*/*/$unstable_branch "$repodir"/apt/ubuntu/dists/*/*/$unstable_branch
|
||||||
do
|
do
|
||||||
|
@ -49,7 +49,7 @@ REPOPATH="/var/www/repo"
|
|||||||
ARCHES=["x86_64"]
|
ARCHES=["x86_64"]
|
||||||
|
|
||||||
# Made up names for the flavors of distribution we package for.
|
# Made up names for the flavors of distribution we package for.
|
||||||
DISTROS=["redhat","ubuntu"]
|
DISTROS=["debian","redhat","ubuntu"]
|
||||||
|
|
||||||
|
|
||||||
class Spec(object):
|
class Spec(object):
|
||||||
@ -138,18 +138,31 @@ class Distro(object):
|
|||||||
repo/apt/ubuntu/dists/precise/mongodb-enterprise/2.5/multiverse/binary-amd64
|
repo/apt/ubuntu/dists/precise/mongodb-enterprise/2.5/multiverse/binary-amd64
|
||||||
repo/apt/ubuntu/dists/precise/mongodb-enterprise/2.5/multiverse/binary-i386
|
repo/apt/ubuntu/dists/precise/mongodb-enterprise/2.5/multiverse/binary-i386
|
||||||
|
|
||||||
|
repo/apt/debian/dists/wheezy/mongodb-enterprise/2.5/main/binary-amd64
|
||||||
|
repo/apt/debian/dists/wheezy/mongodb-enterprise/2.5/main/binary-i386
|
||||||
|
|
||||||
repo/yum/redhat/6/mongodb-enterprise/2.5/x86_64
|
repo/yum/redhat/6/mongodb-enterprise/2.5/x86_64
|
||||||
yum/redhat/6/mongodb-enterprise/2.5/i386
|
yum/redhat/6/mongodb-enterprise/2.5/i386
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
if re.search("^(debian|ubuntu)", self.n):
|
if re.search("^(debian|ubuntu)", self.n):
|
||||||
return "repo/apt/%s/dists/%s/mongodb-enterprise/%s/multiverse/binary-%s/" % (self.n, self.repo_os_version(build_os), spec.branch(), self.archname(arch))
|
return "repo/apt/%s/dists/%s/mongodb-enterprise/%s/%s/binary-%s/" % (self.n, self.repo_os_version(build_os), spec.branch(), self.repo_component(), self.archname(arch))
|
||||||
elif re.search("(redhat|fedora|centos)", self.n):
|
elif re.search("(redhat|fedora|centos)", self.n):
|
||||||
return "repo/yum/%s/%s/mongodb-enterprise/%s/%s/RPMS/" % (self.n, self.repo_os_version(build_os), spec.branch(), self.archname(arch))
|
return "repo/yum/%s/%s/mongodb-enterprise/%s/%s/RPMS/" % (self.n, self.repo_os_version(build_os), spec.branch(), self.archname(arch))
|
||||||
else:
|
else:
|
||||||
raise Exception("BUG: unsupported platform?")
|
raise Exception("BUG: unsupported platform?")
|
||||||
|
|
||||||
|
def repo_component(self):
|
||||||
|
"""Return the name of the section/component/pool we are publishing into -
|
||||||
|
e.g. "multiverse" for Ubuntu, "main" for debian."""
|
||||||
|
if self.n == 'ubuntu':
|
||||||
|
return "multiverse"
|
||||||
|
elif self.n == 'debian':
|
||||||
|
return "main"
|
||||||
|
else:
|
||||||
|
raise Exception("unsupported distro: %s" % self.n)
|
||||||
|
|
||||||
def repo_os_version(self, build_os):
|
def repo_os_version(self, build_os):
|
||||||
"""Return an OS version suitable for package repo directory
|
"""Return an OS version suitable for package repo directory
|
||||||
naming - e.g. 5, 6 or 7 for redhat/centos, "precise," "wheezy," etc.
|
naming - e.g. 5, 6 or 7 for redhat/centos, "precise," "wheezy," etc.
|
||||||
@ -161,6 +174,11 @@ class Distro(object):
|
|||||||
return "precise"
|
return "precise"
|
||||||
else:
|
else:
|
||||||
raise Exception("unsupported build_os: %s" % build_os)
|
raise Exception("unsupported build_os: %s" % build_os)
|
||||||
|
elif self.n == 'debian':
|
||||||
|
if build_os == 'debian71':
|
||||||
|
return 'wheezy'
|
||||||
|
else:
|
||||||
|
raise Exception("unsupported build_os: %s" % build_os)
|
||||||
else:
|
else:
|
||||||
raise Exception("unsupported distro: %s" % self.n)
|
raise Exception("unsupported distro: %s" % self.n)
|
||||||
|
|
||||||
@ -174,12 +192,14 @@ class Distro(object):
|
|||||||
|
|
||||||
def build_os(self):
|
def build_os(self):
|
||||||
"""Return the build os label in the binary package to download ("rhel57" and "rhel62"
|
"""Return the build os label in the binary package to download ("rhel57" and "rhel62"
|
||||||
for redhat, "ubuntu1204" for Ubuntu and Debian)"""
|
for redhat, "ubuntu1204" for Ubuntu and "debian71" for Debian)"""
|
||||||
|
|
||||||
if re.search("^(debian|ubuntu)", self.n):
|
if re.search("(redhat|fedora|centos)", self.n):
|
||||||
return [ "ubuntu1204" ]
|
|
||||||
elif re.search("(redhat|fedora|centos)", self.n):
|
|
||||||
return [ "rhel62", "rhel57" ]
|
return [ "rhel62", "rhel57" ]
|
||||||
|
elif self.n == 'ubuntu':
|
||||||
|
return [ "ubuntu1204" ]
|
||||||
|
elif self.n == 'debian':
|
||||||
|
return [ "debian71" ]
|
||||||
else:
|
else:
|
||||||
raise Exception("BUG: unsupported platform?")
|
raise Exception("BUG: unsupported platform?")
|
||||||
|
|
||||||
@ -421,7 +441,7 @@ def make_deb_repo(repo, distro, build_os, spec):
|
|||||||
# Note: the Debian repository Packages files must be generated
|
# Note: the Debian repository Packages files must be generated
|
||||||
# very carefully in order to be usable.
|
# very carefully in order to be usable.
|
||||||
oldpwd=os.getcwd()
|
oldpwd=os.getcwd()
|
||||||
os.chdir(repo+"../../../../")
|
os.chdir(repo+"../../../../../../")
|
||||||
try:
|
try:
|
||||||
dirs=set([os.path.dirname(deb)[2:] for deb in backtick(["find", ".", "-name", "*.deb"]).split()])
|
dirs=set([os.path.dirname(deb)[2:] for deb in backtick(["find", ".", "-name", "*.deb"]).split()])
|
||||||
for d in dirs:
|
for d in dirs:
|
||||||
@ -447,9 +467,9 @@ Label: mongodb
|
|||||||
Suite: mongodb
|
Suite: mongodb
|
||||||
Codename: %s/mongodb-enterprise
|
Codename: %s/mongodb-enterprise
|
||||||
Architectures: amd64
|
Architectures: amd64
|
||||||
Components: multiverse
|
Components: %s
|
||||||
Description: MongoDB packages
|
Description: MongoDB packages
|
||||||
""" % (distro.repo_os_version(build_os))
|
""" % (distro.repo_os_version(build_os), distro.repo_component())
|
||||||
if os.path.exists(repo+"../../Release"):
|
if os.path.exists(repo+"../../Release"):
|
||||||
os.unlink(repo+"../../Release")
|
os.unlink(repo+"../../Release")
|
||||||
if os.path.exists(repo+"../../Release.gpg"):
|
if os.path.exists(repo+"../../Release.gpg"):
|
||||||
|
Loading…
Reference in New Issue
Block a user