OSDN Git Service

Change target version to PG11 and fix the SPEC file
[pghintplan/pg_hint_plan.git] / SPECS / pg_hint_plan11.spec
1 # SPEC file for pg_store_plans
2 # Copyright(C) 2018 NIPPON TELEGRAPH AND TELEPHONE CORPORATION
3
4 %define _pgdir   /usr/pgsql-11
5 %define _bindir  %{_pgdir}/bin
6 %define _libdir  %{_pgdir}/lib
7 %define _datadir %{_pgdir}/share
8 %define _bcdir %{_libdir}/bitcode/pg_hint_plan
9
10 %if "%(echo ${MAKE_ROOT})" != ""
11   %define _rpmdir %(echo ${MAKE_ROOT})/RPMS
12   %define _sourcedir %(echo ${MAKE_ROOT})
13 %endif
14
15 ## Set general information for pg_store_plans.
16 Summary:    Optimizer hint on PostgreSQL 11
17 Name:       pg_hint_plan11
18 Version:    1.3.2
19 Release:    1%{?dist}
20 License:    BSD
21 Group:      Applications/Databases
22 Source0:    %{name}-%{version}.tar.gz
23 URL:        https://github.com/ossc-db/pg_hint_plan
24 BuildRoot:  %{_tmppath}/%{name}-%{version}-%{release}-%(%{__id_u} -n)
25 Vendor:     NIPPON TELEGRAPH AND TELEPHONE CORPORATION
26
27 ## We use postgresql-devel package
28 BuildRequires:  postgresql11-devel
29 Requires:  postgresql11-server
30
31 ## Description for "pg_hint_plan"
32 %description
33
34 pg_hint_plan provides capability to tweak execution plans to be
35 executed on PostgreSQL.
36
37 Note that this package is available for only PostgreSQL 11.
38
39 %package llvmjit
40 Requires: postgresql11-server, postgresql11-llvmjit
41 Requires: pg_hint_plan11 = 1.3.1
42 Summary:  Just-in-time compilation support for pg_hint_plan11
43
44 %description llvmjit
45 Just-in-time compilation support for pg_hint_plan11
46
47 ## pre work for build pg_hint_plan
48 %prep
49 PATH=/usr/pgsql-11/bin:$PATH
50 if [ "${MAKE_ROOT}" != "" ]; then
51   pushd ${MAKE_ROOT}
52   make clean %{name}-%{version}.tar.gz
53   popd
54 fi
55 if [ ! -d %{_rpmdir} ]; then mkdir -p %{_rpmdir}; fi
56 %setup -q
57
58 ## Set variables for build environment
59 %build
60 PATH=/usr/pgsql-11/bin:$PATH
61 make USE_PGXS=1 %{?_smp_mflags}
62
63 ## Set variables for install
64 %install
65 rm -rf %{buildroot}
66 install -d %{buildroot}%{_libdir}
67 install pg_hint_plan.so %{buildroot}%{_libdir}/pg_hint_plan.so
68 install -d %{buildroot}%{_datadir}/extension
69 install -m 644 pg_hint_plan--1.3.2.sql %{buildroot}%{_datadir}/extension/pg_hint_plan--1.3.2.sql
70 install -m 644 pg_hint_plan.control %{buildroot}%{_datadir}/extension/pg_hint_plan.control
71 install -d %{buildroot}%{_bcdir}
72 install -m 644 pg_hint_plan.bc %{buildroot}%{_bcdir}/pg_hint_plan.bc
73
74 %clean
75 rm -rf %{buildroot}
76
77 %files
78 %defattr(0755,root,root)
79 %{_libdir}/pg_hint_plan.so
80 %defattr(0644,root,root)
81 %{_datadir}/extension/pg_hint_plan--1.3.2.sql
82 %{_datadir}/extension/pg_hint_plan.control
83
84 %files llvmjit
85 %defattr(0755,root,root)
86 %{_bcdir}
87 %defattr(0644,root,root)
88 %{_bcdir}/pg_hint_plan.bc
89
90 # History of pg_hint_plan.
91 %changelog
92 * Tue Nov 13 2018 Kyotaro Horiguchi
93 - Support PostgreSQL 11. Version 1.3.2.
94 * Tue Jun 08 2018 Kyotaro Horiguchi
95 - Fixed a crash bug. Version 1.3.1.
96 * Tue Oct 10 2017 Kyotaro Horiguchi
97 - Support PostgreSQL 10. Version 1.3.0.
98 * Tue Feb 7 2017 Kyotaro Horiguchi
99 - Added new hint Parallel. Version 1.2.0.
100 * Thu Jul 21 2016 Kyotaro Horiguchi
101 - Support PostgreSQL 9.6