[csw-devel] SF.net SVN: gar:[15225] csw/mgar/pkg/unixodbc/trunk

dmichelsen at users.sourceforge.net dmichelsen at users.sourceforge.net
Tue Jul 26 15:25:53 CEST 2011


Revision: 15225
          http://gar.svn.sourceforge.net/gar/?rev=15225&view=rev
Author:   dmichelsen
Date:     2011-07-26 13:25:53 +0000 (Tue, 26 Jul 2011)

Log Message:
-----------
unixodbc: Use MIGRATE_CONF, update to new standards

Modified Paths:
--------------
    csw/mgar/pkg/unixodbc/trunk/Makefile
    csw/mgar/pkg/unixodbc/trunk/checksums

Removed Paths:
-------------
    csw/mgar/pkg/unixodbc/trunk/files/CSWunixodbc.postinstall-linking
    csw/mgar/pkg/unixodbc/trunk/files/CSWunixodbc.postinstall-moving
    csw/mgar/pkg/unixodbc/trunk/files/cswmigrateconf

Modified: csw/mgar/pkg/unixodbc/trunk/Makefile
===================================================================
--- csw/mgar/pkg/unixodbc/trunk/Makefile	2011-07-26 10:51:46 UTC (rev 15224)
+++ csw/mgar/pkg/unixodbc/trunk/Makefile	2011-07-26 13:25:53 UTC (rev 15225)
@@ -9,59 +9,55 @@
 DESCRIPTION = ODBC drivers for Unix systems
 define BLURB
 endef
-DL_NAME = unixODBC
+
 MASTER_SITES = http://www.unixodbc.org/
-DISTNAME = $(DL_NAME)-$(VERSION)
-DISTFILES  = $(DISTNAME).tar.gz
-DISTFILES += cswmigrateconf
-UFILES_REGEX = $(DL_NAME)-(\d+(?:\.\d+)*).tar.gz
+
+DISTNAME = unixODBC-$(VERSION)
+DISTFILES = $(DISTNAME).tar.gz
+
+PACKAGES += CSWunixodbc
+SPKG_DESC_CSWunixodbc = $(DESCRIPTION)
 RUNTIME_DEP_PKGS_CSWunixodbc += CSWiconv
-RUNTIME_DEP_PKGS_CSWunixodbc += CSWreadline
+RUNTIME_DEP_PKGS_CSWunixodbc += CSWlibreadline6
 RUNTIME_DEP_PKGS_CSWunixodbc += CSWlibltdl7
 RUNTIME_DEP_PKGS_CSWunixodbc += CSWlibodbcinst1
 RUNTIME_DEP_PKGS_CSWunixodbc += CSWlibodbc1
-sysconfdir = /etc$(prefix)
-localstatedir = /var$(prefix)
-CONFIGURE_ARGS = $(DIRPATHS) --enable-gui=no
-BUILD64 = 1
-SAMPLECONF = \/etc\/opt\/csw\/odbc(inst|).ini
-MIGRATECONF = \/etc\/opt\/csw\/pkg\/$(NAME)\/cswmigrateconf
-TEST_SCRIPTS =
-LICENSE = COPYING
 
-PACKAGES += CSWunixodbc
-SPKG_DESC_CSWunixodbc = $(DESCRIPTION)
-
 PACKAGES += CSWunixodbc-dev
 CATALOGNAME_CSWunixodbc-dev = unixodbc_dev
-SPKG_DESC_CSWunixodbc-dev = $(DESCRIPTION), development files
-PKGFILES_CSWunixodbc-dev = $(PKGFILES_DEVEL)
+SPKG_DESC_CSWunixodbc-dev = Development files for libodbc*.so.1
+PKGFILES_CSWunixodbc-dev += $(PKGFILES_DEVEL)
+PKGFILES_CSWunixodbc-dev += $(call baseisadirs,$(bindir),odbc_config)
 RUNTIME_DEP_PKGS_CSWunixodbc-dev += CSWlibodbc1
 RUNTIME_DEP_PKGS_CSWunixodbc-dev += CSWlibodbccr1
 RUNTIME_DEP_PKGS_CSWunixodbc-dev += CSWlibodbcinst1
 
 PACKAGES += CSWlibodbc1
 SPKG_DESC_CSWlibodbc1 = $(DESCRIPTION), libodbc.so.1
-PKGFILES_CSWlibodbc1 = .*libodbc\.so\.1.*
+PKGFILES_CSWlibodbc1 = $(call pkgfiles_lib,libodbc.so.1)
 RUNTIME_DEP_PKGS_CSWlibodbc1 += CSWlibltdl7
 RUNTIME_DEP_PKGS_CSWlibodbc1 += CSWiconv
 
 PACKAGES += CSWlibodbccr1
 SPKG_DESC_CSWlibodbccr1 = $(DESCRIPTION), libodbccr.so.1
-PKGFILES_CSWlibodbccr1 = .*libodbccr\.so\.1.*
+PKGFILES_CSWlibodbccr1 = $(call pkgfiles_lib,libodbccr.so.1)
 
 PACKAGES += CSWlibodbcinst1
 SPKG_DESC_CSWlibodbcinst1 = $(DESCRIPTION), libodbcinst.so.1
-PKGFILES_CSWlibodbcinst1 = .*libodbcinst\.so\.1.*
+PKGFILES_CSWlibodbcinst1 = $(call pkgfiles_lib,libodbcinst.so.1)
 RUNTIME_DEP_PKGS_CSWlibodbcinst1 += CSWlibltdl7
 
-include gar/category.mk
+BUILD64 = 1
+CONFIGURE_ARGS += $(DIRPATHS)
+CONFIGURE_ARGS += --enable-gui=no
 
-post-install-modulated:
-	(cd $(DESTDIR)$(sysconfdir); \
-	for f in odbc.ini odbcinst.ini; do \
-		mv "$${f}" "$${f}.CSW"; \
-	done)
-	ginstall -d -m 755 $(DESTDIR)$(sysconfdir)/pkg/$(NAME)
-	ginstall -m 644 $(FILEDIR)/cswmigrateconf $(DESTDIR)$(sysconfdir)/pkg/$(NAME)
-	@$(MAKECOOKIE)
+# TEST_SCRIPTS =
+
+PRESERVECONF += $(sysconfdir)/odbc.ini
+PRESERVECONF += $(sysconfdir)/odbcinst.ini
+
+MIGRATE_FILES_CSWunixodbc += odbc.ini
+MIGRATE_FILES_CSWunixodbc += odbcinst.ini
+MIGRATE_FILES_CSWunixodbc += ODBCDataSources
+
+include gar/category.mk

Modified: csw/mgar/pkg/unixodbc/trunk/checksums
===================================================================
--- csw/mgar/pkg/unixodbc/trunk/checksums	2011-07-26 10:51:46 UTC (rev 15224)
+++ csw/mgar/pkg/unixodbc/trunk/checksums	2011-07-26 13:25:53 UTC (rev 15225)
@@ -1,2 +1 @@
-fb47ac973383744b50cbd5af320a8dc2  cswmigrateconf
 f2ad22cbdffe836c58987ed2332c2e99  unixODBC-2.3.0.tar.gz

Deleted: csw/mgar/pkg/unixodbc/trunk/files/CSWunixodbc.postinstall-linking
===================================================================
--- csw/mgar/pkg/unixodbc/trunk/files/CSWunixodbc.postinstall-linking	2011-07-26 10:51:46 UTC (rev 15224)
+++ csw/mgar/pkg/unixodbc/trunk/files/CSWunixodbc.postinstall-linking	2011-07-26 13:25:53 UTC (rev 15225)
@@ -1,76 +0,0 @@
-#!/bin/sh
-#
-# $Id$
-#
-# vim:set sw=2 ts=2 sts=2 expandtab:
-#
-# # If old_path exists:
-#  # Create a file named {{old_path.THIS_LOCATION_IS_DEPRECATED}} and leave a message inside the file.
-#  # If new_path and new_path.CSW files are identical:
-#   # Remove new_path (it's only a copy of the .CSW default file, no data loss)
-#   # Create a symlink from new_path to old_path
-#  # Otherwise:
-#   # Create a file named {{old_path.THIS_FILE_IS_PROBABLY_UNUSED}}
-#
-# http://wiki.opencsw.org/configuration-directory-migration
-
-deprecated_info="
-This location (/opt/csw/etc) is deprecated.
-
-Configuration files are currently being placed in /etc/opt/csw.  Please make
-sure your new configuration is in /etc/opt/csw and remove the old one from
-/opt/csw/etc.
-"
-deprecated_file_ext="THIS_LOCATION_IS_DEPRECATED"
-
-filepairs="/opt/csw/etc/odbc.ini:/etc/opt/csw/odbc.ini"
-filepairs="${filepairs} /opt/csw/etc/odbcinst.ini:/etc/opt/csw/odbcinst.ini"
-dirpairs="/opt/csw/etc/ODBCDataSources:/etc/opt/csw/ODBCDataSources"
-
-return_code=0
-
-# Generated ../../../ when given a path like /etc/opt/csw/odbc.ini
-gen_dubdots() {
-  echo "$1" \
-    | sed -e 's+[^/]+.+g' \
-    | sed -e 's+\.*$++g' \
-    | tr -s . \
-    | sed -e 's+\.+..+g' \
-    | sed -e 's+^/++'
-}
-
-files_are_identical() {
-  cmp "$1" "$2" > /dev/null
-}
-
-drop_warning() {
-  echo "${deprecated_info}" > "$1.${deprecated_file_ext}"
-}
-
-for ff in ${filepairs} ${dirpairs}; do
-  old_location=`echo ${ff} | awk -F: '{print $1}'`
-  new_location=`echo ${ff} | awk -F: '{print $2}'`
-  abs_old_location="${PKG_INSTALL_ROOT}${old_location}"
-  abs_new_location="${PKG_INSTALL_ROOT}${new_location}"
-  old_location_noslash=`echo "${old_location}" | sed -e 's+^/++'`
-  dubdots=`gen_dubdots "${new_location}"`
-  if [ -r "${abs_old_location}" ]; then
-    drop_warning "${abs_old_location}"
-    if [ -h "${abs_new_location}" ]; then
-      # It's a symbolic link already, doing nothing.
-      true
-    elif [ -r "${abs_new_location}" ]; then
-      if files_are_identical "${abs_new_location}" "${abs_new_location}.CSW"; then
-        rm "${abs_new_location}"
-        ln -s "${dubdots}${old_location_noslash}" "${abs_new_location}"
-      else
-        touch "${abs_old_location}.THIS_FILE_IS_PROBABLY_UNUSED"
-      fi
-    else
-      # The file or directory doesn't exist.
-      ln -s "${dubdots}${old_location_noslash}" "${abs_new_location}"
-    fi
-  fi
-done
-
-exit "${return_code}"

Deleted: csw/mgar/pkg/unixodbc/trunk/files/CSWunixodbc.postinstall-moving
===================================================================
--- csw/mgar/pkg/unixodbc/trunk/files/CSWunixodbc.postinstall-moving	2011-07-26 10:51:46 UTC (rev 15224)
+++ csw/mgar/pkg/unixodbc/trunk/files/CSWunixodbc.postinstall-moving	2011-07-26 13:25:53 UTC (rev 15225)
@@ -1,175 +0,0 @@
-#!/bin/sh
-# vim:set sw=2 ts=2 sts=2 expandtab:
-#
-# $Id$
-#
-# old_path: e.g. /opt/csw/etc/foo.conf
-# new_path: e.g. /etc/opt/csw/foo.conf
-# arch_path: e.g. /etc/opt/csw/migration-archive/foo.conf
-#
-# # If old_path exists:
-#  # Create a file named {{old_path.README.migration}}
-#    and leave a message inside the file.
-#  # Move old_path to archive_path
-# # If new_path does not exist:
-#  # Copy archive_path to new_path
-#
-# http://wiki.opencsw.org/configuration-directory-migration
-#
-# Usage:
-#
-# A configuration should be set:
-#
-# A list of files to migrate:
-# MIGRATE_FILES="odbc.ini odbcinst.ini ODBCDataSources"
-#
-# The directories to use:
-# SOURCE_DIR___default__="/opt/csw/etc"
-# readonly SOURCE_DIR___default__
-# ARCH_DIR___default__="/opt/csw/etc/migration-archive"
-# readonly ARCH_DIR___default__
-# DEST_DIR___default__="/etc/opt/csw"
-# readonly DEST_DIR___default__
-#
-# If a file needs to be moved to a different directory than the default,
-# a special setting can be used:
-#
-# DEST_DIR_odbc_ini="/etc/opt/csw/foo/odbc.ini"
-#
-# The same applies to DEST_DIR and ARCH_DIR.
-
-set -u
-
-# To prevent issues with a-z in regular expressions
-unset LC_ALL
-LANG=C
-
-MIGRATE_FILES="odbc.ini odbcinst.ini ODBCDataSources"
-
-
-# The defaults
-SOURCE_DIR___default__="/opt/csw/etc"
-readonly SOURCE_DIR___default__
-ARCH_DIR___default__="/opt/csw/etc/migration-archive"
-readonly ARCH_DIR___default__
-DEST_DIR___default__="/etc/opt/csw"
-readonly DEST_DIR___default__
-
-PKG_INSTALL_ROOT=${PKG_INSTALL_ROOT:-/}
-
-return_code=0
-
-migration_info="
-This location (/opt/csw/etc) is deprecated.
-
-Configuration files are currently being placed in /etc/opt/csw.  Please make
-sure your new configuration is in /etc/opt/csw and remove the old one from
-/opt/csw/etc.
-
-For more information, please see
-http://wiki.opencsw.org/configuration-directory-migration
-"
-readonly migration_info
-deprecated_file_ext="README.migration"
-readonly deprecated_file_ext
-
-give_a_chance_to_stop() {
-  echo
-  echo "*******************************************************************"
-  echo "* The old configuration directory ${obsolete_dir} still exists.    "
-  echo "* Please move your configuration to ${new_dir}.                    "
-  echo "*                                                                  "
-  echo "*       Installation will continue in 10 seconds.                  "
-  echo "*         Press CTRL+C if you want to stop now.                    "
-  echo "*******************************************************************"
-  echo
-  sleep 10
-}
-
-
-files_are_identical() {
-  cmp "$1" "$2" > /dev/null
-}
-
-drop_warning() {
-  echo "${migration_info}" > "$1.${deprecated_file_ext}"
-}
-
-sanitize() {
-  echo "$1" | sed -e 's/[^a-zA-Z0-9]/_/g'
-}
-
-expand_modifiers() {
-  # Emulating local variables
-  __per_file_variable="$1"
-  __per_file_modifier_value="$2"
-  eval echo `echo \\${${__per_file_variable}_${__per_file_modifier_value}:-}`
-}
-
-place_signpost_for() {
-  __file_name="$1"
-  echo "${migration_info}" > "${__file_name}.${deprecated_file_ext}"
-}
-
-main() {
-  for file_name in ${MIGRATE_FILES}; do
-    modifier_value=`sanitize "${file_name}"`
-    echo "file: ${file_name}"
-    echo "modifier_value: ${modifier_value}"
-
-    # Perhaps the following three segments of code could be turned into
-    # a function, but it would require complicated eval calls.
-    per_file_srcdir=`expand_modifiers SOURCE_DIR ${modifier_value}`
-    default_srcdir=`expand_modifiers SOURCE_DIR __default__`
-    srcdir="${per_file_srcdir:-${default_srcdir}}"
-    per_file_dstdir=`expand_modifiers DEST_DIR ${modifier_value}`
-    default_dstdir=`expand_modifiers DEST_DIR __default__`
-    dstdir="${per_file_dstdir:-${default_dstdir}}"
-    per_file_archdir=`expand_modifiers ARCH_DIR ${modifier_value}`
-    default_archdir=`expand_modifiers ARCH_DIR __default__`
-    archdir="${per_file_archdir:-${default_archdir}}"
-    srcpath="${PKG_INSTALL_ROOT}/${srcdir}/${file_name}"
-    dstpath="${PKG_INSTALL_ROOT}/${dstdir}/${file_name}"
-    archpath="${PKG_INSTALL_ROOT}/${archdir}/${file_name}"
-
-    # Make sure we have the environment we expect
-    if [ ! -d "${archdir}" ]
-    then
-      echo "Creating ${archdir}"
-      mkdir -m 755 -p "${archdir}"
-      if [ $? -ne 0 ]
-      then
-        echo "Couldn't create '${archdir}', bailing out."
-        exit 1
-      fi
-    fi
-
-    # All variables are set, the main algorithm goes here.
-
-    # Moving the file will only work in the global zone. The assumption is that
-    # the postinstall script is going to be run in the global zone first; by the
-    # time it gets to the non-global zones, the ${srcpath} will have been
-    # moved already.
-    if [ -r "${srcpath}" ]
-    then
-      place_signpost_for "${srcpath}"
-      mv "${srcpath}" "${archpath}"
-    fi
-
-    # If the destination file is not there and the archived file is, copy it.
-    if [ ! -r "${dstpath}" ]
-    then
-      if [ -r "${archpath}" ]
-      then
-        cp "${archpath}" "${dstpath}"
-      else
-        echo "The archived file does not exist: ${archpath}"
-        echo "Nothing to copy to ${dstpath}."
-      fi
-    fi
-  done
-}
-
-main
-
-exit "${return_code}"

Deleted: csw/mgar/pkg/unixodbc/trunk/files/cswmigrateconf
===================================================================
--- csw/mgar/pkg/unixodbc/trunk/files/cswmigrateconf	2011-07-26 10:51:46 UTC (rev 15224)
+++ csw/mgar/pkg/unixodbc/trunk/files/cswmigrateconf	2011-07-26 13:25:53 UTC (rev 15225)
@@ -1,3 +0,0 @@
-# $Id$
-
-MIGRATE_FILES="odbc.ini odbcinst.ini ODBCDataSources"


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.


More information about the devel mailing list