X-Git-Url: http://git.pld-linux.org/?a=blobdiff_plain;f=mongodb.spec;h=5848e409e57101fd9d39e09dc56d8f042cc4b491;hb=2606b0a5c8ba9b07b3c228ce4d2a8cef417e37d7;hp=fde82890e12529285f747790bc4b3a7a33ce6650;hpb=4f4a6eae680d3156990c89e4acc1f4d35a893392;p=packages%2Fmongodb.git diff --git a/mongodb.spec b/mongodb.spec index fde8289..5848e40 100644 --- a/mongodb.spec +++ b/mongodb.spec @@ -1,31 +1,40 @@ -# TODO: pass rpmldflags +# TODO: +# - add support for sharding server (init scripts, systemd units, sample config) +# - 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.6 +Version: 2.2.2 Release: 3 License: AGPL v3 Group: Applications/Databases Source0: http://downloads.mongodb.org/src/%{name}-src-r%{version}.tar.gz -# Source0-md5: b3b32fecdcbe8e8068ec2989be9d2da4 +# Source0-md5: 697c448271358545a8a40a973f88edf4 Source1: %{name}.logrotate Source2: %{name}.init -Patch0: config.patch +Source3: mongod-default.conf +Source4: mongod@.service +Patch0: %{name}-cflags.patch Patch1: %{name}-system-libs.patch -Patch2: %{name}-build.patch -Patch3: boost-1.50.patch +Patch2: boost-1.50.patch +Patch3: %{name}-install.patch URL: http://www.mongodb.org/ -BuildRequires: boost-devel >= 1.42 +BuildRequires: boost-devel >= 1.50 BuildRequires: libpcap-devel BuildRequires: libstdc++-devel >= 6:4.0 +%ifarch x86_64 +BuildRequires: libtcmalloc-devel +%endif BuildRequires: pcre-cxx-devel -BuildRequires: pcre-devel +BuildRequires: pcre-devel >= 8.30 BuildRequires: readline-devel -BuildRequires: rpmbuild(macros) >= 1.228 +BuildRequires: rpmbuild(macros) >= 1.644 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 @@ -66,7 +75,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. @@ -85,7 +95,7 @@ oprogramowania klienckiego dla MongoDB. Summary: Static MongoDB client library Summary(pl.UTF-8): Statyczna biblioteka kliencka MongoDB Group: Development/Libraries -Requires: %{name}-libs = %{version}-%{release} +#Requires: %{name}-libs = %{version}-%{release} %description static Mongo (from "huMONGOus") is a schema-free document-oriented database. @@ -103,6 +113,7 @@ Summary: MongoDB server, sharding server, and support scripts Summary(pl.UTF-8): Serwer MongoDB, serwer dzielący oraz skrypty pomocnicze Group: Applications/Databases Requires: %{name} = %{version}-%{release} +Requires: systemd-units >= 38 Requires(post,preun): /sbin/chkconfig Requires(postun): /usr/sbin/groupdel Requires(postun): /usr/sbin/userdel @@ -134,19 +145,20 @@ konfiguracji oraz skrypty init.d. %patch1 -p1 %patch2 -p1 %patch3 -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} +%{__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} @@ -154,24 +166,35 @@ find -type f -executable | xargs chmod a-x rm -rf $RPM_BUILD_ROOT install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_mandir}/man1} \ $RPM_BUILD_ROOT/etc/{logrotate.d,rc.d/init.d,sysconfig,mongod} \ - $RPM_BUILD_ROOT%{_var}/{lib,log}/mongo + $RPM_BUILD_ROOT%{_var}/{lib,log{,/archive}}/mongo \ + $RPM_BUILD_ROOT%{systemdunitdir} # 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/default.conf +install %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/mongod/default.conf cp -p debian/*.1 $RPM_BUILD_ROOT%{_mandir}/man1 +# mask out the LSB service +ln -s /dev/null $RPM_BUILD_ROOT%{systemdunitdir}/mongod.service +install %{SOURCE4} $RPM_BUILD_ROOT%{systemdunitdir}/mongod@.service + touch $RPM_BUILD_ROOT%{_var}/log/mongo/mongod.log +# for some reason these are installed twice, remove unwanted copies +for f in $RPM_BUILD_ROOT%{_includedir}/mongo/* ; do + rm -r "$RPM_BUILD_ROOT%{_includedir}/$(basename $f)" || : +done + %clean rm -rf $RPM_BUILD_ROOT @@ -185,11 +208,23 @@ rm -rf $RPM_BUILD_ROOT %post server /sbin/chkconfig --add mongod %service mongod restart +# our systemd macros cannot handle template (multi-instance) units yet +export SYSTEMD_LOG_LEVEL=warning SYSTEMD_LOG_TARGET=syslog +/bin/systemd_booted && /bin/systemctl --quiet daemon-reload || : +if [ $1 -eq 1 ]; then + /bin/systemctl --quiet enable mongod@.service || : + /bin/systemd_booted && echo 'Run "/bin/systemctl start mongod@default.service" to start mongod.' || : +else + /bin/systemd_booted && /bin/systemctl --quiet try-restart mongod@default.service || : +fi %preun server if [ "$1" = "0" ]; then %service -q mongod stop /sbin/chkconfig --del mongod + export SYSTEMD_LOG_LEVEL=warning SYSTEMD_LOG_TARGET=syslog + /bin/systemd_booted && /bin/systemctl --quiet stop mongod@default.service || : + /bin/systemctl --quiet disable mongod@.service || : fi %postun server @@ -197,6 +232,7 @@ if [ "$1" = "0" ]; then %userremove mongod %groupremove mongod fi +%systemd_reload %triggerpostun server -- %{name}-server < 2.0.6-3 if [ -f %{_sysconfdir}/mongod.conf.rpmsave ] ; then @@ -215,6 +251,8 @@ fi %attr(755,root,root) %{_bindir}/mongoexport %attr(755,root,root) %{_bindir}/mongofiles %attr(755,root,root) %{_bindir}/mongoimport +%attr(755,root,root) %{_bindir}/mongooplog +%attr(755,root,root) %{_bindir}/mongoperf %attr(755,root,root) %{_bindir}/mongorestore %attr(755,root,root) %{_bindir}/mongosniff %attr(755,root,root) %{_bindir}/mongostat @@ -229,9 +267,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) @@ -254,5 +294,8 @@ 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 +%{systemdunitdir}/mongod.service +%{systemdunitdir}/mongod@.service