-# TODO: pass rpmldflags, rpmcppflags
+# TODO: pass rpmldflags
Summary: MongoDB client shell and tools
Summary(pl.UTF-8): Powłoka kliencka i narzędzia dla bazy danych MongoDB
Name: mongodb
-Version: 1.8.3
-Release: 0.1
-License: AGPL 3.0
+Version: 2.0.1
+Release: 1
+License: AGPL v3
Group: Applications/Databases
Source0: http://downloads.mongodb.org/src/%{name}-src-r%{version}.tar.gz
-# Source0-md5: 662e7ad6ff9f8e4d16c72c038b4a0c60
+# Source0-md5: cb8579074b7c9752eb382a2094ac4523
Source1: %{name}.logrotate
Source2: %{name}.init
Patch0: config.patch
+Patch1: %{name}-system-libs.patch
+Patch2: %{name}-build.patch
URL: http://www.mongodb.org/
BuildRequires: boost-devel >= 1.42
BuildRequires: libpcap-devel
BuildRequires: rpmbuild(macros) >= 1.228
BuildRequires: scons >= 1.2
BuildRequires: sed >= 4.0
+BuildRequires: snappy-devel
BuildRequires: v8-devel
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%prep
%setup -q -n %{name}-src-r%{version}
%patch0 -p1
-%{__sed} -i 's,-O3,%{rpmcxxflags},;/,\.\.\/v8/d' SConstruct
+%patch1 -p1
+%patch2 -p1
+%{__sed} -i -e 's,-O3,%{rpmcxxflags} %{rpmcppflags},' SConstruct
# Fix permissions
find -type f -executable | xargs chmod a-x
+# force system pcre/js/snappy
+%{__rm} -r third_party/{js-1.7,pcre-7.4,snappy,*.py}
+
%build
+export LDFLAGS="%{rpmldflags} =-fuse-ld=bfd"
%scons \
--prefix=$RPM_BUILD_ROOT%{_prefix} \
--sharedclient \
--usev8 \
--cxx=%{__cxx}
-# XXX really should have shared library here
-
%install
rm -rf $RPM_BUILD_ROOT
install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_mandir}/man1} \
$RPM_BUILD_ROOT/etc/{logrotate.d,rc.d/init.d,sysconfig} \
$RPM_BUILD_ROOT%{_var}/{lib,log}/mongo
+# XXX: scons is so great, recompiles everything here!
+export LDFLAGS="%{rpmldflags} =-fuse-ld=bfd"
%scons install \
--prefix=$RPM_BUILD_ROOT%{_prefix} \
--sharedclient \
--full \
- --usev8
+ --usev8 \
+ --cxx=%{__cxx}
cp -p %{SOURCE1} $RPM_BUILD_ROOT/etc/logrotate.d/mongod
install -p %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/mongod
%files
%defattr(644,root,root,755)
%doc README GNU-AGPL-3.0.txt
+%attr(755,root,root) %{_bindir}/bsondump
%attr(755,root,root) %{_bindir}/mongo
%attr(755,root,root) %{_bindir}/mongodump
%attr(755,root,root) %{_bindir}/mongoexport
%attr(755,root,root) %{_bindir}/mongorestore
%attr(755,root,root) %{_bindir}/mongosniff
%attr(755,root,root) %{_bindir}/mongostat
-%attr(755,root,root) %{_bindir}/bsondump
+%attr(755,root,root) %{_bindir}/mongotop
+%{_mandir}/man1/bsondump.1*
%{_mandir}/man1/mongo.1*
%{_mandir}/man1/mongodump.1*
%{_mandir}/man1/mongoexport.1*