File libguytools.spec of Package libguytools

#
# spec file for package libguytools2
#
# Copyright (c) 2014 SUSE LINUX Products 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 http://bugs.opensuse.org/
#


%define  soname 2
Name:           libguytools
%define    base_name libguytools
Version:        2.0.2
Release:        0
Summary:        A small programming toolbox, guymager is based on libguytools
License:        GPL-2.0
Group:          Development/Libraries/Other
Source:         http://downloads.sourceforge.net/project/libguytools/libguytools/LatestSource/tools-2.0.2.tar.gz
Url:            http://guymager.sourceforge.net/
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  qt-devel

%description
A small programming toolbox. Guymager is based on libguytools. Given the importance of testability, libguytools only provides a static library to link against.  That way the user can test guymager and know that it is not linking to a library that may change over time.

%package        devel
Summary:        Development files for %{name}
Group:          Development/Libraries/Other
Requires:       %{name} = %{version}-%{release}

%description    devel
The %{name}-devel package contains libraries and header files for
developing applications that use %{name}.

%package        devel-static
Summary:        Development files for %{name}
Group:          Development/Libraries/Other
Requires:       %{name}-devel = %{version}-%{release}

%description    devel-static
The %{name}-devel package contains the static library for
developing applications that use %{name}.

%package        -n %name%soname
Summary:        Shared Library for %name
Group:          Development/Libraries/Other

%description    -n %name%soname
A small programming toolbox. Guymager is based on libguytools. Given the importance of testability, libguytools only provides a static library to link against.  That way the user can test guymager and know that it is not linking to a library that may change over time.


%prep
%setup -q  -n tools-%{version}

#build copied from the debian's rules file

%build
# Debian only
# ./create_version_file.sh
echo 'VERSION="%{version}"' > libguytools_version.pro.inc
qmake toolsstatic.pro
%{__make}
qmake tools.pro
%{__make}

%install
# rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT%{_libdir}
mkdir -p $RPM_BUILD_ROOT%{_includedir}/libguytools
cp -pPv lib/* $RPM_BUILD_ROOT%{_libdir}
cp -rp include/* $RPM_BUILD_ROOT%{_includedir}/libguytools

%post -n %{name}%soname -p /sbin/ldconfig

%postun -n %{name}%soname -p /sbin/ldconfig

%files -n %name%soname
%defattr(-,root,root,-)
%{_libdir}/*.so.*
%exclude %{_libdir}/libguytools.a

%files devel
%defattr(-,root,root,-)
%{_includedir}/libguytools/
%{_libdir}/libguytools.so

%files devel-static
%defattr(-,root,root,-)
%{_libdir}/libguytools.a

%changelog