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
This commit is contained in:
Ismail Dönmez 2014-09-29 10:57:13 +00:00 committed by Git OBS Bridge
parent cf44ed411b
commit 15b897c4e6
4 changed files with 33 additions and 3 deletions

2
.gitattributes vendored
View File

@ -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

3
gvim.svg Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:de721437216546d343c9a6d920495c84f6ed8c56e9388d828a48cc7d3f8e89a3
size 9566

View File

@ -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

View File

@ -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