]> git.pld-linux.org Git - packages/mongodb.git/blame_incremental - mongodb.spec
- added shared patch, build sharedclient again (seems fixed now)
[packages/mongodb.git] / mongodb.spec
... / ...
CommitLineData
1# TODO:
2# - add support for sharding server (init scripts, systemd units, sample config)
3#
4Summary: MongoDB client shell and tools
5Summary(pl.UTF-8): Powłoka kliencka i narzędzia dla bazy danych MongoDB
6Name: mongodb
7Version: 2.2.2
8Release: 1
9License: AGPL v3
10Group: Applications/Databases
11Source0: http://downloads.mongodb.org/src/%{name}-src-r%{version}.tar.gz
12# Source0-md5: 697c448271358545a8a40a973f88edf4
13Source1: %{name}.logrotate
14Source2: %{name}.init
15Source3: mongod-default.conf
16Source4: mongod@.service
17Patch0: %{name}-cflags.patch
18Patch1: %{name}-system-libs.patch
19Patch2: boost-1.50.patch
20Patch3: %{name}-install.patch
21Patch4: %{name}-shared.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
37Requires: %{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
78Requires: %{name}-libs = %{version}-%{release}
79
80%description devel
81Mongo (from "huMONGOus") is a schema-free document-oriented database.
82
83This package provides the header files needed to develop MongoDB
84client software.
85
86%description devel -l pl.UTF-8
87Mongo (od "huMONGOus") to baza danych zorientowana na dokumenty
88pozbawione schematu.
89
90Ten pakiet zawiera pliki nagłówkowe potrzebne do tworzenia
91oprogramowania klienckiego dla MongoDB.
92
93%package static
94Summary: Static MongoDB client library
95Summary(pl.UTF-8): Statyczna biblioteka kliencka MongoDB
96Group: Development/Libraries
97Requires: %{name}-devel = %{version}-%{release}
98
99%description static
100Mongo (from "huMONGOus") is a schema-free document-oriented database.
101
102This package provides the MongoDB static client library.
103
104%description static -l pl.UTF-8
105Mongo (od "huMONGOus") to baza danych zorientowana na dokumenty
106pozbawione schematu.
107
108Ten pakiet zawiera statyczną bibliotekę kliencką MongoDB.
109
110%package server
111Summary: MongoDB server, sharding server, and support scripts
112Summary(pl.UTF-8): Serwer MongoDB, serwer dzielący oraz skrypty pomocnicze
113Group: Applications/Databases
114Requires: %{name} = %{version}-%{release}
115Requires: systemd-units >= 38
116Requires(post,preun): /sbin/chkconfig
117Requires(postun): /usr/sbin/groupdel
118Requires(postun): /usr/sbin/userdel
119Requires(pre): /bin/id
120Requires(pre): /usr/bin/getgid
121Requires(pre): /usr/sbin/groupadd
122Requires(pre): /usr/sbin/useradd
123Requires: rc-scripts
124Provides: group(mongod)
125Provides: user(mongod)
126Conflicts: logrotate < 3.8.0
127
128%description server
129Mongo (from "huMONGOus") is a schema-free document-oriented database.
130
131This package provides the mongo server software, mongo sharding server
132software, default configuration files, and init.d scripts.
133
134%description server -l pl.UTF-8
135Mongo (od "huMONGOus") to baza danych zorientowana na dokumenty
136pozbawione schematu.
137
138Ten pakiet zawiera serwer mongo, serwer dzielący, pliki domyślnej
139konfiguracji oraz skrypty init.d.
140
141%prep
142%setup -q -n %{name}-src-r%{version}
143%patch0 -p1
144%patch1 -p1
145%patch2 -p1
146%patch3 -p1
147%patch4 -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 --sharedclient \
163 --usev8 \
164 --cxx=%{__cxx}
165
166%install
167rm -rf $RPM_BUILD_ROOT
168install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_mandir}/man1} \
169 $RPM_BUILD_ROOT/etc/{logrotate.d,rc.d/init.d,sysconfig,mongod} \
170 $RPM_BUILD_ROOT%{_var}/{lib,log{,/archive}}/mongo \
171 $RPM_BUILD_ROOT%{systemdunitdir}
172
173# XXX: scons is so great, recompiles everything here!
174%scons install \
175 CPPFLAGS="%{rpmcppflags} -DXP_UNIX" \
176 --use-system-all=yes \
177 --extralib=pcrecpp,pcre,snappy \
178 --prefix=$RPM_BUILD_ROOT%{_prefix} \
179 --full=all \
180 --sharedclient \
181 --usev8 \
182 --cxx=%{__cxx}
183
184cp -p %{SOURCE1} $RPM_BUILD_ROOT/etc/logrotate.d/mongod
185install -p %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/mongod
186cp -p rpm/mongod.sysconfig $RPM_BUILD_ROOT/etc/sysconfig/mongod
187install %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/mongod/default.conf
188cp -p debian/*.1 $RPM_BUILD_ROOT%{_mandir}/man1
189
190# mask out the LSB service
191ln -s /dev/null $RPM_BUILD_ROOT%{systemdunitdir}/mongod.service
192install %{SOURCE4} $RPM_BUILD_ROOT%{systemdunitdir}/mongod@.service
193
194touch $RPM_BUILD_ROOT%{_var}/log/mongo/mongod.log
195
196# for some reason these are installed twice, remove unwanted copies
197for f in $RPM_BUILD_ROOT%{_includedir}/mongo/* ; do
198 rm -r "$RPM_BUILD_ROOT%{_includedir}/$(basename $f)" || :
199done
200
201%clean
202rm -rf $RPM_BUILD_ROOT
203
204%post libs -p /sbin/ldconfig
205%postun libs -p /sbin/ldconfig
206
207%pre server
208%groupadd -g 258 -r mongod
209%useradd -u 258 -r -g mongod -d %{_var}/lib/mongo -s /bin/false -c "MongoDB Database Server" mongod
210
211%post server
212/sbin/chkconfig --add mongod
213%service mongod restart
214# our systemd macros cannot handle template (multi-instance) units yet
215export SYSTEMD_LOG_LEVEL=warning SYSTEMD_LOG_TARGET=syslog
216/bin/systemd_booted && /bin/systemctl --quiet daemon-reload || :
217if [ $1 -eq 1 ]; then
218 /bin/systemctl --quiet enable mongod@.service || :
219 /bin/systemd_booted && echo 'Run "/bin/systemctl start mongod@default.service" to start mongod.' || :
220else
221 /bin/systemd_booted && /bin/systemctl --quiet try-restart mongod@default.service || :
222fi
223
224%preun server
225if [ "$1" = "0" ]; then
226 %service -q mongod stop
227 /sbin/chkconfig --del mongod
228 export SYSTEMD_LOG_LEVEL=warning SYSTEMD_LOG_TARGET=syslog
229 /bin/systemd_booted && /bin/systemctl --quiet stop mongod@default.service || :
230 /bin/systemctl --quiet disable mongod@.service || :
231fi
232
233%postun server
234if [ "$1" = "0" ]; then
235 %userremove mongod
236 %groupremove mongod
237fi
238%systemd_reload
239
240%triggerpostun server -- %{name}-server < 2.0.6-3
241if [ -f %{_sysconfdir}/mongod.conf.rpmsave ] ; then
242 cp -f %{_sysconfdir}/mongod/default.conf{,.rpmnew} || :
243 echo "Moving %{_sysconfdir}/mongod.conf to %{_sysconfdir}/mongod/default.conf"
244 mv -f %{_sysconfdir}/mongod.conf.rpmsave %{_sysconfdir}/mongod/default.conf
245 %service mongod restart
246fi
247
248%files
249%defattr(644,root,root,755)
250%doc README GNU-AGPL-3.0.txt
251%attr(755,root,root) %{_bindir}/bsondump
252%attr(755,root,root) %{_bindir}/mongo
253%attr(755,root,root) %{_bindir}/mongodump
254%attr(755,root,root) %{_bindir}/mongoexport
255%attr(755,root,root) %{_bindir}/mongofiles
256%attr(755,root,root) %{_bindir}/mongoimport
257%attr(755,root,root) %{_bindir}/mongooplog
258%attr(755,root,root) %{_bindir}/mongoperf
259%attr(755,root,root) %{_bindir}/mongorestore
260%attr(755,root,root) %{_bindir}/mongosniff
261%attr(755,root,root) %{_bindir}/mongostat
262%attr(755,root,root) %{_bindir}/mongotop
263%{_mandir}/man1/bsondump.1*
264%{_mandir}/man1/mongo.1*
265%{_mandir}/man1/mongodump.1*
266%{_mandir}/man1/mongoexport.1*
267%{_mandir}/man1/mongofiles.1*
268%{_mandir}/man1/mongoimport.1*
269%{_mandir}/man1/mongosniff.1*
270%{_mandir}/man1/mongostat.1*
271%{_mandir}/man1/mongorestore.1*
272
273%files libs
274%defattr(644,root,root,755)
275%attr(755,root,root) %{_libdir}/libmongoclient.so
276
277%files devel
278%defattr(644,root,root,755)
279%{_includedir}/mongo
280
281%files static
282%defattr(644,root,root,755)
283%{_libdir}/libmongoclient.a
284
285%files server
286%defattr(644,root,root,755)
287#%dir %{_sysconfdir}
288%dir %{_sysconfdir}/mongod
289%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mongod/default.conf
290%attr(754,root,root) /etc/rc.d/init.d/mongod
291%config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/mongod
292%config(noreplace) /etc/logrotate.d/mongod
293%attr(755,root,root) %{_bindir}/mongod
294%attr(755,root,root) %{_bindir}/mongos
295%{_mandir}/man1/mongod.1*
296%{_mandir}/man1/mongos.1*
297%attr(755,mongod,mongod) %dir %{_var}/lib/mongo
298%attr(775,root,mongod) %dir %{_var}/log/mongo
299%attr(775,root,mongod) %dir %{_var}/log/archive/mongo
300%attr(640,mongod,mongod) %config(noreplace) %verify(not md5 mtime size) %{_var}/log/mongo/mongod.log
301%{systemdunitdir}/mongod.service
302%{systemdunitdir}/mongod@.service
This page took 0.028834 seconds and 4 git commands to generate.