File sqlean.spec of Package sqlean

%define THISMONTHSHORT %(LC_TIME='en_US.UTF-8' date +%%b)
%define THISMONTHLONG %(LC_TIME='en_US.UTF-8' date +%%B)
%define THISYEAR %(date +%%Y)
%define DAYNUMBER %(LC_TIME='en_US.UTF-8' date +%%d)
%define DAYNAMESHORT %(LC_TIME='en_US.UTF-8' date +%%a)
#%%define today Mon Jan 23 2023
%define today %{DAYNAMESHORT} %{THISMONTHSHORT} %{DAYNUMBER} %{THISYEAR}
%define packager Kimi
%define packager_lowercase %(echo %{packager} | tr '[:upper:]' '[:lower:]')
%define packagerEmail noreply@nodomain.org
Name:           sqlean
Summary:        The ultimate set of SQLite extensions
License:        MIT
Version:        0.21.8
Release:        0
Group:          Other
URL:            "https://github.com/nalgeon/sqlean"
Source:         %{name}-%{version}.tar.xz
Source1:        sqlite-amalgamation.zip
BuildRequires:  unzip


%description
The ultimate set of SQLite extensions
command.


%prep
%setup
%setup -a 1


%build
echo "%%{_sourcedir}=%{_sourcedir}"
ls -al "%{_sourcedir}"
echo "... If not set as Source1: above, do the following:"
echo "... Extract sqlite source code from zip file"
echo "... unzip -v "%{_sourcedir}/sqlite-amalgamation.zip""
#echo "... mv -v sqlite-amalgamation-*/* src"
mv -v sqlite-amalgamation-*/* src
find . -name xxhash.impl.h
echo "--- List all source files ---"
find | sed 's/\.\///g'
echo "--- End list all source files ---"
echo "Preparing directory dist ..."
if [ -d dist ]; then rm -rf dist; else mkdir -pv dist; fi
make compile-linux


%install
cd dist
strip -s *.so
install -D -m755 *.so --target-directory="%{buildroot}/usr/lib64/sqlean"
echo
echo "--- Show files that will be packaged ---"
find %{buildroot}
echo "--- End show files that will be packaged ---"
echo


%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig


%files
%{_libdir}/sqlean

%changelog
* %{today} %{packager} <%{packagerEmail}> - %{version}
- Initial compilation.
openSUSE Build Service is sponsored by