atom-bin/atom-bin.spec

100 lines
3.3 KiB
RPMSpec

Name: atom-bin
Version: 1.19.4
Release: 2mamba
Summary: A text editor that's modern, approachable, yet hackable to the core (upstream binary distribution)
Group: Graphical Desktop/Applications/Utilities
Vendor: openmamba
Distribution: openmamba
Packager: Silvan Calarco <silvan.calarco@mambasoft.it>
URL: https://atom.io/
## GITSOURCE https://github.com/atom/atom.git v1.5.3
Source: https://github.com/atom/atom/releases/download/v%{version}/atom-amd64.tar.gz
#Source: https://github.com/atom/atom.git/v%{version}/atom-%{version}.tar.bz2
License: MIT
## AUTOBUILDREQ-BEGIN
## AUTOBUILDREQ-END
BuildRoot: %{_tmppath}/%{name}-%{version}-root
%description
Atom is a text editor that's modern, approachable, yet hackable to the core—a tool you can customize to do anything but also use productively without ever touching a config file (upstream binary distribution).
%debug_package
%prep
%setup -q -n atom-%{version}-amd64
#sed -i -e "/exception-reporting/d" \
# -e "/metrics/d" package.json
#
#sed -e "s/<%= description %>/%{summary}/" \
# -e "s|<%= appName %>|Atom|"\
# -e "s|<%= installDir %>/share/<%= appFileName %>|%{_bindir}|"\
# -e "s|<%= iconPath %>|atom|"\
# resources/linux/atom.desktop.in > resources/linux/atom.desktop
%define _use_internal_dependency_generator 0
%define __find_provides %{_builddir}/atom-%{version}-amd64/find_provides.sh
cat > %{_builddir}/atom-%{version}-amd64/find_provides.sh <<_EOF
#! /bin/sh
grep -v %{buildroot}%{_datadir} | \
%{_prefix}/lib/rpm/find-provides %{buildroot} %{_target_cpu}
_EOF
chmod +x %{_builddir}/atom-%{version}-amd64/find_provides.sh
%define __find_requires %{_builddir}/atom-%{version}-amd64/find_requires.sh
cat > %{_builddir}/atom-%{version}-amd64/find_requires.sh <<_EOF
#! /bin/sh
%{_prefix}/lib/rpm/find-requires %{buildroot} %{_target_cpu} 2>/dev/null |
while read line; do
[ ! -f %{buildroot}%{_datadir}/atom-x86_64/\${line/\(*} ] && echo "\$line"
done
_EOF
chmod +x %{_builddir}/atom-%{version}-amd64/find_requires.sh
%build
%install
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
install -d -m0755 %{buildroot}%{_datadir}/atom-x86_64
cp -a * %{buildroot}%{_datadir}/atom-x86_64/
install -d -m0755 %{buildroot}%{_bindir}
ln -s %{_datadir}/atom-x86_64/atom %{buildroot}%{_bindir}/atom-x86_64
install -d -m0755 %{buildroot}%{_datadir}/applications
cat > %{buildroot}%{_datadir}/applications/atom-bin.desktop << _EOF
[Desktop Entry]
Name=Atom (upstream binary distribution)
GenericName=Text Editor
Exec=/usr/bin/atom-x86_64 %F
Icon=atom-bin
Type=Application
StartupNotify=true
Categories=GNOME;GTK;Utility;TextEditor;Development;
MimeType=text/plain;
_EOF
install -D -m0644 atom.png %{buildroot}%{_datadir}/pixmaps/atom-bin.png
%clean
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%files
%defattr(-,root,root)
%{_bindir}/atom-x86_64
%dir %{_datadir}/atom-x86_64
%{_datadir}/atom-x86_64/*
%{_datadir}/applications/atom-bin.desktop
%{_datadir}/pixmaps/atom-bin.png
%doc LICENSE
%changelog
* Wed Aug 30 2017 Silvan Calarco <silvan.calarco@mambasoft.it> 1.19.4-2mamba
- added desktop entry and icon
* Tue Aug 29 2017 Silvan Calarco <silvan.calarco@mambasoft.it> 1.19.4-1mamba
- package upstream binary distribution for x86_64 since there are problems building it from source