]> git.pld-linux.org Git - packages/postgresql.git/blame - postgresql.spec
- pldize
[packages/postgresql.git] / postgresql.spec
CommitLineData
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
30Summary: PostgreSQL client programs and libraries.
31Name: postgresql
32Version: 7.2.3
c900cdf0 33Release: 0.1
2a5e2dc9
GS
34License: BSD
35Group: Applications/Databases
36Source0: ftp://ftp.postgresql.org/pub/source/v%{version}/%{name}-%{version}.tar.gz
37Source3: %{name}.init
38Source4: file-lists.tar.gz
39Source6: README.rpm-dist
40Source7: migration-scripts.tar.gz
41Source8: http://jdbc.postgresql.org/download/devpgjdbc1.jar
42Source9: http://jdbc.postgresql.org/download/devpgjdbc2.jar
43Source10: http://jdbc.postgresql.org/download/pgjdbc1.jar
44Source11: http://jdbc.postgresql.org/download/pgjdbc2.jar
45Source15: %{name}-bashprofile
46Patch1: %{name}-rpm.patch
47Patch3: %{name}-7.2rc2-betterquote.patch
48Patch4: %{name}-7.2-tighten.patch
49Patch5: %{name}-7.2.1-mktime.patch
50Patch6: %{name}-aurox.patch
51Patch7: %{name}-DESTDIR.patch
94af239f
GS
52BuildRequires: perl glibc-devel bison flex
53BuildRequires: libstdc++-devel
54BuildRequires: tcl-devel
55BuildRequires: gettext-devel
2a5e2dc9
GS
56Prereq: /sbin/ldconfig initscripts
57BuildPrereq: perl
58BuildPrereq: readline-devel >= 4.0
59BuildPrereq: zlib-devel >= 1.0.4
60BuildPrereq: patch >= 2.5.4
61Url: http://www.postgresql.org/
62Requires: postgresql-libs = %{version}
68ae034e 63%if %ssl
2a5e2dc9 64BuildPrereq: openssl-devel
68ae034e
GS
65%endif
66%if %kerberos
2a5e2dc9 67BuildPrereq: krb5-devel
68ae034e
GS
68%endif
69%if %nls
2a5e2dc9 70BuildPrereq: gettext >= 0.10.36
68ae034e 71%endif
2a5e2dc9
GS
72Obsoletes: postgresql-clients
73Buildroot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
68ae034e
GS
74# Obsolete the packages we are not building...
75%if ! %{plperl}
2a5e2dc9 76Obsoletes: postgresql-plperl
68ae034e
GS
77%endif
78%if %{tcl}
2a5e2dc9 79Buildrequires: tcl
68ae034e
GS
80%endif
81%if ! %{tcl}
2a5e2dc9 82Obsoletes: postgresql-tcl
68ae034e
GS
83%endif
84%if ! %{tkpkg}
2a5e2dc9 85Obsoletes: postgresql-tk
68ae034e
GS
86%endif
87%if ! %{odbc}
2a5e2dc9 88Obsoletes: postgresql-odbc
68ae034e
GS
89%endif
90%if ! %{perl}
2a5e2dc9 91Obsoletes: postgresql-perl
68ae034e
GS
92%endif
93%if %{python}
2a5e2dc9 94BuildRequires: python-devel
68ae034e
GS
95%endif
96%if ! %{python}
2a5e2dc9 97Obsoletes: postgresql-python
68ae034e
GS
98%endif
99%if ! %{jdbc}
2a5e2dc9 100Obsoletes: postgresql-jdbc
68ae034e
GS
101%endif
102%if ! %{test}
2a5e2dc9 103Obsoletes: postgresql-test
68ae034e
GS
104%endif
105%if ! %{sgmldocs}
2a5e2dc9 106Obsoletes: postgresql-docs
68ae034e
GS
107%endif
108%if %{pam}
2a5e2dc9 109BuildRequires: pam-devel
68ae034e 110%endif
48115857 111
68ae034e
GS
112%description
113PostgreSQL is an advanced Object-Relational database management system
114(DBMS) that supports almost all SQL constructs (including
115transactions, subselects and user-defined types and functions). The
116postgresql package includes the client programs and libraries that
2a5e2dc9 117you'll need to access a PostgreSQL DBMS server. These PostgreSQL
68ae034e
GS
118client programs are programs that directly manipulate the internal
119structure of PostgreSQL databases on a PostgreSQL server. These client
120programs can be located on the same machine with the PostgreSQL
121server, or may be on a remote machine which accesses a PostgreSQL
2a5e2dc9
GS
122server over a network connection. This package contains the docs in
123HTML for the whole package, as well as command-line utilities for
124managing PostgreSQL databases on a PostgreSQL server.
68ae034e
GS
125
126If you want to manipulate a PostgreSQL database on a remote PostgreSQL
127server, you need this package. You also need to install this package
128if you're installing the postgresql-server package.
b35e841d 129
9ea08160 130%package libs
2a5e2dc9
GS
131Summary: The shared libraries required for any PostgreSQL clients.
132Group: Applications/Databases
133Provides: libpq.so.2 libpq.so.2.0 libpq.so
9ea08160 134
135%description libs
2a5e2dc9
GS
136The postgresql-libs package provides the essential shared libraries
137for any PostgreSQL client program or interface. You will need to
138install this package to use any other PostgreSQL package or any
139clients that need to connect to a PostgreSQL server.
68ae034e
GS
140
141%package server
2a5e2dc9
GS
142Summary: The programs needed to create and run a PostgreSQL server.
143Group: Applications/Databases
144Prereq: /usr/sbin/useradd /sbin/chkconfig
145Requires: postgresql = %{version} libpq.so
146Requires: postgresql-libs = %{version}
68ae034e
GS
147
148#------------
149%if %sgmldocs
150%package docs
2a5e2dc9
GS
151Summary: Extra documentation for PostgreSQL
152Group: Applications/Databases
68ae034e 153%description docs
2a5e2dc9
GS
154The postgresql-docs package includes the SGML source for the
155documentation as well as the documentation in other formats, and some
156extra documentation. Install this package if you want to help with the
157PostgreSQL documentation project, or if you want to generate printed
158documentation.
68ae034e 159%endif
9f84dc01 160
68ae034e 161%package contrib
2a5e2dc9
GS
162Summary: Contributed source and binaries distributed with PostgreSQL
163Group: Applications/Databases
164Requires: libpq.so postgresql = %{version}
68ae034e 165%description contrib
2a5e2dc9
GS
166The postgresql-contrib package includes the contrib tree distributed
167with the PostgreSQL tarball. Selected contrib modules are prebuilt.
68ae034e
GS
168
169%description server
170The postgresql-server package includes the programs needed to create
171and run a PostgreSQL server, which will in turn allow you to create
2a5e2dc9 172and maintain PostgreSQL databases. PostgreSQL is an advanced
68ae034e
GS
173Object-Relational database management system (DBMS) that supports
174almost all SQL constructs (including transactions, subselects and
175user-defined types and functions). You should install
176postgresql-server if you want to create and maintain your own
177PostgreSQL databases and/or your own PostgreSQL server. You also need
178to install the postgresql package.
b35e841d 179
68ae034e 180%package devel
2a5e2dc9
GS
181Summary: PostgreSQL development header files and libraries.
182Group: Development/Libraries
183Requires: postgresql-libs = %{version}
55747262 184
68ae034e
GS
185%description devel
186The postgresql-devel package contains the header files and libraries
187needed to compile C or C++ applications which will directly interact
188with a PostgreSQL database management server and the ecpg Embedded C
189Postgres preprocessor. You need to install this package if you want to
190develop applications which will interact with a PostgreSQL server. If
2a5e2dc9 191you're installing postgresql-server, you need to install this package.
68ae034e
GS
192
193#------------
194%if %plperl
195%package plperl
2a5e2dc9
GS
196Summary: The PL/Perl procedural language for PostgreSQL.
197Group: Applications/Databases
198Requires: perl, postgresql = %{version}
68ae034e
GS
199
200%description plperl
201PostgreSQL is an advanced Object-Relational database management
2a5e2dc9 202system. The postgresql-plperl package contains the the PL/Perl
68ae034e
GS
203procedural language for the backend.
204%endif
7386fb4a 205
68ae034e
GS
206#------------
207%if %tcl
208%package tcl
2a5e2dc9
GS
209Summary: A Tcl client library, and the PL/Tcl procedural language for PostgreSQL.
210Group: Applications/Databases
211Requires: tcl >= 8.0
55747262 212
68ae034e
GS
213%description tcl
214PostgreSQL is an advanced Object-Relational database management
2a5e2dc9
GS
215system. The postgresql-tcl package contains the libpgtcl client
216library, the pg-enhanced pgtclsh, and the PL/Tcl procedural language
217for the backend.
68ae034e 218%endif
7386fb4a 219
68ae034e
GS
220#------------
221%if %tkpkg
222%package tk
2a5e2dc9
GS
223Summary: Tk shell and tk-based GUI for PostgreSQL.
224Group: Applications/Databases
225Requires: tcl >= 8.0, tk >= 8.0
68ae034e
GS
226
227%description tk
228PostgreSQL is an advanced Object-Relational database management
2a5e2dc9
GS
229system. The postgresql-tk package contains the pgaccess program.
230Pgaccess is a graphical front end, written in Tcl/Tk, for the psql and
231related PostgreSQL client programs.
68ae034e 232%endif
7386fb4a 233
68ae034e
GS
234#------------
235%if %odbc
236%package odbc
2a5e2dc9
GS
237Summary: The ODBC driver needed for accessing a PostgreSQL DB using ODBC.
238Group: Applications/Databases
b35e841d 239
68ae034e
GS
240%description odbc
241PostgreSQL is an advanced Object-Relational database management
242system. The postgresql-odbc package includes the ODBC (Open DataBase
243Connectivity) driver and sample configuration files needed for
244applications to access a PostgreSQL database using ODBC.
245%endif
246
247#------------
248%if %perl
249%package perl
2a5e2dc9
GS
250Summary: Development module needed for Perl code to access a PostgreSQL DB.
251Group: Applications/Databases
252Requires: perl >= 5.004-4
7386fb4a 253
68ae034e
GS
254%description perl
255PostgreSQL is an advanced Object-Relational database management
256system. The postgresql-perl package includes a module for developers
257to 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
263Summary: Development module for Python code to access a PostgreSQL DB.
264Group: Applications/Databases
265Requires: python
266Conflicts: python < %pyver, python >= %pynextver
7386fb4a 267
048840cb 268
68ae034e
GS
269%description python
270PostgreSQL is an advanced Object-Relational database management
2a5e2dc9
GS
271system. The postgresql-python package includes a module for developers
272to 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
278Summary: Files needed for Java programs to access a PostgreSQL database.
279Group: Applications/Databases
a57096f6 280
68ae034e
GS
281%description jdbc
282PostgreSQL is an advanced Object-Relational database management
283system. The postgresql-jdbc package includes the .jar file needed for
284Java programs to access a PostgreSQL database.
285%endif
7386fb4a 286
68ae034e
GS
287#------------
288%if %test
289%package test
2a5e2dc9
GS
290Summary: The test suite distributed with PostgreSQL.
291Group: Applications/Databases
292Requires: postgresql = %{version}
68ae034e
GS
293
294%description test
295PostgreSQL is an advanced Object-Relational database management
296system. The postgresql-test package includes the sources and pre-built
297binaries of various tests for the PostgreSQL database management
298system, 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
313rm contrib/spi/preprocessor/step1.e
b35e841d 314
68ae034e 315%build
c80000c0 316
68ae034e
GS
317# Get file lists....
318tar 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
327CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS
328CXXFLAGS="${CXXFLAGS:-%optflags}" ; export CXXFLAGS
329
330# Strip out -ffast-math from CFLAGS....
331
332CFLAGS=`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
378make all
379
380
381%if %test
382 pushd src/test
383 make all
384 popd
00287bb7 385%endif
b35e841d 386
387%install
388rm -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 425make DESTDIR=$RPM_BUILD_ROOT install-all-headers
00287bb7 426
68ae034e
GS
427# copy over Makefile.global to the include dir....
428install -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....
456if [ -d /etc/rc.d/init.d ]
457then
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
461fi
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
466if [ -d /sbin/init.d ]
467then
468 # install the SuSE stuff...
469 mv suse-style-files.lst files.lst
320d02f0 470fi
4a025d17 471
5cb5ee80 472
68ae034e
GS
473# PGDATA needs removal of group and world permissions due to pg_pwd hole.
474install -d -m 700 $RPM_BUILD_ROOT/var/lib/pgsql/data
475
476# backups of data go here...
477install -d -m 700 $RPM_BUILD_ROOT/var/lib/pgsql/backups
478
479# postgres' .bash_profile
480install -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.
495pushd $RPM_BUILD_ROOT
496tar xzf %{SOURCE7}
497popd
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
507cp %{SOURCE6} README.rpm-dist
508mv $RPM_BUILD_ROOT%{_docdir}/postgresql/html doc
509
510# Build contrib stuff....
511pushd contrib
512make clean
513make all
2a5e2dc9 514popd
68ae034e
GS
515# move the contrib tree to the right place after building....
516cp -r contrib $RPM_BUILD_ROOT/usr/lib/pgsql
517# We'll do more prep work in a later release.....
518
519#more massaging
520
521pushd $RPM_BUILD_ROOT/usr/lib/pgsql/contrib
522
523# Get rid of useless makefiles
524rm -f Makefile */Makefile
525
526# array
527pushd array
528perl -pi -e "s|\\\$libdir|/usr/lib/pgsql/contrib/array|" *
529popd
530
531# btree_gist
532pushd btree_gist
533perl -pi -e "s|\\\$libdir|/usr/lib/pgsql/contrib/btree_gist|" *.sql
534popd
535
536# chkpass
537pushd chkpass
538perl -pi -e "s|\\\$libdir|/usr/lib/pgsql/contrib/chkpass|" *.sql
539popd
540
541# cube
542pushd cube
543perl -pi -e "s|\\\$libdir|/usr/lib/pgsql/contrib/cube|" cube.sql
544popd
545
546# dblink
547pushd dblink
548perl -pi -e "s|\\\$libdir|/usr/lib/pgsql/contrib/dblink|" dblink.sql
549popd
550
551# earthdistance
552pushd earthdistance
553perl -pi -e "s|/usr/share/pgsql/contrib|/usr/lib/pgsql/contrib/earthdistance|" *.sql
554popd
555
556# fulltext
557pushd fulltextindex
558perl -pi -e "s|\\\$libdir|/usr/lib/pgsql/contrib/fulltextindex|" *.sql
559popd
560
561# fuzzystrmatch
562pushd fuzzystrmatch
563perl -pi -e "s|\\\$libdir|/usr/lib/pgsql/contrib/fuzzystrmatch|" *.sql
564popd
565
566# intarray
567pushd intarray
568perl -pi -e "s|\\\$libdir|/usr/lib/pgsql/contrib/intarray|" *.sql
569popd
570
571# isbn_issn
572pushd isbn_issn
573perl -pi -e "s|\\\$libdir|/usr/lib/pgsql/contrib/isbn_issn|" *.sql
574popd
575
576# lo
577pushd lo
578perl -pi -e "s|\\\$libdir|/usr/lib/pgsql/contrib/lo|" *.sql
579popd
580
581# miscutil
582pushd miscutil
583perl -pi -e "s|\\\$libdir|/usr/lib/pgsql/contrib/miscutil|" *.sql
584popd
585
586# noupdate
587pushd noupdate
588perl -pi -e "s|\\\$libdir|/usr/lib/pgsql/contrib/noupdate|" *.sql
589popd
590
591# pgcrypto
592pushd pgcrypto
593perl -pi -e "s|\\\$libdir|/usr/lib/pgsql/contrib/pgcrypto|" *.sql
594perl -pi -e "s|/usr/lib/pgsql/contrib/pgcrypto/pgcrypto|/usr/lib/pgsql/contrib/pgcrypto/libpgcrypto|" *.sql
2a5e2dc9 595rm -f *.in *.o
68ae034e
GS
596popd
597
598# pgstattuple
599pushd pgstattuple
600perl -pi -e "s|\\\$libdir|/usr/lib/pgsql/contrib/pgstattuple|" *.sql
601popd
602
603# rserv
604pushd rserv
605perl -pi -e "s|/usr/share/|/usr/lib/|" *
606perl -pi -e "s|\\\$libdir|/usr/lib/pgsql/contrib|" *
607perl -pi -e "s|/usr/bin|/usr/lib/pgsql/contrib/rserv|" *
608popd
609
610# rtree_gist
611pushd pgstattuple
612perl -pi -e "s|\\\$libdir|/usr/lib/pgsql/contrib|" *.sql
613popd
614
2a5e2dc9 615# seg
68ae034e
GS
616pushd seg
617perl -pi -e "s|\\\$libdir|/usr/lib/pgsql/contrib|" *.sql
618popd
619
620# spi
621pushd spi
622perl -pi -e "s|\\\$libdir|/usr/lib/pgsql/contrib/spi|" *.sql
623popd
624
625# Don"t need these
626rm -fr startscripts
627
628# string
629pushd string
630perl -pi -e "s|\\\$libdir|/usr/lib/pgsql/contrib/string|" *.sql
631popd
632
633# tsearch
634pushd tsearch
635perl -pi -e "s|\\\$libdir|/usr/lib/pgsql/contrib/tsearch|" *.sql
636popd
637
638# userlock
639pushd userlock
640perl -pi -e "s|\\\$libdir|/usr/lib/pgsql/contrib/userlock|" *.sql
641popd
642
643popd
644
645#more broken symlinks
646rm -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
647cp src/backend/utils/hash/pg_crc.c $RPM_BUILD_ROOT/usr/lib/pgsql/contrib/pg_resetxlog/pg_crc.c
648ln $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.
652pushd $RPM_BUILD_ROOT/usr/lib
653ln -s libpq.so.2 libpq.so.2.0
654popd
655
656# arch backups should go in /usr/lib, not /usr/share
657pushd $RPM_BUILD_ROOT
658mkdir -p usr/lib/pgsql/backup
2a5e2dc9 659mv usr/share/pgsql/backup/pg_dumpall_new usr/lib/pgsql/backup/pg_dumpall_new
68ae034e
GS
660popd
661
662
663%find_lang libpq
664%find_lang pg_dump
665%find_lang postgres
666%find_lang psql
667
668cat psql.lang pg_dump.lang > main.lst
669cat 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
676if [ $1 -gt 1 ]
677then
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 685fi
c1db913e 686
2a5e2dc9
GS
687%post libs -p /sbin/ldconfig
688%postun libs -p /sbin/ldconfig
68ae034e
GS
689
690%pre server
691groupadd -g 26 -o -r postgres >/dev/null 2>&1 || :
692useradd -M -n -g postgres -o -r -d /var/lib/pgsql -s /bin/bash \
693 -c "PostgreSQL Server" -u 26 postgres >/dev/null 2>&1 || :
694touch /var/log/pgsql
695chown postgres.postgres /var/log/pgsql
696chmod 0700 /var/log/pgsql
697
698
699%post server
700chkconfig --add postgresql
701/sbin/ldconfig
702
703%preun server
704if [ $1 = 0 ] ; then
705 chkconfig --del postgresql
1bc01910 706fi
016f481d 707
68ae034e 708%postun server
2a5e2dc9 709/sbin/ldconfig
68ae034e
GS
710if [ $1 -ge 1 ]; then
711 /sbin/service postgresql condrestart >/dev/null 2>&1
712fi
713if [ $1 = 0 ] ; then
714 userdel postgres >/dev/null 2>&1 || :
2a5e2dc9 715 groupdel postgres >/dev/null 2>&1 || :
68ae034e 716fi
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
735chown -R postgres.postgres /usr/share/pgsql/test >/dev/null 2>&1 || :
736%endif
737
738%clean
739rm -rf $RPM_BUILD_ROOT
740rm -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
This page took 0.20392 seconds and 4 git commands to generate.