/[packages]/updates/3/couchdb/current/SPECS/couchdb.spec
ViewVC logotype

Annotation of /updates/3/couchdb/current/SPECS/couchdb.spec

Parent Directory Parent Directory | Revision Log Revision Log


Revision 321769 - (hide annotations) (download)
Sun Nov 25 15:27:09 2012 UTC (11 years, 4 months ago) by colin
Original Path: cauldron/couchdb/current/SPECS/couchdb.spec
File size: 4222 byte(s)
- Do not package tmpfiles conf in /etc
- Run systemd-tmpfiles --create on post install
SILENT: Packaging here seems weird with it's -bin package...
1 dmorgan 77595 %define tarname apache-couchdb
2     %define couchdb_user couchdb
3     %define couchdb_group couchdb
4     %define couchdb_home %{_localstatedir}/lib/couchdb
5    
6 sander85 277298 Name: couchdb
7     Version: 1.2.0
8 colin 321769 Release: %mkrel 5
9 sander85 277298 Summary: A document database server, accessible via a RESTful JSON API
10     Group: Databases
11     License: Apache License
12     URL: http://couchdb.apache.org/
13     Source0: http://www.apache.org/dist/%{name}/releases/%{version}/%{tarname}-%{version}.tar.gz
14     Source1: %{name}.service
15     Source2: %{name}.tmpfiles.conf
16 dmorgan 77595
17 sander85 277298 BuildRequires: erlang-devel erlang-compiler erlang-crypto erlang-eunit
18     BuildRequires: libicu-devel
19     BuildRequires: js-devel
20     BuildRequires: help2man
21     BuildRequires: curl-devel
22 dmorgan 77595
23 sander85 277298 Requires: couchdb-bin
24 dmorgan 77595
25 sander85 277298 Requires(pre): shadow-utils
26 dmorgan 77595
27     %description
28     Apache CouchDB is a distributed, fault-tolerant and schema-free
29     document-oriented database accessible via a RESTful HTTP/JSON API.
30     Among other features, it provides robust, incremental replication
31     with bi-directional conflict detection and resolution, and is
32     queryable and indexable using a table-oriented view engine with
33     JavaScript acting as the default view definition language.
34    
35 sander85 277298 This package contains the systemd unit needed to start a systemwide
36     instance of CouchDB.
37 dmorgan 77595
38 sander85 277298 %package bin
39     Group: Databases
40     Summary: Binary for Couchdb, a document database server
41 dmorgan 77595
42 sander85 277298 Requires: erlang
43 dmorgan 77595 Requires: erlang-crypto
44     Requires: erlang-ssl
45     Requires: erlang-xmerl
46     Requires: erlang-inets
47     Requires: erlang-tools
48 sander85 277298 Requires: erlang-public_key
49     Requires: erlang-os_mon
50 dmorgan 77595
51     %description bin
52     Apache CouchDB is a distributed, fault-tolerant and schema-free
53     document-oriented database accessible via a RESTful HTTP/JSON API.
54     Among other features, it provides robust, incremental replication
55     with bi-directional conflict detection and resolution, and is
56     queryable and indexable using a table-oriented view engine with
57     JavaScript acting as the default view definition language.
58    
59     This package contains the binary needed to run a CouchDB instance.
60    
61 sander85 277298
62 dmorgan 77595 %prep
63     %setup -q -n %{tarname}-%{version}
64    
65 sander85 277298
66 dmorgan 77595 %build
67 sander85 277298 autoreconf -fi
68 sander85 276749 %configure2_5x \
69 wally 187826 --with-js-include=%{_includedir}/js \
70     --with-erlang=%{_libdir}/erlang%{_includedir}
71 dmorgan 77595
72 sander85 276749 %make
73 dmorgan 77595
74 sander85 277298
75 dmorgan 77595 %install
76 fwang 187690 %makeinstall_std
77 dmorgan 77595
78 sander85 277298 # Libdir for systemd unit
79     sed -i -e 's|@LIBDIR@|%{_libdir}|' %{SOURCE1}
80 dmorgan 77595
81 sander85 277298 # Install systemd unit
82     install -D -m 755 %{SOURCE1} %{buildroot}%{_unitdir}/%{name}.service
83    
84 colin 321769 # Install tmpfiles entry
85     install -D -m 644 %{SOURCE2} %{buildroot}%{_tmpfilesdir}/%{name}.conf
86 sander85 277298
87 dmorgan 77595 # Create /var/log/couchdb
88 fwang 187690 mkdir -p %{buildroot}%{_localstatedir}/log/%{name}
89 dmorgan 77595
90     # Create /var/lib/couchdb
91 fwang 187690 mkdir -p %{buildroot}%{_localstatedir}/lib/%{name}
92 dmorgan 77595
93     # Create /etc/couchdb/default.d
94 fwang 187690 mkdir -p %{buildroot}%{_sysconfdir}/%{name}/default.d
95 dmorgan 77595
96     # Create /etc/couchdb/local.d
97 fwang 187690 mkdir -p %{buildroot}%{_sysconfdir}/%{name}/local.d
98 dmorgan 77595
99     ## Use /etc/sysconfig instead of /etc/default
100 fwang 187690 mkdir -p %{buildroot}%{_sysconfdir}/sysconfig
101     mv %{buildroot}%{_sysconfdir}/default/couchdb \
102     %{buildroot}%{_sysconfdir}/sysconfig/%{name}
103     rm -rf %{buildroot}%{_sysconfdir}/default
104 dmorgan 77595
105     # Remove unecessary files
106 fwang 187690 rm %{buildroot}%{_sysconfdir}/rc.d/couchdb
107     rm -rf %{buildroot}%{_datadir}/doc/couchdb
108 dmorgan 77595
109     # clean-up .la archives
110 colin 321769 find %{buildroot} -name '*.la' -delete
111 dmorgan 77595
112 sander85 277298
113 dmorgan 77595 %pre bin
114     %_pre_useradd %{couchdb_user} %{couchdb_home} /bin/bash
115    
116 sander85 277298
117 dmorgan 77595 %post
118     %_post_service %{name}
119    
120 colin 321769 %post bin
121     # (cg) NB This should really be before the _post_service above... but packaging
122     # here seems really bizare with it's split...
123     %_tmpfilescreate %{name}
124 sander85 277298
125 dmorgan 77595 %postun bin
126     %_postun_userdel %{couchdb_user}
127    
128 sander85 277298
129 dmorgan 77595 %preun
130     %_preun_service %{name}
131    
132 sander85 277298
133 dmorgan 77595 %files
134     %doc AUTHORS BUGS CHANGES LICENSE NEWS NOTICE README THANKS
135     %config(noreplace) %{_sysconfdir}/sysconfig/%{name}
136     %config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
137 sander85 277298 %{_unitdir}/%{name}.service
138 dmorgan 77595
139     %files bin
140     %{_bindir}/*
141     %dir %{_sysconfdir}/%{name}
142     %dir %{_sysconfdir}/%{name}/local.d
143     %dir %{_sysconfdir}/%{name}/default.d
144     %config(noreplace) %attr(0644,%{couchdb_user},root) %{_sysconfdir}/%{name}/default.ini
145     %config(noreplace) %attr(0644,%{couchdb_user},root) %{_sysconfdir}/%{name}/local.ini
146 colin 321769 %{_tmpfilesdir}/%{name}.conf
147 dmorgan 77595 %{_libdir}/%{name}
148     %{_datadir}/%{name}
149     %{_mandir}/man1/*
150     %dir %attr(0755,%{couchdb_user},root) %{_localstatedir}/log/%{name}
151     %dir %attr(0755,%{couchdb_user},root) %{_localstatedir}/lib/%{name}

  ViewVC Help
Powered by ViewVC 1.1.30