forked from softace/sqliteodbc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sqliteodbc.spec.in
106 lines (96 loc) · 2.74 KB
/
sqliteodbc.spec.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
%define name sqliteodbc
%define version @VER_INFO@
%define release 1
Name: %{name}
Summary: ODBC driver for SQLite
Version: %{version}
Release: %{release}
Source: http://www.ch-werner.de/sqliteodbc/%{name}-%{version}.tar.gz
Group: Applications/Databases
URL: http://www.ch-werner.de/sqliteodbc
License: BSD
BuildRoot: %{_tmppath}/%{name}-%{version}-root-%(id -u)
%description
ODBC driver for SQLite interfacing SQLite 2.x and/or 3.x using the
unixODBC or iODBC driver managers. For more information refer to
http://www.sqlite.org - SQLite engine
http://www.unixodbc.org - unixODBC Driver Manager
http://www.iodbc.org - iODBC Driver Manager
%prep
%setup -q
mv configure.in DONT-configure.in # RPM 3.x, don't run libtoolize
%build
%configure
make
%install
mkdir -p $RPM_BUILD_ROOT%{_libdir}
make install DESTDIR=$RPM_BUILD_ROOT
rm -f $RPM_BUILD_ROOT%{_libdir}/libsqliteodbc*.{a,la}
rm -f $RPM_BUILD_ROOT%{_libdir}/libsqlite3odbc*.{a,la}
rm -f $RPM_BUILD_ROOT%{_libdir}/libsqlite3_mod_*.{a,la}
%clean
rm -rf $RPM_BUILD_ROOT
%post
if [ -x /usr/bin/odbcinst ] ; then
INST=/tmp/sqliteinst$$
if [ -r %{_libdir}/libsqliteodbc.so ] ; then
cat > $INST << 'EOD'
[SQLITE]
Description=SQLite ODBC 2.X
Driver=%{_libdir}/libsqliteodbc.so
Setup=%{_libdir}/libsqliteodbc.so
Threading=2
FileUsage=1
EOD
/usr/bin/odbcinst -q -d -n SQLITE | grep '^\[SQLITE\]' >/dev/null || {
/usr/bin/odbcinst -i -d -n SQLITE -f $INST || true
}
cat > $INST << 'EOD'
[SQLite Datasource]
Driver=SQLITE
EOD
/usr/bin/odbcinst -q -s -n "SQLite Datasource" | \
grep '^\[SQLite Datasource\]' >/dev/null || {
/usr/bin/odbcinst -i -l -s -n "SQLite Datasource" -f $INST || true
}
fi
if [ -r %{_libdir}/libsqlite3odbc.so ] ; then
cat > $INST << 'EOD'
[SQLITE3]
Description=SQLite ODBC 3.X
Driver=%{_libdir}/libsqlite3odbc.so
Setup=%{_libdir}/libsqlite3odbc.so
Threading=2
FileUsage=1
EOD
/usr/bin/odbcinst -q -d -n SQLITE3 | grep '^\[SQLITE3\]' >/dev/null || {
/usr/bin/odbcinst -i -d -n SQLITE3 -f $INST || true
}
cat > $INST << 'EOD'
[SQLite3 Datasource]
Driver=SQLITE3
EOD
/usr/bin/odbcinst -q -s -n "SQLite3 Datasource" | \
grep '^\[SQLite3 Datasource\]' >/dev/null || {
/usr/bin/odbcinst -i -l -s -n "SQLite3 Datasource" -f $INST || true
}
fi
rm -f $INST || true
fi
%preun
if [ "$1" = "0" ] ; then
test -x /usr/bin/odbcinst && {
/usr/bin/odbcinst -u -d -n SQLITE || true
/usr/bin/odbcinst -u -l -s -n "SQLite Datasource" || true
/usr/bin/odbcinst -u -d -n SQLITE3 || true
/usr/bin/odbcinst -u -l -s -n "SQLite3 Datasource" || true
}
true
fi
%files
%defattr(-, root, root)
%doc README license.terms ChangeLog
%{_libdir}/*.so*
%changelog
* @SPEC_CHANGELOG_TS@ ...
- automatically recreated by configure ...