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

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

Parent Directory Parent Directory | Revision Log Revision Log


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

  ViewVC Help
Powered by ViewVC 1.1.28