2 # - fix 'libs' subpackage (disabled due to broken 'sharedclient' build option)
4 Summary: MongoDB client shell and tools
5 Summary(pl.UTF-8): Powłoka kliencka i narzędzia dla bazy danych MongoDB
10 Group: Applications/Databases
11 Source0: http://downloads.mongodb.org/src/%{name}-src-r%{version}.tar.gz
12 # Source0-md5: 832bdb6cc659176fd8d6b16a660ccfc6
13 Source1: %{name}.logrotate
15 Source3: mongod-default.conf
16 Patch0: %{name}-cflags.patch
17 Patch1: %{name}-system-libs.patch
18 Patch2: boost-1.50.patch
19 Patch3: %{name}-install.patch
20 URL: http://www.mongodb.org/
21 BuildRequires: boost-devel >= 1.50
22 BuildRequires: libpcap-devel
23 BuildRequires: libstdc++-devel >= 6:4.0
25 BuildRequires: libtcmalloc-devel
27 BuildRequires: pcre-cxx-devel
28 BuildRequires: pcre-devel >= 8.30
29 BuildRequires: readline-devel
30 BuildRequires: rpmbuild(macros) >= 1.228
31 BuildRequires: scons >= 1.2
32 BuildRequires: sed >= 4.0
33 BuildRequires: snappy-devel
34 BuildRequires: v8-devel
35 #Requires: %{name}-libs = %{version}-%{release}
36 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
39 Mongo (from "huMONGOus") is a schema-free document-oriented database.
40 It features dynamic profileable queries, full indexing, replication
41 and fail-over support, efficient storage of large binary data objects,
44 This package provides the mongo shell, import/export tools, and other
47 %description -l pl.UTF-8
48 Mongo (od "huMONGOus") to baza danych zorientowana na dokumenty
49 pozbawione schematu. Obsługuje dynamicznie profilowane zapytania,
50 pełne indeksowanie, replikację i fail-over, wydajne składowanie dużych
51 obiektów danych binarnych oraz automatyczne dzielenie.
53 Ten pakiet zawiera powłokę mongo, narzędzia do eksportu/importu danych
54 oraz inne narzędzia klienckie.
57 Summary: MongoDB client library
58 Summary(pl.UTF-8): Biblioteka kliencka MongoDB
62 Mongo (from "huMONGOus") is a schema-free document-oriented database.
64 This package provides the mongo client library.
66 %description libs -l pl.UTF-8
67 Mongo (od "huMONGOus") to baza danych zorientowana na dokumenty
70 Ten pakiet zawiera bibliotekę kliencką mongo.
73 Summary: Header files for MongoDB client library
74 Summary(pl.UTF-8): Pliki nagłówkowe biblioteki klienckiej MongoDB
75 Group: Development/Libraries
76 #Requires: %{name}-libs = %{version}-%{release}
77 Requires: %{name}-static = %{version}-%{release}
80 Mongo (from "huMONGOus") is a schema-free document-oriented database.
82 This package provides the header files needed to develop MongoDB
85 %description devel -l pl.UTF-8
86 Mongo (od "huMONGOus") to baza danych zorientowana na dokumenty
89 Ten pakiet zawiera pliki nagłówkowe potrzebne do tworzenia
90 oprogramowania klienckiego dla MongoDB.
93 Summary: Static MongoDB client library
94 Summary(pl.UTF-8): Statyczna biblioteka kliencka MongoDB
95 Group: Development/Libraries
96 #Requires: %{name}-libs = %{version}-%{release}
99 Mongo (from "huMONGOus") is a schema-free document-oriented database.
101 This package provides the MongoDB static client library.
103 %description static -l pl.UTF-8
104 Mongo (od "huMONGOus") to baza danych zorientowana na dokumenty
107 Ten pakiet zawiera statyczną bibliotekę kliencką MongoDB.
110 Summary: MongoDB server, sharding server, and support scripts
111 Summary(pl.UTF-8): Serwer MongoDB, serwer dzielący oraz skrypty pomocnicze
112 Group: Applications/Databases
113 Requires: %{name} = %{version}-%{release}
114 Requires(post,preun): /sbin/chkconfig
115 Requires(postun): /usr/sbin/groupdel
116 Requires(postun): /usr/sbin/userdel
117 Requires(pre): /bin/id
118 Requires(pre): /usr/bin/getgid
119 Requires(pre): /usr/sbin/groupadd
120 Requires(pre): /usr/sbin/useradd
122 Provides: group(mongod)
123 Provides: user(mongod)
124 Conflicts: logrotate < 3.8.0
127 Mongo (from "huMONGOus") is a schema-free document-oriented database.
129 This package provides the mongo server software, mongo sharding server
130 software, default configuration files, and init.d scripts.
132 %description server -l pl.UTF-8
133 Mongo (od "huMONGOus") to baza danych zorientowana na dokumenty
136 Ten pakiet zawiera serwer mongo, serwer dzielący, pliki domyślnej
137 konfiguracji oraz skrypty init.d.
140 %setup -q -n %{name}-src-r%{version}
147 find -type f -executable | xargs chmod a-x
149 # force system pcre/js/snappy
150 %{__rm} -r src/third_party/{js-1.7,pcre-8.30,snappy,boost}
154 CPPFLAGS="%{rpmcppflags} -DXP_UNIX" \
155 --use-system-all=yes \
156 --extralib=pcrecpp,pcre,snappy \
157 --prefix=$RPM_BUILD_ROOT%{_prefix} \
163 rm -rf $RPM_BUILD_ROOT
164 install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_mandir}/man1} \
165 $RPM_BUILD_ROOT/etc/{logrotate.d,rc.d/init.d,sysconfig,mongod} \
166 $RPM_BUILD_ROOT%{_var}/{lib,log{,/archive}}/mongo
168 # XXX: scons is so great, recompiles everything here!
170 --use-system-all=yes \
171 --extralib=pcrecpp,pcre,snappy \
172 --prefix=$RPM_BUILD_ROOT%{_prefix} \
177 cp -p %{SOURCE1} $RPM_BUILD_ROOT/etc/logrotate.d/mongod
178 install -p %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/mongod
179 cp -p rpm/mongod.sysconfig $RPM_BUILD_ROOT/etc/sysconfig/mongod
180 install %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/mongod/default.conf
181 cp -p debian/*.1 $RPM_BUILD_ROOT%{_mandir}/man1
183 touch $RPM_BUILD_ROOT%{_var}/log/mongo/mongod.log
185 # for some reason these are installed twice, remove unwanted copies
186 for f in $RPM_BUILD_ROOT%{_includedir}/mongo/* ; do
187 rm -r "$RPM_BUILD_ROOT%{_includedir}/$(basename $f)" || :
191 rm -rf $RPM_BUILD_ROOT
193 %post libs -p /sbin/ldconfig
194 %postun libs -p /sbin/ldconfig
197 %groupadd -g 258 -r mongod
198 %useradd -u 258 -r -g mongod -d %{_var}/lib/mongo -s /bin/false -c "MongoDB Database Server" mongod
201 /sbin/chkconfig --add mongod
202 %service mongod restart
205 if [ "$1" = "0" ]; then
206 %service -q mongod stop
207 /sbin/chkconfig --del mongod
211 if [ "$1" = "0" ]; then
216 %triggerpostun server -- %{name}-server < 2.0.6-3
217 if [ -f %{_sysconfdir}/mongod.conf.rpmsave ] ; then
218 cp -f %{_sysconfdir}/mongod/default.conf{,.rpmnew} || :
219 echo "Moving %{_sysconfdir}/mongod.conf to %{_sysconfdir}/mongod/default.conf"
220 mv -f %{_sysconfdir}/mongod.conf.rpmsave %{_sysconfdir}/mongod/default.conf
221 %service mongod restart
225 %defattr(644,root,root,755)
226 %doc README GNU-AGPL-3.0.txt
227 %attr(755,root,root) %{_bindir}/bsondump
228 %attr(755,root,root) %{_bindir}/mongo
229 %attr(755,root,root) %{_bindir}/mongodump
230 %attr(755,root,root) %{_bindir}/mongoexport
231 %attr(755,root,root) %{_bindir}/mongofiles
232 %attr(755,root,root) %{_bindir}/mongoimport
233 %attr(755,root,root) %{_bindir}/mongooplog
234 %attr(755,root,root) %{_bindir}/mongoperf
235 %attr(755,root,root) %{_bindir}/mongorestore
236 %attr(755,root,root) %{_bindir}/mongosniff
237 %attr(755,root,root) %{_bindir}/mongostat
238 %attr(755,root,root) %{_bindir}/mongotop
239 %{_mandir}/man1/bsondump.1*
240 %{_mandir}/man1/mongo.1*
241 %{_mandir}/man1/mongodump.1*
242 %{_mandir}/man1/mongoexport.1*
243 %{_mandir}/man1/mongofiles.1*
244 %{_mandir}/man1/mongoimport.1*
245 %{_mandir}/man1/mongosniff.1*
246 %{_mandir}/man1/mongostat.1*
247 %{_mandir}/man1/mongorestore.1*
251 %defattr(644,root,root,755)
252 %attr(755,root,root) %{_libdir}/libmongoclient.so
256 %defattr(644,root,root,755)
260 %defattr(644,root,root,755)
261 %{_libdir}/libmongoclient.a
264 %defattr(644,root,root,755)
266 %dir %{_sysconfdir}/mongod
267 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mongod/default.conf
268 %attr(754,root,root) /etc/rc.d/init.d/mongod
269 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/mongod
270 %config(noreplace) /etc/logrotate.d/mongod
271 %attr(755,root,root) %{_bindir}/mongod
272 %attr(755,root,root) %{_bindir}/mongos
273 %{_mandir}/man1/mongod.1*
274 %{_mandir}/man1/mongos.1*
275 %attr(755,mongod,mongod) %dir %{_var}/lib/mongo
276 %attr(775,root,mongod) %dir %{_var}/log/mongo
277 %attr(775,root,mongod) %dir %{_var}/log/archive/mongo
278 %attr(640,mongod,mongod) %config(noreplace) %verify(not md5 mtime size) %{_var}/log/mongo/mongod.log