Page 1 of 4 123 ... LastLast
Results 1 to 10 of 35

Thread: Atom spec file is not building an RPM or SRPM; why?

  1. #1
    Join Date
    Nov 2015
    Location
    Townsville, Australia
    Posts
    270

    Default Atom spec file is not building an RPM or SRPM; why?

    Hi,

    I have borrowed an Atom spec file from Fedora's COPR and tried to modify it to better fit openSUSE, here it is:
    Code:
    # https://copr.fedoraproject.org/coprs/helber/atom
    %{?nodejs_find_provides_and_requires}
    %global debug_package %{nil}
    %global _hardened_build 1
    %global __requires_exclude (libnode)
    %global npm_ver 2.7.6
    %global project atom
    %global repo %{project}
    
    
    # commit
    %global _commit 164201e7bba5681594ac80ef1430c3afd9b58911
    %global _shortcommit %(c=%{_commit}; echo ${c:0:7})
    
    
    Name:    atom
    Version: 1.4.3
    Release: 1
    Summary: A hackable text editor for the 21st century
    
    
    Group:   Applications/Editors
    License: MIT
    URL:     https://atom.io/
    Source0: https://github.com/atom/atom/archive/v%{version}.tar.gz
    
    
    BuildRequires: npm
    BuildRequires: nodejs-packaging
    BuildRequires: libgnome-keyring-devel
    BuildRequires: python-setuptools
    BuildRequires: git-core
    Requires:      nodejs
    Requires:      http-parser
    
    
    %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.
    
    
    Visit https://atom.io to learn more.
    
    
    %prep
    %setup -q
    
    
    %build
    # Hardened package
    export CFLAGS="%{optflags} -fPIC -pie"
    export CXXFLAGS="%{optflags} -fPIC -pie"
    ## Upgrade npm
    # Install new npm to INSTALL_PREFIX for build package
    npm config set registry="http://registry.npmjs.org/"
    npm config set ca ""
    npm config set strict-ssl false
    npm install -g --ca=null --prefix %{buildroot}%{_prefix} npm@%{npm_ver}
    # Export PATH to new npm version
    export PATH="%{buildroot}%{_bindir}:$PATH"
    until ./script/build 2>&1; do :; done
    
    
    %install
    script/grunt install --install-dir "%{buildroot}%{_prefix}"
    %{__sed} -i -e 's|=.*atom|=atom|g' -e 's|atom.png|atom|g' \
        %{buildroot}%{_datadir}/applications/atom.desktop
    
    
    # copy over icons in sizes that most desktop environments like
    for i in 1024 512 256 128 64 48 32 24 16; do
        install -D -m 0644 /tmp/atom-build/icons/${i}.png \
          %{buildroot}%{_datadir}/icons/hicolor/${i}x${i}/apps/%{name}.png
    done
    
    
    %post
    /bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null ||:
    /usr/bin/update-desktop-database -q ||:
    
    
    %postun
    if [ $1 -eq 0 ]; then
        /bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null ||:
        /usr/bin/gtk-update-icon-cache -f -t -q %{_datadir}/icons/hicolor ||:
    fi
    /usr/bin/update-desktop-database -q ||:
    
    
    %posttrans
    /usr/bin/gtk-update-icon-cache -f -t -q %{_datadir}/icons/hicolor ||:
    
    
    %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.*
    I followed the RPM build instructions at the Fedora Wiki as I was told to by the openSUSE Wiki. Then I ran:
    Code:
    rpmbuild -ba atom.spec
    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.

    Thanks for your time,
    Brenton

  2. #2
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    22,314
    Blog Entries
    15

    Default Re: Atom spec file is not building an RPM or SRPM; why?

    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.

    Else look at using OBS for building....
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    openSUSE Leap 42.2 (x86_64) GNOME 3.20.2
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  3. #3
    Join Date
    Nov 2015
    Location
    Townsville, Australia
    Posts
    270

    Default Re: Atom spec file is not building an RPM or SRPM; why?

    That Fedora Wiki's guide to building RPMs is what told me to build as the makerpm user, http://fedoraproject.org/wiki/How_to...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:
    Code:
    find . -name "*.log"
    from /home/makerpm/rpmbuild and it returned:
    Code:
    ./BUILD/atom-1.4.3/build/node_modules/grunt/node_modules/grunt-legacy-log/node_modules/underscore.string/libpeerconnection.log
    ./BUILD/atom-1.4.3/build/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/libpeerconnection.log
    ./BUILD/atom-1.4.3/node_modules/roaster/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/libpeerconnection.log
    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?

  4. #4
    Join Date
    Nov 2015
    Location
    Townsville, Australia
    Posts
    270

    Default Re: Atom spec file is not building an RPM or SRPM; why?

    Oh and if https://en.opensuse.org/openSUSE:Build_Service_Tutorial is the guide I should follow then, well I need some help. I have an ~/.oscrc file:
    Code:
    su-wrapper = sudo
    I also have the lines:
    Code:
    fusion809    ALL = NOPASSWD: /usr/bin/build
    fusion809    ALL = NOPASSWD: /usr/bin/osc
    in my /etc/sudoers file, yet running:
    Code:
    cd ~/OBS
    osc checkout home:fusion809
    returns:
    Code:
    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\n'

  5. #5
    Join Date
    Nov 2015
    Location
    Townsville, Australia
    Posts
    270

    Default Re: Atom spec file is not building an RPM or SRPM; why?

    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
    Code:
    osc checkout home:fusion809
    .

  6. #6
    Join Date
    Nov 2015
    Location
    Townsville, Australia
    Posts
    270

    Default Re: Atom spec file is not building an RPM or SRPM; why?

    Now I am getting the error:
    Code:
    Error: "/home/fusion809/OBS/home:fusion809" is not an osc package working copy.
    from running:
    Code:
    osc up home:fusion809
    , after running
    Code:
    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:
    Code:
    <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>

  7. #7
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    22,314
    Blog Entries
    15

    Default Re: Atom spec file is not building an RPM or SRPM; why?

    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;
    Code:
    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
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    openSUSE Leap 42.2 (x86_64) GNOME 3.20.2
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  8. #8
    Join Date
    Nov 2015
    Location
    Townsville, Australia
    Posts
    270

    Default Re: Atom spec file is not building an RPM or SRPM; why?

    Thanks, you've been very helpful. I experienced an error but it seemed to have been caused by errors in copying the spec file across from this forum.

  9. #9
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    22,314
    Blog Entries
    15

    Default Re: Atom spec file is not building an RPM or SRPM; why?

    Quote Originally Posted by fusion809 View Post
    Thanks, you've been very helpful. I experienced an error but it seemed to have been caused by errors in copying the spec file across from this forum.
    Hi
    Try this version then;
    http://paste.opensuse.org/view/raw/2e57057f
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    openSUSE Leap 42.2 (x86_64) GNOME 3.20.2
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  10. #10
    Join Date
    Nov 2015
    Location
    Townsville, Australia
    Posts
    270

    Default Re: Atom spec file is not building an RPM or SRPM; why?

    Thanks again, I managed to copy it across, but now errors are being encountered at the %install stage:
    Code:
    + 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.

Page 1 of 4 123 ... LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •