sqliteodbc-vl.spec 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  1. %define pkg_name sqliteodbc
  2. %define pkg_version 0.9996
  3. %define pkg_release 2%{?_dist_release}
  4. Summary: SQLite ODBC Driver
  5. Name: %{pkg_name}
  6. Version: %{pkg_version}
  7. Release: %{pkg_release}
  8. License: BSD
  9. Group: System Environment/Libraries
  10. URL: http://www.ch-werner.de/sqliteodbc
  11. Source: http://www.ch-werner.de/sqliteodbc/%{name}-%{version}.tar.gz
  12. BuildRequires: libxml2-devel
  13. # BuildRequires: sqlite-devel
  14. BuildRequires: sqlite3-devel
  15. BuildRequires: unixODBC-devel
  16. BuildRequires: zlib-devel
  17. Requires: unixODBC
  18. Vendor: Project Vine
  19. Distribution: Vine Linux
  20. %description
  21. ODBC driver for SQLite interfacing SQLite 3.x using the
  22. unixODBC or iODBC driver managers. For more information refer to:
  23. - http://www.sqlite.org - SQLite engine
  24. - http://www.unixodbc.org - unixODBC Driver Manager
  25. - http://www.iodbc.org - iODBC Driver Manager
  26. %prep
  27. rm -rf %{buildroot}
  28. %setup -q
  29. # correct EOL
  30. for i in README; do
  31. sed 's#\r##g' $i > $i.tmp && \
  32. touch -r $i $i.tmp && \
  33. mv $i.tmp $i
  34. done
  35. # Convert encoding to UTF-8
  36. for i in ChangeLog; do
  37. iconv -f ISO-8859-1 -t UTF-8 -o $i.tmp $i && \
  38. touch -r $i $i.tmp && \
  39. mv $i.tmp $i
  40. done
  41. %build
  42. %configure
  43. make %{_smp_mflags}
  44. %install
  45. mkdir -p %{buildroot}%{_libdir}
  46. make install DESTDIR=%{buildroot}
  47. # rm -f %{buildroot}%{_libdir}/libsqliteodbc*.{a,la}
  48. rm -f %{buildroot}%{_libdir}/libsqlite3odbc*.{a,la}
  49. rm -f %{buildroot}%{_libdir}/libsqlite3_mod_*.{a,la}
  50. # install example file
  51. cat > odbc.ini.sample <<- 'EOD'
  52. # ~/.odbc.ini example file
  53. [mysqlitedb]
  54. Description=My SQLite3 test database
  55. Driver=SQLite3
  56. Database=/home/user_name/Documents/databases/testdb.sqlite
  57. # optional lock timeout in milliseconds
  58. # Timeout=2000
  59. # StepAPI = No|Yes
  60. # ShortNames = No|Yes
  61. # FKSupport = No|Yes
  62. # SyncPragma = NORMAL|OFF|FULL
  63. # JournalMode = WAL|MEMORY|TRUNCATE|OFF|PERSIST|DELETE
  64. # BigInt = No|Yes
  65. EOD
  66. %clean
  67. %{__rm} -rf %{buildroot}
  68. %post
  69. /sbin/ldconfig
  70. if [ -x %{_bindir}/odbcinst ] ; then
  71. INST=/tmp/sqliteodbcinst$$
  72. # if [ -r %{_libdir}/libsqliteodbc.so ] ; then
  73. # cat > $INST <<- 'EOD'
  74. # [SQLITE]
  75. # Description=SQLite ODBC 2.X
  76. # Driver=%{_libdir}/libsqliteodbc.so
  77. # Setup=%{_libdir}/libsqliteodbc.so
  78. # Threading=2
  79. # FileUsage=1
  80. # EOD
  81. # %{_bindir}/odbcinst -q -d -n SQLITE | grep '^\[SQLITE\]' >/dev/null || {
  82. # %{_bindir}/odbcinst -i -d -n SQLITE -f $INST || true
  83. # }
  84. # cat > $INST <<- 'EOD'
  85. # [SQLite Datasource]
  86. # Driver=SQLITE
  87. # EOD
  88. # %{_bindir}/odbcinst -q -s -n "SQLite Datasource" | \
  89. # grep '^\[SQLite Datasource\]' >/dev/null || {
  90. # %{_bindir}/odbcinst -i -l -s -n "SQLite Datasource" -f $INST || true
  91. # }
  92. # fi
  93. if [ -r %{_libdir}/libsqlite3odbc.so ] ; then
  94. cat > $INST <<- 'EOD'
  95. [SQLITE3]
  96. Description=SQLite ODBC 3.X
  97. Driver=%{_libdir}/libsqlite3odbc.so
  98. Setup=%{_libdir}/libsqlite3odbc.so
  99. Threading=2
  100. FileUsage=1
  101. EOD
  102. %{_bindir}/odbcinst -q -d -n SQLITE3 | grep '^\[SQLITE3\]' >/dev/null || {
  103. %{_bindir}/odbcinst -i -d -n SQLITE3 -f $INST || true
  104. }
  105. cat > $INST <<- 'EOD'
  106. [SQLite3 Datasource]
  107. Driver=SQLITE3
  108. EOD
  109. %{_bindir}/odbcinst -q -s -n "SQLite3 Datasource" | \
  110. grep '^\[SQLite3 Datasource\]' >/dev/null || {
  111. %{_bindir}/odbcinst -i -l -s -n "SQLite3 Datasource" -f $INST || true
  112. }
  113. fi
  114. rm -f $INST || true
  115. fi
  116. %preun
  117. if [ "$1" = "0" ] ; then
  118. test -x %{_bindir}/odbcinst && {
  119. # %{_bindir}/odbcinst -u -d -n SQLITE || true
  120. # %{_bindir}/odbcinst -u -l -s -n "SQLite Datasource" || true
  121. %{_bindir}/odbcinst -u -d -n SQLITE3 || true
  122. %{_bindir}/odbcinst -u -l -s -n "SQLite3 Datasource" || true
  123. }
  124. true
  125. fi
  126. %postun -p /sbin/ldconfig
  127. %files
  128. %doc README ChangeLog license.terms odbc.ini.sample
  129. %{_libdir}/*.so*
  130. %changelog
  131. * Sat Aug 31 2019 Toshiaki Ara <ara_t@384.jp> - 0.9996-2
  132. - drop sqlite2 support
  133. * Thu Aug 29 2019 Toshiaki Ara <ara_t@384.jp> - 0.9996-1
  134. - first reease for Vine Linux
  135. * Sat Jul 27 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.9996-4
  136. - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
  137. * Sun Feb 03 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.9996-3
  138. - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
  139. * Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.9996-2
  140. - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
  141. * Mon Mar 12 2018 Damian Wrobel <dwrobel@ertelnet.rybnik.pl> - 0.9996-1
  142. - Update to the latest available version.
  143. * Sat Feb 24 2018 Damian Wrobel <dwrobel@ertelnet.rybnik.pl> - 0.9995-5
  144. - Add missing BR (gcc)
  145. * Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.9995-4
  146. - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
  147. * Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.9995-3
  148. - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
  149. * Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.9995-2
  150. - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
  151. * Mon Jun 12 2017 Damian Wrobel <dwrobel@ertelnet.rybnik.pl> - 0.9995-1
  152. - Update to the latest available version.
  153. - Start using %%license
  154. * Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.9994-2
  155. - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
  156. * Wed Aug 17 2016 Damian Wrobel <dwrobel@ertelnet.rybnik.pl> - 0.9994-1
  157. - Update to the latest available version.
  158. * Tue Sep 23 2014 Damian Wrobel <dwrobel@ertelnet.rybnik.pl> - 0.999-1
  159. - Initial package.