2 # - add support for sharding server (init scripts, systemd units, sample config)
3 # - \> escape not liked?
4 # Sep 11 00:20:18 blodnatt systemd[1]: [/lib/systemd/system/mongod@.service:8] Invalid escape sequences in command line: "/bin/sh -c "if grep -q '^[ \t]*fork\>' /etc/mongod/%i.conf ; then echo there must be no 'fork' in /etc/mongod/%i.conf >&2 ; exit 1 ; fi""
7 Summary: MongoDB client shell and tools
8 Summary(pl.UTF-8): Powłoka kliencka i narzędzia dla bazy danych MongoDB
13 Group: Applications/Databases
14 Source0: http://downloads.mongodb.org/src/%{name}-src-r%{version}.tar.gz
15 # Source0-md5: 033354c543c053f5d539b573ac8c28b0
16 Source1: %{name}.logrotate
18 Source3: mongod-default.conf
19 Source4: mongod@.service
20 Patch0: %{name}-cflags.patch
21 Patch1: %{name}-system-libs.patch
22 Patch2: boost-1.50.patch
23 Patch3: %{name}-install.patch
24 Patch4: %{name}-shared.patch
26 Patch6: no-Werror.patch
28 URL: http://www.mongodb.org/
29 BuildRequires: boost-devel >= 1.50
30 BuildRequires: libpcap-devel
31 BuildRequires: libstdc++-devel >= 6:4.0
33 BuildRequires: libtcmalloc-devel
35 BuildRequires: pcre-cxx-devel
36 BuildRequires: pcre-devel >= 8.30
37 BuildRequires: readline-devel
38 BuildRequires: rpmbuild(macros) >= 1.644
39 BuildRequires: scons >= 1.2
40 BuildRequires: sed >= 4.0
41 BuildRequires: snappy-devel
42 BuildRequires: v8-devel
43 Requires: %{name}-libs = %{version}-%{release}
45 ExclusiveArch: %{ix86} %{x8664} arm mips
46 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
49 Mongo (from "huMONGOus") is a schema-free document-oriented database.
50 It features dynamic profileable queries, full indexing, replication
51 and fail-over support, efficient storage of large binary data objects,
54 This package provides the mongo shell, import/export tools, and other
57 %description -l pl.UTF-8
58 Mongo (od "huMONGOus") to baza danych zorientowana na dokumenty
59 pozbawione schematu. Obsługuje dynamicznie profilowane zapytania,
60 pełne indeksowanie, replikację i fail-over, wydajne składowanie dużych
61 obiektów danych binarnych oraz automatyczne dzielenie.
63 Ten pakiet zawiera powłokę mongo, narzędzia do eksportu/importu danych
64 oraz inne narzędzia klienckie.
67 Summary: MongoDB client library
68 Summary(pl.UTF-8): Biblioteka kliencka MongoDB
72 Mongo (from "huMONGOus") is a schema-free document-oriented database.
74 This package provides the mongo client library.
76 %description libs -l pl.UTF-8
77 Mongo (od "huMONGOus") to baza danych zorientowana na dokumenty
80 Ten pakiet zawiera bibliotekę kliencką mongo.
83 Summary: Header files for MongoDB client library
84 Summary(pl.UTF-8): Pliki nagłówkowe biblioteki klienckiej MongoDB
85 Group: Development/Libraries
86 Requires: %{name}-libs = %{version}-%{release}
89 Mongo (from "huMONGOus") is a schema-free document-oriented database.
91 This package provides the header files needed to develop MongoDB
94 %description devel -l pl.UTF-8
95 Mongo (od "huMONGOus") to baza danych zorientowana na dokumenty
98 Ten pakiet zawiera pliki nagłówkowe potrzebne do tworzenia
99 oprogramowania klienckiego dla MongoDB.
102 Summary: Static MongoDB client library
103 Summary(pl.UTF-8): Statyczna biblioteka kliencka MongoDB
104 Group: Development/Libraries
105 Requires: %{name}-devel = %{version}-%{release}
108 Mongo (from "huMONGOus") is a schema-free document-oriented database.
110 This package provides the MongoDB static client library.
112 %description static -l pl.UTF-8
113 Mongo (od "huMONGOus") to baza danych zorientowana na dokumenty
116 Ten pakiet zawiera statyczną bibliotekę kliencką MongoDB.
119 Summary: MongoDB server, sharding server, and support scripts
120 Summary(pl.UTF-8): Serwer MongoDB, serwer dzielący oraz skrypty pomocnicze
121 Group: Applications/Databases
122 Requires: %{name} = %{version}-%{release}
123 Requires: systemd-units >= 38
124 Requires(post,preun): /sbin/chkconfig
125 Requires(postun): /usr/sbin/groupdel
126 Requires(postun): /usr/sbin/userdel
127 Requires(pre): /bin/id
128 Requires(pre): /usr/bin/getgid
129 Requires(pre): /usr/sbin/groupadd
130 Requires(pre): /usr/sbin/useradd
132 Provides: group(mongod)
133 Provides: user(mongod)
134 Conflicts: logrotate < 3.8.0
137 Mongo (from "huMONGOus") is a schema-free document-oriented database.
139 This package provides the mongo server software, mongo sharding server
140 software, default configuration files, and init.d scripts.
142 %description server -l pl.UTF-8
143 Mongo (od "huMONGOus") to baza danych zorientowana na dokumenty
146 Ten pakiet zawiera serwer mongo, serwer dzielący, pliki domyślnej
147 konfiguracji oraz skrypty init.d.
150 %setup -q -n %{name}-src-r%{version}
161 find -type f -executable | xargs chmod a-x
163 # force system pcre/js/snappy
164 %{__rm} -r src/third_party/{js-1.7,pcre-8.30,snappy,boost}
168 CPPFLAGS="%{rpmcppflags} -DXP_UNIX" \
169 --use-system-all=yes \
170 --extralib=pcrecpp,pcre,snappy \
171 --prefix=$RPM_BUILD_ROOT%{_prefix} \
178 rm -rf $RPM_BUILD_ROOT
179 install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_mandir}/man1} \
180 $RPM_BUILD_ROOT/etc/{logrotate.d,rc.d/init.d,sysconfig,mongod} \
181 $RPM_BUILD_ROOT%{_var}/{lib,log{,/archive}}/mongodb \
182 $RPM_BUILD_ROOT%{systemdunitdir}
184 # XXX: scons is so great, recompiles everything here!
186 CPPFLAGS="%{rpmcppflags} -DXP_UNIX" \
187 --use-system-all=yes \
188 --extralib=pcrecpp,pcre,snappy \
189 --prefix=$RPM_BUILD_ROOT%{_prefix} \
195 cp -p %{SOURCE1} $RPM_BUILD_ROOT/etc/logrotate.d/mongod
196 install -p %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/mongod
197 cp -p rpm/mongod.sysconfig $RPM_BUILD_ROOT/etc/sysconfig/mongod
198 cp -p %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/mongod/default.conf
199 cp -p debian/*.1 $RPM_BUILD_ROOT%{_mandir}/man1
201 # mask out the LSB service
202 ln -s /dev/null $RPM_BUILD_ROOT%{systemdunitdir}/mongod.service
203 cp -p %{SOURCE4} $RPM_BUILD_ROOT%{systemdunitdir}/mongod@.service
205 touch $RPM_BUILD_ROOT%{_var}/log/mongodb/mongod.log
207 # for some reason these are installed twice, remove unwanted copies
208 for f in $RPM_BUILD_ROOT%{_includedir}/mongo/*; do
209 rm -r "$RPM_BUILD_ROOT%{_includedir}/$(basename $f)" || :
213 chmod -R a+rX $RPM_BUILD_ROOT/usr/lib
214 %{__rm} -r $RPM_BUILD_ROOT/usr/lib
218 rm -rf $RPM_BUILD_ROOT
220 %post libs -p /sbin/ldconfig
221 %postun libs -p /sbin/ldconfig
224 %groupadd -g 258 -r mongod
225 %useradd -u 258 -r -g mongod -d %{_var}/lib/mongodb -s /bin/false -c "MongoDB Database Server" mongod
228 /sbin/chkconfig --add mongod
229 %service mongod restart
230 # our systemd macros cannot handle template (multi-instance) units yet
231 export SYSTEMD_LOG_LEVEL=warning SYSTEMD_LOG_TARGET=syslog
232 /bin/systemd_booted && /bin/systemctl --quiet daemon-reload || :
233 if [ $1 -eq 1 ]; then
234 /bin/systemctl --quiet enable mongod@.service || :
235 /bin/systemd_booted && echo 'Run "/bin/systemctl start mongod@default.service" to start mongod.' || :
237 /bin/systemd_booted && /bin/systemctl --quiet try-restart mongod@default.service || :
241 if [ "$1" = "0" ]; then
242 %service -q mongod stop
243 /sbin/chkconfig --del mongod
244 export SYSTEMD_LOG_LEVEL=warning SYSTEMD_LOG_TARGET=syslog
245 /bin/systemd_booted && /bin/systemctl --quiet stop mongod@default.service || :
246 /bin/systemctl --quiet disable mongod@.service || :
250 if [ "$1" = "0" ]; then
256 %triggerpostun server -- %{name}-server < 2.0.6-3
257 if [ -f %{_sysconfdir}/mongod.conf.rpmsave ] ; then
258 cp -f %{_sysconfdir}/mongod/default.conf{,.rpmnew} || :
259 echo "Moving %{_sysconfdir}/mongod.conf to %{_sysconfdir}/mongod/default.conf"
260 mv -f %{_sysconfdir}/mongod.conf.rpmsave %{_sysconfdir}/mongod/default.conf
261 %service mongod restart
265 %defattr(644,root,root,755)
266 %doc README GNU-AGPL-3.0.txt
267 %attr(755,root,root) %{_bindir}/bsondump
268 %attr(755,root,root) %{_bindir}/mongo
269 %attr(755,root,root) %{_bindir}/mongodump
270 %attr(755,root,root) %{_bindir}/mongoexport
271 %attr(755,root,root) %{_bindir}/mongofiles
272 %attr(755,root,root) %{_bindir}/mongoimport
273 %attr(755,root,root) %{_bindir}/mongooplog
274 %attr(755,root,root) %{_bindir}/mongoperf
275 %attr(755,root,root) %{_bindir}/mongorestore
276 %attr(755,root,root) %{_bindir}/mongosniff
277 %attr(755,root,root) %{_bindir}/mongostat
278 %attr(755,root,root) %{_bindir}/mongotop
279 %{_mandir}/man1/bsondump.1*
280 %{_mandir}/man1/mongo.1*
281 %{_mandir}/man1/mongodump.1*
282 %{_mandir}/man1/mongoexport.1*
283 %{_mandir}/man1/mongofiles.1*
284 %{_mandir}/man1/mongoimport.1*
285 %{_mandir}/man1/mongosniff.1*
286 %{_mandir}/man1/mongostat.1*
287 %{_mandir}/man1/mongorestore.1*
290 %defattr(644,root,root,755)
291 %attr(755,root,root) %{_libdir}/libmongoclient.so
294 %defattr(644,root,root,755)
298 %defattr(644,root,root,755)
299 %{_libdir}/libmongoclient.a
302 %defattr(644,root,root,755)
303 %dir %{_sysconfdir}/mongod
304 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mongod/default.conf
305 %attr(754,root,root) /etc/rc.d/init.d/mongod
306 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/mongod
307 %config(noreplace) /etc/logrotate.d/mongod
308 %{systemdunitdir}/mongod.service
309 %{systemdunitdir}/mongod@.service
310 %attr(755,root,root) %{_bindir}/mongod
311 %attr(755,root,root) %{_bindir}/mongos
312 %{_mandir}/man1/mongod.1*
313 %{_mandir}/man1/mongos.1*
314 %attr(755,mongod,mongod) %dir %{_var}/lib/mongodb
315 %attr(775,root,mongod) %dir %{_var}/log/mongodb
316 %attr(775,root,mongod) %dir %{_var}/log/archive/mongodb
317 %attr(640,mongod,mongod) %config(noreplace) %verify(not md5 mtime size) %{_var}/log/mongodb/mongod.log