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