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