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