diff --git a/apfel.changes b/apfel.changes index 693abc2..3ad8e49 100644 --- a/apfel.changes +++ b/apfel.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Sat Apr 19 23:21:37 UTC 2014 - badshah400@gmail.com + +- Build and install hicolor icons (introduces a BuildRequires on + hicolor-icon-theme) and desktop menu entry. + ------------------------------------------------------------------- Sun Apr 13 21:16:25 UTC 2014 - badshah400@gmail.com diff --git a/apfelgui.changes b/apfelgui.changes index 693abc2..3ad8e49 100644 --- a/apfelgui.changes +++ b/apfelgui.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Sat Apr 19 23:21:37 UTC 2014 - badshah400@gmail.com + +- Build and install hicolor icons (introduces a BuildRequires on + hicolor-icon-theme) and desktop menu entry. + ------------------------------------------------------------------- Sun Apr 13 21:16:25 UTC 2014 - badshah400@gmail.com diff --git a/apfelgui.spec b/apfelgui.spec index a5abade..dfb6a42 100644 --- a/apfelgui.spec +++ b/apfelgui.spec @@ -29,6 +29,8 @@ Source: http://apfel.hepforge.org/downloads/%{bname}-%{version}.tar.gz BuildRequires: apfel-devel = %{version} BuildRequires: gcc-c++ BuildRequires: gcc-fortran +BuildRequires: hicolor-icon-theme +BuildRequires: ImageMagick BuildRequires: lhapdf-devel <= 5.9.1 BuildRequires: libqt4-devel BuildRequires: libroot-core-devel @@ -64,6 +66,8 @@ Requires: python-apfel = %{version} Requires: root-plugin-graf2d-asimage-devel Requires: root-plugin-hist-histpainter-devel Requires: root-ttf +Requires(post): update-desktop-files +Requires(postun): update-desktop-files BuildRoot: %{_tmppath}/%{name}-%{version}-build %description @@ -85,8 +89,43 @@ make %{?_smp_mflags} # make_install script is broken install -D apfelgui %{buildroot}%{_bindir}/apfelgui +# Build and install hicolor icons +for i in 24 32 48 64 128 256; +do + convert -geometry ${i}x resources/logo.png %{name}-${i}.png + install -Dm0644 \ + %{name}-${i}.png \ + %{buildroot}%{_datadir}/icons/hicolor/${i}x${i}/apps/%{name}.png +done + +# Create and install desktop menu file +cat << EOF > %{name}.desktop +[Desktop Entry] +Encoding=UTF-8 +Name=ApfelGUI +GenericName=Parton Distribution Function Evolution Utility +Comment=Plotting Parton Distributions, luminosity and DIS observables +Exec=apfelgui +Icon=apfelgui +Terminal=false +Type=Application +Categories=Graphics;2DGraphics; +EOF + +install -Dm0644 %{name}.desktop %{buildroot}%{_datadir}/applications/%{name}.desktop + +%post +%icon_theme_cache_post +%desktop_database_post + +%postun +%icon_theme_cache_postun +%desktop_database_postun + %files %defattr(-,root,root) %{_bindir}/apfelgui +%{_datadir}/icons/hicolor/*/apps/%{name}.png +%{_datadir}/applications/%{name}.desktop %changelog diff --git a/apfelgui.spec.in b/apfelgui.spec.in index 31142ba..b034fc6 100644 --- a/apfelgui.spec.in +++ b/apfelgui.spec.in @@ -29,6 +29,8 @@ Source: http://apfel.hepforge.org/downloads/%{bname}-%{version}.tar.gz BuildRequires: apfel-devel = %{version} BuildRequires: gcc-c++ BuildRequires: gcc-fortran +BuildRequires: hicolor-icon-theme +BuildRequires: ImageMagick BuildRequires: lhapdf-devel <= 5.9.1 BuildRequires: libqt4-devel BuildRequires: libroot-core-devel @@ -64,6 +66,8 @@ Requires: python-apfel = %{version} Requires: root-plugin-graf2d-asimage-devel Requires: root-plugin-hist-histpainter-devel Requires: root-ttf +Requires(post): update-desktop-files +Requires(postun): update-desktop-files BuildRoot: %{_tmppath}/%{name}-%{version}-build %description @@ -85,8 +89,43 @@ make %{?_smp_mflags} # make_install script is broken install -D apfelgui %{buildroot}%{_bindir}/apfelgui +# Build and install hicolor icons +for i in 24 32 48 64 128 256; +do + convert -geometry ${i}x resources/logo.png %{name}-${i}.png + install -Dm0644 \ + %{name}-${i}.png \ + %{buildroot}%{_datadir}/icons/hicolor/${i}x${i}/apps/%{name}.png +done + +# Create and install desktop menu file +cat << EOF > %{name}.desktop +[Desktop Entry] +Encoding=UTF-8 +Name=ApfelGUI +GenericName=Parton Distribution Function Evolution Utility +Comment=Plotting Parton Distributions, luminosity and DIS observables +Exec=apfelgui +Icon=apfelgui +Terminal=false +Type=Application +Categories=Graphics;2DGraphics; +EOF + +install -Dm0644 %{name}.desktop %{buildroot}%{_datadir}/applications/%{name}.desktop + +%post +%icon_theme_cache_post +%desktop_database_post + +%postun +%icon_theme_cache_postun +%desktop_database_postun + %files %defattr(-,root,root) %{_bindir}/apfelgui +%{_datadir}/icons/hicolor/*/apps/%{name}.png +%{_datadir}/applications/%{name}.desktop %changelog