forked from nahanni/rw_redis_fdw
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathredis_fdw.spec
117 lines (96 loc) · 2.8 KB
/
redis_fdw.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
%global pgmajorversion 14
%global pginstdir /usr/pgsql-14
%global sname redis_fdw
%if 0%{?rhel} && 0%{?rhel} == 7
%ifarch ppc64 ppc64le
%pgdg_set_ppc64le_compiler_at10
%endif
%endif
# Disable tests by default.
%{!?runselftest:%global runselftest 0}
Summary: A PostgreSQL Foreign Data Wrapper for Redis
Name: %{sname}_%{pgmajorversion}
Version: 1.0.3
Release: 1%{?dist}
License: PostgreSQL
URL: https://github.com/nahanni/rw_redis_fdw/
Source0: https://github.com/nahanni/rw_redis_fdw/archive/%{sname}-%{version}.tar.gz
BuildRequires: postgresql%{pgmajorversion}-devel hiredis-devel
BuildRequires: postgresql%{pgmajorversion}-server
Requires: postgresql%{pgmajorversion}-server hiredis
%if 0%{?rhel} && 0%{?rhel} == 7
Requires: glibc-devel
%endif
%if 0%{?rhel} && 0%{?rhel} >= 8
Requires: libnsl
%endif
# Packages come from EPEL and SCL:
%if 0%{?rhel} && 0%{?rhel} == 7
%ifarch aarch64
BuildRequires: llvm-toolset-7.0-llvm-devel >= 7.0.1 llvm-toolset-7.0-clang >= 7.0.1
%else
BuildRequires: llvm5.0-devel >= 5.0 llvm-toolset-7-clang >= 4.0.1
%endif
%endif
%if 0%{?rhel} && 0%{?rhel} >= 8
# Packages come from Appstream:
BuildRequires: llvm-devel >= 8.0.1 clang-devel >= 8.0.1
%endif
%if 0%{?fedora}
BuildRequires: llvm-devel >= 5.0 clang-devel >= 5.0
%endif
%if 0%{?suse_version} >= 1315 && 0%{?suse_version} <= 1499
BuildRequires: llvm6-devel clang6-devel
%endif
%if 0%{?suse_version} >= 1500
BuildRequires: llvm10-devel clang10-devel
%endif
%if 0%{?rhel} && 0%{?rhel} == 7
%ifarch ppc64 ppc64le
%pgdg_set_ppc64le_min_requires
%endif
%endif
%description
Writable Foreign Data Wrapper for Redis
This PostgreSQL extension provides a Foreign Data Wrapper for read (SELECT)
and write (INSERT, UPDATE, DELETE) access to Redis databases
(http://redis.io). Supported Redis data types include: string, set, hash,
list, zset, and pubsub.
%prep
%setup -q -n rw_redis_fdw-%{version}
%build
%if 0%{?rhel} && 0%{?rhel} == 7
%ifarch ppc64 ppc64le
%pgdg_set_ppc64le_compiler_flags
%endif
%endif
PATH=%{pginstdir}/bin/:$PATH %{__make} %{?_smp_mflags}
%install
%{__rm} -rf %{buildroot}
PATH=%{pginstdir}/bin/:$PATH %{__make} %{?_smp_mflags} install DESTDIR=%{buildroot}
%check
%if %runselftest
PATH=%{pginstdir}/bin/:$PATH %{__make} installcheck PG_CONFIG=%{pginstdir}/bin/pg_config %{?_smp_mflags} PGUSER=postgres PGPORT=5495
%endif
%clean
%{__rm} -rf %{buildroot}
%files
%defattr(-,root,root,-)
%license LICENSE
%doc README.md
%{pginstdir}/lib/*.so
%{pginstdir}/share/extension/*.sql
%{pginstdir}/share/extension/*.control
%ifarch ppc64 ppc64le
%else
%if %{pgmajorversion} >= 11 && %{pgmajorversion} < 90
%if 0%{?rhel} && 0%{?rhel} <= 6
%else
%{pginstdir}/lib/bitcode/%{sname}*.bc
%{pginstdir}/lib/bitcode/%{sname}/*.bc
%endif
%endif
%endif
%changelog
* Fri Oct 22 2021 - Vitezslav Kosina <admin@posdee.com> 1.0.3-1
- Build for PostgreSQL 14