source: spec/trunk/SPECS/sqlite.spec@ 17

Last change on this file since 17 was 17, checked in by Yuri Dario, 15 years ago

spec: fixed suffix extensions for patched files.

  • Property svn:eol-style set to native
File size: 5.2 KB
Line 
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
15Summary: Library that implements an embeddable SQL database engine
16Name: sqlite
17Version: %{basever}
18Release: 1
19License: Public Domain
20Group: Applications/Databases
21URL: http://www.sqlite.org/
22Source0: http://www.sqlite.org/sqlite-%{version}.tar.gz
23Source1: http://www.sqlite.org/sqlite_docs_%{docver}.zip
24
25Patch1: 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
36BuildRoot: %{_tmppath}/%{name}-root
37
38%description
39SQLite is a C library that implements an SQL database engine. A large
40subset of SQL92 is supported. A complete database is stored in a
41single disk file. The API is designed for convenience and ease of use.
42Applications that link against SQLite can enjoy the power and
43flexibility of an SQL database without the administrative hassles of
44supporting a separate database server. Version 2 and version 3 binaries
45are named to permit each to be installed on a single host
46
47%package devel
48Summary: Development tools for the sqlite3 embeddable SQL database engine
49Group: Development/Libraries
50Requires: %{name} = %{version}-%{release}
51Requires: pkgconfig
52
53%description devel
54This package contains the header files and development documentation
55for %{name}. If you like to develop programs using %{name}, you will need
56to install %{name}-devel.
57
58%package doc
59Summary: Documentation for sqlite
60Group: Documentation
61
62%description doc
63This package contains most of the static HTML files that comprise the
64www.sqlite.org website, including all of the SQL Syntax and the
65C/C++ interface specs and other miscellaneous documentation.
66
67%package -n lemon
68Summary: A parser generator
69Group: Development/Tools
70
71%description -n lemon
72Lemon is an LALR(1) parser generator for C or C++. It does the same
73job as bison and yacc. But lemon is not another bison or yacc
74clone. It uses a different grammar syntax which is designed to reduce
75the number of coding errors. Lemon also uses a more sophisticated
76parsing engine that is faster than yacc and bison and which is both
77reentrant and thread-safe. Furthermore, Lemon implements features
78that can be used to eliminate resource leaks, making is suitable for
79use in long-running programs such as graphical user interfaces or
80embedded controllers.
81
82%if %{with tcl}
83%package tcl
84Summary: Tcl module for the sqlite3 embeddable SQL database engine
85Group: Development/Languages
86Requires: %{name} = %{version}-%{release}
87Requires: tcl(abi) = %{tcl_version}
88
89%description tcl
90This 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"
100export 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
114make %{?_smp_mflags}
115
116%install
117rm -rf $RPM_BUILD_ROOT
118
119make DESTDIR=${RPM_BUILD_ROOT} install
120
121install -D -m0644 sqlite3.1 $RPM_BUILD_ROOT/%{_mandir}/man1/sqlite3.1
122install -D -m0755 lemon.exe $RPM_BUILD_ROOT/%{_bindir}/lemon.exe
123install -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}
132rm -f $RPM_BUILD_ROOT/%{_libdir}/*.la
133rm -f $RPM_BUILD_ROOT/%{_libdir}/*.a
134%endif
135
136# YD install dll
137install -D -m0755 sqlite3.dll $RPM_BUILD_ROOT/%{_libdir}/
138install -D -m0755 .libs/sqlite3.a $RPM_BUILD_ROOT/%{_libdir}/
139install -D -m0755 .libs/sqlite3_s.a $RPM_BUILD_ROOT/%{_libdir}/
140install -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
153rm -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
Note: See TracBrowser for help on using the repository browser.