]>
Commit | Line | Data |
---|---|---|
5688efcd | 1 | # |
d1b0fd13 | 2 | # TODO |
75e22e92 | 3 | # - pass our rpm*cflags |
5688efcd | 4 | # |
69fbae1d | 5 | Summary: MongoDB client shell and tools |
6 | Name: mongodb | |
105f2c53 | 7 | Version: 1.8.3 |
d1b0fd13 | 8 | Release: 0.1 |
69fbae1d | 9 | License: AGPL 3.0 |
10 | Group: Applications/Databases | |
d1b0fd13 | 11 | URL: http://www.mongodb.org/ |
1987b887 | 12 | Source0: http://downloads.mongodb.org/src/%{name}-src-r%{version}.tar.gz |
105f2c53 | 13 | # Source0-md5: 662e7ad6ff9f8e4d16c72c038b4a0c60 |
1987b887 | 14 | Source1: %{name}.logrotate |
15 | Source2: %{name}.init | |
105f2c53 | 16 | Patch0: config.patch |
69fbae1d | 17 | # BuildRequires: libpcap-devel |
18 | BuildRequires: boost-devel >= 1.42 | |
c5835a7a | 19 | BuildRequires: libstdc++-devel >= 6:4.0 |
1987b887 | 20 | BuildRequires: pcre-cxx-devel |
c07fcde2 | 21 | BuildRequires: pcre-devel |
69fbae1d | 22 | BuildRequires: readline-devel |
aa21d651 | 23 | BuildRequires: rpmbuild(macros) >= 1.228 |
69fbae1d | 24 | BuildRequires: scons >= 1.2 |
75e22e92 | 25 | BuildRequires: sed >= 4.0 |
69fbae1d | 26 | BuildRequires: v8-devel |
69fbae1d | 27 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
69fbae1d | 28 | |
29 | %description | |
30 | Mongo (from "huMONGOus") is a schema-free document-oriented database. | |
31 | It features dynamic profileable queries, full indexing, replication | |
32 | and fail-over support, efficient storage of large binary data objects, | |
33 | and auto-sharding. | |
34 | ||
35 | This package provides the mongo shell, import/export tools, and other | |
36 | client utilities. | |
37 | ||
69fbae1d | 38 | %package devel |
1987b887 | 39 | Summary: Headers and libraries for mongo development |
69fbae1d | 40 | Group: Development/Libraries |
c5835a7a | 41 | Requires: %{name} = %{version}-%{release} |
69fbae1d | 42 | |
43 | %description devel | |
44 | Mongo (from "huMONGOus") is a schema-free document-oriented database. | |
45 | ||
46 | This package provides the mongo static library and header files needed | |
47 | to develop mongo client software. | |
48 | ||
748739f7 ER |
49 | %package server |
50 | Summary: MongoDB server, sharding server, and support scripts | |
51 | Group: Applications/Databases | |
52 | Requires: %{name} = %{version}-%{release} | |
40ec6826 ER |
53 | Provides: group(mongod) |
54 | Provides: user(mongod) | |
aa21d651 | 55 | Requires(post,preun): /sbin/chkconfig |
40ec6826 ER |
56 | Requires(postun): /usr/sbin/groupdel |
57 | Requires(postun): /usr/sbin/userdel | |
58 | Requires(pre): /bin/id | |
59 | Requires(pre): /usr/bin/getgid | |
60 | Requires(pre): /usr/sbin/groupadd | |
61 | Requires(pre): /usr/sbin/useradd | |
aa21d651 | 62 | Requires: rc-scripts |
748739f7 ER |
63 | |
64 | %description server | |
65 | Mongo (from "huMONGOus") is a schema-free document-oriented database. | |
66 | ||
67 | This package provides the mongo server software, mongo sharding server | |
68 | softwware, default configuration files, and init.d scripts. | |
69 | ||
69fbae1d | 70 | %prep |
71 | %setup -q -n %{name}-src-r%{version} | |
105f2c53 | 72 | %patch0 -p1 |
75e22e92 | 73 | %{__sed} -i 's,-O3,,' SConstruct |
69fbae1d | 74 | |
d1b0fd13 ER |
75 | # Fix permissions |
76 | find -type f -executable | xargs chmod a-x | |
77 | ||
69fbae1d | 78 | %build |
d1b0fd13 ER |
79 | %scons \ |
80 | --prefix=$RPM_BUILD_ROOT%{_prefix} \ | |
81 | --sharedclient \ | |
82 | --full all \ | |
75e22e92 | 83 | --usev8 \ |
84 | --cxx=%{__cxx} | |
69fbae1d | 85 | |
69fbae1d | 86 | # XXX really should have shared library here |
87 | ||
88 | %install | |
89 | rm -rf $RPM_BUILD_ROOT | |
d1b0fd13 | 90 | install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_mandir}/man1} \ |
748739f7 | 91 | $RPM_BUILD_ROOT/etc/{logrotate.d,rc.d/init.d,sysconfig} \ |
d1b0fd13 | 92 | $RPM_BUILD_ROOT%{_var}/{lib,log}/mongo |
748739f7 | 93 | |
d1b0fd13 ER |
94 | %scons install \ |
95 | --prefix=$RPM_BUILD_ROOT%{_prefix} \ | |
96 | --sharedclient \ | |
97 | --full \ | |
98 | --usev8 | |
99 | ||
748739f7 ER |
100 | install -p %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/mongod |
101 | cp -a rpm/mongod.sysconfig $RPM_BUILD_ROOT/etc/sysconfig/mongod | |
69fbae1d | 102 | |
748739f7 | 103 | cp -a %{SOURCE1} $RPM_BUILD_ROOT/etc/logrotate.d/mongod |
d1b0fd13 | 104 | cp -a rpm/mongod.conf $RPM_BUILD_ROOT%{_sysconfdir}/mongod.conf |
69fbae1d | 105 | |
748739f7 | 106 | cp -a debian/*.1 $RPM_BUILD_ROOT%{_mandir}/man1 |
69fbae1d | 107 | |
748739f7 | 108 | touch $RPM_BUILD_ROOT%{_var}/log/mongo/mongod.log |
69fbae1d | 109 | |
110 | %clean | |
69fbae1d | 111 | rm -rf $RPM_BUILD_ROOT |
112 | ||
113 | %pre server | |
5688efcd | 114 | %groupadd -g 258 -r mongod |
115 | %useradd -u 258 -r -g mongod -d %{_var}/lib/mongo -s /bin/false -c "MongoDB Database Server" mongod | |
69fbae1d | 116 | |
117 | %post server | |
aa21d651 ER |
118 | /sbin/chkconfig --add mongod |
119 | %service mongod restart | |
69fbae1d | 120 | |
121 | %preun server | |
aa21d651 ER |
122 | if [ "$1" = "0" ]; then |
123 | %service -q mongod stop | |
124 | /sbin/chkconfig --del mongod | |
125 | fi | |
69fbae1d | 126 | |
5688efcd | 127 | %postun server |
40ec6826 ER |
128 | if [ "$1" = "0" ]; then |
129 | %userremove mongod | |
130 | %groupremove mongod | |
131 | fi | |
132 | ||
69fbae1d | 133 | %files |
134 | %defattr(644,root,root,755) | |
135 | %doc README GNU-AGPL-3.0.txt | |
136 | %attr(755,root,root) %{_bindir}/mongo | |
137 | %attr(755,root,root) %{_bindir}/mongodump | |
138 | %attr(755,root,root) %{_bindir}/mongoexport | |
139 | %attr(755,root,root) %{_bindir}/mongofiles | |
140 | %attr(755,root,root) %{_bindir}/mongoimport | |
141 | %attr(755,root,root) %{_bindir}/mongorestore | |
105f2c53 | 142 | #%%attr(755,root,root) %{_bindir}/mongosniff |
69fbae1d | 143 | %attr(755,root,root) %{_bindir}/mongostat |
144 | %attr(755,root,root) %{_bindir}/bsondump | |
145 | %{_mandir}/man1/mongo.1* | |
146 | %{_mandir}/man1/mongod.1* | |
147 | %{_mandir}/man1/mongodump.1* | |
148 | %{_mandir}/man1/mongoexport.1* | |
149 | %{_mandir}/man1/mongofiles.1* | |
150 | %{_mandir}/man1/mongoimport.1* | |
151 | %{_mandir}/man1/mongosniff.1* | |
152 | %{_mandir}/man1/mongostat.1* | |
153 | %{_mandir}/man1/mongorestore.1* | |
154 | ||
155 | %files server | |
156 | %defattr(644,root,root,755) | |
748739f7 ER |
157 | %dir %{_sysconfdir} |
158 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mongod.conf | |
159 | %attr(754,root,root) /etc/rc.d/init.d/mongod | |
160 | %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/mongod | |
69fbae1d | 161 | %config(noreplace) /etc/logrotate.d/mongod |
69fbae1d | 162 | %attr(755,root,root) %{_bindir}/mongod |
163 | %attr(755,root,root) %{_bindir}/mongos | |
164 | %{_mandir}/man1/mongos.1* | |
165 | %attr(755,mongod,mongod) %dir %{_var}/lib/mongo | |
166 | %attr(755,mongod,mongod) %dir %{_var}/log/mongo | |
167 | %attr(640,mongod,mongod) %config(noreplace) %verify(not md5 mtime size) %{_var}/log/mongo/mongod.log | |
168 | ||
169 | %files devel | |
170 | %defattr(644,root,root,755) | |
171 | %{_includedir}/mongo | |
172 | %{_libdir}/libmongoclient.a | |
173 | %{_libdir}/libmongoclient.so | |
174 | #%{_libdir}/libmongotestfiles.a |