]>
Commit | Line | Data |
---|---|---|
0fb76bcc GS |
1 | %define beta 0 |
2 | ||
68ae034e GS |
3 | %{?beta:%define __os_install_post /usr/lib/rpm/brp-compress} |
4 | %{!?perl:%define perl 1} | |
5 | %{!?tcl:%define tcl 1} | |
6 | %{!?tkpkg:%define tkpkg 0} | |
7 | %{!?odbc:%define odbc 1} | |
8 | %{!?jdbc:%define jdbc 1} | |
9 | %{!?test:%define test 0} | |
10 | %{!?python:%define python 1} | |
11 | %{!?pltcl:%define pltcl 1} | |
12 | %{?forceplperl:%define plperl %{expand:forceplperl}} | |
13 | %{!?forceplperl:%define forceplperl 0} | |
14 | %{!?plperl:%define plperl 0} | |
15 | %{!?ssl:%define ssl 1} | |
16 | %{!?kerberos:%define kerberos 0} | |
17 | %{!?nls:%define nls 1} | |
18 | %{!?pam:%define pam 1} | |
19 | %{!?sgmldocs:%define sgmldocs 0} | |
20 | ||
21 | ||
22 | # Utility feature defines. | |
23 | %{!?enable_mb:%define enable_mb 1} | |
24 | %{!?pgaccess:%define pgaccess 0} | |
25 | ||
26 | # Python major version. | |
2a5e2dc9 GS |
27 | %{expand:%%define pyver %(python -c 'import sys;print(sys.version[0:3])')%{nil}} |
28 | %{expand:%%define pynextver %(python -c 'import sys;print(float(sys.version[0:3])+0.1)')%{nil}} | |
68ae034e | 29 | |
2a5e2dc9 GS |
30 | Summary: PostgreSQL client programs and libraries. |
31 | Name: postgresql | |
32 | Version: 7.2.3 | |
c900cdf0 | 33 | Release: 0.1 |
2a5e2dc9 GS |
34 | License: BSD |
35 | Group: Applications/Databases | |
36 | Source0: ftp://ftp.postgresql.org/pub/source/v%{version}/%{name}-%{version}.tar.gz | |
37 | Source3: %{name}.init | |
38 | Source4: file-lists.tar.gz | |
39 | Source6: README.rpm-dist | |
40 | Source7: migration-scripts.tar.gz | |
41 | Source8: http://jdbc.postgresql.org/download/devpgjdbc1.jar | |
42 | Source9: http://jdbc.postgresql.org/download/devpgjdbc2.jar | |
43 | Source10: http://jdbc.postgresql.org/download/pgjdbc1.jar | |
44 | Source11: http://jdbc.postgresql.org/download/pgjdbc2.jar | |
45 | Source15: %{name}-bashprofile | |
46 | Patch1: %{name}-rpm.patch | |
47 | Patch3: %{name}-7.2rc2-betterquote.patch | |
48 | Patch4: %{name}-7.2-tighten.patch | |
49 | Patch5: %{name}-7.2.1-mktime.patch | |
50 | Patch6: %{name}-aurox.patch | |
51 | Patch7: %{name}-DESTDIR.patch | |
94af239f GS |
52 | BuildRequires: perl glibc-devel bison flex |
53 | BuildRequires: libstdc++-devel | |
54 | BuildRequires: tcl-devel | |
55 | BuildRequires: gettext-devel | |
2a5e2dc9 GS |
56 | Prereq: /sbin/ldconfig initscripts |
57 | BuildPrereq: perl | |
58 | BuildPrereq: readline-devel >= 4.0 | |
59 | BuildPrereq: zlib-devel >= 1.0.4 | |
60 | BuildPrereq: patch >= 2.5.4 | |
61 | Url: http://www.postgresql.org/ | |
62 | Requires: postgresql-libs = %{version} | |
68ae034e | 63 | %if %ssl |
2a5e2dc9 | 64 | BuildPrereq: openssl-devel |
68ae034e GS |
65 | %endif |
66 | %if %kerberos | |
2a5e2dc9 | 67 | BuildPrereq: krb5-devel |
68ae034e GS |
68 | %endif |
69 | %if %nls | |
2a5e2dc9 | 70 | BuildPrereq: gettext >= 0.10.36 |
68ae034e | 71 | %endif |
2a5e2dc9 GS |
72 | Obsoletes: postgresql-clients |
73 | Buildroot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
68ae034e GS |
74 | # Obsolete the packages we are not building... |
75 | %if ! %{plperl} | |
2a5e2dc9 | 76 | Obsoletes: postgresql-plperl |
68ae034e GS |
77 | %endif |
78 | %if %{tcl} | |
2a5e2dc9 | 79 | Buildrequires: tcl |
68ae034e GS |
80 | %endif |
81 | %if ! %{tcl} | |
2a5e2dc9 | 82 | Obsoletes: postgresql-tcl |
68ae034e GS |
83 | %endif |
84 | %if ! %{tkpkg} | |
2a5e2dc9 | 85 | Obsoletes: postgresql-tk |
68ae034e GS |
86 | %endif |
87 | %if ! %{odbc} | |
2a5e2dc9 | 88 | Obsoletes: postgresql-odbc |
68ae034e GS |
89 | %endif |
90 | %if ! %{perl} | |
2a5e2dc9 | 91 | Obsoletes: postgresql-perl |
68ae034e GS |
92 | %endif |
93 | %if %{python} | |
2a5e2dc9 | 94 | BuildRequires: python-devel |
68ae034e GS |
95 | %endif |
96 | %if ! %{python} | |
2a5e2dc9 | 97 | Obsoletes: postgresql-python |
68ae034e GS |
98 | %endif |
99 | %if ! %{jdbc} | |
2a5e2dc9 | 100 | Obsoletes: postgresql-jdbc |
68ae034e GS |
101 | %endif |
102 | %if ! %{test} | |
2a5e2dc9 | 103 | Obsoletes: postgresql-test |
68ae034e GS |
104 | %endif |
105 | %if ! %{sgmldocs} | |
2a5e2dc9 | 106 | Obsoletes: postgresql-docs |
68ae034e GS |
107 | %endif |
108 | %if %{pam} | |
2a5e2dc9 | 109 | BuildRequires: pam-devel |
68ae034e | 110 | %endif |
48115857 | 111 | |
68ae034e GS |
112 | %description |
113 | PostgreSQL is an advanced Object-Relational database management system | |
114 | (DBMS) that supports almost all SQL constructs (including | |
115 | transactions, subselects and user-defined types and functions). The | |
116 | postgresql package includes the client programs and libraries that | |
2a5e2dc9 | 117 | you'll need to access a PostgreSQL DBMS server. These PostgreSQL |
68ae034e GS |
118 | client programs are programs that directly manipulate the internal |
119 | structure of PostgreSQL databases on a PostgreSQL server. These client | |
120 | programs can be located on the same machine with the PostgreSQL | |
121 | server, or may be on a remote machine which accesses a PostgreSQL | |
2a5e2dc9 GS |
122 | server over a network connection. This package contains the docs in |
123 | HTML for the whole package, as well as command-line utilities for | |
124 | managing PostgreSQL databases on a PostgreSQL server. | |
68ae034e GS |
125 | |
126 | If you want to manipulate a PostgreSQL database on a remote PostgreSQL | |
127 | server, you need this package. You also need to install this package | |
128 | if you're installing the postgresql-server package. | |
b35e841d | 129 | |
9ea08160 | 130 | %package libs |
2a5e2dc9 GS |
131 | Summary: The shared libraries required for any PostgreSQL clients. |
132 | Group: Applications/Databases | |
133 | Provides: libpq.so.2 libpq.so.2.0 libpq.so | |
9ea08160 | 134 | |
135 | %description libs | |
2a5e2dc9 GS |
136 | The postgresql-libs package provides the essential shared libraries |
137 | for any PostgreSQL client program or interface. You will need to | |
138 | install this package to use any other PostgreSQL package or any | |
139 | clients that need to connect to a PostgreSQL server. | |
68ae034e GS |
140 | |
141 | %package server | |
2a5e2dc9 GS |
142 | Summary: The programs needed to create and run a PostgreSQL server. |
143 | Group: Applications/Databases | |
144 | Prereq: /usr/sbin/useradd /sbin/chkconfig | |
145 | Requires: postgresql = %{version} libpq.so | |
146 | Requires: postgresql-libs = %{version} | |
68ae034e GS |
147 | |
148 | #------------ | |
149 | %if %sgmldocs | |
150 | %package docs | |
2a5e2dc9 GS |
151 | Summary: Extra documentation for PostgreSQL |
152 | Group: Applications/Databases | |
68ae034e | 153 | %description docs |
2a5e2dc9 GS |
154 | The postgresql-docs package includes the SGML source for the |
155 | documentation as well as the documentation in other formats, and some | |
156 | extra documentation. Install this package if you want to help with the | |
157 | PostgreSQL documentation project, or if you want to generate printed | |
158 | documentation. | |
68ae034e | 159 | %endif |
9f84dc01 | 160 | |
68ae034e | 161 | %package contrib |
2a5e2dc9 GS |
162 | Summary: Contributed source and binaries distributed with PostgreSQL |
163 | Group: Applications/Databases | |
164 | Requires: libpq.so postgresql = %{version} | |
68ae034e | 165 | %description contrib |
2a5e2dc9 GS |
166 | The postgresql-contrib package includes the contrib tree distributed |
167 | with the PostgreSQL tarball. Selected contrib modules are prebuilt. | |
68ae034e GS |
168 | |
169 | %description server | |
170 | The postgresql-server package includes the programs needed to create | |
171 | and run a PostgreSQL server, which will in turn allow you to create | |
2a5e2dc9 | 172 | and maintain PostgreSQL databases. PostgreSQL is an advanced |
68ae034e GS |
173 | Object-Relational database management system (DBMS) that supports |
174 | almost all SQL constructs (including transactions, subselects and | |
175 | user-defined types and functions). You should install | |
176 | postgresql-server if you want to create and maintain your own | |
177 | PostgreSQL databases and/or your own PostgreSQL server. You also need | |
178 | to install the postgresql package. | |
b35e841d | 179 | |
68ae034e | 180 | %package devel |
2a5e2dc9 GS |
181 | Summary: PostgreSQL development header files and libraries. |
182 | Group: Development/Libraries | |
183 | Requires: postgresql-libs = %{version} | |
55747262 | 184 | |
68ae034e GS |
185 | %description devel |
186 | The postgresql-devel package contains the header files and libraries | |
187 | needed to compile C or C++ applications which will directly interact | |
188 | with a PostgreSQL database management server and the ecpg Embedded C | |
189 | Postgres preprocessor. You need to install this package if you want to | |
190 | develop applications which will interact with a PostgreSQL server. If | |
2a5e2dc9 | 191 | you're installing postgresql-server, you need to install this package. |
68ae034e GS |
192 | |
193 | #------------ | |
194 | %if %plperl | |
195 | %package plperl | |
2a5e2dc9 GS |
196 | Summary: The PL/Perl procedural language for PostgreSQL. |
197 | Group: Applications/Databases | |
198 | Requires: perl, postgresql = %{version} | |
68ae034e GS |
199 | |
200 | %description plperl | |
201 | PostgreSQL is an advanced Object-Relational database management | |
2a5e2dc9 | 202 | system. The postgresql-plperl package contains the the PL/Perl |
68ae034e GS |
203 | procedural language for the backend. |
204 | %endif | |
7386fb4a | 205 | |
68ae034e GS |
206 | #------------ |
207 | %if %tcl | |
208 | %package tcl | |
2a5e2dc9 GS |
209 | Summary: A Tcl client library, and the PL/Tcl procedural language for PostgreSQL. |
210 | Group: Applications/Databases | |
211 | Requires: tcl >= 8.0 | |
55747262 | 212 | |
68ae034e GS |
213 | %description tcl |
214 | PostgreSQL is an advanced Object-Relational database management | |
2a5e2dc9 GS |
215 | system. The postgresql-tcl package contains the libpgtcl client |
216 | library, the pg-enhanced pgtclsh, and the PL/Tcl procedural language | |
217 | for the backend. | |
68ae034e | 218 | %endif |
7386fb4a | 219 | |
68ae034e GS |
220 | #------------ |
221 | %if %tkpkg | |
222 | %package tk | |
2a5e2dc9 GS |
223 | Summary: Tk shell and tk-based GUI for PostgreSQL. |
224 | Group: Applications/Databases | |
225 | Requires: tcl >= 8.0, tk >= 8.0 | |
68ae034e GS |
226 | |
227 | %description tk | |
228 | PostgreSQL is an advanced Object-Relational database management | |
2a5e2dc9 GS |
229 | system. The postgresql-tk package contains the pgaccess program. |
230 | Pgaccess is a graphical front end, written in Tcl/Tk, for the psql and | |
231 | related PostgreSQL client programs. | |
68ae034e | 232 | %endif |
7386fb4a | 233 | |
68ae034e GS |
234 | #------------ |
235 | %if %odbc | |
236 | %package odbc | |
2a5e2dc9 GS |
237 | Summary: The ODBC driver needed for accessing a PostgreSQL DB using ODBC. |
238 | Group: Applications/Databases | |
b35e841d | 239 | |
68ae034e GS |
240 | %description odbc |
241 | PostgreSQL is an advanced Object-Relational database management | |
242 | system. The postgresql-odbc package includes the ODBC (Open DataBase | |
243 | Connectivity) driver and sample configuration files needed for | |
244 | applications to access a PostgreSQL database using ODBC. | |
245 | %endif | |
246 | ||
247 | #------------ | |
248 | %if %perl | |
249 | %package perl | |
2a5e2dc9 GS |
250 | Summary: Development module needed for Perl code to access a PostgreSQL DB. |
251 | Group: Applications/Databases | |
252 | Requires: perl >= 5.004-4 | |
7386fb4a | 253 | |
68ae034e GS |
254 | %description perl |
255 | PostgreSQL is an advanced Object-Relational database management | |
256 | system. The postgresql-perl package includes a module for developers | |
257 | to use when writing Perl code for accessing a PostgreSQL database. | |
258 | %endif | |
7386fb4a | 259 | |
68ae034e GS |
260 | #------------ |
261 | %if %python | |
262 | %package python | |
2a5e2dc9 GS |
263 | Summary: Development module for Python code to access a PostgreSQL DB. |
264 | Group: Applications/Databases | |
265 | Requires: python | |
266 | Conflicts: python < %pyver, python >= %pynextver | |
7386fb4a | 267 | |
048840cb | 268 | |
68ae034e GS |
269 | %description python |
270 | PostgreSQL is an advanced Object-Relational database management | |
2a5e2dc9 GS |
271 | system. The postgresql-python package includes a module for developers |
272 | to use when writing Python code for accessing a PostgreSQL database. | |
68ae034e | 273 | %endif |
048840cb | 274 | |
68ae034e GS |
275 | #---------- |
276 | %if %jdbc | |
277 | %package jdbc | |
2a5e2dc9 GS |
278 | Summary: Files needed for Java programs to access a PostgreSQL database. |
279 | Group: Applications/Databases | |
a57096f6 | 280 | |
68ae034e GS |
281 | %description jdbc |
282 | PostgreSQL is an advanced Object-Relational database management | |
283 | system. The postgresql-jdbc package includes the .jar file needed for | |
284 | Java programs to access a PostgreSQL database. | |
285 | %endif | |
7386fb4a | 286 | |
68ae034e GS |
287 | #------------ |
288 | %if %test | |
289 | %package test | |
2a5e2dc9 GS |
290 | Summary: The test suite distributed with PostgreSQL. |
291 | Group: Applications/Databases | |
292 | Requires: postgresql = %{version} | |
68ae034e GS |
293 | |
294 | %description test | |
295 | PostgreSQL is an advanced Object-Relational database management | |
296 | system. The postgresql-test package includes the sources and pre-built | |
297 | binaries of various tests for the PostgreSQL database management | |
298 | system, including regression tests and benchmarks. | |
299 | %endif | |
4ddf546b | 300 | |
b35e841d | 301 | %prep |
2a5e2dc9 | 302 | %setup -q |
68ae034e | 303 | |
3b12d52f | 304 | %patch1 -p1 |
68ae034e GS |
305 | #patch2 -p1 |
306 | #patch3 -p1 | |
00287bb7 | 307 | %patch4 -p1 |
68ae034e GS |
308 | %patch5 -p1 |
309 | %patch6 -p1 | |
310 | %patch7 -p1 | |
a1028a17 | 311 | |
68ae034e GS |
312 | #binary |
313 | rm contrib/spi/preprocessor/step1.e | |
b35e841d | 314 | |
68ae034e | 315 | %build |
c80000c0 | 316 | |
68ae034e GS |
317 | # Get file lists.... |
318 | tar xzf %{SOURCE4} | |
48115857 | 319 | |
68ae034e GS |
320 | #Commented out for testing on other platforms for now. |
321 | # If libtool installed, copy some files.... | |
322 | #if [ -d /usr/share/libtool ] | |
323 | #then | |
324 | # cp /usr/share/libtool/config.* . | |
325 | #fi | |
326 | ||
327 | CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS | |
328 | CXXFLAGS="${CXXFLAGS:-%optflags}" ; export CXXFLAGS | |
329 | ||
330 | # Strip out -ffast-math from CFLAGS.... | |
331 | ||
332 | CFLAGS=`echo $CFLAGS|xargs -n 1|grep -v ffast-math|xargs -n 100` | |
333 | ||
2a5e2dc9 | 334 | ./configure --enable-locale --with-CXX --prefix=%{_prefix} --disable-rpath\ |
68ae034e GS |
335 | %if %beta |
336 | --enable-debug \ | |
337 | --enable-cassert \ | |
338 | %endif | |
339 | %if %perl | |
40a8e4da | 340 | --with-perl \ |
68ae034e GS |
341 | %endif |
342 | %if %enable_mb | |
343 | --enable-multibyte \ | |
344 | %endif | |
345 | %if %tcl | |
346 | --with-tcl \ | |
347 | %endif | |
348 | %if %tkpkg | |
349 | %else | |
350 | --without-tk \ | |
351 | %endif | |
352 | %if %odbc | |
353 | --with-odbc \ | |
354 | %endif | |
355 | --enable-syslog\ | |
356 | %if %python | |
802dc4e5 | 357 | --with-python \ |
68ae034e GS |
358 | %endif |
359 | %if %ssl | |
40a8e4da | 360 | --with-openssl \ |
68ae034e GS |
361 | %endif |
362 | %if %pam | |
363 | --with-pam \ | |
364 | %endif | |
365 | %if %kerberos | |
366 | --with-krb5=/usr/kerberos \ | |
367 | %endif | |
368 | %if %nls | |
369 | --enable-nls \ | |
370 | %endif | |
371 | --sysconfdir=/etc/pgsql \ | |
372 | --mandir=%{_mandir} \ | |
373 | --docdir=%{_docdir} \ | |
374 | --includedir=%{_includedir} \ | |
2a5e2dc9 | 375 | --datadir=/usr/share/pgsql |
68ae034e GS |
376 | |
377 | ||
378 | make all | |
379 | ||
380 | ||
381 | %if %test | |
382 | pushd src/test | |
383 | make all | |
384 | popd | |
00287bb7 | 385 | %endif |
b35e841d | 386 | |
387 | %install | |
388 | rm -rf $RPM_BUILD_ROOT | |
4f5dceb8 | 389 | |
2a5e2dc9 | 390 | %{__make} DESTDIR=$RPM_BUILD_ROOT install |
68ae034e GS |
391 | |
392 | %if %perl | |
393 | make DESTDIR=$RPM_BUILD_ROOT -C src/interfaces/perl5 -f Makefile install | |
394 | ||
395 | # Get rid of the packing list generated by the perl Makefile, and build my own... | |
2a5e2dc9 GS |
396 | find $RPM_BUILD_ROOT%{_libdir}/perl5 -name .packlist -exec rm -f {} \; |
397 | find $RPM_BUILD_ROOT%{_libdir}/perl5 -type f -print | \ | |
68ae034e GS |
398 | sed -e "s|$RPM_BUILD_ROOT/|/|g" | \ |
399 | sed -e "s|.*/man/.*|&\*|" > perlfiles.list | |
2a5e2dc9 | 400 | find $RPM_BUILD_ROOT%{_libdir}/perl5 -type d -name Pg -print | \ |
68ae034e | 401 | sed -e "s|$RPM_BUILD_ROOT/|%dir /|g" >> perlfiles.list |
2a5e2dc9 | 402 | |
68ae034e GS |
403 | # check and fixup Pg manpage location.... |
404 | if [ ! -e $RPM_BUILD_ROOT%{_mandir}/man3/Pg.* ] | |
405 | then | |
2a5e2dc9 | 406 | install -d $RPM_BUILD_ROOT%{_mandir}/man3 |
68ae034e GS |
407 | cp src/interfaces/perl5/blib/man3/Pg.3pm $RPM_BUILD_ROOT%{_mandir}/man3 |
408 | fi | |
2a5e2dc9 | 409 | |
68ae034e | 410 | pushd src/interfaces |
2a5e2dc9 GS |
411 | install -d $RPM_BUILD_ROOT%{_datadir}/pgsql/perl5 |
412 | cp -a perl5/test.pl $RPM_BUILD_ROOT%{_datadir}/pgsql/perl5 | |
68ae034e GS |
413 | popd |
414 | # remove perllocal.pod and Pg.bs from the file list - only occurs with 5.6 | |
00287bb7 | 415 | |
68ae034e GS |
416 | perl -pi -e "s/^.*perllocal.pod$//" perlfiles.list |
417 | perl -pi -e "s/^.*Pg.bs$//" perlfiles.list | |
2a5e2dc9 | 418 | install -d $RPM_BUILD_ROOT%{_libdir}/perl5/site_perl/%{_arch}-linux/auto/Pg |
00287bb7 | 419 | |
68ae034e | 420 | %endif |
b35e841d | 421 | |
4ddf546b | 422 | |
68ae034e | 423 | # install dev headers. |
4ddf546b | 424 | |
68ae034e | 425 | make DESTDIR=$RPM_BUILD_ROOT install-all-headers |
00287bb7 | 426 | |
68ae034e GS |
427 | # copy over Makefile.global to the include dir.... |
428 | install -m755 src/Makefile.global $RPM_BUILD_ROOT/usr/include/pgsql | |
b35e841d | 429 | |
68ae034e GS |
430 | %if %pgaccess |
431 | # pgaccess installation | |
432 | pushd src/bin | |
433 | install -m 755 pgaccess/pgaccess $RPM_BUILD_ROOT/usr/bin | |
434 | mkdir -p $RPM_BUILD_ROOT/usr/share/pgsql/pgaccess | |
435 | install -m 644 pgaccess/main.tcl $RPM_BUILD_ROOT/usr/share/pgsql/pgaccess | |
436 | tar cf - pgaccess/lib pgaccess/images | tar xf - -C $RPM_BUILD_ROOT/usr/share/pgsql | |
437 | cp -a pgaccess/doc/html ../../doc/pgaccess | |
438 | cp pgaccess/demo/*.sql ../../doc/pgaccess | |
439 | popd | |
440 | %endif | |
a1028a17 | 441 | |
68ae034e GS |
442 | %if %jdbc |
443 | # Java/JDBC | |
444 | # The user will have to set a CLASSPATH to find it here, but not sure where else to put it... | |
b35e841d | 445 | |
2a5e2dc9 | 446 | # JDBC jars |
68ae034e GS |
447 | install -m 755 %{SOURCE8} $RPM_BUILD_ROOT/usr/share/pgsql |
448 | install -m 755 %{SOURCE9} $RPM_BUILD_ROOT/usr/share/pgsql | |
449 | install -m 755 %{SOURCE10} $RPM_BUILD_ROOT/usr/share/pgsql | |
450 | install -m 755 %{SOURCE11} $RPM_BUILD_ROOT/usr/share/pgsql | |
40a8e4da | 451 | |
68ae034e | 452 | %endif |
a9e3ed5f | 453 | |
68ae034e GS |
454 | # The initscripts.... |
455 | # Redhat-style.... | |
456 | if [ -d /etc/rc.d/init.d ] | |
457 | then | |
458 | install -d $RPM_BUILD_ROOT/etc/rc.d/init.d | |
459 | install -m 755 %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/postgresql | |
460 | mv redhat-style-files.lst files.lst | |
4c2f9988 JB |
461 | fi |
462 | ||
68ae034e GS |
463 | # SuSE-style.... |
464 | # NOTE: SuSE stuff not yet fully implemented -- this is likely to not work yet. | |
465 | # Putting SuSE-style stuff here | |
466 | if [ -d /sbin/init.d ] | |
467 | then | |
468 | # install the SuSE stuff... | |
469 | mv suse-style-files.lst files.lst | |
320d02f0 | 470 | fi |
4a025d17 | 471 | |
5cb5ee80 | 472 | |
68ae034e GS |
473 | # PGDATA needs removal of group and world permissions due to pg_pwd hole. |
474 | install -d -m 700 $RPM_BUILD_ROOT/var/lib/pgsql/data | |
475 | ||
476 | # backups of data go here... | |
477 | install -d -m 700 $RPM_BUILD_ROOT/var/lib/pgsql/backups | |
478 | ||
479 | # postgres' .bash_profile | |
480 | install -m 644 %{SOURCE15} $RPM_BUILD_ROOT/var/lib/pgsql/.bash_profile | |
481 | ||
482 | %if %test | |
483 | # tests. There are many files included here that are unnecessary, but include | |
484 | # them anyway for completeness. | |
485 | mkdir -p $RPM_BUILD_ROOT/usr/lib/pgsql/test | |
486 | cp -a src/test/regress $RPM_BUILD_ROOT/usr/lib/pgsql/test | |
487 | install -m 0755 contrib/spi/refint.so $RPM_BUILD_ROOT/usr/lib/pgsql/test/regress | |
488 | install -m 0755 contrib/spi/autoinc.so $RPM_BUILD_ROOT/usr/lib/pgsql/test/regress | |
489 | pushd $RPM_BUILD_ROOT/usr/lib/pgsql/test/regress/ | |
490 | strip *.so | |
491 | popd | |
492 | %endif | |
493 | ||
494 | # Upgrade scripts. | |
495 | pushd $RPM_BUILD_ROOT | |
496 | tar xzf %{SOURCE7} | |
497 | popd | |
498 | ||
499 | # logrotate script removed until future release | |
500 | #logrotate script source (which needs WORK) | |
501 | #mkdir -p $RPM_BUILD_ROOT/etc/logrotate.d | |
502 | #cp %{SOURCE8} $RPM_BUILD_ROOT/etc/logrotate.d/postgres | |
503 | #chmod 0644 $RPM_BUILD_ROOT/etc/logrotate.d/postgres | |
504 | ||
505 | # Fix some more documentation | |
506 | # gzip doc/internals.ps | |
507 | cp %{SOURCE6} README.rpm-dist | |
508 | mv $RPM_BUILD_ROOT%{_docdir}/postgresql/html doc | |
509 | ||
510 | # Build contrib stuff.... | |
511 | pushd contrib | |
512 | make clean | |
513 | make all | |
2a5e2dc9 | 514 | popd |
68ae034e GS |
515 | # move the contrib tree to the right place after building.... |
516 | cp -r contrib $RPM_BUILD_ROOT/usr/lib/pgsql | |
517 | # We'll do more prep work in a later release..... | |
518 | ||
519 | #more massaging | |
520 | ||
521 | pushd $RPM_BUILD_ROOT/usr/lib/pgsql/contrib | |
522 | ||
523 | # Get rid of useless makefiles | |
524 | rm -f Makefile */Makefile | |
525 | ||
526 | # array | |
527 | pushd array | |
528 | perl -pi -e "s|\\\$libdir|/usr/lib/pgsql/contrib/array|" * | |
529 | popd | |
530 | ||
531 | # btree_gist | |
532 | pushd btree_gist | |
533 | perl -pi -e "s|\\\$libdir|/usr/lib/pgsql/contrib/btree_gist|" *.sql | |
534 | popd | |
535 | ||
536 | # chkpass | |
537 | pushd chkpass | |
538 | perl -pi -e "s|\\\$libdir|/usr/lib/pgsql/contrib/chkpass|" *.sql | |
539 | popd | |
540 | ||
541 | # cube | |
542 | pushd cube | |
543 | perl -pi -e "s|\\\$libdir|/usr/lib/pgsql/contrib/cube|" cube.sql | |
544 | popd | |
545 | ||
546 | # dblink | |
547 | pushd dblink | |
548 | perl -pi -e "s|\\\$libdir|/usr/lib/pgsql/contrib/dblink|" dblink.sql | |
549 | popd | |
550 | ||
551 | # earthdistance | |
552 | pushd earthdistance | |
553 | perl -pi -e "s|/usr/share/pgsql/contrib|/usr/lib/pgsql/contrib/earthdistance|" *.sql | |
554 | popd | |
555 | ||
556 | # fulltext | |
557 | pushd fulltextindex | |
558 | perl -pi -e "s|\\\$libdir|/usr/lib/pgsql/contrib/fulltextindex|" *.sql | |
559 | popd | |
560 | ||
561 | # fuzzystrmatch | |
562 | pushd fuzzystrmatch | |
563 | perl -pi -e "s|\\\$libdir|/usr/lib/pgsql/contrib/fuzzystrmatch|" *.sql | |
564 | popd | |
565 | ||
566 | # intarray | |
567 | pushd intarray | |
568 | perl -pi -e "s|\\\$libdir|/usr/lib/pgsql/contrib/intarray|" *.sql | |
569 | popd | |
570 | ||
571 | # isbn_issn | |
572 | pushd isbn_issn | |
573 | perl -pi -e "s|\\\$libdir|/usr/lib/pgsql/contrib/isbn_issn|" *.sql | |
574 | popd | |
575 | ||
576 | # lo | |
577 | pushd lo | |
578 | perl -pi -e "s|\\\$libdir|/usr/lib/pgsql/contrib/lo|" *.sql | |
579 | popd | |
580 | ||
581 | # miscutil | |
582 | pushd miscutil | |
583 | perl -pi -e "s|\\\$libdir|/usr/lib/pgsql/contrib/miscutil|" *.sql | |
584 | popd | |
585 | ||
586 | # noupdate | |
587 | pushd noupdate | |
588 | perl -pi -e "s|\\\$libdir|/usr/lib/pgsql/contrib/noupdate|" *.sql | |
589 | popd | |
590 | ||
591 | # pgcrypto | |
592 | pushd pgcrypto | |
593 | perl -pi -e "s|\\\$libdir|/usr/lib/pgsql/contrib/pgcrypto|" *.sql | |
594 | perl -pi -e "s|/usr/lib/pgsql/contrib/pgcrypto/pgcrypto|/usr/lib/pgsql/contrib/pgcrypto/libpgcrypto|" *.sql | |
2a5e2dc9 | 595 | rm -f *.in *.o |
68ae034e GS |
596 | popd |
597 | ||
598 | # pgstattuple | |
599 | pushd pgstattuple | |
600 | perl -pi -e "s|\\\$libdir|/usr/lib/pgsql/contrib/pgstattuple|" *.sql | |
601 | popd | |
602 | ||
603 | # rserv | |
604 | pushd rserv | |
605 | perl -pi -e "s|/usr/share/|/usr/lib/|" * | |
606 | perl -pi -e "s|\\\$libdir|/usr/lib/pgsql/contrib|" * | |
607 | perl -pi -e "s|/usr/bin|/usr/lib/pgsql/contrib/rserv|" * | |
608 | popd | |
609 | ||
610 | # rtree_gist | |
611 | pushd pgstattuple | |
612 | perl -pi -e "s|\\\$libdir|/usr/lib/pgsql/contrib|" *.sql | |
613 | popd | |
614 | ||
2a5e2dc9 | 615 | # seg |
68ae034e GS |
616 | pushd seg |
617 | perl -pi -e "s|\\\$libdir|/usr/lib/pgsql/contrib|" *.sql | |
618 | popd | |
619 | ||
620 | # spi | |
621 | pushd spi | |
622 | perl -pi -e "s|\\\$libdir|/usr/lib/pgsql/contrib/spi|" *.sql | |
623 | popd | |
624 | ||
625 | # Don"t need these | |
626 | rm -fr startscripts | |
627 | ||
628 | # string | |
629 | pushd string | |
630 | perl -pi -e "s|\\\$libdir|/usr/lib/pgsql/contrib/string|" *.sql | |
631 | popd | |
632 | ||
633 | # tsearch | |
634 | pushd tsearch | |
635 | perl -pi -e "s|\\\$libdir|/usr/lib/pgsql/contrib/tsearch|" *.sql | |
636 | popd | |
637 | ||
638 | # userlock | |
639 | pushd userlock | |
640 | perl -pi -e "s|\\\$libdir|/usr/lib/pgsql/contrib/userlock|" *.sql | |
641 | popd | |
642 | ||
643 | popd | |
644 | ||
645 | #more broken symlinks | |
646 | rm -f $RPM_BUILD_ROOT/usr/lib/pgsql/contrib/pg_resetxlog/pg_crc.c $RPM_BUILD_ROOT/usr/lib/pgsql/contrib/pg_controldata/pg_crc.c | |
647 | cp src/backend/utils/hash/pg_crc.c $RPM_BUILD_ROOT/usr/lib/pgsql/contrib/pg_resetxlog/pg_crc.c | |
648 | ln $RPM_BUILD_ROOT/usr/lib/pgsql/contrib/pg_resetxlog/pg_crc.c $RPM_BUILD_ROOT/usr/lib/pgsql/contrib/pg_controldata/pg_crc.c | |
649 | ||
2a5e2dc9 | 650 | # Symlink libpq.so.2.0 to libpq.so.2 for backwards compatibility, until |
68ae034e GS |
651 | # -soname patches are the norm. |
652 | pushd $RPM_BUILD_ROOT/usr/lib | |
653 | ln -s libpq.so.2 libpq.so.2.0 | |
654 | popd | |
655 | ||
656 | # arch backups should go in /usr/lib, not /usr/share | |
657 | pushd $RPM_BUILD_ROOT | |
658 | mkdir -p usr/lib/pgsql/backup | |
2a5e2dc9 | 659 | mv usr/share/pgsql/backup/pg_dumpall_new usr/lib/pgsql/backup/pg_dumpall_new |
68ae034e GS |
660 | popd |
661 | ||
662 | ||
663 | %find_lang libpq | |
664 | %find_lang pg_dump | |
665 | %find_lang postgres | |
666 | %find_lang psql | |
667 | ||
668 | cat psql.lang pg_dump.lang > main.lst | |
669 | cat postgres.lang files.lst > server.lst | |
670 | ||
671 | %pre | |
672 | # Need to make backups of some executables if an upgrade | |
673 | # They will be needed to do a dump of the old version's database. | |
674 | # All output redirected to /dev/null. | |
675 | ||
676 | if [ $1 -gt 1 ] | |
677 | then | |
678 | mkdir -p /usr/lib/pgsql/backup > /dev/null | |
679 | pushd /usr/bin > /dev/null | |
680 | cp -fp postmaster postgres pg_dump pg_dumpall psql /usr/lib/pgsql/backup > /dev/null 2>&1 || : | |
681 | popd > /dev/null | |
682 | pushd /usr/lib > /dev/null | |
683 | cp -fp libpq.* /usr/lib/pgsql/backup > /dev/null 2>&1 || : | |
684 | popd > /dev/null | |
1bc01910 | 685 | fi |
c1db913e | 686 | |
2a5e2dc9 GS |
687 | %post libs -p /sbin/ldconfig |
688 | %postun libs -p /sbin/ldconfig | |
68ae034e GS |
689 | |
690 | %pre server | |
691 | groupadd -g 26 -o -r postgres >/dev/null 2>&1 || : | |
692 | useradd -M -n -g postgres -o -r -d /var/lib/pgsql -s /bin/bash \ | |
693 | -c "PostgreSQL Server" -u 26 postgres >/dev/null 2>&1 || : | |
694 | touch /var/log/pgsql | |
695 | chown postgres.postgres /var/log/pgsql | |
696 | chmod 0700 /var/log/pgsql | |
697 | ||
698 | ||
699 | %post server | |
700 | chkconfig --add postgresql | |
701 | /sbin/ldconfig | |
702 | ||
703 | %preun server | |
704 | if [ $1 = 0 ] ; then | |
705 | chkconfig --del postgresql | |
1bc01910 | 706 | fi |
016f481d | 707 | |
68ae034e | 708 | %postun server |
2a5e2dc9 | 709 | /sbin/ldconfig |
68ae034e GS |
710 | if [ $1 -ge 1 ]; then |
711 | /sbin/service postgresql condrestart >/dev/null 2>&1 | |
712 | fi | |
713 | if [ $1 = 0 ] ; then | |
714 | userdel postgres >/dev/null 2>&1 || : | |
2a5e2dc9 | 715 | groupdel postgres >/dev/null 2>&1 || : |
68ae034e | 716 | fi |
048840cb | 717 | |
68ae034e GS |
718 | %if %odbc |
719 | %post -p /sbin/ldconfig odbc | |
720 | %postun -p /sbin/ldconfig odbc | |
721 | %endif | |
722 | ||
723 | %if %tcl | |
724 | %post -p /sbin/ldconfig tcl | |
725 | %postun -p /sbin/ldconfig tcl | |
726 | %endif | |
727 | ||
728 | %if %plperl | |
729 | %post -p /sbin/ldconfig plperl | |
730 | %postun -p /sbin/ldconfig plperl | |
731 | %endif | |
732 | ||
733 | %if %test | |
734 | %post test | |
735 | chown -R postgres.postgres /usr/share/pgsql/test >/dev/null 2>&1 || : | |
736 | %endif | |
737 | ||
738 | %clean | |
739 | rm -rf $RPM_BUILD_ROOT | |
740 | rm -f perlfiles.list | |
741 | ||
742 | # Ok, we are dynamically generating some filelists. These are by default | |
743 | # under the BUILD/postgresql-x.y.z tree. | |
744 | ||
745 | # Note that macros such as config are available in those lists. | |
746 | # The lists differentiate between RedHat, SuSE, and others. | |
747 | ||
748 | %files -f main.lst | |
2a5e2dc9 GS |
749 | %defattr(644,root,root,755) |
750 | %doc doc/FAQ doc/KNOWN_BUGS doc/MISSING_FEATURES doc/README* | |
68ae034e GS |
751 | %doc COPYRIGHT README HISTORY doc/bug.template |
752 | %doc README.rpm-dist | |
753 | %doc doc/html | |
2a5e2dc9 GS |
754 | %attr(755,root,root) %{_bindir}/createdb |
755 | %attr(755,root,root) %{_bindir}/createlang | |
756 | %attr(755,root,root) %{_bindir}/createuser | |
757 | %attr(755,root,root) %{_bindir}/dropdb | |
758 | %attr(755,root,root) %{_bindir}/droplang | |
759 | %attr(755,root,root) %{_bindir}/dropuser | |
760 | %attr(755,root,root) %{_bindir}/pg_dump | |
761 | %attr(755,root,root) %{_bindir}/pg_dumpall | |
762 | %attr(755,root,root) %{_bindir}/pg_encoding | |
763 | %attr(755,root,root) %{_bindir}/pg_id | |
764 | %attr(755,root,root) %{_bindir}/pg_restore | |
765 | %attr(755,root,root) %{_bindir}/psql | |
766 | %attr(755,root,root) %{_bindir}/vacuumdb | |
7386fb4a | 767 | %{_mandir}/man1/createdb.1* |
3b5f40ab | 768 | %{_mandir}/man1/createlang.1* |
7386fb4a | 769 | %{_mandir}/man1/createuser.1* |
3b5f40ab | 770 | %{_mandir}/man1/dropdb.1* |
771 | %{_mandir}/man1/droplang.1* | |
772 | %{_mandir}/man1/dropuser.1* | |
68ae034e GS |
773 | %{_mandir}/man1/pg_dump.1* |
774 | %{_mandir}/man1/pg_dumpall.1* | |
775 | %{_mandir}/man1/psql.1* | |
776 | %{_mandir}/man1/vacuumdb.1* | |
777 | %{_mandir}/man1/pg_restore.1* | |
778 | %{_mandir}/man7/* | |
779 | ||
780 | %if %sgmldocs | |
781 | %files docs | |
2a5e2dc9 | 782 | %defattr(644,root,root,755) |
68ae034e GS |
783 | %doc doc/src/* |
784 | %endif | |
785 | ||
786 | %files contrib | |
2a5e2dc9 GS |
787 | %defattr(644,root,root,755) |
788 | %dir %{_libdir}/pgsql/contrib/ | |
789 | %{_libdir}/pgsql/contrib/* | |
68ae034e GS |
790 | |
791 | %files libs -f libpq.lang | |
2a5e2dc9 GS |
792 | %defattr(644,root,root,755) |
793 | %{_libdir}/libpq.so.* | |
794 | %{_libdir}/libecpg.so.* | |
795 | %{_libdir}/libpq++.so.* | |
796 | %{_libdir}/libpgeasy.so.* | |
68ae034e GS |
797 | |
798 | %files server -f server.lst | |
2a5e2dc9 GS |
799 | %defattr(644,root,root,755) |
800 | %attr(755,root,root) %{_bindir}/initdb | |
801 | %attr(755,root,root) %{_bindir}/initlocation | |
802 | %attr(755,root,root) %{_bindir}/ipcclean | |
803 | %attr(755,root,root) %{_bindir}/pg_ctl | |
804 | %attr(755,root,root) %{_bindir}/pg_passwd | |
805 | %attr(755,root,root) %{_bindir}/postgres | |
806 | %attr(755,root,root) %{_bindir}/postmaster | |
7386fb4a AF |
807 | %{_mandir}/man1/initdb.1* |
808 | %{_mandir}/man1/initlocation.1* | |
68ae034e | 809 | %{_mandir}/man1/ipcclean.1* |
c80000c0 | 810 | %{_mandir}/man1/pg_ctl.1* |
68ae034e | 811 | %{_mandir}/man1/pg_passwd.1* |
7386fb4a AF |
812 | %{_mandir}/man1/postgres.1* |
813 | %{_mandir}/man1/postmaster.1* | |
2a5e2dc9 GS |
814 | %{_datadir}/pgsql/postgres.bki |
815 | %{_datadir}/pgsql/postgres.description | |
816 | %{_datadir}/pgsql/*.sample | |
817 | %{_libdir}/pgsql/plpgsql.so | |
818 | %dir %{_libdir}/pgsql | |
819 | %dir %{_datadir}/pgsql | |
820 | %attr(700,postgres,postgres) %dir %{_libdir}/pgsql/backup | |
821 | %{_libdir}/pgsql/backup/pg_dumpall_new | |
68ae034e GS |
822 | %attr(700,postgres,postgres) %dir /var/lib/pgsql |
823 | %attr(700,postgres,postgres) %dir /var/lib/pgsql/data | |
824 | %attr(700,postgres,postgres) %dir /var/lib/pgsql/backups | |
825 | %attr(644,postgres,postgres) %config(noreplace) /var/lib/pgsql/.bash_profile | |
7386fb4a | 826 | |
68ae034e | 827 | %files devel |
2a5e2dc9 GS |
828 | %defattr(644,root,root,755) |
829 | %{_includedir}/* | |
830 | %attr(755,root,root) %{_bindir}/ecpg | |
831 | %attr(755,root,root) %{_bindir}/pg_config | |
832 | %{_libdir}/libpq.so | |
833 | %{_libdir}/libecpg.so | |
834 | %{_libdir}/libpq++.so | |
835 | %{_libdir}/libpgeasy.so | |
836 | %{_libdir}/libpq.a | |
837 | %{_libdir}/libecpg.a | |
838 | %{_libdir}/libpq++.a | |
839 | %{_libdir}/libpgeasy.a | |
68ae034e | 840 | %if %tcl |
2a5e2dc9 | 841 | %{_libdir}/libpgtcl.a |
68ae034e GS |
842 | %endif |
843 | %{_mandir}/man1/ecpg.1* | |
844 | %{_mandir}/man1/pg_config.1* | |
048840cb | 845 | |
68ae034e GS |
846 | %if %tcl |
847 | %files tcl | |
2a5e2dc9 GS |
848 | %defattr(644,root,root,755) |
849 | %attr(755,root,root) %{_libdir}/libpgtcl.so.* | |
850 | %{_libdir}/libpgtcl.so | |
851 | %attr(755,root,root) %{_bindir}/pgtclsh | |
852 | %attr(755,root,root) %{_bindir}/pltcl_delmod | |
853 | %attr(755,root,root) %{_bindir}/pltcl_listmod | |
854 | %attr(755,root,root) %{_bindir}/pltcl_loadmod | |
68ae034e | 855 | %{_mandir}/man1/pgtclsh.1* |
2a5e2dc9 GS |
856 | %{_libdir}/pgsql/pltcl.so |
857 | %{_datadir}/pgsql/unknown.pltcl | |
68ae034e | 858 | %endif |
5cb5ee80 | 859 | |
68ae034e GS |
860 | %if %tkpkg |
861 | %files tk | |
2a5e2dc9 GS |
862 | %defattr(644,root,root,755) |
863 | %attr(755,root,root) %{_bindir}/pgtksh | |
68ae034e GS |
864 | %{_mandir}/man1/pgtksh.1* |
865 | %endif | |
7386fb4a | 866 | |
68ae034e GS |
867 | %if %pgaccess |
868 | %doc doc/pgaccess/* | |
869 | /usr/share/pgsql/pgaccess | |
870 | /usr/bin/pgaccess | |
871 | %{_mandir}/man1/pgaccess.1* | |
872 | %endif | |
7386fb4a | 873 | |
68ae034e GS |
874 | %if %odbc |
875 | %files odbc | |
2a5e2dc9 GS |
876 | %defattr(644,root,root,755) |
877 | %attr(755,root,root) %{_libdir}/libpsqlodbc.so* | |
878 | %{_datadir}/pgsql/odbc.sql | |
68ae034e | 879 | %endif |
cb920eb9 | 880 | |
68ae034e GS |
881 | %if %perl |
882 | %files -f perlfiles.list perl | |
2a5e2dc9 GS |
883 | %defattr(644,root,root,755) |
884 | %dir %{_libdir}/perl5/site_perl/%{_arch}-linux/auto | |
885 | %{_datadir}/pgsql/perl5 | |
68ae034e | 886 | %{_mandir}/man3/Pg.* |
2a5e2dc9 | 887 | %{_libdir}/pgsql/plperl.so |
68ae034e | 888 | %endif |
b35e841d | 889 | |
68ae034e GS |
890 | %if %plperl |
891 | %files plperl | |
2a5e2dc9 GS |
892 | %defattr(644,root,root,755) |
893 | %{_libdir}/pgsql/plperl.so | |
68ae034e | 894 | %endif |
b35e841d | 895 | |
68ae034e GS |
896 | %if %python |
897 | %files python | |
2a5e2dc9 | 898 | %defattr(644,root,root,755) |
68ae034e | 899 | %doc src/interfaces/python/README src/interfaces/python/tutorial |
2a5e2dc9 GS |
900 | %{_libdir}/python%{pyver}/site-packages/_pgmodule.so |
901 | %{_libdir}/python%{pyver}/site-packages/*.py | |
902 | %{_libdir}/pgsql/plpython.so | |
68ae034e | 903 | %endif |
9ea08160 | 904 | |
68ae034e GS |
905 | %if %jdbc |
906 | %files jdbc | |
2a5e2dc9 GS |
907 | %defattr(644,root,root,755) |
908 | %{_datadir}/pgsql/*jar | |
68ae034e | 909 | %endif |
54c7a281 | 910 | |
68ae034e GS |
911 | %if %test |
912 | %files test | |
2a5e2dc9 GS |
913 | %defattr(644,root,root,755) |
914 | %attr(-,postgres,postgres) %{_libdir}/pgsql/test/* | |
915 | %attr(-,postgres,postgres) %dir %{_libdir}/pgsql/test | |
68ae034e | 916 | %endif |