Author Topic: Going to try and learn how to package  (Read 1557 times)

Offline daniel

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3729
  • God knows, i'm not an Angel!
    • Tipps und Tricks
Re: Going to try and learn how to package
« Reply #15 on: March 26, 2012, 11:25:45 AM »
Try oldskool, install only pkgutils, when mkrepo end with an error, start it from terminal mkrepo, and set your path, and macros.

After that download a srpm from here

http://ftp.nluug.nl/ibiblio/distributions/pclinuxos/pclinuxos/apt/pclinuxos/2010/SRPMS.main/

For a simple package to learn use this

http://ftp.nluug.nl/ibiblio/distributions/pclinuxos/pclinuxos/apt/pclinuxos/2010/SRPMS.main/Zip_Player-0.4-3pclos2010.src.rpm

go to your download folder and open a terminal (F4) and type
Code: [Select]
rpm -i Zip_Player-0.4-3pclos2010.src.rpm
Now go to your Spec files folder, should created under /home/YOU/src/rpm/specs

Open the spec file Zip_Player.spec with your editor, best is medit, or gedit.

Edit the release from 3 to 4
%define release %mkrel 3
and add in Changelog what you have changed

%changelog
* Thu Jul 29 2010 leiche <meisssw01 at aol.com> 0.4-3pclos2010
- fix output dialog under zip_player script


maybe

%changelog
* Mon Mar 26 2012 YOU <YourMail at whatever.com> 0.4-4YOU2012
- rebuild for new branch


Save it, and open terminal (F4) and type

Code: [Select]
rpmbuild -ba Zip_Player.spec
If all required devs packages available it will created, when not install it with synaptic, or apt-get...

After that you can use rpm_installer to install your created packages...

Good luck, and ask by issues...


Offline Ramchu

  • Hero Member
  • *****
  • Posts: 1587
Re: Going to try and learn how to package
« Reply #16 on: March 27, 2012, 11:36:40 AM »
Try oldskool, install only pkgutils, when mkrepo end with an error, start it from terminal mkrepo, and set your path, and macros.

After that download a srpm from here

http://ftp.nluug.nl/ibiblio/distributions/pclinuxos/pclinuxos/apt/pclinuxos/2010/SRPMS.main/

For a simple package to learn use this

http://ftp.nluug.nl/ibiblio/distributions/pclinuxos/pclinuxos/apt/pclinuxos/2010/SRPMS.main/Zip_Player-0.4-3pclos2010.src.rpm

go to your download folder and open a terminal (F4) and type
Code: [Select]
rpm -i Zip_Player-0.4-3pclos2010.src.rpm
Now go to your Spec files folder, should created under /home/YOU/src/rpm/specs

Open the spec file Zip_Player.spec with your editor, best is medit, or gedit.

Edit the release from 3 to 4
%define release %mkrel 3
and add in Changelog what you have changed

%changelog
* Thu Jul 29 2010 leiche <meisssw01 at aol.com> 0.4-3pclos2010
- fix output dialog under zip_player script


maybe

%changelog
* Mon Mar 26 2012 YOU <YourMail at whatever.com> 0.4-4YOU2012
- rebuild for new branch


Save it, and open terminal (F4) and type

Code: [Select]
rpmbuild -ba Zip_Player.spec
If all required devs packages available it will created, when not install it with synaptic, or apt-get...

After that you can use rpm_installer to install your created packages...

Good luck, and ask by issues...




Thank You Leiche !
I followed your post and was able to package and install the Zip_Player  ;) ;D

Offline daniel

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3729
  • God knows, i'm not an Angel!
    • Tipps und Tricks
Re: Going to try and learn how to package
« Reply #17 on: March 27, 2012, 11:44:46 AM »
Good news  ;), and best wishes for the next packages  ;D

Offline Archie

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 8583
  • Aurum nostrum non est aurum vulgi.
Re: Going to try and learn how to package
« Reply #18 on: March 27, 2012, 05:22:53 PM »
Thank You Leiche !
I followed your post and was able to package and install the Zip_Player  ;) ;D


That is good news, Ramchu. The more packages you handle, the better you can understand more complex stuff.

Good luck.
Since 2006 | LiCo 401868 | Bare Metal | What is necessary is never unwise. --Sarek, 2258.42


Offline djohnston

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 6227
  • I don't do Windows
Re: Going to try and learn how to package
« Reply #19 on: March 28, 2012, 11:23:38 PM »

When I try to install pkgutils-thunar - it says it wants to install thunar(also)but it is unstable Sorry
it says not installable and won't let me install pkgutils-thunar.
should I be getting pkgutils-thunar from something other than the regular repo's


Ramchu, if you still want to use that method, (in addition to "oldskool"), enable xfce4 section of your regular repo. That's where the thunar package is "hiding". Afterwards, you can disable xfce4 section.
Bare metal                           VBox
AMD Athlon 7750 Dual-Core    Single core
4GiB RAM                              1GiB RAM
nVidia GeForce FX 5200          64MB video
LXDE 32bit                            KDE 64bit

Registered Linux User #416378

Offline Zou

  • Jr. Member
  • **
  • Posts: 17
Re: Going to try and learn how to package
« Reply #20 on: March 31, 2012, 10:41:12 AM »
Hi,

I have just tested the procedure given by leiche. I built the rpm without error.
When I install it with "rpm -Uvh Zip_Player-0.4-4zou2012.src.rpm" no error is raised.
I am under zen mini but I cannot see now how to test zip_player.

If someone could give me any advices it will be great.

Zou

Online Old-Polack

  • Administrator
  • Super Villain
  • *****
  • Posts: 11528
  • ----IOFLU----
Re: Going to try and learn how to package
« Reply #21 on: March 31, 2012, 11:09:16 AM »
Hi,

I have just tested the procedure given by leiche. I built the rpm without error.
When I install it with "rpm -Uvh Zip_Player-0.4-4zou2012.src.rpm" no error is raised.
I am under zen mini but I cannot see now how to test zip_player.

If someone could give me any advices it will be great.

Zou

If the build was done right and successful, you should have both a .src.rpm and a regular binary .rpm package, or packages. You need to install the binary .rpm package(s).
Old-Polack

Of what use be there for joy, if not for the sharing thereof?



Lest we forget...

Offline Zou

  • Jr. Member
  • **
  • Posts: 17
Re: Going to try and learn how to package
« Reply #22 on: March 31, 2012, 01:16:05 PM »
You're right.

I did a little mistake betwwen RPMS and SRPMS.

But now I have an error when I try to install it. The first time, xmms was missing, I installed it from synaptic but now I have the following error : "error: can't create transaction lock on /var/lib/rpm/__db.000 (no such file or directory)".

Ok, I just know why. I have to be root user to install rpm.

Zou
« Last Edit: March 31, 2012, 01:28:16 PM by Zou »

Offline AS

  • Hero Member
  • *****
  • Posts: 4111
  • Have a nice ... night!
Re: Going to try and learn how to package
« Reply #23 on: March 31, 2012, 01:28:44 PM »
You're right.

I did a little mistake betwwen RPMS and SRPMS.

But now I have an error when I try to install it. The first time, xmms was missing, I installed it from synaptic but now I have the following error : "error: can't create transaction lock on /var/lib/rpm/__db.000 (no such file or directory)".

Zou

while installing packages, you need to have root privileges, use su obtain such privileges.  ;)

AS

Offline Zou

  • Jr. Member
  • **
  • Posts: 17
Re: Going to try and learn how to package
« Reply #24 on: March 31, 2012, 01:31:20 PM »
Thanks, I have edited my previous post after testing with su.

The installation is now ok. I can see zip-player in the menu.

I am very happy with this first packaging !

Thanks to all for helping me so fast !

PCLOS is a very good distro. I like it !

Zou

Offline clarms

  • Full Member
  • ***
  • Posts: 72
Re: Going to try and learn how to package
« Reply #25 on: April 01, 2012, 11:53:52 AM »
One of the best way to learn rpm packaging, is to download some pclinuxos src rpms and look at the specfile. There are also links in the forum to some rpm pdfs which are helpful for a general understanding.

From the most part, the only section that requires rarely used unique code is the %setup section.
For example, an extra package besides the source code that would also need to be unpacked.
%setup -q -a1

The underlined variables, "%{_variable}", usually point to a macro in /etc/rpm or possibly in /usr/lib/rpm.


Online gseaman

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 3788
Re: Going to try and learn how to package
« Reply #26 on: April 01, 2012, 12:23:56 PM »
What is the purpose of the underline and when should it be used? I've seen %{libdir} and %{_libdir} for example. They both seem to always work, and I usually leave it the same as the example that I am copying, but I've never figured out the difference.

Galen

Offline clarms

  • Full Member
  • ***
  • Posts: 72
Re: Going to try and learn how to package
« Reply #27 on: April 01, 2012, 12:40:04 PM »
What is the purpose of the underline and when should it be used? I've seen %{libdir} and %{_libdir} for example. They both seem to always work, and I usually leave it the same as the example that I am copying, but I've never figured out the difference.

Galen


Good question. Here is what "usually" is the case.

The underlined variables (starting with an underline) are the ones usually found in macro files in /etc/rpm or /usr/lib/rpm.

The non-underlined variables are usually defined in the specfile itself, usually at the top.

Examples -
%{_libdir} is defined in one of the system macros and is (most likely) set to /usr/lib.

Create a custom variable, at the top of the specfile:
%define libdir /usr/local/lib
then call it somewhere with
%{libdir}

« Last Edit: April 01, 2012, 12:58:51 PM by clarms »