You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

158 lines
5.7 KiB

##
## redis-libs.spec -- OpenPKG RPM Package Specification
## Copyright (c) 2000-2012 OpenPKG Foundation e.V. <http://openpkg.net/>
##
## Permission to use, copy, modify, and distribute this software for
## any purpose with or without fee is hereby granted, provided that
## the above copyright notice and this permission notice appear in all
## copies.
##
## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
## SUCH DAMAGE.
##
# package version
%define V_hiredis_tgz 20111210
%define V_hiredis_dir 95e8338
%define V_jedis 2.0.0
%define V_scala_redis bdf2d79
%define V_perl_redis 1.951
%define V_perl_redis_hiredis 0.10.1
%define V_predis_tgz v0.7.3-0-g4bc6f58
%define V_predis_dir 35ea06d
# package information
Name: redis-libs
Summary: Redis Client Libraries
URL: http://redis.io/clients
Vendor: Salvatore Sanfilippo et al.
Packager: OpenPKG Foundation e.V.
Distribution: OpenPKG Community
Class: EVAL
Group: Database
License: Open Source
Version: 0
Release: 20120607
# package options
%option with_perl yes
# list of sources
Source0: http://download.openpkg.org/components/versioned/redis/hiredis-%{V_hiredis_tgz}.tar.gz
Source1: http://cloud.github.com/downloads/xetorthio/jedis/jedis-%{V_jedis}.jar
Source2: http://download.github.com/acrosa-scala-redis-%{V_scala_redis}.tar.gz
Source3: http://www.cpan.org/authors/id/M/ME/MELO/Redis-%{V_perl_redis}.tar.gz
Source4: http://www.cpan.org/authors/id/N/NE/NEOPHENIX/Redis-hiredis-%{V_perl_redis_hiredis}.tar.gz
Source5: http://download.github.com/nrk-predis-%{V_predis_tgz}.tar.gz
# build information
BuildPreReq: OpenPKG, openpkg >= 20100101, make
PreReq: OpenPKG, openpkg >= 20100101
%if "%{with_perl}" == "yes"
BuildPreReq: perl, perl-openpkg
PreReq: perl
%endif
%description
This is a set of Redis client libraries for the programming
languages C, Java, Scala, Perl and PHP.
%track
prog redis-libs:hiredis = {
version = %{V_hiredis_tgz}
url = http://download.openpkg.org/components/versioned/redis/
regex = hiredis-(__VER__)\.tar\.gz
}
prog redis-libs:jedis = {
version = %{V_jedis}
url = http://github.com/xetorthio/jedis/downloads
regex = jedis-(__VER__)\.jar
}
prog redis-libs:scala-redis = {
version = %{V_scala_redis}
url = http://github.com/acrosa/scala-redis
regex = acrosa-scala-redis-(__VER__)\.tar\.gz
}
prog redis-libs:perl-redis = {
version = %{V_perl_redis}
url = http://www.cpan.org/authors/id/M/ME/MELO/
regex = Redis-(__VER__)\.tar\.gz
}
prog redis-libs:perl-redis-hiredis = {
version = %{V_perl_redis_hiredis}
url = http://www.cpan.org/authors/id/N/NE/NEOPHENIX/
regex = Redis-hiredis-(__VER__)\.tar\.gz
}
prog redis-libs:predis = {
version = %{V_predis_tgz}
url = http://github.com/nrk/predis/downloads
regex = nrk-predis-(__VER__)\.tar\.gz
}
%prep
%setup -q -c
%setup -q -T -D -a 2
%if "%{with_perl}" == "yes"
%setup -q -T -D -a 3
%setup -q -T -D -a 4
%endif
%setup -q -T -D -a 5
%build
( cd antirez-hiredis-%{V_hiredis_dir}
%{l_make} %{l_mflags} \
CC="%{l_cc} %{l_cflags -O}" DEBUG="" \
libhiredis.a
) || exit $?
%if "%{with_perl}" == "yes"
( cd Redis-%{V_perl_redis}
%{l_prefix}/bin/perl-openpkg prepare
%{l_prefix}/bin/perl-openpkg configure build
) || exit $?
( cd Redis-hiredis-%{V_perl_redis_hiredis}
%{l_prefix}/bin/perl-openpkg prepare
%{l_prefix}/bin/perl-openpkg configure build
) || exit $?
%endif
%install
%{l_shtool} mkdir -f -p -m 755 \
$RPM_BUILD_ROOT%{l_prefix}/include/redis \
$RPM_BUILD_ROOT%{l_prefix}/lib/redis
%{l_shtool} install -c -s -m 755 \
antirez-hiredis-%{V_hiredis_dir}/libhiredis.a \
$RPM_BUILD_ROOT%{l_prefix}/lib/redis/
%{l_shtool} install -c -m 644 \
antirez-hiredis-%{V_hiredis_dir}/hiredis.h \
$RPM_BUILD_ROOT%{l_prefix}/include/redis/
%{l_shtool} install -c -m 644 \
%{SOURCE jedis-%{V_jedis}.jar} \
$RPM_BUILD_ROOT%{l_prefix}/lib/redis/redis-java.jar
%{l_shtool} install -c -m 644 \
acrosa-scala-redis-*/target/redisclient-*.jar \
$RPM_BUILD_ROOT%{l_prefix}/lib/redis/redis-scala.jar
%if "%{with_perl}" == "yes"
%{l_prefix}/bin/perl-openpkg -d Redis-%{V_perl_redis} install
%{l_prefix}/bin/perl-openpkg -d Redis-hiredis-%{V_perl_redis_hiredis} install
%{l_prefix}/bin/perl-openpkg -F perl-openpkg-files fixate cleanup
%else
>perl-openpkg-files
%endif
cp -r nrk-predis-%{V_predis_dir}/lib/Predis \
$RPM_BUILD_ROOT%{l_prefix}/lib/redis/
%{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} `cat perl-openpkg-files`
%files -f files
%clean