postgresql/postgresql.spec

changeset 690
67c9fa937f34
parent 301
51b6f3cffaff
child 699
da76d565ccd3
equal deleted inserted replaced
1:c70c3d5bb969 2:88bd44dab8ed
1 ## 1 ##
2 ## postgresql.spec -- OpenPKG RPM Package Specification 2 ## postgresql.spec -- OpenPKG RPM Package Specification
3 ## Copyright (c) 2000-2010 OpenPKG Foundation e.V. <http://openpkg.net/> 3 ## Copyright (c) 2000-2012 OpenPKG Foundation e.V. <http://openpkg.net/>
4 ## 4 ##
5 ## Permission to use, copy, modify, and distribute this software for 5 ## Permission to use, copy, modify, and distribute this software for
6 ## any purpose with or without fee is hereby granted, provided that 6 ## any purpose with or without fee is hereby granted, provided that
7 ## the above copyright notice and this permission notice appear in all 7 ## the above copyright notice and this permission notice appear in all
8 ## copies. 8 ## copies.
20 ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 20 ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
21 ## SUCH DAMAGE. 21 ## SUCH DAMAGE.
22 ## 22 ##
23 23
24 # package versions 24 # package versions
25 %define V_postgresql 9.0.0 25 %define V_postgresql 9.1.4
26 %define V_postgresql_dist 9.0.0 26 %define V_postgresql_dist 9.1.4
27 %define V_postgresql_dir 9.0.0 27 %define V_postgresql_dir 9.1.4
28 %define V_libpqxx 3.1 28 %define V_libpqxx 4.0
29 %define V_perl 5.10.0 29 %define V_perl 5.10.0
30 %define V_pgperl 2.0.2 30 %define V_pgperl 2.0.2
31 %define V_psqlodbc 09.00.0200 31 %define V_psqlodbc 09.00.0200
32 %define V_pgjdbc 9.0-801 32 %define V_pgjdbc 9.1-902
33 %define V_slony1_major 1.2 33 %define V_slony1_major 1.2
34 %define V_slony1_minor 21 34 %define V_slony1_minor 23
35 %define V_pgcluster 1.9.0rc5 35 %define V_pgcluster 1.9.0rc5
36 %define V_pgcluster_dir 1706 36 %define V_pgcluster_dir 1706
37 %define V_mysqlcompat 1.0b3 37 %define V_mysqlcompat 1.0b3
38 %define V_mysqlcompat_dir 548 38 %define V_mysqlcompat_dir 548
39 39
46 Distribution: OpenPKG Community 46 Distribution: OpenPKG Community
47 Class: BASE 47 Class: BASE
48 Group: Database 48 Group: Database
49 License: GPL 49 License: GPL
50 Version: %{V_postgresql} 50 Version: %{V_postgresql}
51 Release: 20101120 51 Release: 20120800
52 52
53 # package options 53 # package options
54 %option with_server yes 54 %option with_server yes
55 %option with_cxx no 55 %option with_cxx no
56 %option with_perl no 56 %option with_perl no
57 %option with_odbc no 57 %option with_odbc no
58 %option with_jdbc no 58 %option with_jdbc no
59 %option with_compat no 59 %option with_compat no
60 %option with_tcl no
61 %option with_slony1 no 60 %option with_slony1 no
62 %option with_pgcluster no 61 %option with_pgcluster no
63 %option with_kerberos no 62 %option with_kerberos no
64 %option with_mysqlcompat no 63 %option with_mysqlcompat no
65 %option with_xml no 64 %option with_xml no
79 Source9: pg_migrate 78 Source9: pg_migrate
80 Source10: pg_passwd 79 Source10: pg_passwd
81 Patch0: postgresql.patch 80 Patch0: postgresql.patch
82 81
83 # build information 82 # build information
84 Prefix: %{l_prefix} 83 BuildPreReq: OpenPKG, openpkg >= 20100101, make, gcc, flex, bison, gzip
85 BuildRoot: %{l_buildroot} 84 PreReq: OpenPKG, openpkg >= 20100101
86 BuildPreReq: OpenPKG, openpkg >= 20060823, make, gcc, flex, bison, gzip
87 PreReq: OpenPKG, openpkg >= 20060823
88 BuildPreReq: readline, zlib, openssl, getopt 85 BuildPreReq: readline, zlib, openssl, getopt
89 PreReq: readline, zlib, openssl, getopt 86 PreReq: readline, zlib, openssl, getopt
90 %if "%{with_perl}" == "yes" 87 %if "%{with_perl}" == "yes"
91 BuildPreReq: perl >= %{V_perl}, perl-openpkg >= %{V_perl}-20061013 88 BuildPreReq: perl >= %{V_perl}, perl-openpkg >= %{V_perl}-20061013
92 PreReq: perl >= %{V_perl} 89 PreReq: perl >= %{V_perl}
96 PreReq: unixodbc 93 PreReq: unixodbc
97 %endif 94 %endif
98 %if "%{with_jdbc}" == "yes" 95 %if "%{with_jdbc}" == "yes"
99 BuildPreReq: java, JAVA-JDK, ant 96 BuildPreReq: java, JAVA-JDK, ant
100 PreReq: java, JAVA-JDK 97 PreReq: java, JAVA-JDK
101 %endif
102 %if "%{with_tcl}" == "yes"
103 BuildPreReq: tcl, tcl::with_x11 = yes, X11
104 PreReq: tcl, tcl::with_x11 = yes, X11
105 %endif 98 %endif
106 %if "%{with_kerberos}" == "yes" 99 %if "%{with_kerberos}" == "yes"
107 BuildPreReq: KERBEROS 100 BuildPreReq: KERBEROS
108 PreReq: KERBEROS 101 PreReq: KERBEROS
109 %endif 102 %endif
137 130
138 %track 131 %track
139 prog postgresql = { 132 prog postgresql = {
140 version = %{V_postgresql_dist} 133 version = %{V_postgresql_dist}
141 url = ftp://ftp.postgresql.org/pub/source/ 134 url = ftp://ftp.postgresql.org/pub/source/
142 regex = v(\d+\.\d+(\.\d+)*(?:beta\d*)?) 135 regex = v(\d+(\.\d+)+)
143 url = ftp://ftp.postgresql.org/pub/source/v__NEWVER__/ 136 url = ftp://ftp.postgresql.org/pub/source/v__NEWVER__/
144 regex = postgresql-(\d+(\.\d+)+)\.tar\.(bz2|gz) 137 regex = postgresql-(\d+(\.\d+)+)\.tar\.(bz2|gz)
145 } 138 }
146 prog postgresql:libpqxx = { 139 prog postgresql:libpqxx = {
147 version = %{V_libpqxx} 140 version = %{V_libpqxx}
247 contrib/uuid-ossp/Makefile 240 contrib/uuid-ossp/Makefile
248 %endif 241 %endif
249 %{l_shtool} subst \ 242 %{l_shtool} subst \
250 -e 's;# Shared library stuff;enable_shared = yes;g' \ 243 -e 's;# Shared library stuff;enable_shared = yes;g' \
251 src/pl/plpgsql/src/Makefile 244 src/pl/plpgsql/src/Makefile
245 case "%{l_platform -t}" in
246 *-linux* )
247 %{l_shtool} subst \
248 -e 's;\(printf("%s\)\(\\n", VAL_LIBS\);\1 -lpthread\2;' \
249 src/bin/pg_config/pg_config.c
250 ;;
251 esac
252 252
253 %build 253 %build
254 254
255 # configure package 255 # configure package
256 echo "ac_cv_func_isinf=no" >config.cache 256 echo "ac_cv_func_isinf=no" >config.cache
259 export CPPFLAGS="%{l_cppflags readline}" 259 export CPPFLAGS="%{l_cppflags readline}"
260 export LDFLAGS="%{l_ldflags}" 260 export LDFLAGS="%{l_ldflags}"
261 export LIBS="" 261 export LIBS=""
262 %if "%{with_slony1}" == "yes" 262 %if "%{with_slony1}" == "yes"
263 CFLAGS="$CFLAGS -pthread" 263 CFLAGS="$CFLAGS -pthread"
264 %endif
265 %if "%{with_tcl}" == "yes"
266 CPPFLAGS="$CPPFLAGS %{l_cppflags tcl}"
267 LDFLAGS="$LDFLAGS -L`%{l_rc} --query x11_libdir`"
268 %endif 264 %endif
269 %if "%{with_kerberos}" == "yes" 265 %if "%{with_kerberos}" == "yes"
270 CPPFLAGS="$CPPFLAGS `krb5-config --cflags`" 266 CPPFLAGS="$CPPFLAGS `krb5-config --cflags`"
271 LIBS="$LIBS `krb5-config --libs`" 267 LIBS="$LIBS `krb5-config --libs`"
272 %endif 268 %endif
287 --sysconfdir=%{l_prefix}/etc/postgresql \ 283 --sysconfdir=%{l_prefix}/etc/postgresql \
288 --includedir=%{l_prefix}/include/postgresql \ 284 --includedir=%{l_prefix}/include/postgresql \
289 --with-openssl \ 285 --with-openssl \
290 --with-readline \ 286 --with-readline \
291 --with-zlib \ 287 --with-zlib \
292 %if "%{with_tcl}" == "yes"
293 --with-tcl \
294 --with-tclconfig="%{l_prefix}/lib" \
295 --with-tkconfig="%{l_prefix}/lib" \
296 %endif
297 %if "%{with_slony1}" == "yes" 288 %if "%{with_slony1}" == "yes"
298 --enable-thread-safety \ 289 --enable-thread-safety \
299 %endif 290 %endif
300 %if "%{with_kerberos}" == "yes" 291 %if "%{with_kerberos}" == "yes"
301 --with-krb5 \ 292 --with-krb5 \
309 --with-ossp-uuid \ 300 --with-ossp-uuid \
310 %endif 301 %endif
311 --disable-shared 302 --disable-shared
312 303
313 # build package 304 # build package
314 %{l_make} %{l_mflags} 305 %{l_make} %{l_mflags -O}
315 306
316 # build C++ bindings (both old and new one) 307 # build C++ bindings (both old and new one)
317 %if "%{with_cxx}" == "yes" 308 %if "%{with_cxx}" == "yes"
318 ln -s `pwd`/src/interfaces/libpq/*.h src/include/ 309 ln -s `pwd`/src/interfaces/libpq/*.h src/include/
319 ( cd libpqxx-%{V_libpqxx} 310 ( cd libpqxx-%{V_libpqxx}
627 %endif 618 %endif
628 619
629 %files -f files 620 %files -f files
630 621
631 %clean 622 %clean
632 rm -rf $RPM_BUILD_ROOT
633 623
634 %pre 624 %pre
635 %if "%{with_server}" == "yes" 625 %if "%{with_server}" == "yes"
636 # before upgrade, check migration dump, save status and stop service 626 # before upgrade, check migration dump, save status and stop service
637 [ $1 -eq 2 ] || exit 0 627 [ $1 -eq 2 ] || exit 0
739 echo " NOCREATEDB NOCREATEROLE;" 729 echo " NOCREATEDB NOCREATEROLE;"
740 echo " template1=> CREATE TABLESPACE <user> OWNER <user>" 730 echo " template1=> CREATE TABLESPACE <user> OWNER <user>"
741 echo " LOCATION '/u/<user>/rdbms';" 731 echo " LOCATION '/u/<user>/rdbms';"
742 echo " template1=> CREATE DATABASE <user> OWNER <user>" 732 echo " template1=> CREATE DATABASE <user> OWNER <user>"
743 echo " TABLESPACE <user>;" 733 echo " TABLESPACE <user>;"
734 echo " template1=> \\q"
744 echo " \$ echo 'localhost:*:<user>:<user>:<password>' >>/u/<user>/.pgpass" 735 echo " \$ echo 'localhost:*:<user>:<user>:<password>' >>/u/<user>/.pgpass"
745 echo " \$ chmod 600 <user> /u/<user>/.pgpass" 736 echo " \$ chmod 600 <user> /u/<user>/.pgpass"
746 echo " \$ chown <user> /u/<user>/.pgpass" 737 echo " \$ chown <user> /u/<user>/.pgpass"
747 echo "After this the user <user> will be able to connect to his RDBMS with:" 738 echo "After this the user <user> will be able to connect to his RDBMS with:"
748 echo " \$ $RPM_INSTALL_PREFIX/bin/psql" 739 echo " \$ $RPM_INSTALL_PREFIX/bin/psql"

mercurial