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