/[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 404859 - (hide annotations) (download)
Sun Mar 24 15:20:47 2013 UTC (11 years, 1 month ago) by colin
Original Path: cauldron/couchdb/current/SPECS/couchdb.spec
File size: 4375 byte(s)
Add systemd requires and general post/pre fixes (mga#9302)
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 neoclust 394707 Version: 1.2.1
8 colin 404859 Release: %mkrel 3
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 colin 404859 Requires(post): systemd >= %{systemd_required_version}
51 dmorgan 77595
52     %description bin
53     Apache CouchDB is a distributed, fault-tolerant and schema-free
54     document-oriented database accessible via a RESTful HTTP/JSON API.
55     Among other features, it provides robust, incremental replication
56     with bi-directional conflict detection and resolution, and is
57     queryable and indexable using a table-oriented view engine with
58     JavaScript acting as the default view definition language.
59    
60     This package contains the binary needed to run a CouchDB instance.
61    
62 sander85 277298
63 dmorgan 77595 %prep
64     %setup -q -n %{tarname}-%{version}
65    
66 wally 336582 # fix build with new automake 1.13
67     sed -i -e 's,AM_CONFIG_HEADER,AC_CONFIG_HEADERS,g' configure.*
68 sander85 277298
69 dmorgan 77595 %build
70 sander85 277298 autoreconf -fi
71 sander85 276749 %configure2_5x \
72 wally 187826 --with-js-include=%{_includedir}/js \
73     --with-erlang=%{_libdir}/erlang%{_includedir}
74 dmorgan 77595
75 sander85 276749 %make
76 dmorgan 77595
77 sander85 277298
78 dmorgan 77595 %install
79 fwang 187690 %makeinstall_std
80 dmorgan 77595
81 sander85 277298 # Libdir for systemd unit
82     sed -i -e 's|@LIBDIR@|%{_libdir}|' %{SOURCE1}
83 dmorgan 77595
84 sander85 277298 # Install systemd unit
85     install -D -m 755 %{SOURCE1} %{buildroot}%{_unitdir}/%{name}.service
86    
87 colin 321769 # Install tmpfiles entry
88     install -D -m 644 %{SOURCE2} %{buildroot}%{_tmpfilesdir}/%{name}.conf
89 sander85 277298
90 dmorgan 77595 # Create /var/log/couchdb
91 fwang 187690 mkdir -p %{buildroot}%{_localstatedir}/log/%{name}
92 dmorgan 77595
93     # Create /var/lib/couchdb
94 fwang 187690 mkdir -p %{buildroot}%{_localstatedir}/lib/%{name}
95 dmorgan 77595
96     # Create /etc/couchdb/default.d
97 fwang 187690 mkdir -p %{buildroot}%{_sysconfdir}/%{name}/default.d
98 dmorgan 77595
99     # Create /etc/couchdb/local.d
100 fwang 187690 mkdir -p %{buildroot}%{_sysconfdir}/%{name}/local.d
101 dmorgan 77595
102     ## Use /etc/sysconfig instead of /etc/default
103 fwang 187690 mkdir -p %{buildroot}%{_sysconfdir}/sysconfig
104     mv %{buildroot}%{_sysconfdir}/default/couchdb \
105     %{buildroot}%{_sysconfdir}/sysconfig/%{name}
106     rm -rf %{buildroot}%{_sysconfdir}/default
107 dmorgan 77595
108     # Remove unecessary files
109 fwang 187690 rm %{buildroot}%{_sysconfdir}/rc.d/couchdb
110     rm -rf %{buildroot}%{_datadir}/doc/couchdb
111 dmorgan 77595
112     # clean-up .la archives
113 colin 321769 find %{buildroot} -name '*.la' -delete
114 dmorgan 77595
115 sander85 277298
116 dmorgan 77595 %pre bin
117     %_pre_useradd %{couchdb_user} %{couchdb_home} /bin/bash
118    
119 sander85 277298
120 dmorgan 77595 %post
121     %_post_service %{name}
122    
123 colin 321769 %post bin
124     # (cg) NB This should really be before the _post_service above... but packaging
125     # here seems really bizare with it's split...
126     %_tmpfilescreate %{name}
127 sander85 277298
128 dmorgan 77595 %postun bin
129     %_postun_userdel %{couchdb_user}
130    
131 sander85 277298
132 dmorgan 77595 %preun
133     %_preun_service %{name}
134    
135 sander85 277298
136 dmorgan 77595 %files
137     %doc AUTHORS BUGS CHANGES LICENSE NEWS NOTICE README THANKS
138     %config(noreplace) %{_sysconfdir}/sysconfig/%{name}
139     %config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
140 sander85 277298 %{_unitdir}/%{name}.service
141 dmorgan 77595
142     %files bin
143     %{_bindir}/*
144     %dir %{_sysconfdir}/%{name}
145     %dir %{_sysconfdir}/%{name}/local.d
146     %dir %{_sysconfdir}/%{name}/default.d
147     %config(noreplace) %attr(0644,%{couchdb_user},root) %{_sysconfdir}/%{name}/default.ini
148     %config(noreplace) %attr(0644,%{couchdb_user},root) %{_sysconfdir}/%{name}/local.ini
149 colin 321769 %{_tmpfilesdir}/%{name}.conf
150 dmorgan 77595 %{_libdir}/%{name}
151     %{_datadir}/%{name}
152     %{_mandir}/man1/*
153     %dir %attr(0755,%{couchdb_user},root) %{_localstatedir}/log/%{name}
154     %dir %attr(0755,%{couchdb_user},root) %{_localstatedir}/lib/%{name}

  ViewVC Help
Powered by ViewVC 1.1.30