Mailinglist Archive: opensuse-buildservice (153 mails)

< Previous Next >
RE: [opensuse-buildservice] Build C++ Files for different distributions
Okay, so what I achieved/understood so far is this:
What Open Build Service does is extract my helloWorld-1.tar.gz
After that we have a folder helloWorld-1 in our working directory.
After which we change into that directory.
Afterwards my build command "g++ -o helloWorldBin helloWorld.cpp" is executed,
so I have a binary called "helloWorldBin" in my helloWorld-1 folder.

As you said I now need to copy this binary into the" $RPM_BUILDROOT%{_bindir}"
-Folder in the install section and add this file to the files section.
Did I miss anything? If not, why can´t I just add the binary to the files

Because I just have one .cpp file and no make file I can´t execute any make
commands like all of the examples I found., I tried to do the following:
Name: helloWorld
Version: 1
Release: 0
License: GPL-2.0+
Summary: helloWorld
Group: Other
Source: helloWorld-1.tar.gz
BuildRequires: gcc-c++ cmake
BuildRoot: %{_tmppath}/helloWorld


%setup -q

g++ -o helloWorldBin helloWorld.cpp

cp helloWorldBin $RPM_BUILDROOT%{_bindir}/hello_world_1





I get the following error:
cp: cannot create regular file `/usr/bin/hello_world_1': Permission denied

Somehow the spec guideline isn´t helping me much

Excuse me for asking again and thank you very much for your help!
< Previous Next >