]> git.pld-linux.org Git - packages/mongodb.git/blob - mongodb.spec
- user/group adding macros/deps
[packages/mongodb.git] / mongodb.spec
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 Provides:       group(mongod)
50 Provides:       user(mongod)
51 Requires(post,preun):   /sbin/chkconfig
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
58 Requires:       rc-scripts
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
66 %prep
67 %setup -q -n %{name}-src-r%{version}
68
69 # Fix permissions
70 find -type f -executable | xargs chmod a-x
71
72 %build
73 %scons \
74         --prefix=$RPM_BUILD_ROOT%{_prefix} \
75         --sharedclient \
76         --full all \
77         --usev8
78
79 # XXX really should have shared library here
80
81 %install
82 rm -rf $RPM_BUILD_ROOT
83 install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_mandir}/man1} \
84         $RPM_BUILD_ROOT/etc/{logrotate.d,rc.d/init.d,sysconfig} \
85         $RPM_BUILD_ROOT%{_var}/{lib,log}/mongo
86
87 %scons install \
88         --prefix=$RPM_BUILD_ROOT%{_prefix} \
89         --sharedclient \
90         --full \
91         --usev8
92
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
95
96 cp -a %{SOURCE1} $RPM_BUILD_ROOT/etc/logrotate.d/mongod
97 cp -a rpm/mongod.conf $RPM_BUILD_ROOT%{_sysconfdir}/mongod.conf
98
99 cp -a debian/*.1 $RPM_BUILD_ROOT%{_mandir}/man1
100
101 touch $RPM_BUILD_ROOT%{_var}/log/mongo/mongod.log
102
103 %clean
104 rm -rf $RPM_BUILD_ROOT
105
106 %pre server
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
109
110 %post server
111 /sbin/chkconfig --add mongod
112 %service mongod restart
113
114 %preun server
115 if [ "$1" = "0" ]; then
116         %service -q mongod stop
117         /sbin/chkconfig --del mongod
118 fi
119
120 %postun
121 if [ "$1" = "0" ]; then
122         %userremove mongod
123         %groupremove mongod
124 fi
125
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)
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
153 %config(noreplace) /etc/logrotate.d/mongod
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
This page took 0.08856 seconds and 4 git commands to generate.