OSDN Git Service

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