Can't build on Obs

after several attempts even without patches, I always get the same error, such as :
100s] CMake Error: The source directory “/home/abuild/rpmbuild/BUILD/skylendar/#” does not exist.

because I have no access to the underlying structure, and don’t know what’s going on. I still flounder in the mud…:frowning:

Set up your build environment in your /home:

$ mkdir -p ~/rpmbuild/{BUILD,BUILDROOT,OTHER,RPMS,SOURCES,SPECS,SRPMS}
$ echo '%_topdir %(echo $HOME)/rpmbuild' > ~/.rpmmacros

The $ means: execute it as User.

Copy your source to SOURCES, the spec-File to SPEC.
Goto the SPEC Directory and execute as User:

rpmbuild -ba --noclean File.spec

Then the Source will expand to BUILD, the Files from the builded rpm will be installed in BUILDROOT, the builded rpms to RPMS, the src.rpm to SRPMS.
If something is going wrong, you can follow it better as on OBS.
And all is done as User, not as root.

AT least, you have to install the rpms with zypper as root.

Hi
AFAIK, user is using osc locally to build not rpmbuild…?

Hi
Because you need to use the -c option in %prep…


%setup -c -q -n %{name}-%{version}

Then in %build use;


%cmake -DCMAKE_BUILD_Type=Release ../%{name}/

The reason is the %cmake macro sets up the build directory, therefore the src files are relative to this so always …/ and because the way the tarball extracts you need to add the name as well…

On your local system you can browse the home/abuild directory to see what it’s doing…

Thx for the tip. Will try, but I’m doing several tasks at the same moment. That’s why I’m a little confused…

After hours of tedious attempts, I’m already ok, but last glitch, rpmbuild can’t find:
/home/abuild/rpmbuild/SOURCES/skylendar-4.1nn-74.1.tar.xz

whereas I have downloaded: skylendar-4.1nn-1.tar.xz

where 74 is the current obs release number and -1 the provided release.

I’m tired… :\

Without spec-file, nobody can help…
Also the whole error…

Hi
Almost there…wakey wakey :slight_smile:

So line 25 of the spec file, remove the %{release} also set line 20 (Release) to zero as OBS takes care of this.


Line 20: Release:        1

should be

Line 20: Release:        0

Line 25: Source0:        https://cfhcable.dl.sourceforge.net/project/skylendar/%{name}-%{version}-%{release}.tar.xz

should be

Line 25: Source0:        https://cfhcable.dl.sourceforge.net/project/skylendar/%{name}-%{version}.tar.xz

Ok, I got something, for x86_64, but gcc yields an error for i586 in astrosql.cpp

sighhhhhhhhh again

Ok, I got something!

Now, what should I do with my rpm packages ?

Hi
Congratulations :slight_smile:

So, have you downloaded and installed to test your rpm works?

On the link to the left of the succeeded text, that a link to the built rpms, links to the right show the details or you (if logged into OBS) can download. At the top is a link to the repository containing the rpms for users to download/install.

Now I would suggest you look at adding Tumbleweed repository instead of Factory, also add Leap 42.3 and Leap 15.0 as these are still in use. Go back to your main page to add the additional repositories. If not using 32bit for Tumbleweed, I would disable the building of that.

Then if you feel like maintaining the package in the distribution, you can push to a development repository in anticipation of sending off to factory and into the releases…

I have spoken too fast… the requirement list is incomplete. I need to declare packages like perl, postgresql-client etc…

How can I get the list of the available packages to rpmbuild ?

Hi
The reason for this is your building against factory… in a nutshell, sure, build for testing that it does build, but don’t publish (as in disable).

Only build/publish against Tumbleweed and supported Leap releases.

So, You need to add the build target repositories…

You need to add them here;

Then enable against the package here;

Then your issues (and end user) will go away as your package will then be built/published against the standard repository packages, which Factory is not…

Hi
Also change;


BuildRequires:  pkgconfig(libpq)

to

BuildRequires:  pkgconfig(libpq) >= 9.6.0 

That will get rid of the unresolvable warning… unless you want to use a specific version only…

I did that, ok, I can compile for Tumbleweed & Co , but I wanted to know how to declare a requirement like perl or postgres-client. pkgconfig(perl) doesn’t work

Hi
Things are different for perl, it would be;


config(perl)

for a perl module

perl(Devel::CheckOS)

Normally rpm takes care of any requires, else you would add a Requires, is this for your test package or another package?

I’m trying to install on a clean opensuse leap 15.0 distro. If I click on the .rpm file from e.g. dolphin, I can install the rpm via discover if all the needed packages (including postgresql-server) are already present. If not, discover shrieks that an internal error occured, and I can’t find why. It just says that packagekit failed.

Hi
Then that would be bug in the desktop tools, what happens if you use zypper?

Fresh Leap 15.0 install with zypper I see (from my build);


zypper in skylendar-4.1nn-lp150.8.1.x86_64.rpm 

Loading repository data...
Reading installed packages...
Resolving package dependencies...

The following 6 NEW packages are going to be installed:
  libQt5PrintSupport5 libQt5Sql5 libQt5Sql5-sqlite libQt5Svg5 libQt5Xml5 skylendar

The following recommended package was automatically selected:
  libQt5Sql5-sqlite

6 new packages to install.
Overall download size: 12.2 MiB. Already cached: 0 B. After the operation, additional 17.3 MiB will be used.
Continue? [y/n/...? shows all options] (y):

With your package I see;


zypper in skylendar-4.1nn-lp150.83.1.x86_64.rpm 

Loading repository data...
Reading installed packages...
Resolving package dependencies...

The following 15 NEW packages are going to be installed:
  libQt5PrintSupport5 libQt5Sql5 libQt5Sql5-postgresql libQt5Svg5 libQt5Xml5 libpq5 perl-DBD-Pg perl-DBI perl-Module-Signature
  perl-XML-DOM perl-XML-RegExp perl-libxml-perl postgresql postgresql10 skylendar

The following 3 recommended packages were automatically selected:
  libQt5Sql5-postgresql perl-Module-Signature postgresql10

15 new packages to install.
Overall download size: 15.1 MiB. Already cached: 0 B. After the operation, additional 27.6 MiB will be used.
Continue? [y/n/...? shows all options] (y): 

Try zypper as root:

zypper install /path/to/the/rpm/name.rpm

You can use the bash-completion (tab-key)

I’m almost ok…

but I’d like to start postgresql when installing skylendar, with a declaration in skylendar.spec such as:

%post
/sbin/ldconfig
systemctl start postgres

of course it doesn’t work. systemctl no found