فهرست منبع

- be consistent with other packages: if we have V_xxx, then for all parts - be consistent with (most) other packages: first versions, then options - split over-sized CPPLINE line - make build loop even more portable by using sed(1) instead of basename(1) - be more portable and use "ar" commands "rc" plus an "rm" before - remove extra blank line

Ralf S. Engelschall 23 سال پیش
والد
کامیت
ae0d1f1cb6
1فایلهای تغییر یافته به همراه15 افزوده شده و 17 حذف شده
  1. 15 17
      postgresql/postgresql.spec

+ 15 - 17
postgresql/postgresql.spec

@@ -23,6 +23,10 @@
 ##  SUCH DAMAGE.
 ##
 
+#   package versions
+%define       V_postgresql  7.3
+%define       V_libpqxx     4.0
+
 #   package options
 %ifndef       with_openssl
 %define       with_openssl  no
@@ -37,9 +41,6 @@
 %define       with_tcl      no
 %endif
 
-#   package component versions
-%define       V_libpqxx     4.0
-
 #   package information
 Name:         postgresql
 Summary:      PostgreSQL Database
@@ -49,11 +50,11 @@ Packager:     The OpenPKG Project
 Distribution: OpenPKG [BASE]
 Group:        Database
 License:      GPL
-Version:      7.3
+Version:      %{V_postgresql}
 Release:      20021219
 
 #   list of sources
-Source0:      ftp://ftp.postgresql.org/pub/source/v%{version}/postgresql-%{version}.tar.gz
+Source0:      ftp://ftp.postgresql.org/pub/source/v%{V_postgresql}/postgresql-%{V_postgresql}.tar.gz
 Source1:      ftp://gborg.postgresql.org/pub/libpqpp/stable/libpq++-%{V_libpqxx}.tar.gz
 Source2:      rc.postgresql
 Source3:      pg_migrate
@@ -138,13 +139,16 @@ AutoReqProv:  no
     ( cd libpq++-%{V_libpqxx}
       CXX="%{l_cxx}"
       CFLAGS="%{l_cflags -O}"
-      CPPFLAGS="-DHAVE_NAMESPACE_STD -DHAVE_CXX_STRING_HEADER -DDLLIMPORT= -I. -I../src/interfaces -I../src/interfaces/libpq %{l_cppflags}"
+      CPPFLAGS="-DHAVE_NAMESPACE_STD -DHAVE_CXX_STRING_HEADER -DDLLIMPORT= "
+      CPPFLAGS="$CPPFLAGS -I. -I../src/interfaces -I../src/interfaces/libpq "
+      CPPFLAGS="$CPPFLAGS %{l_cppflags}"
       LDFLAGS="%{l_ldflags}"
       OBJS="pgconnection.o pgdatabase.o pgtransdb.o pgcursordb.o pglobject.o"
       for o in $OBJS; do
-          $CXX $CFLAGS $CPPFLAGS $LDFLAGS -c -o $o `basename $o .o`.cc
+          $CXX $CFLAGS $CPPFLAGS $LDFLAGS -c -o $o `echo $o | sed -e 's;\.o$;.cc;'`
       done
-      ar r libpq++.a $OBJS
+      rm -f libpq++.a
+      ar rc libpq++.a $OBJS
     )
 
 %install
@@ -202,17 +206,11 @@ AutoReqProv:  no
       %{l_shtool} mkdir -f -p -m 755 \
           $RPM_BUILD_ROOT%{l_prefix}/include/libpq++
       %{l_shtool} install -c -m 644 \
-          libpq++.h \
-          pgconnection.h \
-          pgdatabase.h \
-          pgtransdb.h \
-          pgcursordb.h \
-          pglobject.h \
+          libpq++.h pgconnection.h pgdatabase.h pgtransdb.h pgcursordb.h pglobject.h \
           $RPM_BUILD_ROOT%{l_prefix}/include/libpq++/
       %{l_shtool} install -c -m 644 \
           libpq++.a \
           $RPM_BUILD_ROOT%{l_prefix}/lib/
-      
     )
 
     #   install run-command script
@@ -244,7 +242,7 @@ AutoReqProv:  no
             #   database migration dumping hint
             v_old_all=`cat $RPM_INSTALL_PREFIX/var/postgresql/db/PG_VERSION`
             v_old_maj=`echo "$v_old_all" | sed -e 's/^\([0-9]*\.[0-9]*\).*/\1/'`
-            v_new_all="%{version}"
+            v_new_all="%{V_postgresql}"
             v_new_maj=`echo "$v_new_maj" | sed -e 's/^\([0-9]*\.[0-9]*\).*/\1/'`
             if [ ".$v_old_maj" != ".$v_new_maj" ]; then
                if [ ! -f $RPM_INSTALL_PREFIX/var/postgresql/db.dump.sql.bz2 -a ".$PG_MIGRATE" != .ignore ]; then
@@ -326,7 +324,7 @@ AutoReqProv:  no
             #   database migration restoring hint
             v_old_all=`cat $RPM_INSTALL_PREFIX/var/postgresql/db/PG_VERSION`
             v_old_maj=`echo "$v_old_all" | sed -e 's/^\([0-9]*\.[0-9]*\).*/\1/'`
-            v_new_all="%{version}"
+            v_new_all="%{V_postgresql}"
             v_new_maj=`echo "$v_new_maj" | sed -e 's/^\([0-9]*\.[0-9]*\).*/\1/'`
             if [ ".$v_old_maj" != ".$v_new_maj" ]; then
                 ( echo "You upgraded from PostgreSQL $v_old_all to PostgresSQL $v_new_all,"