]> git.pld-linux.org Git - packages/mongodb.git/blame_incremental - mongodb.spec
Release: 2
[packages/mongodb.git] / mongodb.spec
... / ...
CommitLineData
1# TODO:
2# - add support for sharding server (init scripts, systemd units, sample config)
3# - fix 'libs' subpackage (disabled due to broken 'sharedclient' build option)
4#
5Summary: MongoDB client shell and tools
6Summary(pl.UTF-8): Powłoka kliencka i narzędzia dla bazy danych MongoDB
7Name: mongodb
8Version: 2.2.0
9Release: 2
10License: AGPL v3
11Group: Applications/Databases
12Source0: http://downloads.mongodb.org/src/%{name}-src-r%{version}.tar.gz
13# Source0-md5: 832bdb6cc659176fd8d6b16a660ccfc6
14Source1: %{name}.logrotate
15Source2: %{name}.init
16Source3: mongod-default.conf
17Source4: mongod@.service
18Patch0: %{name}-cflags.patch
19Patch1: %{name}-system-libs.patch
20Patch2: boost-1.50.patch
21Patch3: %{name}-install.patch
22URL: http://www.mongodb.org/
23BuildRequires: boost-devel >= 1.50
24BuildRequires: libpcap-devel
25BuildRequires: libstdc++-devel >= 6:4.0
26%ifarch x86_64
27BuildRequires: libtcmalloc-devel
28%endif
29BuildRequires: pcre-cxx-devel
30BuildRequires: pcre-devel >= 8.30
31BuildRequires: readline-devel
32BuildRequires: rpmbuild(macros) >= 1.644
33BuildRequires: scons >= 1.2
34BuildRequires: sed >= 4.0
35BuildRequires: snappy-devel
36BuildRequires: v8-devel
37#Requires: %{name}-libs = %{version}-%{release}
38BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
39
40%description
41Mongo (from "huMONGOus") is a schema-free document-oriented database.
42It features dynamic profileable queries, full indexing, replication
43and fail-over support, efficient storage of large binary data objects,
44and auto-sharding.
45
46This package provides the mongo shell, import/export tools, and other
47client utilities.
48
49%description -l pl.UTF-8
50Mongo (od "huMONGOus") to baza danych zorientowana na dokumenty
51pozbawione schematu. Obsługuje dynamicznie profilowane zapytania,
52pełne indeksowanie, replikację i fail-over, wydajne składowanie dużych
53obiektów danych binarnych oraz automatyczne dzielenie.
54
55Ten pakiet zawiera powłokę mongo, narzędzia do eksportu/importu danych
56oraz inne narzędzia klienckie.
57
58%package libs
59Summary: MongoDB client library
60Summary(pl.UTF-8): Biblioteka kliencka MongoDB
61Group: Libraries
62
63%description libs
64Mongo (from "huMONGOus") is a schema-free document-oriented database.
65
66This package provides the mongo client library.
67
68%description libs -l pl.UTF-8
69Mongo (od "huMONGOus") to baza danych zorientowana na dokumenty
70pozbawione schematu.
71
72Ten pakiet zawiera bibliotekę kliencką mongo.
73
74%package devel
75Summary: Header files for MongoDB client library
76Summary(pl.UTF-8): Pliki nagłówkowe biblioteki klienckiej MongoDB
77Group: Development/Libraries
78#Requires: %{name}-libs = %{version}-%{release}
79Requires: %{name}-static = %{version}-%{release}
80
81%description devel
82Mongo (from "huMONGOus") is a schema-free document-oriented database.
83
84This package provides the header files needed to develop MongoDB
85client software.
86
87%description devel -l pl.UTF-8
88Mongo (od "huMONGOus") to baza danych zorientowana na dokumenty
89pozbawione schematu.
90
91Ten pakiet zawiera pliki nagłówkowe potrzebne do tworzenia
92oprogramowania klienckiego dla MongoDB.
93
94%package static
95Summary: Static MongoDB client library
96Summary(pl.UTF-8): Statyczna biblioteka kliencka MongoDB
97Group: Development/Libraries
98#Requires: %{name}-libs = %{version}-%{release}
99
100%description static
101Mongo (from "huMONGOus") is a schema-free document-oriented database.
102
103This package provides the MongoDB static client library.
104
105%description static -l pl.UTF-8
106Mongo (od "huMONGOus") to baza danych zorientowana na dokumenty
107pozbawione schematu.
108
109Ten pakiet zawiera statyczną bibliotekę kliencką MongoDB.
110
111%package server
112Summary: MongoDB server, sharding server, and support scripts
113Summary(pl.UTF-8): Serwer MongoDB, serwer dzielący oraz skrypty pomocnicze
114Group: Applications/Databases
115Requires: %{name} = %{version}-%{release}
116Requires: systemd-units >= 38
117Requires(post,preun): /sbin/chkconfig
118Requires(postun): /usr/sbin/groupdel
119Requires(postun): /usr/sbin/userdel
120Requires(pre): /bin/id
121Requires(pre): /usr/bin/getgid
122Requires(pre): /usr/sbin/groupadd
123Requires(pre): /usr/sbin/useradd
124Requires: rc-scripts
125Provides: group(mongod)
126Provides: user(mongod)
127Conflicts: logrotate < 3.8.0
128
129%description server
130Mongo (from "huMONGOus") is a schema-free document-oriented database.
131
132This package provides the mongo server software, mongo sharding server
133software, default configuration files, and init.d scripts.
134
135%description server -l pl.UTF-8
136Mongo (od "huMONGOus") to baza danych zorientowana na dokumenty
137pozbawione schematu.
138
139Ten pakiet zawiera serwer mongo, serwer dzielący, pliki domyślnej
140konfiguracji oraz skrypty init.d.
141
142%prep
143%setup -q -n %{name}-src-r%{version}
144%patch0 -p1
145%patch1 -p1
146%patch2 -p1
147%patch3 -p1
148
149# Fix permissions
150find -type f -executable | xargs chmod a-x
151
152# force system pcre/js/snappy
153%{__rm} -r src/third_party/{js-1.7,pcre-8.30,snappy,boost}
154
155%build
156%scons \
157 CPPFLAGS="%{rpmcppflags} -DXP_UNIX" \
158 --use-system-all=yes \
159 --extralib=pcrecpp,pcre,snappy \
160 --prefix=$RPM_BUILD_ROOT%{_prefix} \
161 --full=all \
162 --usev8 \
163 --cxx=%{__cxx}
164
165%install
166rm -rf $RPM_BUILD_ROOT
167install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_mandir}/man1} \
168 $RPM_BUILD_ROOT/etc/{logrotate.d,rc.d/init.d,sysconfig,mongod} \
169 $RPM_BUILD_ROOT%{_var}/{lib,log{,/archive}}/mongo \
170 $RPM_BUILD_ROOT%{systemdunitdir}
171
172# XXX: scons is so great, recompiles everything here!
173%scons install \
174 --use-system-all=yes \
175 --extralib=pcrecpp,pcre,snappy \
176 --prefix=$RPM_BUILD_ROOT%{_prefix} \
177 --full=all \
178 --usev8 \
179 --cxx=%{__cxx}
180
181cp -p %{SOURCE1} $RPM_BUILD_ROOT/etc/logrotate.d/mongod
182install -p %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/mongod
183cp -p rpm/mongod.sysconfig $RPM_BUILD_ROOT/etc/sysconfig/mongod
184install %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/mongod/default.conf
185cp -p debian/*.1 $RPM_BUILD_ROOT%{_mandir}/man1
186
187# mask out the LSB service
188ln -s /dev/null $RPM_BUILD_ROOT%{systemdunitdir}/mongod.service
189install %{SOURCE4} $RPM_BUILD_ROOT%{systemdunitdir}/mongod@.service
190
191touch $RPM_BUILD_ROOT%{_var}/log/mongo/mongod.log
192
193# for some reason these are installed twice, remove unwanted copies
194for f in $RPM_BUILD_ROOT%{_includedir}/mongo/* ; do
195 rm -r "$RPM_BUILD_ROOT%{_includedir}/$(basename $f)" || :
196done
197
198%clean
199rm -rf $RPM_BUILD_ROOT
200
201%post libs -p /sbin/ldconfig
202%postun libs -p /sbin/ldconfig
203
204%pre server
205%groupadd -g 258 -r mongod
206%useradd -u 258 -r -g mongod -d %{_var}/lib/mongo -s /bin/false -c "MongoDB Database Server" mongod
207
208%post server
209/sbin/chkconfig --add mongod
210%service mongod restart
211# our systemd macros cannot handle template (multi-instance) units yet
212export SYSTEMD_LOG_LEVEL=warning SYSTEMD_LOG_TARGET=syslog
213/bin/systemd_booted && /bin/systemctl --quiet daemon-reload || :
214if [ $1 -eq 1 ]; then
215 /bin/systemctl --quiet enable mongod@.service || :
216 /bin/systemd_booted && echo 'Run "/bin/systemctl start mongod@default.service" to start mongod.' || :
217else
218 /bin/systemd_booted && /bin/systemctl --quiet try-restart mongod@default.service || :
219fi
220
221%preun server
222if [ "$1" = "0" ]; then
223 %service -q mongod stop
224 /sbin/chkconfig --del mongod
225 export SYSTEMD_LOG_LEVEL=warning SYSTEMD_LOG_TARGET=syslog
226 /bin/systemd_booted && /bin/systemctl --quiet stop mongod@default.service || :
227 /bin/systemctl --quiet disable mongod@.service || :
228fi
229
230%postun server
231if [ "$1" = "0" ]; then
232 %userremove mongod
233 %groupremove mongod
234fi
235%systemd_reload
236
237%triggerpostun server -- %{name}-server < 2.0.6-3
238if [ -f %{_sysconfdir}/mongod.conf.rpmsave ] ; then
239 cp -f %{_sysconfdir}/mongod/default.conf{,.rpmnew} || :
240 echo "Moving %{_sysconfdir}/mongod.conf to %{_sysconfdir}/mongod/default.conf"
241 mv -f %{_sysconfdir}/mongod.conf.rpmsave %{_sysconfdir}/mongod/default.conf
242 %service mongod restart
243fi
244
245%files
246%defattr(644,root,root,755)
247%doc README GNU-AGPL-3.0.txt
248%attr(755,root,root) %{_bindir}/bsondump
249%attr(755,root,root) %{_bindir}/mongo
250%attr(755,root,root) %{_bindir}/mongodump
251%attr(755,root,root) %{_bindir}/mongoexport
252%attr(755,root,root) %{_bindir}/mongofiles
253%attr(755,root,root) %{_bindir}/mongoimport
254%attr(755,root,root) %{_bindir}/mongooplog
255%attr(755,root,root) %{_bindir}/mongoperf
256%attr(755,root,root) %{_bindir}/mongorestore
257%attr(755,root,root) %{_bindir}/mongosniff
258%attr(755,root,root) %{_bindir}/mongostat
259%attr(755,root,root) %{_bindir}/mongotop
260%{_mandir}/man1/bsondump.1*
261%{_mandir}/man1/mongo.1*
262%{_mandir}/man1/mongodump.1*
263%{_mandir}/man1/mongoexport.1*
264%{_mandir}/man1/mongofiles.1*
265%{_mandir}/man1/mongoimport.1*
266%{_mandir}/man1/mongosniff.1*
267%{_mandir}/man1/mongostat.1*
268%{_mandir}/man1/mongorestore.1*
269
270%if 0
271%files libs
272%defattr(644,root,root,755)
273%attr(755,root,root) %{_libdir}/libmongoclient.so
274%endif
275
276%files devel
277%defattr(644,root,root,755)
278%{_includedir}/mongo
279
280%files static
281%defattr(644,root,root,755)
282%{_libdir}/libmongoclient.a
283
284%files server
285%defattr(644,root,root,755)
286#%dir %{_sysconfdir}
287%dir %{_sysconfdir}/mongod
288%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mongod/default.conf
289%attr(754,root,root) /etc/rc.d/init.d/mongod
290%config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/mongod
291%config(noreplace) /etc/logrotate.d/mongod
292%attr(755,root,root) %{_bindir}/mongod
293%attr(755,root,root) %{_bindir}/mongos
294%{_mandir}/man1/mongod.1*
295%{_mandir}/man1/mongos.1*
296%attr(755,mongod,mongod) %dir %{_var}/lib/mongo
297%attr(775,root,mongod) %dir %{_var}/log/mongo
298%attr(775,root,mongod) %dir %{_var}/log/archive/mongo
299%attr(640,mongod,mongod) %config(noreplace) %verify(not md5 mtime size) %{_var}/log/mongo/mongod.log
300%{systemdunitdir}/mongod.service
301%{systemdunitdir}/mongod@.service
This page took 0.081658 seconds and 4 git commands to generate.