Build Service is building a pakage in /usr/local but checking in /usr

Hi!
There is a problem building an RPM with the Build Service. Everything goes OK until the check stage. The service installs files for the prefix /usr/local but tries to find them within /usr. Look for the package at https://build.opensuse.org/package/show?package=backitdown_11.4&project=home%3Asunders

Here is the .spec file:


#
# spec file for package backitdown (Version 1.0.93)
#
# Copyright 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright 2011 Alexander Belkov <m_sun@mail.ru>
#
# 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.
#
Summary: File Synchronization and Backup Utility
Name: backitdown
Version: 1.1.107.537
Release: 1
License: BSD
Group: System/Backup
Source: %name-%version.tar.bz2
URL: http://sourceforge.net/projects/backitdown/
Packager: Alexander Belkov <m_sun@mail.ru>
BuildRequires: bison bzip2 cpio db diffutils findutils glibc-devel glibc-locale groff gzip libstdc++ m4 make man popt procinfo timezone util-linux gcc-c++ libbz2-devel wxGTK wxGTK-devel bundle-lang-common-en bundle-lang-common-en sqlite3-devel update-desktop-files
AutoReqProv: on
Requires: sqlite3 wxGTK
BuildRoot: %{_tmppath}/%{name}-%{version}-build

%description
This application will help you synchronize folders or
files between different computers or storage devices.
You can also backup or restore files onto / from external
drives such as USB flash drives or hard-disks.
All you have to do is create a project and with
a few mouse clicks the job is done.

%prep
%setup -q

%build
export CFLAGS="$RPM_OPT_FLAGS" 
/bin/bash configure
make

%check
make check

%install
make install DESTDIR=$RPM_BUILD_ROOT
%find_lang %{name}
%suse_update_desktop_file backit System Backup

%clean
rm -rf $RPM_BUILD_ROOT

%files -f %{name}.lang
%defattr(-,root,root)
%{_bindir}/backit
%{_datadir}/applications/backit.desktop
%{_mandir}/*/*.gz

%dir %{_datadir}/backit/
%dir %{_datadir}/backit/help/
%dir %{_datadir}/backit/help/common/
%dir %{_datadir}/backit/help/en/
%dir %{_datadir}/backit/help/ru/

%{_datadir}/backit/log.xsl
%{_datadir}/backit/help/*/*.png
%{_datadir}/backit/help/common/styles.css
%{_datadir}/backit/help/*/*.hhc
%{_datadir}/backit/help/*/*.hhp
%{_datadir}/backit/help/*/*.gif
%{_datadir}/backit/help/*/*.htm
%{_datadir}/icons/hicolor/16x16/apps/backit.png
%{_datadir}/icons/hicolor/32x32/apps/backit.png
%{_datadir}/icons/hicolor/48x48/apps/backit.png
%{_datadir}/pixmaps/backit.png

%changelog
* Mon Jun 27 2011 m_sun@mail.ru
- update to 1.1.107.537
  * Fixed syncing only user-approved files
  * Added files filtering on synchronization approval dialog
* Sun Jun 26 2011 m_sun@mail.ru
- update to 1.1.101.515
  * Some locale fixes for RPM to be built
  * Because of packaging conflicts wxsqlite3 sources have been
    included to the project and linked statically

And building log excerpts follow:

make[3]: Entering directory `/usr/src/packages/BUILD/backitdown-1.1.107.537/src'
test -z "/usr/local/bin" || /bin/mkdir -p "/usr/src/packages/BUILDROOT/backitdown-1.1.107.537-5.1.i386/usr/local/bin"
  /bin/sh ../libtool   --mode=install /usr/bin/install -c backit '/usr/src/packages/BUILDROOT/backitdown-1.1.107.537-5.1.i386/usr/local/bin'
libtool: install: /usr/bin/install -c backit /usr/src/packages/BUILDROOT/backitdown-1.1.107.537-5.1.i386/usr/local/bin/backit
...
Processing files: backitdown-1.1.107.537-5.1.i586
error: File not found: /usr/src/packages/BUILDROOT/backitdown-1.1.107.537-5.1.i386/usr/bin/backit

Same projects is built for OpenSuSE 11.4 OK, but not in 11.3
Did I overlook something?

Misspelled the link - that one is built OK. The problem one is https://build.opensuse.org/package/show?package=backitdown&project=home%3Asunders

I remember that somewhere in the tutorials it says that RPM packages should not install executables under /usr/local/
Maybe that is the problem.

Hi
You need to change your configure…


configure --prefix=%{_prefix}

In the files section the %{_bindir} resolves to /usr/bin etc hence your error.

You can check all the configure options locally if you unpack the source and use;


configure --help

I remember that somewhere in the tutorials it says that RPM packages should not install executables under /usr/local/

Agree, but how to tell OBS not to install into /usr/local?

You need to change your configure…
Code:

configure --prefix=%{_prefix}

Thanks, malcolmlewis, I’ll try this. But I thought %{_prefix} was set to --prefix, not vice versa.
My first idea was to use


%files -f %{name}.lang
%defattr(-,root,root)
%{_prefix}/bin/backit
%{_prefix}/share/applications/backit.desktop

instead of


%files -f %{name}.lang
%defattr(-,root,root)
%{_bindir}/backit
%{_datadir}/applications/backit.desktop

Maybe that was the better option?

configure --prefix=%{_prefix}

That settled the matter.

By the way, analogical .spec for OpenSuSE 11.4 directs configuration differently:


%configure

I think that’s the reason it has been built without knocks-out.
Thanks anyone!

Hi
Correct, as OBS evolves (and openSUSE versions) things like
%configure, %make_install, %makeinstall etc take care of things. But if
your also wanting to build for SLE some won’t work as the macros used
have not been backported.

Using configure like you did would make it easier to use across
different releases and OS’s (eg Fedora). It all depends on your
requirements.

It’s always good to stooge around on the OBS and look at other spec
files to see how things are done.


Cheers Malcolm °¿° (Linux Counter #276890)
openSUSE 11.4 (x86_64) Kernel 2.6.37.6-0.5-desktop
up 1 day 19:21, 4 users, load average: 0.08, 0.03, 0.08
GPU GeForce 8600 GTS Silent - Driver Version: 270.41.06

I have similar problem with package Openshot 1.4.0, see https://build.opensuse.org/package/show?package=openshot&project=home%3Anobange. It fails and in the log you can see, that in BUILDROOT there’s path /usr/local for files, but it looks for them in /usr. Solution from previous posts can’t be applied here, because it’s Python app and there’s no configure script, only install.py. I can’t figure out where is the bug.

Hi
Patch the python setup.py via sed to replace the /usr/local/


Cheers Malcolm °¿° (Linux Counter #276890)
SUSE Linux Enterprise Desktop 11 (i586) Kernel 2.6.32.45-0.3-pae
up 22:07, 1 user, load average: 0.06, 0.04, 0.00
ASUS eeePC 1000HE ATOM N280 1.66GHz | GPU Mobile 945GM/GMS/GME

That’s the funniest thing, there’s no such text in this file. It must take it from somewhere else.

Hi
It’s on packman;
http://pmbs.links2linux.org/package/view_file?file=openshot.spec&package=openshot&project=Multimedia&srcmd5=1fb04168620cc6de77fc68dd516f2e33

Set the prefix option.


Cheers Malcolm °¿° (Linux Counter #276890)
openSUSE 11.4 (x86_64) Kernel 2.6.37.6-0.7-desktop
up 0:02, 3 users, load average: 0.55, 0.43, 0.18
GPU GeForce 8600 GTS Silent - Driver Version: 280.13

Thank you, now the package builds OK :slight_smile: