%define debug_package %{nil} Summary: A document database server, accessible via a RESTful JSON API Name: couchdb Version:2.1.1 Release: qg Group: Applications/Databases License: Apache URL: http://couchdb.apache.org/ Source0: apache-couchdb-2.1.1.tar.gz Source1: couchdb.service Source2: couchdb #Requires: logrotate BuildRequires: erlang libicu-devel libtool perl-Test-Harness curl-devel js-devel %description Apache CouchDB is a document-oriented database that can be queried and indexed in a MapReduce fashion using JavaScript. CouchDB also offers incremental replication with bi-directional conflict detection and resolution. CouchDB provides a RESTful JSON API than can be accessed from any environment that allows HTTP requests. There are myriad third-party client libraries that make this even easier from your programming language of choice. CouchDB’s built in Web administration console speaks directly to the database using HTTP requests issued from your browser. %prep %setup -q -n apache-couchdb-2.1.1 %build sed -i 's"`whoami`"couchdb"g' configure ./configure --disable-docs sed -ie 's"\./data"/var/lib/couchdb"g' rel/couchdb.config make DESTDIR=%{buildroot}/opt install release %pre /usr/bin/getent passwd couchdb >/dev/null 2>&1 || /usr/sbin/useradd -r --home /var/lib/couchdb -M --shell /bin/bash --comment "CouchDB Database Server" couchdb >/dev/null 2>&1 exit 0 %install rm -rf $RPM_BUILD_ROOT cd rel/couchdb mkdir -p $RPM_BUILD_ROOT/opt/couchdb mkdir -p $RPM_BUILD_ROOT/opt/couchdb/bin mkdir -p $RPM_BUILD_ROOT/opt/couchdb/releases/2.1.1 mkdir -p $RPM_BUILD_ROOT/opt/couchdb/etc/ mkdir -p $RPM_BUILD_ROOT/var/log/couchdb mkdir -p $RPM_BUILD_ROOT/var/run/couchdb mkdir -p $RPM_BUILD_ROOT/opt/couchdb/share/ mkdir -p $RPM_BUILD_ROOT%{_unitdir} mkdir -p $RPM_BUILD_ROOT/opt/couchdb/lib cp -a bin/* $RPM_BUILD_ROOT/opt/couchdb/bin cp -a releases/* $RPM_BUILD_ROOT/opt/couchdb/releases/ cp -a etc/* $RPM_BUILD_ROOT/opt/couchdb/etc/ cp -a lib/* $RPM_BUILD_ROOT/opt/couchdb/lib/ cp -a share/* $RPM_BUILD_ROOT/opt/couchdb/share/ cp -a erts* $RPM_BUILD_ROOT/opt/couchdb cp %{SOURCE1} $RPM_BUILD_ROOT%{_unitdir} mkdir -p $RPM_BUILD_ROOT/etc/logrotate.d/ cp -a %{SOURCE2} $RPM_BUILD_ROOT/etc/logrotate.d/ %clean rm -rf $RPM_BUILD_ROOT %post /usr/bin/chown -R couchdb:couchdb /opt/couchdb /usr/bin/chmod a+x /opt/couchdb/bin/* if [ $1 -eq 1 ] ; then # Initial installation systemctl preset couchdb.service >/dev/null 2>&1 || : fi %files %attr(-,root,root) %attr(-,root,root)/etc/logrotate.d/ %attr(-,couchdb,couchdb) /opt/couchdb/lib %attr(-,couchdb,couchdb) /var/log/couchdb #%attr(-,couchdb,couchdb) /var/run/couchdb/ %attr(-,root,root) %{_unitdir}/couchdb.service %attr(-,couchdb,couchdb) /opt/couchdb/bin/* %attr(-,couchdb,couchdb) /opt/couchdb/share/server %attr(-,couchdb,couchdb) /opt/couchdb/share/www %attr(-,couchdb,couchdb) /opt/couchdb/lib/* #%attr(-,root,root)/opt/couchdb/bin/* %config(noreplace) %attr(-,couchdb,couchdb) /opt/couchdb/etc/local.ini %config(noreplace) %attr(-,couchdb,couchdb) /opt/couchdb/etc/default.ini %config(noreplace) %attr(-,couchdb,couchdb) /opt/couchdb/etc/vm.args %attr(-,couchdb,couchdb) /opt/couchdb/etc/default.d/README %attr(-,couchdb,couchdb) /opt/couchdb/etc/local.d/README %attr(-,couchdb,couchdb) /opt/couchdb/releases/ %attr(-,couchdb,couchdb) /opt/couchdb/erts* %changelog * Thu Nov 16 2017 Iaroslav Andrusyak - 1.0-qg - update to 2.1.1 * Tue Oct 18 2016 Roman Kruglicky - 1.0-qg - Initial build