[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#703061: mongodb: Enable building on kfreebsd



Source: mongodb
Version: 2.0.6-1
Severity: normal
Tags: upstream patch

Dear Maintainer,

I have modified mongodb so that it builds on kfreebsd-amd64 and probably
on kfreebsd-i386.  I have not made serious use of this package yet, but
as I noticed tests are run during the package building process I guess
this provides some level of confidence in the result.

Please consider my patch for a future release of mongodb.

Thanks,
Jeff Epler <jepler@unpythonic.net>

-- System Information:
Debian Release: 7.0
  APT prefers testing
  APT policy: (500, 'testing'), (1, 'experimental')
Architecture: kfreebsd-amd64 (x86_64)

Kernel: kFreeBSD 9.0-2-amd64
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
diff -Nru mongodb-2.0.6/debian/changelog mongodb-2.0.6/debian/changelog
--- mongodb-2.0.6/debian/changelog	2012-06-05 12:53:16.000000000 -0500
+++ mongodb-2.0.6/debian/changelog	2013-03-14 14:21:56.000000000 -0500
@@ -1,3 +1,10 @@
+mongodb (1:2.0.6-1.1) UNRELEASED; urgency=low
+
+  * Non-maintainer upload.
+  * Enable building on kfreebsd-*
+
+ -- Jeff Epler <jepler@unpythonic.net>  Thu, 14 Mar 2013 13:37:54 -0500
+
 mongodb (1:2.0.6-1) unstable; urgency=low
 
   * New upstream release 2.0.6
diff -Nru mongodb-2.0.6/debian/control mongodb-2.0.6/debian/control
--- mongodb-2.0.6/debian/control	2012-06-05 12:53:16.000000000 -0500
+++ mongodb-2.0.6/debian/control	2013-03-14 13:48:02.000000000 -0500
@@ -10,7 +10,7 @@
 Homepage: http://www.mongodb.org
 
 Package: mongodb
-Architecture: i386 amd64
+Architecture: i386 amd64 kfreebsd-i386 kfreebsd-amd64
 Depends: mongodb-server, mongodb-dev, ${shlibs:Depends}, ${misc:Depends}
 Description: object/document-oriented database (metapackage)
  MongoDB is a high-performance, open source, schema-free
@@ -33,7 +33,7 @@
  This is a metapackage that depends on all the mongodb parts.
 
 Package: mongodb-server
-Architecture: i386 amd64
+Architecture: i386 amd64 kfreebsd-i386 kfreebsd-amd64
 Depends: mongodb-clients, ${shlibs:Depends}, ${misc:Depends}, adduser
 Replaces: mongodb (<= 1:1.4.2-2)
 Description: object/document-oriented database (server package)
@@ -57,7 +57,7 @@
  This package contains the server itself.
 
 Package: mongodb-clients
-Architecture: i386 amd64
+Architecture: i386 amd64 kfreebsd-i386 kfreebsd-amd64
 Depends: ${shlibs:Depends}, ${misc:Depends}
 Replaces: mongodb (<= 1:1.4.2-2)
 Description: object/document-oriented database (client apps)
@@ -82,7 +82,7 @@
 
 Package: mongodb-dev
 Section: libdevel
-Architecture: i386 amd64
+Architecture: i386 amd64 kfreebsd-i386 kfreebsd-amd64
 Depends: libboost-dev, ${shlibs:Depends}, ${misc:Depends}
 Suggests: mongodb-server
 Replaces: mongodb (<= 1:1.4.2-2)
diff -Nru mongodb-2.0.6/debian/patches/0004-enable-build-on-kfreebsd.patch mongodb-2.0.6/debian/patches/0004-enable-build-on-kfreebsd.patch
--- mongodb-2.0.6/debian/patches/0004-enable-build-on-kfreebsd.patch	1969-12-31 18:00:00.000000000 -0600
+++ mongodb-2.0.6/debian/patches/0004-enable-build-on-kfreebsd.patch	2013-03-14 14:21:19.000000000 -0500
@@ -0,0 +1,59 @@
+Subject: Enable build on kfreebsd
+Author: Jeff Epler <jepler@unpythonic.net>
+Forwarded: no
+
+Just a few things prevent mongodb from building and passing its
+smoketests on kfreebsd-amd64.  Luckily enough, it seems that kfreebsd
+can be treated just like linux.
+
+--- a/SConstruct
++++ b/SConstruct
+@@ -394,7 +394,7 @@
+ 
+ if os.path.exists( "util/processinfo_" + os.sys.platform + ".cpp" ):
+     processInfoFiles += [ "util/processinfo_" + os.sys.platform + ".cpp" ]
+-elif os.sys.platform == "linux3":
++elif os.sys.platform in ('linux3', 'gnukfreebsd8', 'gnukfreebsd9'):
+     processInfoFiles += [ "util/processinfo_linux2.cpp" ]
+ else:
+     processInfoFiles += [ "util/processinfo_none.cpp" ]
+@@ -523,7 +523,7 @@
+         env.Append( CPPPATH=filterExists(["/sw/include" , "/opt/local/include"]) )
+         env.Append( LIBPATH=filterExists(["/sw/lib/", "/opt/local/lib"]) )
+ 
+-elif "linux2" == os.sys.platform or "linux3" == os.sys.platform:
++elif os.sys.platform in ('linux2', 'linux3', 'gnukfreebsd8', 'gnukfreebsd9'):
+     linux = True
+     platform = "linux"
+ 
+--- a/distsrc/client/SConstruct
++++ b/distsrc/client/SConstruct
+@@ -41,7 +41,7 @@
+ if "darwin" == os.sys.platform:
+     addExtraLibs( "/opt/local/" )
+     nix = True
+-elif "linux2" == os.sys.platform or "linux3" == os.sys.platform:
++elif os.sys.platform in ('linux2', 'linux3', 'gnukfreebsd8', 'gnukfreebsd9'):
+     nix = True
+     linux = True
+ 
+--- a/db/nonce.cpp
++++ b/db/nonce.cpp
+@@ -37,7 +37,7 @@
+         if( _initialized ) return;
+         _initialized = true;
+ 
+-#if defined(__linux__) || defined(__sunos__) || defined(__APPLE__)
++#if defined(__linux__) || defined(__sunos__) || defined(__APPLE__) || defined(__FreeBSD_kernel__)
+         _devrandom = new ifstream("/dev/urandom", ios::binary|ios::in);
+         massert( 10353 ,  "can't open dev/urandom", _devrandom->is_open() );
+ #elif defined(_WIN32)
+@@ -55,7 +55,7 @@
+     nonce64 Security::__getNonce() { 
+         dassert( _initialized );
+         nonce64 n;
+-#if defined(__linux__) || defined(__sunos__) || defined(__APPLE__)
++#if defined(__linux__) || defined(__sunos__) || defined(__APPLE__) || defined(__FreeBSD_kernel__)
+         _devrandom->read((char*)&n, sizeof(n));
+         massert(10355 , "devrandom failed", !_devrandom->fail());
+ #elif defined(_WIN32)
diff -Nru mongodb-2.0.6/debian/patches/series mongodb-2.0.6/debian/patches/series
--- mongodb-2.0.6/debian/patches/series	2012-06-05 12:53:16.000000000 -0500
+++ mongodb-2.0.6/debian/patches/series	2013-03-14 14:12:37.000000000 -0500
@@ -1,3 +1,4 @@
 0001-install-libs-to-usr-lib-not-usr-lib64-Closes-588557.patch
 0002-Ignore-unused-but-set-variables-and-params-Closes-62.patch
 0003-use-system-wide-pcre.patch
+0004-enable-build-on-kfreebsd.patch

Reply to: