File AntTweakBar.spec of Package AntTweakBar

#
# spec file for package AntTweakBar
#
# Copyright (c) 2020 SUSE LLC
#
# 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 sover   1

Name:           AntTweakBar
Version:        1.16
Release:        0
Summary:        GUI library for videogame property editing UIs
License:        Zlib
Group:          System/Libraries
URL:            http://anttweakbar.sourceforge.net/
Source:         http://downloads.sourceforge.net/project/anttweakbar/AntTweakBar_116.zip
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  gcc-c++
BuildRequires:  pkgconfig(x11)
BuildRequires:  pkgconfig(gl)
BuildRequires:  pkgconfig(glu)
BuildRequires:  dos2unix
BuildRequires:  unzip

%description
Library for easily creating and using tweakable properties in an OpenGL
or SDL application, designed primarily for professional game developers.

%package -n libAntTweakBar%{sover}
Summary:        Bullet File Loader Library
Group:          System/Libraries

%description -n libAntTweakBar%{sover}
Library for easily creating and using tweakable properties in an OpenGL
or SDL application, designed primarily for professional game developers.

%package devel
Summary:        Header files for AntTweakBar
Group:          Development/Libraries/C and C++
Requires:       libAntTweakBar%{sover} = %{version}

%description devel
Header files for developing applications making use of AntTweakBar.

%prep
%setup -q -n AntTweakBar

iconv --from=iso-8859-1 --to=utf8 ./License.txt > ./License.txt.utf8
touch -r ./License.txt ./License.txt.utf8
mv ./License.txt.utf8 ./License.txt

dos2unix ./examples/TwSimpleGLUT.c > ./TwSimpleGLUT.c
touch -r ./examples/TwSimpleGLUT.c ./TwSimpleGLUT.c
mv ./TwSimpleGLUT.c ./examples/TwSimpleGLUT.c

find Readme.txt License.txt src examples include -type f -print0 | xargs -0 chmod 0644
find Readme.txt License.txt src examples include -type f -print0 | xargs -0 sed -i "s|\r||g"

%build
cd src
make %{?_smp_mflags} CXXCFG="%{optflags}"

%install
install -m 644 -D include/AntTweakBar.h "%{buildroot}/%{_includedir}/AntTweakBar.h"
install -m 755 -D lib/libAntTweakBar.so "%{buildroot}/%{_libdir}/libAntTweakBar.so.1.0.0"
ln -s "%{_libdir}/libAntTweakBar.so.1.0.0" "%{buildroot}/%{_libdir}/libAntTweakBar.so.1"
ln -s "%{_libdir}/libAntTweakBar.so.1.0.0" "%{buildroot}/%{_libdir}/libAntTweakBar.so"

%post -n libAntTweakBar%{sover} -p /sbin/ldconfig
%postun -n libAntTweakBar%{sover} -p /sbin/ldconfig

%files -n libAntTweakBar%{sover}
%{_libdir}/libAntTweakBar.so.*

%files devel
%defattr(-,root,root,-)
%doc Readme.txt
%license License.txt
%{_includedir}/*
%{_libdir}/libAntTweakBar.so

%changelog
openSUSE Build Service is sponsored by