anyone making rpm's from source (.src and .tar.gz/bz2)
Hi, the moniker says it all really, does anyone here build rpm packages from it's source.
If so, I'd be interested in reading more about it. There are somany programs out there in the OSS world, but rather difficult to keep track of through the various package managers. Any thoughts welcome, any news on the kde4 mandriva packger. I mean the dev/person who builds rpms from the kde4 source for x86_64 as well as i586 I'm mostly interested in x86_64. thanks, happy holidays everyone! Regards Glenn |
Hey Glenn,
I do a bit of packaging, did you have any specific questions or just looking for a general intro/howto ? cheers |
Hi, thanks for the reply.
Yes, I'm interested in a howto, but the rpm-build tutes I have read are old or incomplete. I've been using GNU/Linux for a while now(since 2001) and I want to sort out some things Like avoiding "dependency-hell" and the bloat associated with gtk+ vs Qt (cute), and i586 vs x86_64. If you know of a starting point, please share it with me. I intend to contribute to OSS by way of packaging. I have done (barely passed) 3 programming courses (Pascal, java, c+, and objC), but I am by no means a programmer. The last time I checked was a few years ago, about building rpm's from source. I am interested in getting to a point where I may contribute to the repos, but that may take a while. Thank you, regards Glenn |
The shortest method to getting started :-
Code:
$ sudo yum install rpm-build rpmdevtools rpmlint - SPECS ( spec files go here ) - SOURCES ( tar.gz etc go here ) - BUILD ( temp dir for unpacking/patching sources ) - RPMS ( finished packages will be under here in arch specific subdirs ) - SRPMS ( if you opt to build src.rpm's they will be under here ) The rpmdevtools package provides several spec file templates: /etc/rpmdevtools/spectemplate-R.spec /etc/rpmdevtools/spectemplate-dummy.spec /etc/rpmdevtools/spectemplate-lib.spec /etc/rpmdevtools/spectemplate-minimal.spec /etc/rpmdevtools/spectemplate-ocaml.spec /etc/rpmdevtools/spectemplate-perl.spec /etc/rpmdevtools/spectemplate-php-pear.spec /etc/rpmdevtools/spectemplate-python.spec /etc/rpmdevtools/spectemplate-ruby.spec The minimal template is ideal for generating an rpm from a 'configure/make/make install' type tarball, on Fedora this is the default. Code:
cd ~/rpmbuild Name, Version and Summary - pretty straight forward Group - find a matching category in /usr/share/doc/rpm-xxx/GROUPS License, URL - pretty straight forward Source0 - I usually use %{name}-%{version}.tar.gz, make sure that myapp-1.0.0.tar.gz is named accordingly BuildRequires - what the package needs to compile, comma separated ( gcc, make, ... ) Requires - what the package depends on to function, comma separated Description - pretty straight forward skip down to the %files section, you will need to add all the files that the package will provide, you can specify a directory to include all files under it eg. Code:
%files Code:
%files eg. Code:
%doc CHANGES Code:
* Fri Feb 07 1997 Erik Troan <ewt@redhat.com> First build attempt: Code:
rpmbuild -ba SPECS/myapp.spec You can run 'rpmbuild -b?' to only perform specific sections ( helps when troubleshooting), please see the man page. Once you have a successful build try running rpmlint: Code:
rpmlint SPECS/myapp.spec If you're having trouble it can also help to download someone else's src.rpm, install it and take a look at their spec file Hope this helps, my fingers are worn out cheers |
Thanks heaps for the effort! ;)
I shall begin, but first I'll have to deal with my family (that time of year) But I'll post back in a day or so with feedback and questions, if I have any. Thanks heaps. Regards Glenn |
This may help (it includes information that may be specific to Mandriva):
http://wiki.mandriva.com/en/Mandriva_RPM_HOWTO Jim |
Thank you sir.
Happy holidays! kind regards Glenn |
rpmbuild
1 Attachment(s)
A couple of good links ( I think.)
http://docs.fedoraproject.org/drafts...specfiles.html http://docs.fedoraproject.org/drafts...n/ch09s05.html http://docs.fedoraproject.org/drafts...html#id2972829 ..... http://www.rpm.org/max-rpm-snapshot/index.html http://www.rpm.org/max-rpm/s1-rpm-bu...spec-file.html http://www.rpm.org/max-rpm-snapshot/...b-command.html ..... A "beginners" example spec file is attached .. .. and it works OK .. ..... |
Thank you, I have some (quite a bit of...) reading to do, Thanks for the .txt, I does help.
please excuse me for not responding (yet). I appreciate your support. cheers, Glenn |
Hi kbp, I'm working through the example above,
this spec part, Quote:
The point I'm at is that the spec file is created, empty. Have I missed linking the templates? Quote:
Code:
cd ~/rpmbuild Code:
glenn@GamesBox:~/rpmbuild$ ls /etc/rpmdevtools/ Code:
glenn@GamesBox:~/rpmbuild$ ls /home/glenn/rpmbuild/SOURCES (27-12 12:16) Your assistance is appreciated. Regards Glenn |
Hey mate,
No, you don't need to unpack the tarball, rpmbuild will do that for you. Maybe there's a difference between the Fedora rpmdevtools package and the Mandriva one, as a workaround just copy the minimal template into the SPECS dir and rename it. I'll do a bit of digging and see if I can work out what the difference is... Other than that you're on track cheers |
OK, I see. that should work.
cheers, Glenn |
Best practice to learn how to compile and create is to unpack packages with similar structure or same package from another distribution, unpack it and check it's spec file. That is how I started a year ago. Since then I recompiled about 30 package packs from Fedora to CentOS and created several mine own based on the source. use http://rpm.pbone.net to search for what you need. Look for a binary package you want and on it's page should be a link to src package.
|
Hi DrLove73, That is what I am doing, I realise where the lists are, but for this version of kde (4.3.4), there is no ref on pbone for this version (only 4.3.85).
and the list is quite long. urpmi gives me some details, but for older versions. (4.3.2, the version I have installed.) Bit of a guessing game, but this is not severe, or crucial, It's just time, and I don't mind. Plenty of disk-space and time. Thank you for the tips. Much appreciated, regards Glenn ps, it's just setting up the spec file atm, I've compiled from source many, many times. |
To be sure, here is what the default minimal-spec file gives me before edit.
/etc/rpmdevtools/spectemplate-minimal.spec Code:
Name: |
All times are GMT -5. The time now is 04:44 AM. |