openSUSE-specific RPM build instructions?

Hi all,

I’m trying to learn how to properly make RPMs for openSUSE. I am insanely confused after wiki & google searches. The openSUSE wiki has dozens of technical pages discussing “best practises” and if there is a page there that explains step by step how to make an RPM, I could not find it. In fact, an openSUSE wiki page directed me to Fedora’s https://fedoraproject.org/wiki/How_to_create_an_RPM_package, but even that wasn’t 100% helpful since the

$ rpmdev-setuptree

does not work in openSUSE.

Google directed me to two pages thus far: http://eureka.ykyuen.info/2009/12/28/opensuse-build-a-rpm-package/ & http://ordinatechnic.com/os-specific-guides/opensuse/build-rpm-package-for-local-installation, but I just want to be 100% sure that I’m doing everything correctly. Is there a page specific to openSUSE on how to make RPMs?

Thanks

On Mon 01 Jun 2015 06:16:01 AM CDT, sinayion wrote:

Hi all,

I’m trying to learn how to properly make RPMs for openSUSE. I am
insanely confused after wiki & google searches. The openSUSE wiki has
dozens of technical pages discussing “best practises” and if there is a
page there that explains step by step how to make an RPM, I could not
find it. In fact, an openSUSE wiki page directed me to Fedora’s
https://fedoraproject.org/wiki/How_to_create_an_RPM_package, but even
that wasn’t 100% helpful since the
Code:

$ rpmdev-setuptree

does not work in openSUSE.

Google directed me to two pages thus far:
http://eureka.ykyuen.info/2009/12/28/opensuse-build-a-rpm-package/ &
http://tinyurl.com/qbdhaju, but I just want to be 100% sure that I’m
doing everything correctly. Is there a page specific to openSUSE on how
to make RPMs?

Thanks

Hi
There are, but generally most folks use the openSUSE Build Service,
there is a command line tool for this called osc which enables local
building of rpms (in it’s own build environment) and interfacing with
the build service.

You can see many (thousands in fact) examples of rpm spec files if you
search here;
https://software.opensuse.org/search?

The specifics are all detailed here;
https://en.opensuse.org/Portal:Packaging

And of course look around here;
https://build.opensuse.org/

I would suggest a peruse around the above and if there is a particular
application your wanting to package, then post back (probably in the
build service subforum) and will see what we can do :wink:


Cheers Malcolm °¿° LFCS, SUSE Knowledge Partner (Linux Counter #276890)
SUSE Linux Enterprise Desktop 12 GNOME 3.10.1 Kernel 3.12.39-47-default
If you find this post helpful and are logged into the web interface,
please show your appreciation and click on the star below… Thanks!

That Packaging section of the openSUSE wiki is what threw me off. It keeps linking to Fedora docs, which in turn keep linking to the “rpmdev-setuptree” command. Plus, (unless I’m missing it, and I hope I am), it shows nothing about how to create a package on our own PCs, before teaching OBS.

Is there a good guide for osc? I just realised that the most up to date link I posted earlier has a ridiculous claim:

When installing rpmbuild the default build directories will be created in your home directory. After installing the required package, as indicated above, you will have in your /home/username directory, a folder named rpmbuild. This will in turn have the following directories:

  • BUILD
  • BUILDROOT
  • SOURCES
  • SPECS
  • RPMS
  • SRPMS

How on earth would that even be possible, since we’re installing rpmbuild as root…?

The package I’m trying to build is for fcgiwrap.

Hi
Correct, rpmbuild will create those directories in your /home/username always builds as a user, only install as root user…

Fire up an editor create the rpm spec file, add the source and build away…

So some folks have it built on OBS;
https://software.opensuse.org/package/fcgiwrap?search_term=fcgiwrap

And the spec file;
https://build.opensuse.org/package/view_file/home:conecenter:services-net/fcgiwrap/fcgiwrap.spec?expand=1

If you grab a src rpm and rebuild it locally as your user in you home directory it will create the directory structure under rpmbuild.

Or manually create the directory structure…

Oh, so it creates that structure when you build a spec file? That makes more sense than the page! Thanks, I’ll check this out once I get home tonight. :slight_smile:

EDIT: I just want to say, that in Tumbleweed I installed rpmbuild, and do not have those folders in my user’s home directory. That’s why I was confused with the website. The rpmdev-setup command in fedora seems to build that, whereas openSUSE has no such command.

I’m encountering errors that are not immediately obvious. Where is the best place to ask questions for help regarding our own spec files? I was temped to hit up stackexchange, but wanted to see what the first avenue for openSUSE devs was.

On 2015-06-07 21:16, sinayion wrote:
>
> I’m encountering errors that are not immediately obvious. Where is the
> best place to ask questions for help regarding our own spec files? I was
> temped to hit up stackexchange, but wanted to see what the first avenue
> for openSUSE devs was.

Not many devs hit the forums here, but you could try on the
programming-scripting forum here. There is also a programming mail list,
but it is almost inactive. There is also a packaging mail list.


Cheers / Saludos,

Carlos E. R.

(from 13.1 x86_64 “Bottle” (Minas Tirith))

On Sun 07 Jun 2015 07:16:01 PM CDT, sinayion wrote:

I’m encountering errors that are not immediately obvious. Where is the
best place to ask questions for help regarding our own spec files? I was
temped to hit up stackexchange, but wanted to see what the first avenue
for openSUSE devs was.

Hi
Are you using OBS? if so there is a subforum here. What sort of spec
errors, or are they actual compile errors?


Cheers Malcolm °¿° LFCS, SUSE Knowledge Partner (Linux Counter #276890)
SUSE Linux Enterprise Desktop 12 GNOME 3.10.1 Kernel 3.12.39-47-default
If you find this post helpful and are logged into the web interface,
please show your appreciation and click on the star below… Thanks!