Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

suggesting a rpm specfile #162

Open
ghost opened this issue Jul 5, 2019 · 2 comments
Open

suggesting a rpm specfile #162

ghost opened this issue Jul 5, 2019 · 2 comments

Comments

@ghost
Copy link

ghost commented Jul 5, 2019

Summary:	Elementary icons for xfce
Name:		elementary-xfce
Version:	0.13.1
Release:	%mkrel 1
License:	GPLv2+
Group:		Graphical desktop/XFCE
URL:		https://github.com/shimmerproject
### Source is just a empty folder named %{name}-%{version} to build from git-master ###
Source0:	https://github.com/shimmerproject/releases/%{name}-%{version}.tar.xz
### if you want build from released tarball ###
### Source should be https://github.com/shimmerproject/elementary-xfce/archive/v0.13.1.tar.gz ### 
BuildRequires: optipng

Requires:  gtk+3.0

%description
XFCE elementary icons from shimmerproject.org


%prep
### to build released : %setup -q -n %{name}-%{version} ###
%setup 
git clone https://github.com/shimmerproject/elementary-xfce.git

%build
# just if you build git-master #
cd elementary-xfce
# also a ./configure --prefix=/usr should work
%configure2_5x --prefix=/usr
%make

%install
rm -rf %buildroot
install -d %{buildroot}%{_datadir}/icons/%{name}
install -d %{buildroot}%{_docdir}/%{name}
install -d %{buildroot}%{_datadir}/pkgconfig

cd elementary-xfce

cp -f LICENSE AUTHORS README.md CONTRIBUTORS %{buildroot}%{_docdir}/%{name}/

%make DESTDIR=%{buildroot} install

# clean broken links	
rm -rf %{buildroot}%{_datadir}/icons/*/CONTRIBUTORS
rm -rf %{buildroot}%{_datadir}/icons/*/AUTHORS
rm -rf %{buildroot}%{_datadir}/icons/*/README.md

# icon-theme.caches would create with triggers
install -d %buildroot%{_var}/lib/rpm/filetriggers
cat > %buildroot%{_var}/lib/rpm/filetriggers/gtk-icon-cache-%{name}.filter << EOF
^./usr/share/icons/gnome/
EOF
cat > %buildroot%{_var}/lib/rpm/filetriggers/gtk-icon-cache-%{name}-dark.filter << EOF
^./usr/share/icons/gnome/
EOF
cat > %buildroot%{_var}/lib/rpm/filetriggers/gtk-icon-cache-%{name}-darker.filter << EOF
^./usr/share/icons/gnome/
EOF
cat > %buildroot%{_var}/lib/rpm/filetriggers/gtk-icon-cache-%{name}-darkest.filter << EOF
^./usr/share/icons/gnome/
EOF

cat > %buildroot%{_var}/lib/rpm/filetriggers/gtk-icon-cache-%{name}.script << EOF
#!/bin/sh
if [ -x /usr/bin/gtk-update-icon-cache ]; then 
  /usr/bin/gtk-update-icon-cache -f /usr/share/icons/%{name}
fi
EOF
cat > %buildroot%{_var}/lib/rpm/filetriggers/gtk-icon-cache-%{name}-dark.script << EOF
#!/bin/sh
if [ -x /usr/bin/gtk-update-icon-cache ]; then 
  /usr/bin/gtk-update-icon-cache -f /usr/share/icons/%{name}-dark
fi
EOF
cat > %buildroot%{_var}/lib/rpm/filetriggers/gtk-icon-cache-%{name}-darker.script << EOF
#!/bin/sh
if [ -x /usr/bin/gtk-update-icon-cache ]; then 
  /usr/bin/gtk-update-icon-cache -f /usr/share/icons/%{name}-darker
fi
EOF
cat > %buildroot%{_var}/lib/rpm/filetriggers/gtk-icon-cache-%{name}-darkest.script << EOF
#!/bin/sh
if [ -x /usr/bin/gtk-update-icon-cache ]; then 
  /usr/bin/gtk-update-icon-cache -f /usr/share/icons/%{name}-darkest
fi
EOF

# make a .pc file
%__cat > %{buildroot}%{_datadir}/pkgconfig/%{name}.pc <<EOF
Name: %{name}
Description: A collection of icons used for xfce themes
Version: %{version}
Requires: gtk+3.0
EOF

%clean
rm -rf %buildroot

%post
%update_icon_cache %{name}
%update_icon_cache %{name}-dark
%update_icon_cache %{name}-darker
%update_icon_cache %{name}-darkest

%postun
%clean_icon_cache %{name}*


%files
%defattr(-,root,root,-)
%{_docdir}/%{name}/*
%dir %{_datadir}/icons/%{name}*/
%{_datadir}/icons/%{name}*/*
%{_datadir}/pkgconfig/%{name}.pc
%{_var}/lib/rpm/filetriggers/gtk-icon-cache-*.*

%changelog
* Fri Jul 05 2019 onkelho <oh.quait at gmail.com> 0.13.1-1pclos2019
- release

just to help for packaging, build runs and install and uninstall works without errors,

@m4u9
Copy link
Member

m4u9 commented Jul 5, 2019

What is the purpose? Afaik RPM distros already package it

@ghost
Copy link
Author

ghost commented Jul 6, 2019

I forgot to say that it may be annoying to new package builders to remove the broken links in each subtopic (dark, darker, darkest,) first. But this is in the spec file.
Maybe you should have a spec.in file available here that indicates this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant