日本OpenSolaris Users Group有志による、レポジトリサーバ作成のためのspecファイル群です。
Revision | 29365d4a2cc9b60058188bf18f0dacf0a69cb610 (tree) |
---|---|
Time | 2017-02-21 14:18:21 |
Author | Fumihisa TONAKA <fumi.ftnk@gmai...> |
Commiter | Fumihisa TONAKA |
SFEpgroonga: added
@@ -0,0 +1,91 @@ | ||
1 | +%include Solaris.inc | |
2 | + | |
3 | +%define pg_version 9.6 | |
4 | +%define pg_mangled_version 96 | |
5 | +%define required_groonga_version 6.0.7 | |
6 | + | |
7 | +Name: SFEpgroonga | |
8 | +Summary: PGroonga is a PostgreSQL extension to use Groonga as the index. | |
9 | +IPS_Package_Name: database/pgroonga | |
10 | +Version: 1.1.9 | |
11 | +License: GPL | |
12 | +URL: https://pgroonga.github.io/ | |
13 | +Source: http://packages.groonga.org/source/pgroonga/pgroonga-%{version}.tar.gz | |
14 | +Patch0: pgroonga-makefile.patch | |
15 | +Patch1: pgroonga-pgxs-pgxs.mk.patch | |
16 | +Patch2: pgroonga-pgxs-makefile.global.patch | |
17 | + | |
18 | +# BuildRequires: developer/gcc | |
19 | +# BuildRequires: system/library/gcc/gcc-runtime | |
20 | +BuildRequires: system/header | |
21 | +BuildRequires: database/postgres-%{pg_mangled_version}/developer | |
22 | +BuildRequires: database/postgres-%{pg_mangled_version}/library | |
23 | +BuildRequires: database/groonga >= %{required_groonga_version} | |
24 | +Requires: database/postgres-%{pg_mangled_version} | |
25 | +Requires: database/postgres-%{pg_mangled_version}/library | |
26 | +Requires: database/groonga >= %{required_groonga_version} | |
27 | + | |
28 | +%description | |
29 | +PGroonga is a PostgreSQL extension to use Groonga as the index. | |
30 | + | |
31 | +PostgreSQL supports full text search against languages that use only alphabet and digit. It means that PostgreSQL doesn't support full text search against Japanese, Chinese and so on. You can use super fast full text search feature against all languages by installing PGroonga into your PostgreSQL! | |
32 | + | |
33 | +%prep | |
34 | +%setup -q -n pgroonga-%{version} | |
35 | + | |
36 | +mkdir pgxs | |
37 | +cp /usr/postgres/%{pg_version}/lib/%{_arch64}/pgxs/src/makefiles/pgxs.mk pgxs/ | |
38 | +cp /usr/postgres/%{pg_version}/lib/%{_arch64}/pgxs/src/Makefile.* pgxs/ | |
39 | + | |
40 | +%patch0 -p0 | |
41 | +%patch1 -p0 | |
42 | +%patch2 -p0 | |
43 | + | |
44 | +%build | |
45 | +CPUS=`/usr/sbin/psrinfo | grep on-line | wc -l | tr -d ' '` | |
46 | +if test "x$CPUS" = "x" -o $CPUS = 0; then | |
47 | + CPUS=1 | |
48 | +fi | |
49 | + | |
50 | +# export CC='/usr/bin/gcc -m64' | |
51 | +# export CXX='/usr/bin/g++ -m64' | |
52 | +# export CFLAGS="-m64" | |
53 | +# export CXXFLAGS="-m64" | |
54 | +# export LDFLAGS="-m64 -L/usr/lib/%{_arch64} -L/usr/postgres/%{pg_version}/lib/%{_arch64} -R/usr/lib/%{_arch64} -R/usr/postgres/%{pg_version}/lib/%{_arch64}" | |
55 | +# export LD_OPTIONS="-L/usr/lib/%{_arch64} -L/usr/postgres/%{pg_version}/lib/%{_arch64} -R/usr/lib/%{_arch64} -R/usr/postgres/%{pg_version}/lib/%{_arch64}" | |
56 | +# export PG_CONFIG=/usr/postgres/%{pg_version}/bin/64/pg_config | |
57 | +# # export PKG_CONFIG_PATH=/usr/postgres/%{pg_version}/lib/64/pkgconfig:/usr/lib/%{_arch64}/pkgconifg | |
58 | +# export PKG_CONFIG_PATH=/usr/lib/%{_arch64}/pkgconifg:/usr/postgres/%{pg_version}/lib/64/pkgconfig | |
59 | +# export PATH=/usr/postgres/%{pg_version}/bin/64:${PATH} | |
60 | + | |
61 | +make -j$CPUS | |
62 | + | |
63 | +%install | |
64 | +[ %{buildroot} != "/" ] && rm -rf %{buildroot} | |
65 | +make install DESTDIR=%{buildroot} | |
66 | + | |
67 | +if [ -e %{buildroot}/usr/postgres/%{pg_version}/lib/pgroonga.so ] | |
68 | +then | |
69 | + mkdir %{buildroot}/usr/postgres/%{pg_version}/lib/%{_arch64} | |
70 | + mv %{buildroot}/usr/postgres/%{pg_version}/lib/pgroonga.so \ | |
71 | + %{buildroot}/usr/postgres/%{pg_version}/lib/%{_arch64}/ | |
72 | +fi | |
73 | + | |
74 | +%clean | |
75 | +rm -rf ${RPM_BUILD_ROOT} | |
76 | + | |
77 | +%files | |
78 | +%defattr(-,root,bin) | |
79 | +%dir %attr (0755, root, sys) %{_prefix} | |
80 | +%dir %attr (0755, root, bin) %{_prefix}/postgres | |
81 | +%dir %attr (0755, root, bin) %{_prefix}/postgres/%{pg_version} | |
82 | +%dir %attr (0755, root, bin) %{_prefix}/postgres/%{pg_version}/lib | |
83 | +%dir %attr (0755, root, bin) %{_prefix}/postgres/%{pg_version}/lib/%_arch64 | |
84 | +%attr (0755, root, bin) %{_prefix}/postgres/%{pg_version}/lib/%_arch64/* | |
85 | +%dir %attr (0755, root, other) %{_prefix}/postgres/%{pg_version}/share | |
86 | +%dir %attr (0755, root, other) %{_prefix}/postgres/%{pg_version}/share/extension | |
87 | +%attr (0755, root, bin) %{_prefix}/postgres/%{pg_version}/share/extension/* | |
88 | + | |
89 | +%changelog | |
90 | +* Tue Feb 21 2017 - Fumihisa TONAKA <fumi.ftnk@gmail.com> | |
91 | +- Initial version. |
@@ -0,0 +1,28 @@ | ||
1 | +--- Makefile.orig 2017-01-17 05:55:23.056185814 +0900 | |
2 | ++++ Makefile 2017-01-17 06:42:06.023956476 +0900 | |
3 | +@@ -21,8 +21,8 @@ | |
4 | + $(shell echo pgroonga--*--*.sql) | |
5 | + endif | |
6 | + | |
7 | +-PG_CPPFLAGS = $(shell pkg-config --cflags $(PACKAGES)) | |
8 | +-SHLIB_LINK = $(shell pkg-config --libs $(PACKAGES)) -lm | |
9 | ++PG_CPPFLAGS = -I/usr/include | |
10 | ++SHLIB_LINK = -L/usr/lib/amd64 -lgroonga -lm | |
11 | + REGRESS = $(shell find sql -name '*.sql' | sed -e 's,\(^sql/\|\.sql$$\),,g') | |
12 | + REGRESS_OPTS = --load-extension=pgroonga | |
13 | + | |
14 | +@@ -33,11 +33,12 @@ | |
15 | + endif | |
16 | + ifdef DEBUG | |
17 | + COPT += -O0 -g3 -DPGROONGA_DEBUG=1 | |
18 | +-SHLIB_LINK += -Wl,--rpath=$(shell pkg-config --libs-only-L $(PACKAGES) | sed -e 's/^-L//') | |
19 | ++SHLIB_LINK += -Wl,--rpath=/usr/lib/amd64 | |
20 | + endif | |
21 | + | |
22 | + PG_CONFIG = pg_config | |
23 | +-PGXS := $(shell $(PG_CONFIG) --pgxs) | |
24 | ++# PGXS := $(shell $(PG_CONFIG) --pgxs) | |
25 | ++PGXS = pgxs/pgxs.mk | |
26 | + include $(PGXS) | |
27 | + | |
28 | + all: pgroonga--$(EXTENSION_VERSION).sql |
@@ -0,0 +1,27 @@ | ||
1 | +--- /usr/postgres/9.6/lib/amd64/pgxs/src/Makefile.global 2017-01-10 19:06:58.651073282 +0900 | |
2 | ++++ pgxs/Makefile.global 2017-01-16 13:28:21.747690042 +0900 | |
3 | +@@ -236,10 +236,11 @@ | |
4 | + endif | |
5 | + endif # not PGXS | |
6 | + | |
7 | +-CC = cc -Xa | |
8 | +-GCC = | |
9 | +-SUN_STUDIO_CC = yes | |
10 | +-CFLAGS = -m64 -i -xO4 -xspace -xstrconst -Kpic -xregs=no%frameptr -xCC | |
11 | ++# CC = cc -Xa | |
12 | ++CC =/usr/bin/gcc | |
13 | ++GCC = yes | |
14 | ++SUN_STUDIO_CC = | |
15 | ++CFLAGS = -m64 | |
16 | + CFLAGS_VECTOR = | |
17 | + CFLAGS_SSE42 = | |
18 | + | |
19 | +@@ -449,7 +450,7 @@ | |
20 | + have_win32_dbghelp = no | |
21 | + | |
22 | + # Pull in platform-specific magic | |
23 | +-include $(top_builddir)/src/Makefile.port | |
24 | ++include ./pgxs/Makefile.port | |
25 | + | |
26 | + # Set up rpath if enabled. By default it will point to our libdir, | |
27 | + # but individual Makefiles can force other rpath paths if needed. |
@@ -0,0 +1,20 @@ | ||
1 | +--- /usr/postgres/9.6/lib/amd64/pgxs/src/makefiles/pgxs.mk 2017-01-10 19:06:58.822777475 +0900 | |
2 | ++++ pgxs/pgxs.mk 2017-01-16 13:25:26.457982144 +0900 | |
3 | +@@ -60,7 +60,7 @@ | |
4 | + ifdef PGXS | |
5 | + # We assume that we are in src/makefiles/, so top is ... | |
6 | + top_builddir := $(dir $(PGXS))../.. | |
7 | +-include $(top_builddir)/src/Makefile.global | |
8 | ++include ./pgxs/Makefile.global | |
9 | + | |
10 | + # These might be set in Makefile.global, but if they were not found | |
11 | + # during the build of PostgreSQL, supply default values so that users | |
12 | +@@ -103,7 +103,7 @@ | |
13 | + # shared library parameters | |
14 | + NAME = $(MODULE_big) | |
15 | + | |
16 | +-include $(top_srcdir)/src/Makefile.shlib | |
17 | ++include ./pgxs/Makefile.shlib | |
18 | + | |
19 | + all: all-lib | |
20 | + endif # MODULE_big |