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