%global gituser Aegisub %global gitname Aegisub %global commit f743d1411e09cbb2bd34ddd2d4b6738101fab710 %global shortcommit %(c=%{commit}; echo ${c:0:7}) %define with_oss %{nil} %define with_alsa %{nil} %define with_openal %{nil} %define with_pulseaudio %{nil} %define default_player %{nil} # 1 to enable, 0 to disable, %{nil} for default %define with_pulseaudio 1 # %{nil} for default %define default_player pulseaudio ################################################################################ %define wx_version_major 3 %define wx_version_minor 0 %define force_wx_gtk2 %{nil} %define force_wx_gtk2 1 ################################################################################ %define wx_version %{wx_version_major}.%{wx_version_minor} %define wx_name_postfix %{nil} %if 0%{?wx_version_major} >= 3 %if 0%{?wx_version_minor} == 0 %define wx_name_postfix %{wx_version_major} %else %define wx_name_postfix %{wx_version_major}%{wx_version_minor} %endif %endif # Force toolkit # e.g. gtk2 instead of gtk3 %define wx_toolkit %{nil} %if 0%{?force_wx_gtk2} %if 0%{?wx_version_major} >= 3 %if 0%{?wx_version_minor} == 0 %define wx_toolkit gtk2 %endif %endif %endif ################################################################################ %define doc_license %{nil} %define doc_license 1 %if 0%{?rhel}%{?fedora} %if 0%{?rhel} %if 0%{?rhel} < 7 %define doc_license 0 %endif %else %if 0%{?fedora} < 19 %define doc_license 0 %endif %endif %endif %define license_files LICENCE ################################################################################ Name: aegisub Version: 3.2.2 Release: 6%{?dist} Summary: Tool for creating and modifying subtitles #src/gl/ - MIT license. See src/gl/glext.h #src/MatroskaParser.(c|h) - Licensed to BSD like license with permission from the author. #universalchardet/ - MPL 1.1 License: BSD and MIT and MPLv1.1 URL: http://www.aegisub.org # https://github.com/Aegisub/Aegisub Source0: https://github.com/%{gituser}/%{gitname}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz Patch0: %{name}-pthread.patch ExclusiveArch: %{ix86} x86_64 armv7hl armv7hnl Requires: hicolor-icon-theme BuildRequires: gcc BuildRequires: gcc-c++ BuildRequires: automake #BuildRequires: wxWidgets-devel #BuildRequires: wxGTK3-devel %if "%{?wx_toolkit}" != "" BuildRequires: compat-wxGTK%{?wx_name_postfix}-%{wx_toolkit}-devel %else BuildRequires: wxGTK%{?wx_name_postfix}-devel %endif BuildRequires: openal-devel BuildRequires: portaudio-devel BuildRequires: pulseaudio-libs-devel BuildRequires: libass-devel #BuildRequires: ffmpeg-devel BuildRequires: ffms2-devel BuildRequires: fftw-devel BuildRequires: alsa-lib-devel BuildRequires: boost-devel BuildRequires: libicu-devel BuildRequires: mesa-libGL-devel BuildRequires: mesa-libGLU-devel BuildRequires: hunspell-devel BuildRequires: lua-devel #BuildRequires: compat-lua-devel BuildRequires: zlib-devel BuildRequires: libX11-devel BuildRequires: valgrind-devel BuildRequires: intltool BuildRequires: desktop-file-utils #Used for OpenAL tests during configure BuildRequires: libcxx-devel BuildRequires: freetype-devel #needed for the perl script downloading the additional documentation from wiki #for offline reading Requires: /usr/bin/perl perl(strict) perl(HTML::LinkExtor) perl(LWP) perl(File::Path) perl(utf8) perl(URI) perl(warnings) # https://fedoraproject.org/wiki/Packaging:Scriptlets # https://fedoraproject.org/wiki/PackagingDrafts/ScriptletSnippets # gtk-update-icon-cache #Requires(post): gtk-update-icon-cache Requires(postun): gtk-update-icon-cache Requires(posttrans): gtk-update-icon-cache # update-mime-database #Requires(post): shared-mime-info #Requires(postun): shared-mime-info #Requires(posttrans): shared-mime-info # update-desktop-database Requires(post): desktop-file-utils Requires(postun): desktop-file-utils #Requires(posttrans): desktop-file-utils # ldconfig #Requires(post): glibc #Requires(postun): glibc #Requires(posttrans): glibc %description Aegisub is a free, cross-platform open source tool for creating and modifying subtitles. Aegisub makes it quick and easy to time subtitles to audio, and features many powerful tools for styling them, including a built-in real-time video preview. %prep %autosetup -n %{gitname}-%{version} -p 1 %build #remove version postfix sed -i -e 's/aegisub-[0-9.]*/aegisub/g' configure %if 0%{wx_version_major} < 3 WXCONFIG="wx-config" %else WXCONFIG="wx-config-%{wx_version}" %endif export WXCONFIG %if "%{?wx_toolkit}" != "" if hash "${WXCONFIG}-%{?wx_toolkit}" >/dev/null 2>&1 ; then WXCONFIG="${WXCONFIG}-%{?wx_toolkit}" export WXCONFIG fi %endif %if "%{?wx_toolkit}" != "" sed -i -re 's!(^[[:blank:]]*WX_VERSION=`)(.*)(`[[:blank:]]*$)!\1\2 | sed -re "s|-.*||g" 2>/dev/null \3!' configure %endif %configure \ %if "%{?with_oss}" == "1" --with-oss \ %else %if "%{?with_oss}" == "0" --without-oss \ %endif %endif %if "%{?with_alsa}" == "1" --with-alsa \ %else %if "%{?with_alsa}" == "0" --without-alsa \ %endif %endif %if "%{?with_openal}" == "1" --with-openal \ %else %if "%{?with_openal}" == "0" --without-openal \ %endif %endif %if "%{?with_pulseaudio}" == "1" --with-libpulse \ %else %if "%{?with_pulseaudio}" == "0" --without-libpulse \ %endif %endif %if 0%{?default_player:1} %if "%{default_player}" != "%{nil}" --with-player-audio=%{default_player} \ %endif %endif --with-wx-config="${WXCONFIG}" %make_build %install %make_install desktop-file-validate "%{buildroot}/%{_datadir}/applications/%{name}.desktop" %find_lang "%{name}" %post update-desktop-database &>/dev/null ||: touch --no-create "%{_datadir}/icons/hicolor" &>/dev/null || : %postun update-desktop-database &>/dev/null ||: if [[ "${1}" -eq "0" ]] ; then touch --no-create "%{_datadir}/icons/hicolor" &>/dev/null gtk-update-icon-cache "%{_datadir}/icons/hicolor" &>/dev/null || : fi %posttrans gtk-update-icon-cache "%{_datadir}/icons/hicolor" &>/dev/null || : %files -f "%{name}.lang" %if 0%{?doc_license} %license %{license_files} %else %doc %{license_files} %endif %doc docs/* automation/demos/ automation/v4-docs/ %{_bindir}/%{name}* %{_datadir}/%{name} %{_datadir}/applications/%{name}.desktop %{_datadir}/icons/hicolor/*/apps/%{name}.* %changelog * Thu Nov 09 2017 Tomasz Tomasik - 3.2.2-6 - Small SPEC file cleanups - Use license macro - Update requirements - Update supported arches - Try compat-wxGTK3-gtk2 instead of wxGTK3 due problems with GTK 3.x - Rebuild for EL7 * Thu Sep 28 2017 Tomasz Tomasik - 3.2.2-5 - Backport changes from Russian Fedora - Use PulseAudio (instead of ALSA) as default audio player - Rebuild for EL7 * Fri Mar 24 2017 Leigh Scott - 3.2.2-4 - exclude ppc and aarch64 as the bundled luajit fails to build * Thu Sep 29 2016 Michal Ambroz - 3.2.2-3 - remove the version suffix from the commandline and lang catalog - addedd build dependency to libcxx-devel, used for openal detection * Wed Sep 28 2016 Michal Ambroz - 3.2.2-2 - addedd validation of the desktop file - removed buildroot cleanup - addedd requires on hicolor-icon-theme - added buildrequires on intltool * Fri Sep 9 2016 Michal Ambroz - 3.2.2-1 - initial build for Fedora