| 1 | # bcond default logic is nicely backwards...
|
|---|
| 2 | #%bcond_without tcl
|
|---|
| 3 | #%bcond_with static
|
|---|
| 4 | #%bcond_without check
|
|---|
| 5 |
|
|---|
| 6 | %undefine tcl
|
|---|
| 7 | %undefine with_tcl
|
|---|
| 8 | %undefine static
|
|---|
| 9 | %undefine with_static
|
|---|
| 10 |
|
|---|
| 11 | # upstream doesn't provide separate -docs sources for all minor releases
|
|---|
| 12 | %define basever 3.5.9
|
|---|
| 13 | %define docver %(echo %{basever}|sed -e "s/\\./_/g")
|
|---|
| 14 |
|
|---|
| 15 | Summary: Library that implements an embeddable SQL database engine
|
|---|
| 16 | Name: sqlite
|
|---|
| 17 | Version: %{basever}
|
|---|
| 18 | Release: 1
|
|---|
| 19 | License: Public Domain
|
|---|
| 20 | Group: Applications/Databases
|
|---|
| 21 | URL: http://www.sqlite.org/
|
|---|
| 22 | Source0: http://www.sqlite.org/sqlite-%{version}.tar.gz
|
|---|
| 23 | Source1: http://www.sqlite.org/sqlite_docs_%{docver}.zip
|
|---|
| 24 |
|
|---|
| 25 | Patch1: sqlite-3.5.9-os2.diff
|
|---|
| 26 |
|
|---|
| 27 | #BuildRequires: ncurses-devel readline-devel glibc-devel
|
|---|
| 28 | # libdl patch needs
|
|---|
| 29 | #BuildRequires: autoconf
|
|---|
| 30 | %if %{with tcl}
|
|---|
| 31 | #BuildRequires: /usr/bin/tclsh
|
|---|
| 32 | #BuildRequires: tcl-devel
|
|---|
| 33 | %{!?tcl_version: %global tcl_version 8.5}
|
|---|
| 34 | %{!?tcl_sitearch: %global tcl_sitearch %{_libdir}/tcl%{tcl_version}}
|
|---|
| 35 | %endif
|
|---|
| 36 | BuildRoot: %{_tmppath}/%{name}-root
|
|---|
| 37 |
|
|---|
| 38 | %description
|
|---|
| 39 | SQLite is a C library that implements an SQL database engine. A large
|
|---|
| 40 | subset of SQL92 is supported. A complete database is stored in a
|
|---|
| 41 | single disk file. The API is designed for convenience and ease of use.
|
|---|
| 42 | Applications that link against SQLite can enjoy the power and
|
|---|
| 43 | flexibility of an SQL database without the administrative hassles of
|
|---|
| 44 | supporting a separate database server. Version 2 and version 3 binaries
|
|---|
| 45 | are named to permit each to be installed on a single host
|
|---|
| 46 |
|
|---|
| 47 | %package devel
|
|---|
| 48 | Summary: Development tools for the sqlite3 embeddable SQL database engine
|
|---|
| 49 | Group: Development/Libraries
|
|---|
| 50 | Requires: %{name} = %{version}-%{release}
|
|---|
| 51 | Requires: pkgconfig
|
|---|
| 52 |
|
|---|
| 53 | %description devel
|
|---|
| 54 | This package contains the header files and development documentation
|
|---|
| 55 | for %{name}. If you like to develop programs using %{name}, you will need
|
|---|
| 56 | to install %{name}-devel.
|
|---|
| 57 |
|
|---|
| 58 | %package doc
|
|---|
| 59 | Summary: Documentation for sqlite
|
|---|
| 60 | Group: Documentation
|
|---|
| 61 |
|
|---|
| 62 | %description doc
|
|---|
| 63 | This package contains most of the static HTML files that comprise the
|
|---|
| 64 | www.sqlite.org website, including all of the SQL Syntax and the
|
|---|
| 65 | C/C++ interface specs and other miscellaneous documentation.
|
|---|
| 66 |
|
|---|
| 67 | %package -n lemon
|
|---|
| 68 | Summary: A parser generator
|
|---|
| 69 | Group: Development/Tools
|
|---|
| 70 |
|
|---|
| 71 | %description -n lemon
|
|---|
| 72 | Lemon is an LALR(1) parser generator for C or C++. It does the same
|
|---|
| 73 | job as bison and yacc. But lemon is not another bison or yacc
|
|---|
| 74 | clone. It uses a different grammar syntax which is designed to reduce
|
|---|
| 75 | the number of coding errors. Lemon also uses a more sophisticated
|
|---|
| 76 | parsing engine that is faster than yacc and bison and which is both
|
|---|
| 77 | reentrant and thread-safe. Furthermore, Lemon implements features
|
|---|
| 78 | that can be used to eliminate resource leaks, making is suitable for
|
|---|
| 79 | use in long-running programs such as graphical user interfaces or
|
|---|
| 80 | embedded controllers.
|
|---|
| 81 |
|
|---|
| 82 | %if %{with tcl}
|
|---|
| 83 | %package tcl
|
|---|
| 84 | Summary: Tcl module for the sqlite3 embeddable SQL database engine
|
|---|
| 85 | Group: Development/Languages
|
|---|
| 86 | Requires: %{name} = %{version}-%{release}
|
|---|
| 87 | Requires: tcl(abi) = %{tcl_version}
|
|---|
| 88 |
|
|---|
| 89 | %description tcl
|
|---|
| 90 | This package contains the tcl modules for %{name}.
|
|---|
| 91 | %endif
|
|---|
| 92 |
|
|---|
| 93 | %prep
|
|---|
| 94 | %setup -q -a1
|
|---|
| 95 | %patch1 -p1 -b .os2~
|
|---|
| 96 |
|
|---|
| 97 | %build
|
|---|
| 98 | #autoconf
|
|---|
| 99 | #export CFLAGS="$RPM_OPT_FLAGS -DSQLITE_ENABLE_COLUMN_METADATA=1 -DSQLITE_DISABLE_DIRSYNC=1 -DSQLITE_ENABLE_FTS3=3 -DSQLITE_ENABLE_RTREE=1 -Wall -fno-strict-aliasing"
|
|---|
| 100 | export CONFIG_SHELL="/bin/sh"
|
|---|
| 101 | %configure %{!?with_tcl:--disable-tcl} \
|
|---|
| 102 | --enable-threadsafe \
|
|---|
| 103 | --enable-threads-override-locks \
|
|---|
| 104 | --enable-load-extension \
|
|---|
| 105 | %{?with_tcl:TCLLIBDIR=%{tcl_sitearch}/sqlite3} \
|
|---|
| 106 | --disable-rpath \
|
|---|
| 107 | --enable-shared --disable-static \
|
|---|
| 108 | "--cache-file=%{_topdir}/cache/%{name}.cache"
|
|---|
| 109 |
|
|---|
| 110 | # rpath removal
|
|---|
| 111 | #sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
|
|---|
| 112 | #sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
|
|---|
| 113 |
|
|---|
| 114 | make %{?_smp_mflags}
|
|---|
| 115 |
|
|---|
| 116 | %install
|
|---|
| 117 | rm -rf $RPM_BUILD_ROOT
|
|---|
| 118 |
|
|---|
| 119 | make DESTDIR=${RPM_BUILD_ROOT} install
|
|---|
| 120 |
|
|---|
| 121 | install -D -m0644 sqlite3.1 $RPM_BUILD_ROOT/%{_mandir}/man1/sqlite3.1
|
|---|
| 122 | install -D -m0755 lemon.exe $RPM_BUILD_ROOT/%{_bindir}/lemon.exe
|
|---|
| 123 | install -D -m0644 tool/lempar.c $RPM_BUILD_ROOT/%{_datadir}/lemon/lempar.c
|
|---|
| 124 |
|
|---|
| 125 |
|
|---|
| 126 | %if %{with tcl}
|
|---|
| 127 | # fix up permissions to enable dep extraction
|
|---|
| 128 | #chmod 0755 ${RPM_BUILD_ROOT}/%{tcl_sitearch}/sqlite3/*.so
|
|---|
| 129 | %endif
|
|---|
| 130 |
|
|---|
| 131 | %if ! %{with static}
|
|---|
| 132 | rm -f $RPM_BUILD_ROOT/%{_libdir}/*.la
|
|---|
| 133 | rm -f $RPM_BUILD_ROOT/%{_libdir}/*.a
|
|---|
| 134 | %endif
|
|---|
| 135 |
|
|---|
| 136 | # YD install dll
|
|---|
| 137 | install -D -m0755 sqlite3.dll $RPM_BUILD_ROOT/%{_libdir}/
|
|---|
| 138 | install -D -m0755 .libs/sqlite3.a $RPM_BUILD_ROOT/%{_libdir}/
|
|---|
| 139 | install -D -m0755 .libs/sqlite3_s.a $RPM_BUILD_ROOT/%{_libdir}/
|
|---|
| 140 | install -D -m0755 .libs/sqlite3.lib $RPM_BUILD_ROOT/%{_libdir}/
|
|---|
| 141 |
|
|---|
| 142 | # YD check requires tcl
|
|---|
| 143 | #%if %{with check}
|
|---|
| 144 | #%check
|
|---|
| 145 | #%ifarch s390 ppc ppc64
|
|---|
| 146 | #make test || :
|
|---|
| 147 | #%else
|
|---|
| 148 | #make test
|
|---|
| 149 | #%endif
|
|---|
| 150 | #%endif
|
|---|
| 151 |
|
|---|
| 152 | %clean
|
|---|
| 153 | rm -rf $RPM_BUILD_ROOT
|
|---|
| 154 |
|
|---|
| 155 | #%post -p /sbin/ldconfig
|
|---|
| 156 |
|
|---|
| 157 | #%postun -p /sbin/ldconfig
|
|---|
| 158 |
|
|---|
| 159 | %files
|
|---|
| 160 | %defattr(-, root, root)
|
|---|
| 161 | %doc README
|
|---|
| 162 | %{_bindir}/sqlite3.exe
|
|---|
| 163 | %{_libdir}/*.dll
|
|---|
| 164 | %{_mandir}/man?/*
|
|---|
| 165 |
|
|---|
| 166 | %files devel
|
|---|
| 167 | %defattr(-, root, root)
|
|---|
| 168 | %{_includedir}/*.h
|
|---|
| 169 | %{_libdir}/*.dll
|
|---|
| 170 | %{_libdir}/*.a
|
|---|
| 171 | %{_libdir}/*.lib
|
|---|
| 172 | %{_libdir}/pkgconfig/*.pc
|
|---|
| 173 | %if %{with static}
|
|---|
| 174 | %{_libdir}/*_s.a
|
|---|
| 175 | %exclude %{_libdir}/*.la
|
|---|
| 176 | %endif
|
|---|
| 177 |
|
|---|
| 178 | %files doc
|
|---|
| 179 | %defattr(-, root, root)
|
|---|
| 180 | %doc %{name}-%{docver}-docs/*
|
|---|
| 181 |
|
|---|
| 182 | %files -n lemon
|
|---|
| 183 | %defattr(-, root, root)
|
|---|
| 184 | %{_bindir}/lemon.exe
|
|---|
| 185 | %{_datadir}/lemon
|
|---|
| 186 |
|
|---|
| 187 | %if %{with tcl}
|
|---|
| 188 | %files tcl
|
|---|
| 189 | %defattr(-, root, root)
|
|---|
| 190 | %{tcl_sitearch}/sqlite3
|
|---|
| 191 | %endif
|
|---|
| 192 |
|
|---|
| 193 | %changelog
|
|---|