e1ebe7b
## This package uses an own miniz.h file.
e1ebe7b
## Upstream: taken from http://miniz.googlecode.com/svn/trunk/miniz.c. I've cut this into
e1ebe7b
## header and implementation files and disabled (via define) some interfaces that
e1ebe7b
## we don't need:
e1ebe7b
# - MINIZ_NO_ARCHIVE_WRITING_APIS
e1ebe7b
# - MINIZ_NO_ZLIB_COMPATIBLE_NAMES
e1ebe7b
e1ebe7b
Name:          pioneer
e1ebe7b
Summary:       A game of lonely space adventure
4970cfc
Version:       20160710
4970cfc
Release:       1%{?dist}
e1ebe7b
e1ebe7b
## Main license: GPLv3
e1ebe7b
## Dejavu font license: Bitstream Vera and Public Domain
e1ebe7b
## Pioneer's art, music and other assets (including Lua model scripts): CC-BY-SA
e1ebe7b
License:       GPLv3 and CC-BY-SA and Bitstream Vera and Public Domain
e1ebe7b
Group:         Amusements/Games
e1ebe7b
URL:           http://pioneerspacesim.net/
4970cfc
Source0:       https://github.com/pioneerspacesim/pioneer/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz
e1ebe7b
Source1:       %{name}.desktop
e1ebe7b
Source2:       %{name}.appdata.xml
e1ebe7b
e1ebe7b
BuildRequires: autoconf
e1ebe7b
BuildRequires: automake
e1ebe7b
BuildRequires: chrpath
e1ebe7b
BuildRequires: desktop-file-utils
e1ebe7b
BuildRequires: doxygen
e1ebe7b
BuildRequires: fontpackages-devel
e1ebe7b
BuildRequires: graphviz
e1ebe7b
BuildRequires: ImageMagick
e1ebe7b
BuildRequires: pkgconfig
e1ebe7b
BuildRequires: pkgconfig(vorbis)
e1ebe7b
BuildRequires: pkgconfig(sigc++-2.0)
e1ebe7b
BuildRequires: pkgconfig(libcurl)
e1ebe7b
BuildRequires: pkgconfig(SDL2_image)
e1ebe7b
BuildRequires: pkgconfig(freetype2)
e1ebe7b
BuildRequires: pkgconfig(libpng)
e1ebe7b
#BuildRequires: pkgconfig(lua)
b687bd8
BuildRequires: assimp-devel >= 3.2
e1ebe7b
BuildRequires: pkgconfig(gl)
e1ebe7b
BuildRequires: miniz-devel
e1ebe7b
BuildRequires: NaturalDocs
e1ebe7b
BuildRequires: desktop-file-utils
e1ebe7b
BuildRequires: libappstream-glib
e1ebe7b
e1ebe7b
Requires: %{name}-data = %{version}-%{release}
e1ebe7b
Requires: hicolor-icon-theme
e1ebe7b
Requires: graphviz
e1ebe7b
e1ebe7b
%description
e1ebe7b
A space adventure game set in the Milky Way galaxy at the turn of
e1ebe7b
the 31st century.
e1ebe7b
e1ebe7b
The game is open-ended, and you are free to explore the millions of star
e1ebe7b
systems in the game. You can land on planets, slingshot past gas giants, and
e1ebe7b
burn yourself to a crisp flying between binary star systems. You can try your
e1ebe7b
hand at piracy, make your fortune trading between systems, or do missions for
e1ebe7b
the various factions fighting for power, freedom or self-determination.
e1ebe7b
e1ebe7b
####################
e1ebe7b
%package data
e1ebe7b
Summary: Data files of %{name}
e1ebe7b
BuildArch: noarch
e1ebe7b
Group:     Amusements/Games
e1ebe7b
Requires: %{name}-inpionata-fonts = %{version}-%{release}
e1ebe7b
Requires: %{name}-orbiteer-bold-fonts = %{version}-%{release}
e1ebe7b
Requires: %{name}-pionilliumtext22l-medium-fonts = %{version}-%{release}
e1ebe7b
Requires: wqy-microhei-fonts
e1ebe7b
Requires: dejavu-sans-fonts
e1ebe7b
Requires: dejavu-sans-mono-fonts
e1ebe7b
e1ebe7b
%description data
e1ebe7b
Data files of %{name}.
e1ebe7b
e1ebe7b
####################
e1ebe7b
%package doc
e1ebe7b
Summary: HTML documentation files of %{name}
e1ebe7b
BuildArch: noarch
e1ebe7b
%description doc
e1ebe7b
Lua API NaturalDocs and C++ documentation files of %{name}.
e1ebe7b
e1ebe7b
####################
e1ebe7b
%package inpionata-fonts
e1ebe7b
Summary: Inpionata font file for %{name}
e1ebe7b
BuildArch: noarch
e1ebe7b
License:   OFL
e1ebe7b
Requires:  fontpackages-filesystem
e1ebe7b
e1ebe7b
%description inpionata-fonts
e1ebe7b
Inpionata font file based on Inconsolata.
e1ebe7b
e1ebe7b
####################
e1ebe7b
%package orbiteer-bold-fonts
e1ebe7b
Summary: Orbiteer Bold font file for %{name}
e1ebe7b
BuildArch: noarch
e1ebe7b
License:   OFL
e1ebe7b
Requires:  fontpackages-filesystem
e1ebe7b
e1ebe7b
%description orbiteer-bold-fonts
e1ebe7b
Orbiteer Bold font file based on Orbitron.
e1ebe7b
e1ebe7b
####################
e1ebe7b
%package pionilliumtext22l-medium-fonts
e1ebe7b
Summary: PionilliumText22L Medium font file for %{name}
e1ebe7b
BuildArch: noarch
e1ebe7b
License:   OFL
e1ebe7b
Requires:  fontpackages-filesystem
e1ebe7b
e1ebe7b
%description pionilliumtext22l-medium-fonts
e1ebe7b
PionilliumText22L Medium font file based on Titillium.
e1ebe7b
e1ebe7b
%prep
e1ebe7b
%setup -q -n %{name}-%{version}
e1ebe7b
e1ebe7b
## Strip all .png files 
e1ebe7b
## 'iCCP: known incorrect sRGB profile' warnings
e1ebe7b
find . -type f -name "*.png" -exec convert {} -strip {} \;
e1ebe7b
e1ebe7b
## Pioneer does not work with Lua 5.3.2
e1ebe7b
## We cannot unbundle internal Lua yet
e1ebe7b
## See https://github.com/pioneerspacesim/pioneer/issues/3712
e1ebe7b
#rm -f contrib/lua/lua.h
e1ebe7b
#rm -f contrib/lua/lauxlib.h
e1ebe7b
#rm -f contrib/lua/lua.hpp
e1ebe7b
#rm -f contrib/lua/luaconf.h
e1ebe7b
#rm -f contrib/lua/lualib.h
e1ebe7b
e1ebe7b
## Set NaturalDocs name
e1ebe7b
sed -e 's|naturaldocs|NaturalDocs|g' -i Makefile.am
e1ebe7b
6a11d65
%ifarch aarch64
6a11d65
sed -e '/^SUBDIRS/s/ profiler//' -i.bak contrib/Makefile.am
6a11d65
sed -e '/libjson.a/s| \\|| ; /libprofiler.a/d' -i.p.bak src/Makefile.am
6a11d65
sed -e '/contrib\/profiler/d' -i.p.bak configure.ac
6a11d65
sed -e 's/defined(__arm__)/(& || defined(__aarch64__))/' -i.bak contrib/profiler/Profiler.h
6a11d65
%endif
6a11d65
e1ebe7b
%build
e1ebe7b
./bootstrap
e1ebe7b
e1ebe7b
%configure --disable-silent-rules --with-ccache --without-strip \
e1ebe7b
 --with-version --with-extra-version --without-extra-warnings \
e1ebe7b
 --without-thirdparty --without-external-liblua --with-no-optimise \
f593eae
 PIONEER_DATA_DIR=%{_datadir}/%{name}
b687bd8
e1ebe7b
b687bd8
make %{?_smp_mflags} V=1 OPTIMISE=""
e1ebe7b
e1ebe7b
## Build documentation
e1ebe7b
make codedoc
e1ebe7b
pushd doxygen
e1ebe7b
doxygen
e1ebe7b
e1ebe7b
%install
e1ebe7b
%make_install
e1ebe7b
e1ebe7b
## Remove rpaths
e1ebe7b
chrpath -d %{buildroot}%{_bindir}/%{name}
e1ebe7b
chrpath -d %{buildroot}%{_bindir}/modelcompiler
e1ebe7b
e1ebe7b
## Install icons
e1ebe7b
mkdir -p %{buildroot}%{_datadir}/icons/%{name}
e1ebe7b
install -pm 644 application-icon/*.ico %{buildroot}%{_datadir}/icons/%{name}
e1ebe7b
mkdir -p %{buildroot}%{_datadir}/icons/hicolor/scalable/apps
e1ebe7b
install -pm 644 application-icon/badge-* %{buildroot}%{_datadir}/icons/hicolor/scalable/apps
e1ebe7b
e1ebe7b
mkdir -p %{buildroot}%{_datadir}/icons/hicolor/16x16/apps
e1ebe7b
mkdir -p %{buildroot}%{_datadir}/icons/hicolor/22x22/apps
e1ebe7b
mkdir -p %{buildroot}%{_datadir}/icons/hicolor/24x24/apps
e1ebe7b
mkdir -p %{buildroot}%{_datadir}/icons/hicolor/32x32/apps
e1ebe7b
mkdir -p %{buildroot}%{_datadir}/icons/hicolor/40x40/apps
e1ebe7b
mkdir -p %{buildroot}%{_datadir}/icons/hicolor/48x48/apps
e1ebe7b
mkdir -p %{buildroot}%{_datadir}/icons/hicolor/64x64/apps
e1ebe7b
mkdir -p %{buildroot}%{_datadir}/icons/hicolor/128x128/apps
e1ebe7b
mkdir -p %{buildroot}%{_datadir}/icons/hicolor/256x256/apps
e1ebe7b
install -Dpm 644 application-icon/pngs/%{name}-16x16.png %{buildroot}%{_datadir}/icons/hicolor/16x16/apps
e1ebe7b
install -Dpm 644 application-icon/pngs/%{name}-22x22.png %{buildroot}%{_datadir}/icons/hicolor/22x22/apps
e1ebe7b
install -Dpm 644 application-icon/pngs/%{name}-24x24.png %{buildroot}%{_datadir}/icons/hicolor/24x24/apps
e1ebe7b
install -Dpm 644 application-icon/pngs/%{name}-32x32.png %{buildroot}%{_datadir}/icons/hicolor/32x32/apps
e1ebe7b
install -Dpm 644 application-icon/pngs/%{name}-40x40.png %{buildroot}%{_datadir}/icons/hicolor/40x40/apps
e1ebe7b
install -Dpm 644 application-icon/pngs/%{name}-48x48.png %{buildroot}%{_datadir}/icons/hicolor/48x48/apps
e1ebe7b
install -Dpm 644 application-icon/pngs/%{name}-64x64.png %{buildroot}%{_datadir}/icons/hicolor/64x64/apps
e1ebe7b
install -Dpm 644 application-icon/pngs/%{name}-128x128.png %{buildroot}%{_datadir}/icons/hicolor/128x128/apps
e1ebe7b
install -Dpm 644 application-icon/pngs/%{name}-256x256.png %{buildroot}%{_datadir}/icons/hicolor/256x256/apps
e1ebe7b
e1ebe7b
## Install desktop file
e1ebe7b
mkdir -p %{buildroot}%{_datadir}/applications
e1ebe7b
desktop-file-install %{SOURCE1} --dir=%{buildroot}%{_datadir}/applications
e1ebe7b
e1ebe7b
## Install appdata file
e1ebe7b
mkdir -p %{buildroot}%{_datadir}/appdata
e1ebe7b
install -pm 644 %{SOURCE2} %{buildroot}%{_datadir}/appdata
e1ebe7b
appstream-util validate-relax --nonet %{buildroot}%{_datadir}/appdata/*.appdata.xml
e1ebe7b
e1ebe7b
## Remove empty directories
e1ebe7b
find %{buildroot} -name '.gitignore' -exec rm -rf {} ';'
e1ebe7b
e1ebe7b
## Unbundle DejaVuSans.ttf, DejaVuSansMono.ttf and wqy-microhei.ttc
e1ebe7b
mkdir -p %{buildroot}%{_fontdir}
e1ebe7b
mv %{buildroot}%{_datadir}/%{name}/fonts/Inpionata.ttf %{buildroot}%{_fontdir}
e1ebe7b
mv %{buildroot}%{_datadir}/%{name}/fonts/Orbiteer-Bold.ttf %{buildroot}%{_fontdir}
e1ebe7b
mv %{buildroot}%{_datadir}/%{name}/fonts/PionilliumText22L-Medium.ttf %{buildroot}%{_fontdir}
e1ebe7b
e1ebe7b
ln -sf %{_fontdir}/Inpionata.ttf %{buildroot}%{_datadir}/%{name}/fonts/Inpionata.ttf
e1ebe7b
ln -sf %{_fontdir}/Orbiteer-Bold.ttf %{buildroot}%{_datadir}/%{name}/fonts/Orbiteer-Bold.ttf
e1ebe7b
ln -sf %{_fontdir}/PionilliumText22L-Medium.ttf %{buildroot}%{_datadir}/%{name}/fonts/PionilliumText22L-Medium.ttf
e1ebe7b
e1ebe7b
ln -sf %{_fontbasedir}/wqy-microhei/wqy-microhei.ttc %{buildroot}%{_datadir}/%{name}/fonts/wqy-microhei.ttc
e1ebe7b
ln -sf %{_fontbasedir}/dejavu/DejaVuSansMono.ttf %{buildroot}%{_datadir}/%{name}/fonts/DejaVuSansMono.ttf
e1ebe7b
ln -sf %{_fontbasedir}/dejavu/DejaVuSans.ttf %{buildroot}%{_datadir}/%{name}/fonts/DejaVuSans.ttf
e1ebe7b
e1ebe7b
%post
e1ebe7b
/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
e1ebe7b
e1ebe7b
%postun
e1ebe7b
if [ $1 -eq 0 ] ; then
e1ebe7b
    /bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null
e1ebe7b
    /usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
e1ebe7b
fi
e1ebe7b
e1ebe7b
%posttrans
e1ebe7b
/usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
e1ebe7b
e1ebe7b
%files
e1ebe7b
%{_bindir}/%{name}
e1ebe7b
%{_bindir}/modelcompiler
e1ebe7b
%{_datadir}/icons/hicolor/16x16/apps/*.png
e1ebe7b
%{_datadir}/icons/hicolor/22x22/apps/*.png
e1ebe7b
%{_datadir}/icons/hicolor/24x24/apps/*.png
e1ebe7b
%{_datadir}/icons/hicolor/32x32/apps/*.png
e1ebe7b
## Following directories are not owned by hicolor-icon-theme
e1ebe7b
%dir %{_datadir}/icons/hicolor/40x40
e1ebe7b
%dir %{_datadir}/icons/hicolor/40x40/apps
e1ebe7b
##
e1ebe7b
%{_datadir}/icons/hicolor/40x40/apps/*.png
e1ebe7b
%{_datadir}/icons/hicolor/48x48/apps/*.png
e1ebe7b
%{_datadir}/icons/hicolor/64x64/apps/*.png
e1ebe7b
%{_datadir}/icons/hicolor/128x128/apps/*.png
e1ebe7b
%{_datadir}/icons/hicolor/256x256/apps/*.png
e1ebe7b
%{_datadir}/icons/hicolor/scalable/apps/*.svg
e1ebe7b
%{_datadir}/icons/%{name}/
e1ebe7b
%{_datadir}/applications/*.desktop
e1ebe7b
%{_datadir}/appdata/*.appdata.xml
e1ebe7b
e1ebe7b
%files data
e1ebe7b
%license licenses/GPL-3.txt licenses/*.html licenses/CC-BY-SA-3.0.txt licenses/DejaVu-license.txt
e1ebe7b
%doc AUTHORS.txt Changelog.txt Quickstart.txt README.md
e1ebe7b
%{_datadir}/%{name}/
e1ebe7b
e1ebe7b
%files doc
e1ebe7b
%license licenses/GPL-3.txt
e1ebe7b
%doc doxygen/html AUTHORS.txt README.md codedoc
e1ebe7b
e1ebe7b
%_font_pkg -n inpionata Inpionata.ttf
e1ebe7b
%license licenses/SIL-1.1.txt
e1ebe7b
%dir %{_fontdir}
e1ebe7b
e1ebe7b
%_font_pkg -n orbiteer-bold Orbiteer-Bold.ttf
e1ebe7b
%license licenses/SIL-1.1.txt
e1ebe7b
%dir %{_fontdir}
e1ebe7b
e1ebe7b
%_font_pkg -n pionilliumtext22l-medium PionilliumText22L-Medium.ttf
e1ebe7b
%license licenses/SIL-1.1.txt
e1ebe7b
%dir %{_fontdir}
e1ebe7b
e1ebe7b
%changelog
4970cfc
* Tue Jul 19 2016 Ben Rosser <rosser.bjr@gmail.com> 20160710-1
4970cfc
- Update to latest release
4970cfc
23b5635
* Sat Jul 09 2016 Antonio Trande <sagitterATfedoraproject.org>  20160701-2
23b5635
- Fix typos in the appdata file
23b5635
f593eae
* Sat Jul 09 2016 Antonio Trande <sagitterATfedoraproject.org>  20160701-1
f593eae
- Update to release 20160701
f593eae
f593eae
* Sun Jun 12 2016 Antonio Trande <sagitterATfedoraproject.org>  20160512-6
f593eae
- Patched for EXTRA_CXXFLAGS
f593eae
6a11d65
* Thu Jun 02 2016 Antonio Trande <sagitterATfedoraproject.org>  20160512-5
6a11d65
- Patched for aarch64 build
6a11d65
b687bd8
* Thu Jun 02 2016 Antonio Trande <sagitterATfedoraproject.org>  20160512-4
b687bd8
- hardened_builds flags enabled
b687bd8
- assimp libraries linked manually
b687bd8
e1ebe7b
* Sat May 28 2016 Antonio Trande <sagitterATfedoraproject.org>  20160512-3
e1ebe7b
- Unbundle DejaVuSans.ttf DejaVuSansMono.ttf wqy-microhei.ttc font files
e1ebe7b
- Made Inpionata Orbiteer-Bold PionilliumText22L-Medium fonts sub-packages
e1ebe7b
e1ebe7b
* Fri May 27 2016 Antonio Trande <sagitterATfedoraproject.org>  20160512-2
e1ebe7b
- Made /usr/share/icons/hicolor/40x40 owned
e1ebe7b
- Replace Summary
e1ebe7b
- Made a doc sub-package
e1ebe7b
e1ebe7b
* Fri May 20 2016 Antonio Trande <sagitterATfedoraproject.org>  20160512-1
e1ebe7b
- First package