File libfehQlibs0.spec of Package libfehQlibs0
#
# spec file for package libfehQlibs0
#
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%define projectname fehQlibs
Name: libfehQlibs0
Version: 23
Release: 0
Summary: C routines provided as easy-to-use library for Internet services
License: SUSE-Public-Domain
Group: Development/Libraries/C and C++
URL: https://www.fehcom.de/ipnet/qlibs.html
Source: http://www.fehcom.de/ipnet/%{projectname}/%{projectname}-%{version}.tgz
%description
bs - C library and headers based on "djb's libs" and libowfat.
Initially, these libs were excluded from *qmail and forseen to use with eQmail.
As the packages of djb (D.J. Bernstein) uses these libs in different versions,
there comes up the need to have a consistent state.
As time was going on, there was also a need to include additional functionality
and up-to-date best practices.
Short - this was the point where some parts from libowfat were included.
The current fehQlibs rather accustom to the needs of different OS.
In theorie - these libs can be used with any djb software.
%package devel
Summary: Development Files for fehQlibs
Group: Development/Libraries/C and C++
Requires: %{name} = %{version}-%{release}
%description devel
This package contains development files necessary for developing applications
based on fehQlibs.
%prep
%setup -q -n %{projectname}-%{version}
sed -i Makefile -e 's/-o \(lib[^\.]*\.so\)/-fPIC -Wl,-soname,\1.0 -o\1.0/'
sed -i conf-build \
-e 's|^LIBDIR=.*|LIBDIR=%{buildroot}%{_libdir}| ;
s|^HDRDIR=.*|HDRDIR=%{buildroot}%{_includedir}/qlibs| ;
s|^CFLAGS=.*|CFLAGS="%{optflags} -fPIC"|'
# don't pass LDFLAGS to the makelib command!
sed -i Makefile -e 's|$(MAKELIB) $(LDFLAGS)|$(MAKELIB)|'
mv dnsstub/README.md dnsstub/README.dnsstub.md
rm man/INSTALL
# removing, don't know where to place
rm man/x.html
%build
export CXXFLAGS="%{optflags}"
export CFLAGS="%{optflags}"
%configure
make
make %{?_smp_mflags} shared
%install
%make_install
ln -s libqlibs.so.0 %{buildroot}%{_libdir}/libqlibs.so
ln -s libdnsresolv.so.0 %{buildroot}%{_libdir}/libdnsresolv.so
rm %{buildroot}%{_libdir}/*.a %{buildroot}%{_libdir}/*.o
cp *.so.* %{buildroot}%{_libdir}/
mkdir -p %{buildroot}%{_mandir}/man3
cp man/* %{buildroot}%{_mandir}/man3/
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%files
%license LICENSE
%doc VERSION BUILD README.md dnsstub/README.dnsstub.md
%{_libdir}/*.so.0
%files devel
%{_libdir}/*.so
%{_mandir}/man3/*
%{_includedir}/qlibs
%changelog