Hi,
I would like to know how I might write a spec file for Atom that is suitable for the OBS. This may seem like a duplicate of this question, but that question was me looking for any solution that gave me an RPM package locally that I could install. This question is me asking whether and how I can setup an OBS repository that can build Atom, despite the fact that the OBS does not give spec files access to the Internet during the build. See I suspect it might be possible if I provide all the node modules, apm modules and the electron package source code, required for the build of Atom. I have done a Google Search and found a few similar questions to this one, including this issue at Atom’s GitHub repository, but the answers have all been written for people that have an excellent knowledge of both spec files and npm, which I do not have. If it helps here is the spec file I have successfully used to build the latest stable release of Atom (1.5.2), with an Internet connection:
Name: atom
Version: 1.5.2
Release: 0
Summary: A hackable text editor for the 21st century
License: MIT
Group: Productivity/Publishing/Other
Url: https://atom.io/
Source0: v%{version}.tar.gz
Source1: atom.desktop
BuildRequires: git-core
BuildRequires: hicolor-icon-theme
BuildRequires: npm
BuildRequires: nodejs-packaging
BuildRequires: libgnome-keyring-devel
BuildRequires: python-setuptools
BuildRequires: update-desktop-files
# MANUAL BEGIN
Requires: nodejs
Requires: python-http-parser
# MANUAL END
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%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.
%prep
%setup -q
%build
# Hardened package
export CFLAGS="%{optflags} -fPIC -pie"
export CXXFLAGS="%{optflags} -fPIC -pie"
until ./script/build 2>&1; do :; done
%install
script/grunt install --install-dir "%{buildroot}%{_prefix}"
# copy over icons in sizes that most desktop environments like
for i in 1024 512 256 128 64 48 32 24 16; do
install -Dm 0644 /tmp/atom-build/icons/${i}.png \
%{buildroot}%{_datadir}/icons/hicolor/${i}x${i}/apps/%{name}.png
done
install -Dm 0644 %{S:1} %{buildroot}%{_datadir}/applications/atom.desktop
%suse_update_desktop_file %{name}
%post
%desktop_database_post
%icon_theme_cache_post
%postun
%desktop_database_postun
%icon_theme_cache_postun
%files
%defattr(-,root,root,-)
%doc CONTRIBUTING.md README.md docs/
%{license} LICENSE.md
%{_bindir}/atom
%{_bindir}/apm
%dir %{_datadir}/atom
%{_datadir}/atom/*
%{_datadir}/atom
%{_datadir}/applications/atom.desktop
%{_datadir}/icons/hicolor/*/apps/%{name}.png
%exclude %{_datadir}/%{name}/libgcrypt.so.*
%exclude %{_datadir}/%{name}/libnotify.so.*
%changelog
Thanks for your time,
Brenton