From 15b897c4e633866fa5e8fcc84e7edd895295e9513651eb8a3b921d0331d22d7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ismail=20D=C3=B6nmez?= Date: Mon, 29 Sep 2014 10:57:13 +0000 Subject: [PATCH] Accepting request 252646 from home:Zaitor:branches:editors Add high def svg, so we can have a nice looking icon for gvim in gnome-shell overview. OBS-URL: https://build.opensuse.org/request/show/252646 OBS-URL: https://build.opensuse.org/package/show/editors/vim?expand=0&rev=234 --- .gitattributes | 2 ++ gvim.svg | 3 +++ vim.changes | 10 ++++++++++ vim.spec | 21 ++++++++++++++++++--- 4 files changed, 33 insertions(+), 3 deletions(-) create mode 100644 gvim.svg diff --git a/.gitattributes b/.gitattributes index 9b03811..4e2cb74 100644 --- a/.gitattributes +++ b/.gitattributes @@ -21,3 +21,5 @@ *.xz filter=lfs diff=lfs merge=lfs -text *.zip filter=lfs diff=lfs merge=lfs -text *.zst filter=lfs diff=lfs merge=lfs -text +## Specific LFS patterns +gvim.svg filter=lfs diff=lfs merge=lfs -text diff --git a/gvim.svg b/gvim.svg new file mode 100644 index 0000000..ce39950 --- /dev/null +++ b/gvim.svg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:de721437216546d343c9a6d920495c84f6ed8c56e9388d828a48cc7d3f8e89a3 +size 9566 diff --git a/vim.changes b/vim.changes index 1d48748..a8f1b99 100644 --- a/vim.changes +++ b/vim.changes @@ -1,3 +1,13 @@ +------------------------------------------------------------------- +Fri Sep 26 09:51:50 UTC 2014 - zaitor@opensuse.org + +- Add gvim.svg as Source24, taken from gnome-colors-icon-theme. + Convert the svg to all relevant hicolor sizes, and install them. +- Add rsvg-view BuildRequires: Needed to do the above conversion. +- Call relevant macros in %post/%postun: + + %icon_theme_cache_post/postun because the package ships themed + icons. + ------------------------------------------------------------------- Fri Sep 12 12:39:19 UTC 2014 - opensuse@cboltz.de diff --git a/vim.spec b/vim.spec index 9ce4489..60e61ed 100644 --- a/vim.spec +++ b/vim.spec @@ -44,6 +44,8 @@ BuildRequires: perl BuildRequires: pkgconfig BuildRequires: python-devel BuildRequires: python3-devel +# Needed to convert svg to png +BuildRequires: rsvg-view BuildRequires: ruby-devel BuildRequires: update-desktop-files # @@ -87,6 +89,7 @@ Source18: missing-vim-client Source19: gvim.desktop Source20: spec.skeleton Source23: apparmor.vim +Source24: gvim.svg Source99: %{name}-7.4-rpmlintrc Patch3: %{name}-7.4-disable_lang_no.patch Patch4: %{name}-7.3-gvimrc_fontset.patch @@ -239,9 +242,15 @@ sed -i -e 's|define HAVE_DATE_TIME 1|undef HAVE_DATE_TIME|' src/auto/config.h gcc %{optflags} %{SOURCE13} -o vitmp %install -# create icon directory to have the icon from the tarball installed -install -d -m 0755 %{buildroot}%{_datadir}/icons/hicolor/48x48/apps %makeinstall STRIP=: +# create icon directory to have the icons installed and convert them to all hicolor expected sizes. +for size in %{_datadir}/icons/hicolor/*[0-9]x[0-9]*; do + SIZE=$(echo $size | awk -Fx {'print $2}') + install -d -m 0755 %{buildroot}%{_datadir}/icons/hicolor/${SIZE}x${SIZE}/apps + rsvg-convert -h ${SIZE} -w ${SIZE} %{S:24} -o %{buildroot}%{_datadir}/icons/hicolor/${SIZE}x${SIZE}/apps/gvim.png +done +install -d -m 0755 %{buildroot}%{_datadir}/icons/hicolor/scalable/apps +install -m 0644 %{SOURCE24} %{buildroot}%{_datadir}/icons/hicolor/scalable/apps/gvim.svg # the last installed binary is gvim. preserve it and # fix its symlinks. e* was added here as it doesnt make much sense in @@ -342,6 +351,12 @@ trap "printf '\e[r'" EXIT # Look for "TEST FAILURE" in the build log make test +%post -n gvim +%icon_theme_cache_post + +%postun -n gvim +%icon_theme_cache_postun + %files %defattr(-,root,root,-) %config(noreplace) %{_sysconfdir}/vimrc @@ -489,7 +504,7 @@ make test %{_bindir}/rgvim # menu icon %{_datadir}/applications/gvim.desktop -%{_datadir}/icons/hicolor/48x48/apps/gvim.png +%{_datadir}/icons/hicolor/*/apps/gvim.* %doc %{_docdir}/gvim %changelog