RPM error

I got the following error when trying to generate RPMs using OBS.


Install the project...
/usr/bin/cmake -P cmake_install.cmake
-- Install configuration: "Release"
-- Installing:  /var/tmp/maelys-server-1.2.1.13.1-build/usr/local/maelys/server/usr/local/maelys/server/libexec/maelys-master
-- Installing:  /var/tmp/maelys-server-1.2.1.13.1-build/usr/local/maelys/server/usr/local/maelys/server/libexec/maelys-monitor
-- Installing:  /var/tmp/maelys-server-1.2.1.13.1-build/usr/local/maelys/server/usr/local/maelys/server/libexec/maelys-storage
-- Installing:  /var/tmp/maelys-server-1.2.1.13.1-build/usr/local/maelys/server/usr/local/maelys/server/libexec/maelys-client-mgr
-- Installing:  /var/tmp/maelys-server-1.2.1.13.1-build/usr/local/maelys/server/usr/local/maelys/server/libexec/maelys-control-mgr
-- Installing:  /var/tmp/maelys-server-1.2.1.13.1-build/usr/local/maelys/server/usr/local/maelys/server/etc/server.conf
-- Installing:  /var/tmp/maelys-server-1.2.1.13.1-build/usr/local/maelys/server/usr/local/maelys/server/bin/master
-- Installing:  /var/tmp/maelys-server-1.2.1.13.1-build/usr/local/maelys/server/usr/local/maelys/server/var/server.lock
+ RPM_BUILD_ROOT=/var/tmp/maelys-server-1.2.1.13.1-build
+ export RPM_BUILD_ROOT
+ test -x /usr/sbin/Check -a 399 = 0 -o -x /usr/sbin/Check -a '!' -z  /var/tmp/maelys-server-1.2.1.13.1-build
+ echo 'I call /usr/sbin/Check...'
I call /usr/sbin/Check...
+ /usr/sbin/Check
Checking permissions and ownerships - using the permissions files
    /tmp/Check.perms.u45m7i
setting /var/tmp/maelys-server-1.2.1.13.1-build/ to root:root 0755.  (wrong owner/group abuild:abuild)
setting /var/tmp/maelys-server-1.2.1.13.1-build/usr to root:root 0755.  (wrong owner/group abuild:abuild)
+ /usr/lib/rpm/brp-compress
+ /usr/lib/rpm/brp-symlink
Processing files: maelys-server-1.2.1-13.1
error: File not found:  /var/tmp/maelys-server-1.2.1.13.1-build/usr/local/maelys/server/libexec/maelys-master
error: File not found:  /var/tmp/maelys-server-1.2.1.13.1-build/usr/local/maelys/server/libexec/maelys-monitor
error: File not found:  /var/tmp/maelys-server-1.2.1.13.1-build/usr/local/maelys/server/libexec/maelys-storage
error: File not found:  /var/tmp/maelys-server-1.2.1.13.1-build/usr/local/maelys/server/libexec/maelys-client-mgr
error: File not found:  /var/tmp/maelys-server-1.2.1.13.1-build/usr/local/maelys/server/libexec/maelys-control-mgr
error: File not found:  /var/tmp/maelys-server-1.2.1.13.1-build/usr/local/maelys/server/etc/server.conf
error: File not found:  /var/tmp/maelys-server-1.2.1.13.1-build/usr/local/maelys/server/bin/master
error: File not found:  /var/tmp/maelys-server-1.2.1.13.1-build/usr/local/maelys/server/var/server.lock
Checking for unpackaged file(s): /usr/lib/rpm/check-files  /var/tmp/maelys-server-1.2.1.13.1-build
error: Installed (but unpackaged) file(s) found:
   /usr/local/maelys/server/usr/local/maelys/server/bin/master
   /usr/local/maelys/server/usr/local/maelys/server/etc/server.conf
    /usr/local/maelys/server/usr/local/maelys/server/libexec/maelys-client-mgr
    /usr/local/maelys/server/usr/local/maelys/server/libexec/maelys-control-mgr
    /usr/local/maelys/server/usr/local/maelys/server/libexec/maelys-master
    /usr/local/maelys/server/usr/local/maelys/server/libexec/maelys-monitor
    /usr/local/maelys/server/usr/local/maelys/server/libexec/maelys-storage
   /usr/local/maelys/server/usr/local/maelys/server/var/server.lock

The sources seem to compile and install properly. But afterward there is an error and the build complains about missing files, although these files where said to be successfully installed earlier in the process.
Does anyone have an idea about what may be going wrong?

Thks.

Here’s the spec file


Name:           maelys-server
Version:        1.2.1
Release:        1
License:        BSD  
Source:         %{name}-%{version}.tar.gz
BuildRoot:      %{_tmppath}/%{name}-%{version}.%{release}-build
BuildRequires:  gcc-c++ glibc-devel libstdc++-devel cmake
Group:          System Environment/Daemons
Summary:        Serveur du système de gestion de cybercafé Maelys
Packager:	Thierry K. Feuzeu  <thierry.feuzeu@aledde.org>

%description  
Maelys est un système open source de gestion de cybercafé. Il est conçu pour être un outil grâce auquel, au delà de l accès à Internet, de nombreux services supplémentaires peuvent être fournis aux clients des cybercafés.

Maelys Server est le serveur du système de gestion de cybercafé Maelys.

%prep  
%setup -q
 
%build
cmake . -DWITHOUT_CORE=NO -DWITH_MYSQL=NO
make all

%install
make install DESTDIR=$RPM_BUILD_ROOT/usr/local/maelys/server

%clean  
#rm -rf "$RPM_BUILD_ROOT"  

%pre
groupadd maelys-users 2>/dev/null || true
useradd -d /usr/local/maelys/server -s /bin/false -g maelys-users -c "Maelys Server" maelys-server 2>/dev/null || true

%post
chown -R maelys-server:maelys-users /usr/local/maelys/server || true

%preun
true

%postun
userdel maelys-server >/dev/null 2>&1 || true
groupdel maelys-users >/dev/null 2>&1 || true

%files  
%defattr(-,maelys-server,maelys-users,-)
/usr/local/maelys/server/libexec/maelys-master
/usr/local/maelys/server/libexec/maelys-monitor
/usr/local/maelys/server/libexec/maelys-storage
/usr/local/maelys/server/libexec/maelys-client-mgr
/usr/local/maelys/server/libexec/maelys-control-mgr
/usr/local/maelys/server/etc/server.conf
/usr/local/maelys/server/bin/master
/usr/local/maelys/server/var/server.lock

Hi
So have you defined the file locations in the %files section?


Cheers Malcolm °¿° (Linux Counter #276890)
SUSE Linux Enterprise Desktop 11 (x86_64) Kernel 2.6.32.12-0.7-default
up 9:14, 2 users, load average: 0.01, 0.03, 0.00
GPU GeForce 8600 GTS Silent - Driver Version: 173.14.25

When I prefix the paths in the %files section with $RPM_BUILD_ROOT the build complains about missing ‘/’ at the beginning of the paths.

Hi
No %{buildroot} isn’t added in the %files section, look at using the
prefix %{_datadir} instead of /usr/local


Cheers Malcolm °¿° (Linux Counter #276890)
SUSE Linux Enterprise Desktop 11 (x86_64) Kernel 2.6.32.12-0.7-default
up 9:42, 2 users, load average: 0.06, 0.04, 0.00
GPU GeForce 8600 GTS Silent - Driver Version: 173.14.25

I solved the issue by replacing

make install DESTDIR=$RPM_BUILD_ROOT/usr/local/maelys/server

with

make install DESTDIR=$RPM_BUILD_ROOT

The problem occurs because CMake installs the files in $DESTDIR/$CMAKE_INSTALL_DIR, so it’s not necessary to add the install path to the destdir.

I have anoter problem now. I would like to know how to create a cmake based package for Ubuntu.
How can I trigger the installation of cmake in my environment?

Thks.

Hi
Probably better to ask over in the Ubuntu forum, have no idea how to
package up a deb…


Cheers Malcolm °¿° (Linux Counter #276890)
SUSE Linux Enterprise Desktop 11 (x86_64) Kernel 2.6.32.12-0.7-default
up 8:42, 2 users, load average: 0.07, 0.05, 0.01
GPU GeForce 8600 GTS Silent - Driver Version: 195.36.31