]> git.pld-linux.org Git - packages/mongodb.git/blobdiff - mongodb.spec
Version: 2.2.0
[packages/mongodb.git] / mongodb.spec
index 16868f74c829956f4bc26969834d266494e8c1ea..2fdd988fd7da1556b150b7e5fbbf7c64848cb11f 100644 (file)
@@ -1,30 +1,34 @@
-# TODO: pass rpmldflags
+# TODO:
+#      - fix 'libs' subpackage (disabled due to broken 'sharedclient' build option)
+#
 Summary:       MongoDB client shell and tools
 Summary(pl.UTF-8):     Powłoka kliencka i narzędzia dla bazy danych MongoDB
 Name:          mongodb
-Version:       2.0.1
-Release:       2
+Version:       2.2.0
+Release:       0.1
 License:       AGPL v3
 Group:         Applications/Databases
 Source0:       http://downloads.mongodb.org/src/%{name}-src-r%{version}.tar.gz
-# Source0-md5: cb8579074b7c9752eb382a2094ac4523
+# Source0-md5: 832bdb6cc659176fd8d6b16a660ccfc6
 Source1:       %{name}.logrotate
 Source2:       %{name}.init
-Patch0:                config.patch
+Patch0:                %{name}-cflags.patch
 Patch1:                %{name}-system-libs.patch
-Patch2:                %{name}-build.patch
+Patch2:                boost-1.50.patch
+Patch3:                %{name}-install.patch
 URL:           http://www.mongodb.org/
 BuildRequires: boost-devel >= 1.42
 BuildRequires: libpcap-devel
 BuildRequires: libstdc++-devel >= 6:4.0
 BuildRequires: pcre-cxx-devel
-BuildRequires: pcre-devel
+BuildRequires: pcre-devel >= 8.30
 BuildRequires: readline-devel
 BuildRequires: rpmbuild(macros) >= 1.228
 BuildRequires: scons >= 1.2
 BuildRequires: sed >= 4.0
 BuildRequires: snappy-devel
 BuildRequires: v8-devel
+Requires:      %{name}-libs = %{version}-%{release}
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %description
@@ -65,7 +69,8 @@ Ten pakiet zawiera bibliotekę kliencką mongo.
 Summary:       Header files for MongoDB client library
 Summary(pl.UTF-8):     Pliki nagłówkowe biblioteki klienckiej MongoDB
 Group:         Development/Libraries
-Requires:      %{name}-libs = %{version}-%{release}
+#Requires:     %{name}-libs = %{version}-%{release}
+Requires:      %{name}-static = %{version}-%{release}
 
 %description devel
 Mongo (from "huMONGOus") is a schema-free document-oriented database.
@@ -132,40 +137,43 @@ konfiguracji oraz skrypty init.d.
 %patch0 -p1
 %patch1 -p1
 %patch2 -p1
-%{__sed} -i -e 's,-O3,%{rpmcxxflags} %{rpmcppflags},' SConstruct
+%patch3 -p1
 
 # 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}
+%{__rm} -r src/third_party/{js-1.7,pcre-8.30,snappy,boost}
 
 %build
 %scons \
+       CPPFLAGS="%{rpmcppflags} -DXP_UNIX" \
+       --use-system-all=yes \
+       --extralib=pcrecpp,pcre,snappy \
        --prefix=$RPM_BUILD_ROOT%{_prefix} \
-       --sharedclient \
-       --full all \
+       --full=all \
        --usev8 \
        --cxx=%{__cxx}
 
 %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/etc/{logrotate.d,rc.d/init.d,sysconfig,mongod} \
        $RPM_BUILD_ROOT%{_var}/{lib,log}/mongo
 
 # XXX: scons is so great, recompiles everything here!
 %scons install \
+       --use-system-all=yes \
+       --extralib=pcrecpp,pcre,snappy \
        --prefix=$RPM_BUILD_ROOT%{_prefix} \
-       --sharedclient \
-       --full \
+       --full=all \
        --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
 cp -p rpm/mongod.sysconfig $RPM_BUILD_ROOT/etc/sysconfig/mongod
-cp -p rpm/mongod.conf $RPM_BUILD_ROOT%{_sysconfdir}/mongod.conf
+cp -p rpm/mongod.conf $RPM_BUILD_ROOT%{_sysconfdir}/mongod/default.conf
 cp -p debian/*.1 $RPM_BUILD_ROOT%{_mandir}/man1
 
 touch $RPM_BUILD_ROOT%{_var}/log/mongo/mongod.log
@@ -196,6 +204,14 @@ if [ "$1" = "0" ]; then
        %groupremove mongod
 fi
 
+%triggerpostun server -- %{name}-server < 2.0.6-3
+if [ -f %{_sysconfdir}/mongod.conf.rpmsave ] ; then
+       cp -f %{_sysconfdir}/mongod/default.conf{,.rpmnew} || :
+       echo "Moving %{_sysconfdir}/mongod.conf to %{_sysconfdir}/mongod/default.conf"
+       mv -f %{_sysconfdir}/mongod.conf.rpmsave %{_sysconfdir}/mongod/default.conf
+       %service mongod restart
+fi
+
 %files
 %defattr(644,root,root,755)
 %doc README GNU-AGPL-3.0.txt
@@ -219,9 +235,11 @@ fi
 %{_mandir}/man1/mongostat.1*
 %{_mandir}/man1/mongorestore.1*
 
+%if 0
 %files libs
 %defattr(644,root,root,755)
 %attr(755,root,root) %{_libdir}/libmongoclient.so
+%endif
 
 %files devel
 %defattr(644,root,root,755)
@@ -233,8 +251,9 @@ fi
 
 %files server
 %defattr(644,root,root,755)
-%dir %{_sysconfdir}
-%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mongod.conf
+#%dir %{_sysconfdir}
+%dir %{_sysconfdir}/mongod
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mongod/default.conf
 %attr(754,root,root) /etc/rc.d/init.d/mongod
 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/mongod
 %config(noreplace) /etc/logrotate.d/mongod
@@ -243,5 +262,6 @@ fi
 %{_mandir}/man1/mongod.1*
 %{_mandir}/man1/mongos.1*
 %attr(755,mongod,mongod) %dir %{_var}/lib/mongo
-%attr(755,mongod,mongod) %dir %{_var}/log/mongo
+%attr(775,root,mongod) %dir %{_var}/log/mongo
+%attr(775,root,mongod) %dir %{_var}/log/archive/mongo
 %attr(640,mongod,mongod) %config(noreplace) %verify(not md5 mtime size) %{_var}/log/mongo/mongod.log
This page took 0.071527 seconds and 4 git commands to generate.