How to install a source package

Hi,

This must be a silly question.

Where do I click in the yast package manager to install the source package
of a package?

One package. I have seen how to install ALL sources packages, that’s not it.

Yes, the source repo is active.

I have tried viewing by repo, repo source, then search - finds nothing.
All: nothing.


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)

This is done with “zypper si <pkgname>”, but sometimes the src package
name can differ from the binary package name (some src packages create
more than one binary).

Which do you want to install?


PC: oS 12.1 x86_64 | i7-2600@3.40GHz | 16GB | KDE 4.8.4 | GeForce GT 420
ThinkPad E320: oS 12.1 x86_64 | i3@2.30GHz | 8GB | KDE 4.8.4 | HD 3000
eCAFE 800: oS 12.1 i586 | AMD Geode LX 800@500MHz | 512MB | KDE 3.5.10

Am 20.06.2012 15:01, schrieb Martin Helm:
> This is done with “zypper si <pkgname>”, but sometimes the src package
> name can differ from the binary package name (some src packages create
> more than one binary).
>
> Which do you want to install?
>

I just checked now in yast if I can find out. I thought to remember from
years ago that there was a checkbox for the packages to install the
corresponding source when you looked at the listed packages, that seems
to be gone.

On 2012-06-20 15:01, Martin Helm wrote:
> This is done with “zypper si <pkgname>”, but sometimes the src package
> name can differ from the binary package name (some src packages create
> more than one binary).
>
> Which do you want to install?

suspend.

I want to look at the source of s2disk to see if it can be made to print
debugging messages, because it crashes randomly on my system.


> Telcontar:~ # zypper si suspend
> Reading installed packages...
> Loading repository data...
> Resolving package dependencies...
>
> The following NEW packages are going to be installed:
>   libgnutls-extra-devel libx86-devel lzo-devel pciutils-devel splashy-devel
>
> The following source package is going to be installed:
>   suspend
>
> 5 new packages to install.
> Overall download size: 453.0 KiB. After the operation, additional 662.0 KiB
> will be used.
> Continue? [y/n/?] (y): y
> Retrieving package splashy-devel-0.3.13-20.1.x86_64 (1/6), 9.0 KiB (6.0 KiB unpacked)
> Retrieving: splashy-devel-0.3.13-20.1.x86_64.rpm [done (0 B/s)]
> Retrieving package pciutils-devel-3.1.7-8.1.x86_64 (2/6), 23.0 KiB (71.0 KiB unpacked)
> Retrieving: pciutils-devel-3.1.7-8.1.x86_64.rpm [done (41.3 KiB/s)]
> Retrieving package lzo-devel-2.04-14.1.x86_64 (3/6), 42.0 KiB (206.0 KiB unpacked)
> Retrieving: lzo-devel-2.04-14.1.x86_64.rpm [done (63.8 KiB/s)]
> Retrieving package libx86-devel-1.1-27.1.x86_64 (4/6), 5.0 KiB (3.0 KiB unpacked)
> Retrieving: libx86-devel-1.1-27.1.x86_64.rpm [done (0 B/s)]
> Retrieving package libgnutls-extra-devel-2.8.6-5.21.2.x86_64 (5/6), 7.0 KiB (1.0 KiB unpacked)
> Retrieving: libgnutls-extra-devel-2.8.6-5.21.2.x86_64.rpm [done]
> Retrieving: suspend-0.80.20100129-10.1.src.rpm [done (81.9 KiB/s)]
> Installing: splashy-devel-0.3.13-20.1 [done]
> Installing: pciutils-devel-3.1.7-8.1 [done]
> Installing: lzo-devel-2.04-14.1 [done]
> Installing: libx86-devel-1.1-27.1 [done]
> Installing: libgnutls-extra-devel-2.8.6-5.21.2 [done]
> Telcontar:~ #

Why did it install all that extra packages, I wonder?

Now the problem is how to edit the sources. It has installed
“/usr/src/packages/SOURCES/suspend-0.8.20100129.tar.bz2” and a lot of
diffs. I would need to expand and apply those :-?


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)

On 06/20/12 09:38, Carlos E. R. pecked at the keyboard and wrote:
> On 2012-06-20 15:01, Martin Helm wrote:
>> This is done with “zypper si<pkgname>”, but sometimes the src package
>> name can differ from the binary package name (some src packages create
>> more than one binary).
>>
>> Which do you want to install?
> suspend.
>
> I want to look at the source of s2disk to see if it can be made to print
> debugging messages, because it crashes randomly on my system.
>
>
>


>> Telcontar:~ # zypper si suspend
>> Reading installed packages...
>> Loading repository data...
>> Resolving package dependencies...
>>
>> The following NEW packages are going to be installed:
>>    libgnutls-extra-devel libx86-devel lzo-devel pciutils-devel splashy-devel
>>
>> The following source package is going to be installed:
>>    suspend
>>
>> 5 new packages to install.
>> Overall download size: 453.0 KiB. After the operation, additional 662.0 KiB
>> will be used.
>> Continue? [y/n/?] (y): y
>> Retrieving package splashy-devel-0.3.13-20.1.x86_64 (1/6), 9.0 KiB (6.0 KiB unpacked)
>> Retrieving: splashy-devel-0.3.13-20.1.x86_64.rpm [done (0 B/s)]
>> Retrieving package pciutils-devel-3.1.7-8.1.x86_64 (2/6), 23.0 KiB (71.0 KiB unpacked)
>> Retrieving: pciutils-devel-3.1.7-8.1.x86_64.rpm [done (41.3 KiB/s)]
>> Retrieving package lzo-devel-2.04-14.1.x86_64 (3/6), 42.0 KiB (206.0 KiB unpacked)
>> Retrieving: lzo-devel-2.04-14.1.x86_64.rpm [done (63.8 KiB/s)]
>> Retrieving package libx86-devel-1.1-27.1.x86_64 (4/6), 5.0 KiB (3.0 KiB unpacked)
>> Retrieving: libx86-devel-1.1-27.1.x86_64.rpm [done (0 B/s)]
>> Retrieving package libgnutls-extra-devel-2.8.6-5.21.2.x86_64 (5/6), 7.0 KiB (1.0 KiB unpacked)
>> Retrieving: libgnutls-extra-devel-2.8.6-5.21.2.x86_64.rpm [done]
>> Retrieving: suspend-0.80.20100129-10.1.src.rpm [done (81.9 KiB/s)]
>> Installing: splashy-devel-0.3.13-20.1 [done]
>> Installing: pciutils-devel-3.1.7-8.1 [done]
>> Installing: lzo-devel-2.04-14.1 [done]
>> Installing: libx86-devel-1.1-27.1 [done]
>> Installing: libgnutls-extra-devel-2.8.6-5.21.2 [done]
>> Telcontar:~ #
> 

Why did it install all that extra packages, I wonder?



Software Management:
install, in             Install packages.
remove, rm              Remove packages.
verify, ve              Verify integrity of package dependencies.
source-install, si      Install source packages and their build
dependencies.
install-new-recommends, inr
Install newly added packages recommended
by installed packages.

As you can see when you install a source package it will also installs
the other packages needed to build the source.

Now the problem is how to edit the sources. It has installed
“/usr/src/packages/SOURCES/suspend-0.8.20100129.tar.bz2” and a lot of
diffs. I would need to expand and apply those :-?


tar xjvf [name of tar file]

will extract the contents of the tar file so you can look at the files.

Am 20.06.2012 15:38, schrieb Carlos E. R.:
> Why did it install all that extra packages, I wonder?

You can avoid to install the build dependencies by adding option -D to
the si.
I just never do that myself since if I need the source I also need to be
able to build/debug, so I need all dependencies anyway and did not take
that option into account.


zypper si --help


PC: oS 12.1 x86_64 | i7-2600@3.40GHz | 16GB | KDE 4.8.4 | GeForce GT 420
ThinkPad E320: oS 12.1 x86_64 | i3@2.30GHz | 8GB | KDE 4.8.4 | HD 3000
eCAFE 800: oS 12.1 i586 | AMD Geode LX 800@500MHz | 512MB | KDE 3.5.10

On 2012-06-20 16:16, Martin Helm wrote:
> Am 20.06.2012 15:38, schrieb Carlos E. R.:
>> Why did it install all that extra packages, I wonder?
>
> You can avoid to install the build dependencies by adding option -D to
> the si.
> I just never do that myself since if I need the source I also need to be
> able to build/debug, so I need all dependencies anyway and did not take
> that option into account.
>


> zypper si --help
> 

Ok.

I’ll ask about how to apply the patches, edit those sources and compile the
edited sources correctly in another thread. Should be via rpmbuild, I guess.


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)

On Wed, 20 Jun 2012 14:48:06 GMT, “Carlos E. R.”
<robin_listas@no-mx.forums.opensuse.org> wrote:

>On 2012-06-20 16:16, Martin Helm wrote:
>> Am 20.06.2012 15:38, schrieb Carlos E. R.:
>>> Why did it install all that extra packages, I wonder?
>>
>> You can avoid to install the build dependencies by adding option -D to
>> the si.
>> I just never do that myself since if I need the source I also need to be
>> able to build/debug, so I need all dependencies anyway and did not take
>> that option into account.
>>


>> zypper si --help
>> 

>
>Ok.
>
>I’ll ask about how to apply the patches, edit those sources and compile the
>edited sources correctly in another thread. Should be via rpmbuild, I guess.

Mind you i am not sure, but: when the patches are installed they are
incorporated into the source files at that time.

You can lookup where the sources are installed with yast by going to the
package and looking at the (bottom) files tab.

Personally, i like making a link from my directory tree to the source
branch i want to work on before getting busy with it.

?-)