public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Michal Schorm <mschorm@redhat.com>
To: git-commits@fedoraproject.org
Subject: [rpms/sqliteodbc] rawhide: [Fedora 45 Change] Ship drop-in snippet for ODBC driver self-registration
Date: Thu, 30 Jul 2026 20:06:31 GMT	[thread overview]
Message-ID: <178544199135.1.13708231123267922893.rpms-sqliteodbc-4d7bd3bced48@fedoraproject.org> (raw)

            A new commit has been pushed.

            Repo   : rpms/sqliteodbc
            Branch : rawhide
            Commit : 4d7bd3bced48b37aae7c12bf2ce63dd82c093d99
            Author : Michal Schorm <mschorm@redhat.com>
            Date   : 2026-07-20T02:29:59+02:00
            Stats  : +20/-71 in 2 file(s)
            URL    : https://src.fedoraproject.org/rpms/sqliteodbc/c/4d7bd3bced48b37aae7c12bf2ce63dd82c093d99?branch=rawhide

            Log:
            [Fedora 45 Change] Ship drop-in snippet for ODBC driver self-registration

Install '10-sqlite.ini' to '/usr/lib/odbc/odbcinst.d/' so the
unixODBC file trigger automatically registers both '[SQLITE]'
and '[SQLITE3]' drivers in '/etc/odbcinst.ini'. Uses bare
library names resolved via the compiled-in MODULEDIR.

Remove the old '%post'/'%preun' scriptlets that called 'odbcinst'
directly — the file trigger handles registration now.

Snippet directory layout:
- Snippets are installed to '%{_prefix}/lib/odbc/odbcinst.d/' rather
  than directly to '%{_prefix}/lib/odbc/' to separate configuration
  from content — on multilib systems, '%{_prefix}/lib/odbc/' may also
  contain 32-bit driver '.so' files, and the RPM file triggers that
  watch the snippet directory would fire spuriously on '.so' installs
- Both '%{_prefix}/lib/odbc/' and '%{_prefix}/lib/odbc/odbcinst.d/'
  are co-owned by this package per Fedora directory ownership guidelines

Co-Authored-By: Claude AI <noreply@anthropic.com>

This commit is part of a Fedora 45 Self Contained Change:
  https://fedoraproject.org/wiki/Changes/ODBC_stack_modernization

---
diff --git a/10-sqlite.ini b/10-sqlite.ini
new file mode 100644
index 0000000..da1ab90
--- /dev/null
+++ b/10-sqlite.ini
@@ -0,0 +1,9 @@
+[SQLITE]
+Description = SQLite ODBC 2.X
+Driver      = libsqliteodbc.so
+FileUsage   = 2
+
+[SQLITE3]
+Description = SQLite3 ODBC 3.X
+Driver      = libsqlite3odbc.so
+FileUsage   = 2

diff --git a/sqliteodbc.spec b/sqliteodbc.spec
index a1004dd..102d987 100644
--- a/sqliteodbc.spec
+++ b/sqliteodbc.spec
@@ -1,12 +1,13 @@
 Name:		sqliteodbc
 Version:	0.99991
-Release:	10%{?dist}
+Release:	11%{?dist}
 Summary:	SQLite ODBC Driver
 
 # Automatically converted from old format: BSD - review is highly recommended.
 License:	LicenseRef-Callaway-BSD
 URL:		http://www.ch-werner.de/sqliteodbc
 Source:		http://www.ch-werner.de/sqliteodbc/%{name}-%{version}.tar.gz
+Source1:	10-sqlite.ini
 Patch0:		sqliteodbc-0.99991-Fix-too-many-args-to-gpps-compilation-error.patch
 Patch1:		sqliteodbc-0.99991-Fix-incompatible-pointer-compilation-error.patch
 
@@ -19,7 +20,6 @@ BuildRequires:	unixODBC-devel
 BuildRequires:	zlib-devel
 BuildRequires:	/usr/bin/iconv
 
-Requires:	%{_bindir}/odbcinst
 
 
 %description
@@ -79,75 +79,9 @@ cat > odbc.ini.sample <<- 'EOD'
 	# BigInt = No|Yes
 EOD
 
-%post
-if [ -x %{_bindir}/odbcinst ] ; then
-	INST=$(mktemp)
-
-	if [ -r %{_libdir}/odbc/libsqliteodbc.so ] ; then
-		cat > $INST <<- 'EOD'
-			[SQLITE]
-			Description=SQLite ODBC 2.X
-			Driver=%{_libdir}/odbc/libsqliteodbc.so
-			Setup=%{_libdir}/odbc/libsqliteodbc.so
-			Threading=2
-			FileUsage=1
-		EOD
-
-		%{_bindir}/odbcinst -q -d -n SQLITE | grep '^\[SQLITE\]' >/dev/null || {
-			%{_bindir}/odbcinst -i -d -n SQLITE -f $INST || true
-		}
-
-		cat > $INST <<- 'EOD'
-			[SQLite Datasource]
-			Driver=SQLITE
-		EOD
-
-		%{_bindir}/odbcinst -q -s -n "SQLite Datasource" | \
-		grep '^\[SQLite Datasource\]' >/dev/null || {
-			%{_bindir}/odbcinst -i -l -s -n "SQLite Datasource" -f $INST || true
-		}
-	fi
-
-	if [ -r %{_libdir}/odbc/libsqlite3odbc.so ] ; then
-		cat > $INST <<- 'EOD'
-			[SQLITE3]
-			Description=SQLite ODBC 3.X
-			Driver=%{_libdir}/odbc/libsqlite3odbc.so
-			Setup=%{_libdir}/odbc/libsqlite3odbc.so
-			Threading=2
-			FileUsage=1
-		EOD
-
-		%{_bindir}/odbcinst -q -d -n SQLITE3 | grep '^\[SQLITE3\]' >/dev/null || {
-			%{_bindir}/odbcinst -i -d -n SQLITE3 -f $INST || true
-		}
-
-		cat > $INST <<- 'EOD'
-			[SQLite3 Datasource]
-			Driver=SQLITE3
-		EOD
-
-		%{_bindir}/odbcinst -q -s -n "SQLite3 Datasource" | \
-		grep '^\[SQLite3 Datasource\]' >/dev/null || {
-			%{_bindir}/odbcinst -i -l -s -n "SQLite3 Datasource" -f $INST || true
-		}
-	fi
-
-	rm -f $INST || true
-fi
-
-
-%preun
-if [ "$1" = "0" ] ; then
-	test -x %{_bindir}/odbcinst && {
-		%{_bindir}/odbcinst -u -d -n SQLITE || true
-		%{_bindir}/odbcinst -u -l -s -n "SQLite Datasource" || true
-		%{_bindir}/odbcinst -u -d -n SQLITE3 || true
-		%{_bindir}/odbcinst -u -l -s -n "SQLite3 Datasource" || true
-	}
-
-	true
-fi
+# ODBC driver registration drop-in snippet
+mkdir -p %{buildroot}%{_prefix}/lib/odbc/odbcinst.d
+install -m644 %{SOURCE1} %{buildroot}%{_prefix}/lib/odbc/odbcinst.d/
 
 
 %files
@@ -157,9 +91,15 @@ fi
 %{_libdir}/odbc/libsqliteodbc*.so*
 %{_libdir}/odbc/libsqlite3odbc*.so*
 %{_libdir}/libsqlite3_mod_*.so*
+%dir %{_prefix}/lib/odbc
+%dir %{_prefix}/lib/odbc/odbcinst.d
+%{_prefix}/lib/odbc/odbcinst.d/10-sqlite.ini
 
 
 %changelog
+* Mon Jul 20 2026 Michal Schorm <mschorm@redhat.com> - 0.99991-11
+- Ship drop-in snippet for ODBC driver self-registration
+
 * Fri Jul 17 2026 Fedora Release Engineering <releng@fedoraproject.org> - 0.99991-10
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild
 

                 reply	other threads:[~2026-07-30 20:06 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=178544199135.1.13708231123267922893.rpms-sqliteodbc-4d7bd3bced48@fedoraproject.org \
    --to=mschorm@redhat.com \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox