Tips for rebuilding your own packages

Hi,

where are the SRPMs for OMV LX 3.0?

I use OMV LX 3.0.

I use some packages that are not receiving updates:

scilab, texstudio, kile, and the simulator flightgear.

Don’t know if some of these packages were maintained by Crisb who recently left the distro’s development group.

I was looking for the SRPMs for these packages so as to find out if Crisb was their maintainer and also to evaluate my chances/difficulties to build updates by my own and, if successful, upload them to a OMV LX 3.0 repository.

I could not find them, particularly the SRPM for scilab.

Thanks

2 Likes

You may find RPMS for lx3.0 at the following link:
http://abf-downloads.openmandriva.org/3.0/repository/SRPMS/

however better place to look for are ABF and GitHub repo.

2 Likes

Thanks. I have already set an account at gitHub. But I could not find the srpm for scilab in https://abf.openmandriva.org/ and OpenMandriva Association · GitHub links. Also,

Index of /3.0/repository/SRPMS/

does not have the scilab srpm. It seems that its srpm was not copied from older versions of OMV to version 3.0. I could not find repositories of SRPMs for older OMV versions.

I don’t have any experience in dealing with building package stuff for Openmandriva. Thus, I was planning to get current OMV srpms, make proper replacements to have new sources and whatelse is necessary to build a new package successfuly and test. I certainly will look for help in that task in this forum.

By now, the best I can do is to download srpm from, let’s say, fedora, to see what and if I can do something useful.

1 Like

If there is not SRPM for lx3.0 is because it hasn’t been repackaged for this version (I mean the package in use has been built for an earlier version). But SRPM repository for earlier version is not complete for some reason I don’t know. However GitHub repository has all needed stuff for scilab.

If it is you first attempt with RPM the following link could be useful:

http://rpm5.org/docs/rpm-guide.html
https://wiki.openmandriva.org/en/Problems_and_issues_with_packaging

You may also read fedora guide but keep in mind OpenMandriva may use some different policy.

Feel free to ask any support you need here. :slight_smile:

1 Like

Moved to Cooker category as they are the people who can answer these questions.

Edit: Moved back. Should not have moved. My mistake.

1 Like

Not a mistake, @ben79, we are still in process to optimize the process. We can’t think about everything. I’ll make you a proposal to help cooker team to be warned of interesting topics.

1 Like

Once, in the past, I’ve builded a couple of packages using rpmbuild. My plan was to resume this to get the packages I personally need. Given my lack of skills to do this, I used to follow the recipe:

  • Create the building environment ( /rpms, /build, /srpms, etc);
  • Get the SRPMS to start with;
  • Change the spec, source, etc, to build the new package.

Please, let me know if today I have to change the recipe above somehow to achieve my goal.
For example, I’ve downloaded the scilab.spec file and noticed it is a lot different from what I’ve seen in the past.
Thanks

1 Like

Not too much has changed in build chain but something in RPM specs: OpenMandriva actually uses RPM5 (I linked the specs above). You may proceed as follow:

  • Create the building environment: you may use rpmdev-setuptree
  • Take all you need from github repo: place *.spec in SPEC and all the other in SOURCES
  • from SPEC folder run rpmbuild -ba name_packages.spec

You’ll find unpackaged sources and building directory in BUILD, rpm packages in RPM and srpm package in SRPM.

1 Like

Any suggestion on how to avoid messing up sources, specs, patches, from
different packages after building two or more packages? I think I could
have a rpmbuild directory for each one of them…

Thanks again

2 Likes

Really a good question! It’s a lot of time I’d like something like this but I have never tried before. So let’ try!

rpm use lots of macros you can list with rpm --showrc. You may change their values defining a new one into file ${HOME}/.rpmmacros. Here is an example:

%_topdir %(echo $HOME)/rpmbuild
#%_builddir  %{_topdir}/BUILD/%{name}
#%_buildrootdir      %{_topdir}/BUILDROOT/%{name}
#%_rpmdir    %{_topdir}/RPMS/%{name}
%_sourcedir %{_topdir}/SOURCES/%{name}
%_specdir   %{_topdir}/SPECS/%{name}
#%_srcrpmdir %{_topdir}/SRPMS/%{name}

Change path and Remove comments at your needs. Also you may define the numberof processor of your machine: for example for a dual processor machine you may set

%_smp_mflags "-j2"

This will enable parallel compilation.

1 Like

Checking if I understood:

If scilab is the package to be build, uncommenting

#%_builddir %{_topdir}/BUILD/%{name}

would automatically create a directory,

BUILD/SCILAB

in which scilab package files would be written. Right?

Also, in my directory $HOME/rpmbuild there is no directory BUILROOT, should I create one?

Many thanks!

1 Like

Sorry for this aside, but is the title in relation with the topic? :confused:

1 Like

Well, maybe I named this topic in an unprecise way …

No problem, can I rename it «where are the SRPMs for OMV LX 3.0?» or something more specific to scilab?

1 Like

Yes, I thank you for that.

“Looking for OMLx 3.0 SRPMs” ?

2 Likes

Don’t know what Mandian would prefer, but I got a lot of tips for building (Do it Yourself) packages and this was actually my first purpose. Then, I would say something like, “Tips for building your own packages” would be more appropriate.

Yes, but usually you don’t really need it because repmbuild unpacks the source archive in BUILD and it expects to find a directory named %{name}-%{version}_ inside build because usually the source tarball archive is named something like %{name}-%{version}.tar.*z. So all packages will have a separate directory if the source name is different. And you don’t need to keep this directory once you got the rpm. It’s because I comment this line.

The path of rpmbuild folder is influenced by _topdir macro. The default is $HOME/rpmbuild but you may change it as usual. When you set this directory you may use the command rpmdev-setuptree to make all the directory you need. However only SPECS and SOURCES are mandatory (well not sure about SORCES) because the other will be made automatically by rpmbuild.

The following macro automatically selects the number of processors (I don’t remember from where I took :innocent:)

%_smp_mflags %( \
    [ -z "$RPM_BUILD_NCPUS" ] \\\
        && RPM_BUILD_NCPUS="`/usr/bin/nproc 2>/dev/null || \\\
                             /usr/bin/getconf _NPROCESSORS_ONLN`"; \\\
    if [ "$RPM_BUILD_NCPUS" -gt 16 ]; then \\\
        echo "-j16"; \\\
    elif [ "$RPM_BUILD_NCPUS" -gt 1 ]; then \\\
        echo "-j$RPM_BUILD_NCPUS"; \\\
    else \\\
        echo "-j1"; \\\
    fi )

Tips for (re)-building your own packages may be a good tile because we are not speaking about use SRPM packages and instructions about building are quite general.

If you have account on ABF use this to simplify your daily struggle :slight_smile:

urpmi abf-c-c

This will install ABF console client with packages needed to build RPMs.

As normal user run abf in your konsole to configure your system.

then you can run:

abf get scilab

this will download sources

abf rpmbuild

this will start local rpm build process

3 Likes

Thanks TPG,

The command,

abf rpmbuild

differs from

rpmbuild -ba scilab.spec?

Is abf rpmbuild to be issued in the $HOME/rpmbuild directory? How to target
only on one package build?