Package fails to build (mkdir permission denied)

Hi,

I am trying to build a package on obs (ricochet-im) but I keep getting the following error:


  119s] make[1]: Leaving directory '/home/abuild/rpmbuild/BUILD/ricochet-1.1.0'
  119s] + exit 0
  119s] Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.Cwitiu
  119s] + umask 022
  119s] + cd /home/abuild/rpmbuild/BUILD
  119s] + cd ricochet-1.1.0
  119s] + make install DESTDIR=/home/abuild/rpmbuild/BUILDROOT/ricochet-1.1.0-21.1.x86_64 -j3
  119s] make -f Makefile.Release install
  119s] make[1]: Entering directory '/home/abuild/rpmbuild/BUILD/ricochet-1.1.0'
  119s] install -m 644 -p /home/abuild/rpmbuild/BUILD/ricochet-1.1.0/src/ricochet.desktop /usr/share/applications/
  119s] mkdir: cannot create directory '/usr/share/icons/hicolor/48x48'install: cannot create regular file '/usr/share/applications/ricochet.desktop': Permission denied
  119s] : Permission deniedMakefile.Release:1293: recipe for target 'install_shortcut' failed
  119s] make[1]: [install_shortcut] Error 1 (ignored)
  119s] 
  119s] Makefile.Release:1302: recipe for target 'install_icon' failed
  119s] make[1]: *** [install_icon] Error 1
  119s] make[1]: *** Waiting for unfinished jobs....
  119s] mkdir: cannot create directory '/usr/share/icons/hicolor/scalable': Permission denied
  119s] Makefile.Release:1311: recipe for target 'install_scalable_icon' failed
  119s] make[1]: *** [install_scalable_icon] Error 1
  119s] install -m 755 -p "../../BUILDROOT/ricochet-1.1.0-21.1.x86_64/ricochet" "/usr/bin/ricochet"
  119s] install: cannot create regular file '/usr/bin/ricochet': Permission denied
  119s] Makefile.Release:1283: recipe for target 'install_target' failed
  119s] make[1]: [install_target] Error 1 (ignored)
  119s] /bin/true "/usr/bin/ricochet"
  119s] make[1]: Leaving directory '/home/abuild/rpmbuild/BUILD/ricochet-1.1.0'
  119s] Makefile:48: recipe for target 'release-install' failed
  119s] make: *** [release-install] Error 2
  119s] error: Bad exit status from /var/tmp/rpm-tmp.Cwitiu (%install)

Does anyone have an idea on how I can troubleshoot/resolve this? I tried supplying qmake with DESTDIR but that did not help.

Contents of spec file:


#
# spec file for package ricochet-im
#
# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

Name:           ricochet
Version:        1.1.0
Release:        1
License:        BSD-3-Clause
Summary:        Anonymous metadata-resistant instant messaging that just works
Url:            https://github.com/ricochet-im/ricochet/
#Group:
Source:         %{name}-%{version}-src.tar.bz2
#Patch:
BuildRequires:  gcc-c++
BuildRequires:  make
BuildRequires:  libopenssl-devel
BuildRequires:  protobuf-devel
BuildRequires:  libqt5-qtbase-devel
BuildRequires:  libqt5-qtdeclarative-devel
BuildRequires:  libqt5-qttools-devel
BuildRequires:  libqt5-qttools
BuildRequires:  libqt5-qtquickcontrols
BuildRequires:  libQt5Gui5
Requires:    tor
#PreReq:
#Provides:
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description

%prep
%setup -q

%build
lrelease-qt5 ricochet.pro
qmake-qt5 QMAKE_CFLAGS+="%optflags" QMAKE_CXXFLAGS+="%optflags" QMAKE_STRIP="/bin/true" DEFINES+=RICOCHET_NO_PORTABLE DESTDIR="%{buildroot}";
make %{?_smp_flags}

%install
make install DESTDIR="%{buildroot}" %{?_smp_mflags}

%post

%postun

%files
%defattr(-,root,root)
%doc AUTHORS.md README.md LICENSE BUILDING.md

Project is here: https://build.opensuse.org/package/show/home:alanbortu/ricochet-im

On Mon 04 May 2015 12:26:01 AM CDT, alanbortu wrote:

Hi,

I am trying to build a package on obs (ricochet-im) but I keep getting
the following error:

Code:

119s] make[1]: Leaving directory
‘/home/abuild/rpmbuild/BUILD/ricochet-1.1.0’ 119s] + exit 0
119s] Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.Cwitiu
119s] + umask 022
119s] + cd /home/abuild/rpmbuild/BUILD
119s] + cd ricochet-1.1.0
119s] + make install
DESTDIR=/home/abuild/rpmbuild/BUILDROOT/ricochet-1.1.0-21.1.x86_64 -j3
119s] make -f Makefile.Release install 119s] make[1]: Entering
directory ‘/home/abuild/rpmbuild/BUILD/ricochet-1.1.0’ 119s] install
-m 644
-p /home/abuild/rpmbuild/BUILD/ricochet-1.1.0/src/ricochet.desktop /usr/share/applications/
119s] mkdir: cannot create directory
'/usr/share/icons/hicolor/48x48’install: cannot create regular file
‘/usr/share/applications/ricochet.desktop’: Permission denied
119s] : Permission deniedMakefile.Release:1293: recipe for target
‘install_shortcut’ failed 119s] make[1]: [install_shortcut] Error 1
(ignored) 119s] 119s] Makefile.Release:1302: recipe for target
‘install_icon’ failed 119s] make[1]: *** [install_icon] Error 1
119s] make[1]: *** Waiting for unfinished jobs… 119s] mkdir:
cannot create directory ‘/usr/share/icons/hicolor/scalable’: Permission
denied 119s] Makefile.Release:1311: recipe for target
‘install_scalable_icon’ failed 119s] make[1]: ***
[install_scalable_icon] Error 1 119s] install -m 755 -p
“…/…/BUILDROOT/ricochet-1.1.0-21.1.x86_64/ricochet”
“/usr/bin/ricochet” 119s] install: cannot create regular file
‘/usr/bin/ricochet’: Permission denied 119s] Makefile.Release:1283:
recipe for target ‘install_target’ failed 119s] make[1]:
[install_target] Error 1 (ignored) 119s] /bin/true
“/usr/bin/ricochet” 119s] make[1]: Leaving directory
‘/home/abuild/rpmbuild/BUILD/ricochet-1.1.0’ 119s] Makefile:48:
recipe for target ‘release-install’ failed 119s] make: ***
[release-install] Error 2 119s] error: Bad exit status
from /var/tmp/rpm-tmp.Cwitiu (%install) --------------------

Does anyone have an idea on how I can troubleshoot/resolve this? I tried
supplying qmake with DESTDIR but that did not help.
Project is here:
Welcome - openSUSE Build Service

Hi
You need to modify the pro file to add DESTDIR, for an example see my
modifications to the imagwriter application;

If you still have issues, ping me back and will branch your package and
have a look.


Cheers Malcolm °¿° LFCS, SUSE Knowledge Partner (Linux Counter #276890)
SUSE Linux Enterprise Desktop 12 GNOME 3.10.1 Kernel 3.12.39-47-default
If you find this post helpful and are logged into the web interface,
please show your appreciation and click on the star below… Thanks!