1 # SPEC file for pg_hint_plan
2 # Copyright(C) 2012-2018 NIPPON TELEGRAPH AND TELEPHONE CORPORATION
4 %define _pgdir /usr/pgsql-9.4
5 %define _bindir %{_pgdir}/bin
6 %define _libdir %{_pgdir}/lib
7 %define _datadir %{_pgdir}/share
8 %if "%(echo ${MAKE_ROOT})" != ""
9 %define _rpmdir %(echo ${MAKE_ROOT})/RPMS
10 %define _sourcedir %(echo ${MAKE_ROOT})
13 ## Set general information for pg_hint_plan.
14 Summary: Optimizer hint for PostgreSQL 9.4
19 Group: Applications/Databases
20 Source0: %{name}-%{version}.tar.gz
21 #URL: http://example.com/pg_hint_plan/
22 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-%(%{__id_u} -n)
23 Vendor: NIPPON TELEGRAPH AND TELEPHONE CORPORATION
25 ## We use postgresql-devel package
26 BuildRequires: postgresql94-devel
27 Requires: postgresql94-libs
29 ## Description for "pg_hint_plan"
31 pg_hint_plan provides capability to force arbitrary plan to PostgreSQL' planner
32 to optimize queries by hand directly.
34 If you have query plan better than which PostgreSQL chooses, you can force your
35 plan by adding special comment block with optimizer hint before the query you
36 want to optimize. You can control scan method, join method, join order, and
37 planner-related GUC parameters during planning.
39 Note that this package is available for only PostgreSQL 9.4.
41 ## pre work for build pg_hint_plan
43 PATH=/usr/pgsql-9.4/bin:$PATH
44 if [ "${MAKE_ROOT}" != "" ]; then
46 make clean %{name}-%{version}.tar.gz
49 if [ ! -d %{_rpmdir} ]; then mkdir -p %{_rpmdir}; fi
52 ## Set variables for build environment
54 PATH=/usr/pgsql-9.4/bin:$PATH
55 make USE_PGXS=1 %{?_smp_mflags}
57 ## Set variables for install
60 install -d %{buildroot}%{_libdir}
61 install pg_hint_plan.so %{buildroot}%{_libdir}/pg_hint_plan.so
62 install -d %{buildroot}%{_datadir}/extension
63 install -m 644 pg_hint_plan--1.1.2--1.1.3.sql %{buildroot}%{_datadir}/extension/pg_hint_plan--1.1.2--1.1.3.sql
64 install -m 644 pg_hint_plan--1.1.3--1.1.4.sql %{buildroot}%{_datadir}/extension/pg_hint_plan--1.1.3--1.1.4.sql
65 install -m 644 pg_hint_plan--1.1.4--1.1.5.sql %{buildroot}%{_datadir}/extension/pg_hint_plan--1.1.4--1.1.5.sql
66 install -m 644 pg_hint_plan--1.1.5--1.1.6.sql %{buildroot}%{_datadir}/extension/pg_hint_plan--1.1.5--1.1.6.sql
67 install -m 644 pg_hint_plan--1.1.6--1.1.7.sql %{buildroot}%{_datadir}/extension/pg_hint_plan--1.1.6--1.1.7.sql
68 install -m 644 pg_hint_plan--1.1.7.sql %{buildroot}%{_datadir}/extension/pg_hint_plan--1.1.7.sql
69 install -m 644 pg_hint_plan.control %{buildroot}%{_datadir}/extension/pg_hint_plan.control
75 %defattr(0755,root,root)
76 %{_libdir}/pg_hint_plan.so
77 %defattr(0644,root,root)
78 %{_datadir}/extension/pg_hint_plan--1.1.2--1.1.3.sql
79 %{_datadir}/extension/pg_hint_plan--1.1.3--1.1.4.sql
80 %{_datadir}/extension/pg_hint_plan--1.1.4--1.1.5.sql
81 %{_datadir}/extension/pg_hint_plan--1.1.5--1.1.6.sql
82 %{_datadir}/extension/pg_hint_plan--1.1.6--1.1.7.sql
83 %{_datadir}/extension/pg_hint_plan--1.1.7.sql
84 %{_datadir}/extension/pg_hint_plan.control
86 # History of pg_hint_plan.
88 * Tue Nov 13 2018 Kyotaro Horiguchi
89 - Improvement of debug message emission.
90 * Fri Jun 08 2018 Kyotaro Horiguchi
92 * Thu Jul 27 2017 Kyotaro Horiguchi
94 * Fri May 19 2017 Kyotaro Horiguchi
96 * Thu Dec 22 2014 Kyotaro Horiguchi
97 - Bug fix related to pl/pgsql.
98 * Thu Dec 17 2014 Kyotaro Horiguchi
99 - Support 9.4. New rev 1.1.2.
100 * Thu Dec 17 2014 Kyotaro Horiguchi
101 - Support 9.4. New rev 1.1.2.
102 * Mon Sep 02 2013 Takashi Suzuki
103 - Initial cut for 1.1.0
104 * Mon Sep 24 2012 Shigeru Hanada <shigeru.hanada@gmail.com>
105 - Initial cut for 1.0.0