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.7.2
|
---|
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: 5%{?dist}
|
---|
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-os2.diff
|
---|
26 |
|
---|
27 | BuildRequires: ncurses-devel readline-devel libc-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="/@unixroot/usr/bin/sh.exe"
|
---|
101 | export LDFLAGS="-Zbin-files -Zhigh-mem -Zomf -Zargs-wild -Zargs-resp"
|
---|
102 | export LIBS="-lurpo"
|
---|
103 | %configure %{!?with_tcl:--disable-tcl} \
|
---|
104 | --enable-threadsafe \
|
---|
105 | --enable-threads-override-locks \
|
---|
106 | --enable-load-extension \
|
---|
107 | %{?with_tcl:TCLLIBDIR=%{tcl_sitearch}/sqlite3} \
|
---|
108 | --disable-shared \
|
---|
109 | "--cache-file=%{_topdir}/cache/%{name}-%{_target_cpu}.cache"
|
---|
110 |
|
---|
111 | # rpath removal
|
---|
112 | #sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
|
---|
113 | #sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
|
---|
114 |
|
---|
115 | make %{?_smp_mflags}
|
---|
116 |
|
---|
117 | %install
|
---|
118 | rm -rf $RPM_BUILD_ROOT
|
---|
119 |
|
---|
120 | make DESTDIR=${RPM_BUILD_ROOT} install
|
---|
121 |
|
---|
122 | install -D -m0644 sqlite3.1 $RPM_BUILD_ROOT/%{_mandir}/man1/sqlite3.1
|
---|
123 | install -D -m0755 lemon.exe $RPM_BUILD_ROOT/%{_bindir}/lemon.exe
|
---|
124 | install -D -m0644 tool/lempar.c $RPM_BUILD_ROOT/%{_datadir}/lemon/lempar.c
|
---|
125 |
|
---|
126 |
|
---|
127 | %if %{with tcl}
|
---|
128 | # fix up permissions to enable dep extraction
|
---|
129 | #chmod 0755 ${RPM_BUILD_ROOT}/%{tcl_sitearch}/sqlite3/*.so
|
---|
130 | %endif
|
---|
131 |
|
---|
132 | %if ! %{with static}
|
---|
133 | rm -f $RPM_BUILD_ROOT/%{_libdir}/*.la
|
---|
134 | rm -f $RPM_BUILD_ROOT/%{_libdir}/*.a
|
---|
135 | %endif
|
---|
136 |
|
---|
137 | # YD install dll
|
---|
138 | install -D -m0755 sqlit3.dll $RPM_BUILD_ROOT/%{_libdir}/
|
---|
139 | install -D -m0755 .libs/sqlite3.a $RPM_BUILD_ROOT/%{_libdir}/
|
---|
140 | install -D -m0755 .libs/sqlite3_s.a $RPM_BUILD_ROOT/%{_libdir}/
|
---|
141 | install -D -m0755 .libs/sqlite3.lib $RPM_BUILD_ROOT/%{_libdir}/
|
---|
142 |
|
---|
143 | # YD check requires tcl
|
---|
144 | #%if %{with check}
|
---|
145 | #%check
|
---|
146 | #%ifarch s390 ppc ppc64
|
---|
147 | #make test || :
|
---|
148 | #%else
|
---|
149 | #make test
|
---|
150 | #%endif
|
---|
151 | #%endif
|
---|
152 |
|
---|
153 | %clean
|
---|
154 | rm -rf $RPM_BUILD_ROOT
|
---|
155 |
|
---|
156 | #%post -p /sbin/ldconfig
|
---|
157 |
|
---|
158 | #%postun -p /sbin/ldconfig
|
---|
159 |
|
---|
160 | %files
|
---|
161 | %defattr(-, root, root)
|
---|
162 | %doc README
|
---|
163 | %{_bindir}/sqlite3.exe
|
---|
164 | %{_libdir}/*.dll
|
---|
165 | %{_mandir}/man?/*
|
---|
166 |
|
---|
167 | %files devel
|
---|
168 | %defattr(-, root, root)
|
---|
169 | %{_includedir}/*.h
|
---|
170 | %{_libdir}/*.dll
|
---|
171 | %{_libdir}/*.a
|
---|
172 | %{_libdir}/*.lib
|
---|
173 | %{_libdir}/pkgconfig/*.pc
|
---|
174 | %if %{with static}
|
---|
175 | %{_libdir}/*_s.a
|
---|
176 | %exclude %{_libdir}/*.la
|
---|
177 | %endif
|
---|
178 |
|
---|
179 | %files doc
|
---|
180 | %defattr(-, root, root)
|
---|
181 | %doc %{name}-%{docver}-docs/*
|
---|
182 |
|
---|
183 | %files -n lemon
|
---|
184 | %defattr(-, root, root)
|
---|
185 | %{_bindir}/lemon.exe
|
---|
186 | %{_datadir}/lemon
|
---|
187 |
|
---|
188 | %if %{with tcl}
|
---|
189 | %files tcl
|
---|
190 | %defattr(-, root, root)
|
---|
191 | %{tcl_sitearch}/sqlite3
|
---|
192 | %endif
|
---|
193 |
|
---|
194 | %changelog
|
---|
195 | * Mon Jan 16 2012 yd
|
---|
196 | - rebuild with libc 0.6.4 runtime.
|
---|