]>
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 | |
8baa44ca | 5 | Version: 1.6.3 |
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 |
8baa44ca | 11 | # Source0-md5: 076b91f37ee434db80441e9028fe50a5 |
1987b887 | 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 |
aa21d651 | 20 | BuildRequires: rpmbuild(macros) >= 1.228 |
69fbae1d | 21 | BuildRequires: scons >= 1.2 |
22 | BuildRequires: v8-devel | |
69fbae1d | 23 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
69fbae1d | 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 | ||
69fbae1d | 34 | %package devel |
1987b887 | 35 | Summary: Headers and libraries for mongo development |
69fbae1d | 36 | Group: Development/Libraries |
c5835a7a | 37 | Requires: %{name} = %{version}-%{release} |
69fbae1d | 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 | ||
748739f7 ER |
45 | %package server |
46 | Summary: MongoDB server, sharding server, and support scripts | |
47 | Group: Applications/Databases | |
48 | Requires: %{name} = %{version}-%{release} | |
40ec6826 ER |
49 | Provides: group(mongod) |
50 | Provides: user(mongod) | |
aa21d651 | 51 | Requires(post,preun): /sbin/chkconfig |
40ec6826 ER |
52 | Requires(postun): /usr/sbin/groupdel |
53 | Requires(postun): /usr/sbin/userdel | |
54 | Requires(pre): /bin/id | |
55 | Requires(pre): /usr/bin/getgid | |
56 | Requires(pre): /usr/sbin/groupadd | |
57 | Requires(pre): /usr/sbin/useradd | |
aa21d651 | 58 | Requires: rc-scripts |
748739f7 ER |
59 | |
60 | %description server | |
61 | Mongo (from "huMONGOus") is a schema-free document-oriented database. | |
62 | ||
63 | This package provides the mongo server software, mongo sharding server | |
64 | softwware, default configuration files, and init.d scripts. | |
65 | ||
69fbae1d | 66 | %prep |
67 | %setup -q -n %{name}-src-r%{version} | |
68 | ||
d1b0fd13 ER |
69 | # Fix permissions |
70 | find -type f -executable | xargs chmod a-x | |
71 | ||
69fbae1d | 72 | %build |
d1b0fd13 ER |
73 | %scons \ |
74 | --prefix=$RPM_BUILD_ROOT%{_prefix} \ | |
75 | --sharedclient \ | |
76 | --full all \ | |
77 | --usev8 | |
69fbae1d | 78 | |
69fbae1d | 79 | # XXX really should have shared library here |
80 | ||
81 | %install | |
82 | rm -rf $RPM_BUILD_ROOT | |
d1b0fd13 | 83 | install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_mandir}/man1} \ |
748739f7 | 84 | $RPM_BUILD_ROOT/etc/{logrotate.d,rc.d/init.d,sysconfig} \ |
d1b0fd13 | 85 | $RPM_BUILD_ROOT%{_var}/{lib,log}/mongo |
748739f7 | 86 | |
d1b0fd13 ER |
87 | %scons install \ |
88 | --prefix=$RPM_BUILD_ROOT%{_prefix} \ | |
89 | --sharedclient \ | |
90 | --full \ | |
91 | --usev8 | |
92 | ||
748739f7 ER |
93 | install -p %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/mongod |
94 | cp -a rpm/mongod.sysconfig $RPM_BUILD_ROOT/etc/sysconfig/mongod | |
69fbae1d | 95 | |
748739f7 | 96 | cp -a %{SOURCE1} $RPM_BUILD_ROOT/etc/logrotate.d/mongod |
d1b0fd13 | 97 | cp -a rpm/mongod.conf $RPM_BUILD_ROOT%{_sysconfdir}/mongod.conf |
69fbae1d | 98 | |
748739f7 | 99 | cp -a debian/*.1 $RPM_BUILD_ROOT%{_mandir}/man1 |
69fbae1d | 100 | |
748739f7 | 101 | touch $RPM_BUILD_ROOT%{_var}/log/mongo/mongod.log |
69fbae1d | 102 | |
103 | %clean | |
69fbae1d | 104 | rm -rf $RPM_BUILD_ROOT |
105 | ||
106 | %pre server | |
40ec6826 ER |
107 | %groupadd -g xxx -r mongod |
108 | %useradd -u xxx -r -g mongod -d %{_var}/lib/mongo -s /bin/false -c "MongoDB Database Server" mongod | |
69fbae1d | 109 | |
110 | %post server | |
aa21d651 ER |
111 | /sbin/chkconfig --add mongod |
112 | %service mongod restart | |
69fbae1d | 113 | |
114 | %preun server | |
aa21d651 ER |
115 | if [ "$1" = "0" ]; then |
116 | %service -q mongod stop | |
117 | /sbin/chkconfig --del mongod | |
118 | fi | |
69fbae1d | 119 | |
40ec6826 ER |
120 | %postun |
121 | if [ "$1" = "0" ]; then | |
122 | %userremove mongod | |
123 | %groupremove mongod | |
124 | fi | |
125 | ||
69fbae1d | 126 | %files |
127 | %defattr(644,root,root,755) | |
128 | %doc README GNU-AGPL-3.0.txt | |
129 | %attr(755,root,root) %{_bindir}/mongo | |
130 | %attr(755,root,root) %{_bindir}/mongodump | |
131 | %attr(755,root,root) %{_bindir}/mongoexport | |
132 | %attr(755,root,root) %{_bindir}/mongofiles | |
133 | %attr(755,root,root) %{_bindir}/mongoimport | |
134 | %attr(755,root,root) %{_bindir}/mongorestore | |
135 | %attr(755,root,root) %{_bindir}/mongostat | |
136 | %attr(755,root,root) %{_bindir}/bsondump | |
137 | %{_mandir}/man1/mongo.1* | |
138 | %{_mandir}/man1/mongod.1* | |
139 | %{_mandir}/man1/mongodump.1* | |
140 | %{_mandir}/man1/mongoexport.1* | |
141 | %{_mandir}/man1/mongofiles.1* | |
142 | %{_mandir}/man1/mongoimport.1* | |
143 | %{_mandir}/man1/mongosniff.1* | |
144 | %{_mandir}/man1/mongostat.1* | |
145 | %{_mandir}/man1/mongorestore.1* | |
146 | ||
147 | %files server | |
148 | %defattr(644,root,root,755) | |
748739f7 ER |
149 | %dir %{_sysconfdir} |
150 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mongod.conf | |
151 | %attr(754,root,root) /etc/rc.d/init.d/mongod | |
152 | %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/mongod | |
69fbae1d | 153 | %config(noreplace) /etc/logrotate.d/mongod |
69fbae1d | 154 | %attr(755,root,root) %{_bindir}/mongod |
155 | %attr(755,root,root) %{_bindir}/mongos | |
156 | %{_mandir}/man1/mongos.1* | |
157 | %attr(755,mongod,mongod) %dir %{_var}/lib/mongo | |
158 | %attr(755,mongod,mongod) %dir %{_var}/log/mongo | |
159 | %attr(640,mongod,mongod) %config(noreplace) %verify(not md5 mtime size) %{_var}/log/mongo/mongod.log | |
160 | ||
161 | %files devel | |
162 | %defattr(644,root,root,755) | |
163 | %{_includedir}/mongo | |
164 | %{_libdir}/libmongoclient.a | |
165 | %{_libdir}/libmongoclient.so | |
166 | #%{_libdir}/libmongotestfiles.a |