mirror of https://github.com/mosra/magnum.git
3 changed files with 194 additions and 0 deletions
@ -0,0 +1,28 @@
|
||||
# Install next packages |
||||
|
||||
## for usage |
||||
corrade should be installed |
||||
|
||||
``` |
||||
$ sudo dnf install openal-soft \ |
||||
SDL2 \ |
||||
freeglut \ |
||||
glfw |
||||
``` |
||||
## for build and devel package |
||||
corrade-devel should be installed |
||||
|
||||
``` |
||||
$ sudo dnf install git gcc-c++ cmake make rpmdevtools \ |
||||
openal-soft-devel \ |
||||
SDL2-devel \ |
||||
freeglut-devel \ |
||||
glfw-devel |
||||
``` |
||||
|
||||
|
||||
## on centos |
||||
for glfw and glfw-devel packages install EPEL repo: |
||||
``` |
||||
$ sudo dnf install --nogpgcheck https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm |
||||
``` |
||||
@ -0,0 +1,60 @@
|
||||
#!/bin/bash |
||||
name=magnum |
||||
|
||||
cd ../../ |
||||
# get latest tag for empty param |
||||
if [[ -z ${1} ]]; |
||||
then |
||||
version=$(git describe --abbrev=0); |
||||
else |
||||
version="${1}" |
||||
fi |
||||
# try to get hash for input param |
||||
hash=$(git rev-parse --short ${version}) |
||||
if [ "$?" -ne "0" ]; |
||||
then |
||||
echo "------------------------------------------------------------------" |
||||
echo "Build FAILED" |
||||
echo "Parameter should be either master or valid git tag|hash or empty string"; |
||||
exit 1; |
||||
fi |
||||
# if hash provided as input param then name version as "hash" |
||||
if [ "${version}" == "${hash}" ]; |
||||
then |
||||
version="hash" |
||||
fi |
||||
# create the file tree you need to build RPM packages |
||||
rpmdev-setuptree |
||||
# create release string |
||||
release=${hash}$(rpmbuild --eval=%{?dist}); |
||||
# create package name string |
||||
package_name=${name}-${version}-${release} |
||||
# archive sources as ${package_name}.tar.gz into rpm source dir |
||||
tarfile=$(rpmbuild --eval=%{_sourcedir})/${package_name}.tar |
||||
git archive --prefix=${name}-${version}/ -o ${tarfile} ${hash} |
||||
gzip -nf ${tarfile} |
||||
cd ./package/rpm |
||||
# modify Version and Release in rpm spec file |
||||
specfile=$(rpmbuild --eval=%{_specdir})/${package_name}.spec |
||||
cp ${name}.spec ${specfile} |
||||
sed -i "s/Version:.\+/Version: ${version}/g" ${specfile} |
||||
sed -i "s/Release:.\+/Release: ${hash}%{?dist}/g" ${specfile} |
||||
# build rpm into rpm build dir |
||||
rpmbuild -bb ${specfile} |
||||
# tell user what is the result of efforts |
||||
if [ "$?" -ne "0" ]; |
||||
then |
||||
echo "------------------------------------------------------------------" |
||||
echo "Build of '${package_name}' FAILED" |
||||
echo "Specfile: ${specfile}" |
||||
echo "Get more info above" |
||||
exit 1; |
||||
else |
||||
echo "------------------------------------------------------------------" |
||||
echo "Build of '${package_name}' SUCCEED" |
||||
echo "Specfile: ${specfile}" |
||||
arch=$(rpmbuild --eval=%{_arch}) |
||||
rpmdir=$(rpmbuild --eval=%{_rpmdir}) |
||||
echo "To install them run next command:" |
||||
echo " $ sudo rpm -Uhv ${rpmdir}/${arch}/${name}*${version}-${release}.${arch}.rpm" |
||||
fi |
||||
@ -0,0 +1,106 @@
|
||||
Name: magnum |
||||
Version: v2020.06 |
||||
Release: bf4d59707%{?dist} |
||||
Summary: Lightweight and modular C++11/C++14 graphics middleware for games and data visualization |
||||
|
||||
License: MIT |
||||
URL: https://magnum.graphics/ |
||||
Source0: %{name}-%{version}-%{release}.tar.gz |
||||
Requires: corrade |
||||
Requires: SDL2 |
||||
Requires: freeglut |
||||
Requires: glfw |
||||
Requires: openal-soft |
||||
|
||||
BuildRequires: gcc-c++ |
||||
BuildRequires: cmake >= 3.4.0 |
||||
BuildRequires: SDL2-devel |
||||
BuildRequires: freeglut-devel |
||||
BuildRequires: corrade-devel |
||||
BuildRequires: glfw-devel |
||||
BuildRequires: openal-soft-devel |
||||
|
||||
%description |
||||
C++11/C++14 graphics middleware for games and data visualization |
||||
|
||||
%package devel |
||||
Summary: Lightweight and modular C++11/C++14 graphics middleware for games and data visualization |
||||
Requires: corrade-devel |
||||
Requires: %{name} = %{version} |
||||
Requires: SDL2-devel |
||||
Requires: freeglut-devel |
||||
Requires: glfw-devel |
||||
Requires: openal-soft-devel |
||||
|
||||
%description devel |
||||
C++11/C++14 graphics middleware for games and data visualization |
||||
|
||||
%global debug_package %{nil} |
||||
|
||||
%prep |
||||
%autosetup |
||||
|
||||
|
||||
%build |
||||
mkdir build && cd build |
||||
cmake .. \ |
||||
-DCMAKE_INSTALL_PREFIX=%{_prefix} \ |
||||
-DCMAKE_BUILD_TYPE=Release \ |
||||
-DWITH_AUDIO=ON \ |
||||
-DWITH_GLXAPPLICATION=ON \ |
||||
-DWITH_GLFWAPPLICATION=ON \ |
||||
-DWITH_SDL2APPLICATION=ON \ |
||||
-DWITH_WINDOWLESSGLXAPPLICATION=ON \ |
||||
-DWITH_GLXCONTEXT=ON \ |
||||
-DWITH_OPENGLTESTER=ON \ |
||||
-DWITH_ANYAUDIOIMPORTER=ON \ |
||||
-DWITH_ANYIMAGECONVERTER=ON \ |
||||
-DWITH_ANYIMAGEIMPORTER=ON \ |
||||
-DWITH_ANYSCENECONVERTER=ON \ |
||||
-DWITH_ANYSCENEIMPORTER=ON \ |
||||
-DWITH_ANYSHADERCONVERTER=ON \ |
||||
-DWITH_MAGNUMFONT=ON \ |
||||
-DWITH_MAGNUMFONTCONVERTER=ON \ |
||||
-DWITH_OBJIMPORTER=ON \ |
||||
-DWITH_TGAIMAGECONVERTER=ON \ |
||||
-DWITH_TGAIMPORTER=ON \ |
||||
-DWITH_WAVAUDIOIMPORTER=ON \ |
||||
-DWITH_DISTANCEFIELDCONVERTER=ON \ |
||||
-DWITH_IMAGECONVERTER=ON \ |
||||
-DWITH_SCENECONVERTER=ON \ |
||||
-DWITH_SHADERCONVERTER=ON \ |
||||
-DWITH_FONTCONVERTER=ON \ |
||||
-DWITH_GL_INFO=ON \ |
||||
-DWITH_AL_INFO=ON |
||||
make %{?_smp_mflags} |
||||
|
||||
|
||||
%install |
||||
rm -rf $RPM_BUILD_ROOT |
||||
cd build |
||||
make DESTDIR=$RPM_BUILD_ROOT install |
||||
strip $RPM_BUILD_ROOT/%{_prefix}/lib*/lib*.so.* $RPM_BUILD_ROOT/%{_prefix}/lib*/magnum/*/*.so $RPM_BUILD_ROOT/%{_prefix}/bin/* |
||||
|
||||
%post -p /sbin/ldconfig |
||||
|
||||
%postun -p /sbin/ldconfig |
||||
|
||||
%files |
||||
%{_prefix}/bin/* |
||||
%{_prefix}/lib*/magnum/*/* |
||||
%{_prefix}/lib*/lib*.so.* |
||||
%doc COPYING |
||||
|
||||
%files devel |
||||
%{_prefix}/include/Magnum/* |
||||
%{_prefix}/include/MagnumExternal/* |
||||
%{_prefix}/include/MagnumPlugins/* |
||||
%{_prefix}/lib*/lib*.a |
||||
%{_prefix}/lib*/lib*.so |
||||
%{_prefix}/share/cmake* |
||||
%doc COPYING |
||||
|
||||
|
||||
%changelog |
||||
* Sun Oct 17 2021 1b00 <1b00@pm.me> - v2020.06-bf4d59707 |
||||
- Initial release. |
||||
Loading…
Reference in new issue