from /home/makerpm/rpmbuild/SPECS as the makerpm user (I logged in as makerpm by running su - makerpm). To my surprise, while I saw no error messages (the output so great in size that it could not fit in the 1,000 lines kept in memory by Konsole) no RPM or SRPM packages were built in /home/makerpm/rpmbuild/RPMS or /home/makerpm/rpmbuild/SRPMS, respectively. So I am here to ask why. I am new to openSUSE (sort of, I’ve been running it in VirtualBox VMs for several months now, but never run it on my physical machine until yesterday when I installed it on my hard drive, replacing Arch Linux, which I had only installed about a fortnight earlier, as I had experienced issues with it I failed to resolve), and I am hoping that this distro will be a keeper.
Hi
There should be a build log somewhere (not sure why you have a specific user to build rpms, build as user, install as root) or increase the amount of lines kept, I would have to guess it’s an error somewhere.
That Fedora Wiki’s guide to building RPMs is what told me to build as the makerpm user, http://fedoraproject.org/wiki/How_to_create_an_RPM_package, and it is referred to by the article I linked earlier at the openSUSE Wiki. Not sure why it is being linked to by the openSUSE Wiki, if there are superior methods to build RPM packages on openSUSE. Can’t find a build log, I ran:
not sure which log I should look at, that’s if any of these logs is the build log you mean I should look at. Guessing https://en.opensuse.org/openSUSE:Build_Service_Tutorial is what I should follow in order to try using the OBS method?
fusion809 ALL = NOPASSWD: /usr/bin/build
fusion809 ALL = NOPASSWD: /usr/bin/osc
in my /etc/sudoers file, yet running:
cd ~/OBS
osc checkout home:fusion809
returns:
Traceback (most recent call last):
File "/usr/bin/osc", line 41, in <module>
r = babysitter.run(osccli)
File "/usr/lib/python2.7/site-packages/osc/babysitter.py", line 61, in run
return prg.main(argv)
File "/usr/lib/python2.7/site-packages/osc/cmdln.py", line 335, in main
self.postoptparse()
File "/usr/lib/python2.7/site-packages/osc/commandline.py", line 136, in postoptparse
override_verbose = self.options.verbose)
File "/usr/lib/python2.7/site-packages/osc/conf.py", line 796, in get_config
cp = get_configParser(conffile)
File "/usr/lib/python2.7/site-packages/osc/conf.py", line 612, in get_configParser
get_configParser.cp.read(conffile)
File "/usr/lib64/python2.7/ConfigParser.py", line 305, in read
self._read(fp, filename)
File "/usr/lib/python2.7/site-packages/osc/OscConfigParser.py", line 281, in _read
raise configparser.MissingSectionHeaderError(fpname, lineno, line)
ConfigParser.MissingSectionHeaderError: File contains no section headers.
file: /home/fusion809/.oscrc, line: 1
'su-wrapper = sudo
'
Nvm, I merely needed to delete ~/.oscrc (the line that the openSUSE Wiki article told me to add is what was generating this error, so I edit the openSUSE Wiki accordingly) and re-run
Error: "/home/fusion809/OBS/home:fusion809" is not an osc package working copy.
from running:
osc up home:fusion809
, after running
osc meta pkg -e home:fusion809 atom
, filling in the title, description and name of the package. If it is relevant here is the .xml file generated by this osc meta command:
<package name="atom" project="home:fusion809">
<title>atom</title>
<description>Atom is a free and open-source text editor written in web languages such as CSS, HTML and JS. It is designed to be as customizable as it can be, while still being approachable to new users.</description>
</package>
Hi
Since it needs internet access to grab stuff, you need to build locally, you won’t be able to use OBS…
When building openSUSE rpms, we use a few different tools/macros, try with the following spec file;
Name: atom
Version: 1.4.3
Release: 0
Summary: A hackable text editor for the 21st century
License: MIT
Group: Productivity/Publishing/Other
Url: https://atom.io/
Source0: %{name}-%{version}.tar.gz
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
%suse_update_desktop_file %{name}
%post
%desktop_database_post
%postun
%desktop_database_postun
%files
%defattr(-,root,root,-)
%doc README.md docs/
%{license} LICENSE.md
%{_bindir}/atom
%{_bindir}/apm
%{dir} %{_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 again, I managed to copy it across, but now errors are being encountered at the %install stage:
+ QA_CHECK_RPATHS=1
+ case "${QA_CHECK_RPATHS:-}" in
+ /usr/lib/rpm/check-rpaths
+ /usr/lib/rpm/check-buildroot
/home/makerpm/rpmbuild/BUILDROOT/atom-1.4.3-0.x86_64/usr/share/applications/atom.desktop:Exec=/home/makerpm/rpmbuild/BUILDROOT/atom-1.4.3-0.x86_64/usr/share/atom/atom %U
/home/makerpm/rpmbuild/BUILDROOT/atom-1.4.3-0.x86_64/usr/share/applications/atom.desktop:Icon=/home/makerpm/rpmbuild/BUILDROOT/atom-1.4.3-0.x86_64/usr/share/atom/resources/app.asar.unpacked/resources/atom.png
Found '/home/makerpm/rpmbuild/BUILDROOT/atom-1.4.3-0.x86_64' in installed files; aborting
error: Bad exit status from /var/tmp/rpm-tmp.kTwfWa (%install)
RPM build errors:
Bad exit status from /var/tmp/rpm-tmp.kTwfWa (%install)
guessing this indicates that some of %{_sed} command will need to be run in the %prep stage on the atom.desktop file to make it suitable for the RPM.
It failed too, I’m afraid. I captured the output using:
rpmbuild -ba atom.spec > output.txt 2> errors.txt
output.txt is here (http://paste2.org/AdznFUtd) and errors.txt is here (http://paste2.org/W2008MeL). If there’s a better way to capture the output please tell me, I’m only using this method as it is the only one I know that gets all the output.
Hi malcomlewis, I’m afraid this issue has returned. Here is the spec file I was originally using:
Name: atom
Version: 1.5.1
Release: 0
Summary: A hackable text editor for the 21st century
License: MIT
Group: Productivity/Publishing/Other
Url: https://atom.io/
Source0: %{name}-%{version}.tar.gz
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
sed -i -e 's/<%= appName %>/Atom/g' \
-e "s/<%= description %>/%{description}/g" \
-e 's/<%= installDir %>/\/usr/g' \
-e 's|/usr/share/<%= appFileName %>/atom %U|/usr/bin/atom %U|g' \
-e 's/<%= iconPath %>/atom/g' \
-e 's|text/plain;|application/javascript;application/json;application/postscript;application/x-csh;application/x-desktop;application/x-httpd-eruby;application/x-httpd-php;application/x-httpd-php3;application/x-httpd-php4;application/x-httpd-php5;application/x-latex;application/x-msdos-program;application/x-ruby;application/x-sh;application/x-shellscript;application/x-sql;application/x-tcl;application/x-tex;application/xhtml+xml;application/xml;application/xml-dtd;application/xslt+xml;text/css;text/csv;text/html;text/plain;text/xml;text/xml-dtd;text/x-asm;text/x-bibtex;text/x-boo;text/x-c++;text/x-c++hdr;text/x-c++src;text/x-c;text/x-chdr;text/x-csh;text/x-csrc;text/x-dsrc;text/x-diff;text/x-eiffel;text/x-fortran;text/x-go;text/x-haskell;text/x-java;text/x-java-source;text/x-lua;text/x-makefile;text/x-markdown;text/x-objc;text/x-pascal;text/x-perl;text/x-php;text/x-python;text/x-ruby;text/x-scala;text/x-scheme;text/x-sh;text/x-tcl;text/x-tex;text/x-vala;text/yaml;|g' \
resources/linux/atom.desktop.in
%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
%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 README.md docs/
%{license} LICENSE.md
%{_bindir}/atom
%{_bindir}/apm
%dir %{_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
it returns this error:
WARNING: '/usr/lib/rpm/brp-desktop.data/suse-screensavers.menu' does not exist
WARNING: '/usr/lib/rpm/brp-desktop.data/applications-kmenuedit.menu' does not exist
WARNING: '/usr/lib/rpm/brp-desktop.data/custom.menu' does not exist
ERROR: No sufficient Category definition: /home/makerpm/rpmbuild/BUILDROOT/atom-1.5.1-0.x86_64//usr/share/applications/atom.desktop
Errors in installed desktop file detected. Please refer to http://en.opensuse.org/SUSE_Package_Conventions/RPM_Macros
error: Bad exit status from /var/tmp/rpm-tmp.MngPiD (%install)
now removing
%suse_update_desktop_file %{name}
from this spec file doesn’t fix it. The desktop file generated by the sed line is perfectly except the
-e "s/<%= description %>/%{description}/g" \
is not being parsed the way I was hoping it would (i.e., with <%= description %> being replaced with the description provided under %description in the spec file).
Thanks for your time, I really do appreciate it. I have read http://en.opensuse.org/SUSE_Package_Conventions/RPM_Macros but it didn’t help me as my desktop file is fine as it is (the %suse_update_desktop_file macro seems to make modifications to the desktop file), except for this sed issue.