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