Name:           <%= name %>
Version:        <%= version %>
Release:        0.1%{?dist}
Summary:        <%= description %>
License:        MIT
URL:            https://atom.io/
AutoReqProv:    no # Avoid libchromiumcontent.so missing dependency
Prefix:         <%= installDir %>

%description
<%= description %>

%install
mkdir -p %{buildroot}/<%= installDir %>/share/atom/
cp -r Atom/* %{buildroot}/<%= installDir %>/share/atom/
mkdir -p %{buildroot}/<%= installDir %>/bin/
ln -sf ../share/atom/resources/app/apm/node_modules/.bin/apm %{buildroot}/<%= installDir %>/bin/apm
cp atom.sh %{buildroot}/<%= installDir %>/bin/atom
chmod 755 %{buildroot}/<%= installDir %>/bin/atom
mkdir -p %{buildroot}/<%= installDir %>/share/applications/
cp atom.desktop %{buildroot}/<%= installDir %>/share/applications/

# copy over icons in sizes that most desktop environments like
for i in 1024 512 256 128 64 48 32 24 16
do
    mkdir -p %{buildroot}/<%= installDir %>/share/icons/hicolor/${i}x${i}/apps
    cp icons/${i}.png %{buildroot}/<%= installDir %>/share/icons/hicolor/${i}x${i}/apps/atom.png
done

%files
<%= installDir %>/bin/atom
<%= installDir %>/bin/apm
<%= installDir %>/share/atom/
<%= installDir %>/share/applications/atom.desktop
<%= installDir %>/share/icons/hicolor/
