forked from cms-sw/cmsdist
-
Notifications
You must be signed in to change notification settings - Fork 0
/
couchdb.spec
62 lines (53 loc) · 2.43 KB
/
couchdb.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
### RPM external couchdb 1.1.1
# Using the svn url instead of the default release on because we need the
# bootstrap script after patching the Makefile.am
Source0: git://github.com/apache/couchdb?obj=master/%realversion&export=%n&output=/apache-%n-%realversion.tgz
Source1: couch_cms_auth.erl
Patch0: couchdb-cmsauth-Makefile
Patch1: couchdb-ssl-client-cert
Patch5: couchdb-changes-heartbeat
Patch7: couchdb-changes-retry
Patch8: couchdb-compaction-timeout
# Although there is no technical software dependency,
# couchapp was included because all CMS applications will need it.
Requires: curl spidermonkey openssl icu4c erlang couchapp
BuildRequires: autotools
%prep
%setup -n couchdb
%patch0 -p0
%patch1 -p0
%patch5 -p0
%patch7 -p0
%patch8 -p0
cp %_sourcedir/couch_cms_auth.erl %_builddir/couchdb/src/couchdb
perl -p -i -e 's{\s*-L/(opt|usr)/local/lib}{}g; s{-I/(opt|usr)/local/include}{-I/no-no-no/include}g' configure.ac
%build
./bootstrap
export CURL_ROOT SPIDERMONKEY_ROOT OPENSSL_ROOT ICU4C_ROOT ERLANG_ROOT
export LDFLAGS="-L${ICU4C_ROOT}/lib -L${CURL_ROOT}/lib $LDFLAGS"
./configure --prefix=%i --with-js-lib=$SPIDERMONKEY_ROOT/lib --with-js-include=$SPIDERMONKEY_ROOT/include --with-erlang=$ERLANG_ROOT/lib/erlang/usr/include
make %makeprocesses
# Increase the heartbeat timeout to avoid couchdb killing itself from high load
perl -p -i -e 's{HEART_BEAT_TIMEOUT=11}{HEART_BEAT_TIMEOUT=60}g' bin/couchdb
%install
make %makeprocesses install
ln -sf ../lib/couchdb/bin/couchjs %i/bin/couchjs
%define drop_files %i/{man,share/doc}
# Generate dependencies-setup.{sh,csh} so init.{sh,csh} picks full environment.
mkdir -p %i/etc/profile.d
: > %i/etc/profile.d/dependencies-setup.sh
: > %i/etc/profile.d/dependencies-setup.csh
for tool in $(echo %{requiredtools} | sed -e's|\s+| |;s|^\s+||'); do
root=$(echo $tool | tr a-z- A-Z_)_ROOT; eval r=\$$root
if [ X"$r" != X ] && [ -r "$r/etc/profile.d/init.sh" ]; then
echo "test X\$$root != X || . $r/etc/profile.d/init.sh" >> %i/etc/profile.d/dependencies-setup.sh
echo "test X\$?$root = X1 || source $r/etc/profile.d/init.csh" >> %i/etc/profile.d/dependencies-setup.csh
fi
done
%post
%{relocateConfig}etc/profile.d/dependencies-setup.*sh
%{relocateConfig}etc/{rc.d,logrotate.d}/couchdb
%{relocateConfig}etc/couchdb/default.ini
%{relocateConfig}bin/couch*
%{relocateConfig}lib/couchdb/erlang/lib/couch-%realversion/ebin/couch.app
%{relocateConfig}lib/couchdb/erlang/lib/couch-%realversion/priv/lib/couch_icu_driver.la