]> git.pld-linux.org Git - packages/mongodb.git/blob - mongodb.spec
Add missing /var/log/archive/mongo
[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 %clean
182 rm -rf $RPM_BUILD_ROOT
183
184 %post   libs -p /sbin/ldconfig
185 %postun libs -p /sbin/ldconfig
186
187 %pre server
188 %groupadd -g 258 -r mongod
189 %useradd -u 258 -r -g mongod -d %{_var}/lib/mongo -s /bin/false -c "MongoDB Database Server" mongod
190
191 %post server
192 /sbin/chkconfig --add mongod
193 %service mongod restart
194
195 %preun server
196 if [ "$1" = "0" ]; then
197         %service -q mongod stop
198         /sbin/chkconfig --del mongod
199 fi
200
201 %postun server
202 if [ "$1" = "0" ]; then
203         %userremove mongod
204         %groupremove mongod
205 fi
206
207 %triggerpostun server -- %{name}-server < 2.0.6-3
208 if [ -f %{_sysconfdir}/mongod.conf.rpmsave ] ; then
209         cp -f %{_sysconfdir}/mongod/default.conf{,.rpmnew} || :
210         echo "Moving %{_sysconfdir}/mongod.conf to %{_sysconfdir}/mongod/default.conf"
211         mv -f %{_sysconfdir}/mongod.conf.rpmsave %{_sysconfdir}/mongod/default.conf
212         %service mongod restart
213 fi
214
215 %files
216 %defattr(644,root,root,755)
217 %doc README GNU-AGPL-3.0.txt
218 %attr(755,root,root) %{_bindir}/bsondump
219 %attr(755,root,root) %{_bindir}/mongo
220 %attr(755,root,root) %{_bindir}/mongodump
221 %attr(755,root,root) %{_bindir}/mongoexport
222 %attr(755,root,root) %{_bindir}/mongofiles
223 %attr(755,root,root) %{_bindir}/mongoimport
224 %attr(755,root,root) %{_bindir}/mongorestore
225 %attr(755,root,root) %{_bindir}/mongosniff
226 %attr(755,root,root) %{_bindir}/mongostat
227 %attr(755,root,root) %{_bindir}/mongotop
228 %{_mandir}/man1/bsondump.1*
229 %{_mandir}/man1/mongo.1*
230 %{_mandir}/man1/mongodump.1*
231 %{_mandir}/man1/mongoexport.1*
232 %{_mandir}/man1/mongofiles.1*
233 %{_mandir}/man1/mongoimport.1*
234 %{_mandir}/man1/mongosniff.1*
235 %{_mandir}/man1/mongostat.1*
236 %{_mandir}/man1/mongorestore.1*
237
238 %if 0
239 %files libs
240 %defattr(644,root,root,755)
241 %attr(755,root,root) %{_libdir}/libmongoclient.so
242 %endif
243
244 %files devel
245 %defattr(644,root,root,755)
246 %{_includedir}/mongo
247
248 %files static
249 %defattr(644,root,root,755)
250 %{_libdir}/libmongoclient.a
251
252 %files server
253 %defattr(644,root,root,755)
254 #%dir %{_sysconfdir}
255 %dir %{_sysconfdir}/mongod
256 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mongod/default.conf
257 %attr(754,root,root) /etc/rc.d/init.d/mongod
258 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/mongod
259 %config(noreplace) /etc/logrotate.d/mongod
260 %attr(755,root,root) %{_bindir}/mongod
261 %attr(755,root,root) %{_bindir}/mongos
262 %{_mandir}/man1/mongod.1*
263 %{_mandir}/man1/mongos.1*
264 %attr(755,mongod,mongod) %dir %{_var}/lib/mongo
265 %attr(775,root,mongod) %dir %{_var}/log/mongo
266 %attr(775,root,mongod) %dir %{_var}/log/archive/mongo
267 %attr(640,mongod,mongod) %config(noreplace) %verify(not md5 mtime size) %{_var}/log/mongo/mongod.log
This page took 0.099418 seconds and 4 git commands to generate.