I have been following the MaximumRPM guide from here:
http://www.rpm.org/max-rpm-snapshot/index.html
and it seems a bit dated, but still very good (if fact the best all round documentation I have found so far) on using RPM package manager, and how to build rpm packages.
The guide tells me to use the original paths, yet Centos wiki says otherwise.
[rpmbuilder@karsites sox]$ rpm -iv ./sox-12.18.1-1.src.rpm error: cannot write to %sourcedir /usr/src/redhat/SOURCES
Is there a package I need to install and run to set things up corectly?
I have created a user called 'rpmbuilder' under my home dir, and created the rpmbuild dirs under that.
So what build dir shall I go for?
Kind Regards,
Keith Roberts
Moved from a previous thread :)
On Thu, 16 Dec 2010, John Hodrien wrote:
To: CentOS mailing list centos@centos.org From: John Hodrien J.H.Hodrien@leeds.ac.uk Subject: Re: [CentOS] Stripping silent periods from MP3s
On Thu, 16 Dec 2010, Keith Roberts wrote:
Thanks for all the responses!
I've read MaximumRPM from:
http://www.rpm.org/max-rpm-snapshot/index.html
Which helped me a great deal.
I'll start a new thread regarding using RPM to build packages.
You'll find MaximumRPM will have taught you a whole lot you didn't need to know (not that this is a bad thing). In this case, it really should have been a case of:
yum install lame wget src.rpm rpmbuild --rebuild src.rpm rpm -Uvh --force shiny-new-binary.rpm
No twiddling with the spec file was required, as it already auto-detected the presence of lame.
jh
Thanks for that John.
I read MaxRPM once before, so just going over the build part again. I want to be able to build my own Linux/Centos RPM's, and then post them on my website. May even make a 3rd party repo. I obviously know the ./configure, make, make install and autoconf and automake stuff, so doing RPM's and a repo should not be that difficult to work out.
Kind Regards,
Keith Roberts
sox-12.18.1-1.src.rpm [root@karsites sox]# [root@karsites sox]# rpm -iv sox-12.18.1-1.src.rpm sox-12.18.1-1 warning: user mockbuild does not exist - using root warning: group mockbuild does not exist - using root
What's that all about - user mockbuild?
Is that a user created by one of the rpm builder scripts?
Kind Regards,
Keith Roberts
Hello Keith,
On Thu, 2010-12-16 at 15:25 +0000, Keith Roberts wrote:
What's that all about - user mockbuild?
Is that a user created by one of the rpm builder scripts?
No, it's the user that mock uses for its builds. Most if not all upstream rpms are built using mock and so are the CentOS rpms.
Regards, Leonard.
On Thu, 16 Dec 2010, Leonard den Ottolander wrote:
To: CentOS mailing list centos@centos.org From: Leonard den Ottolander leonard@den.ottolander.nl Subject: Re: [CentOS] Building packages using RPMBUILD
Hello Keith,
On Thu, 2010-12-16 at 15:25 +0000, Keith Roberts wrote:
What's that all about - user mockbuild?
Is that a user created by one of the rpm builder scripts?
No, it's the user that mock uses for its builds. Most if not all upstream rpms are built using mock and so are the CentOS rpms.
Regards, Leonard.
Hi Leonard.
Thanks for that.
So I don't need to worry about that!
Regards,
Keith
Hello Keith,
(Oops, send out the previous mail before it was finished.)
On Thu, 2010-12-16 at 15:08 +0000, Keith Roberts wrote:
[rpmbuilder@karsites sox]$ rpm -iv ./sox-12.18.1-1.src.rpm error: cannot write to %sourcedir /usr/src/redhat/SOURCES
/usr/src/redhat and sub dirs are owned root.root. If you want to build as a normal user (and you should!) you should fix the ownership of those directories.
Is there a package I need to install and run to set things up corectly?
redhat-rpm-config sets certain build macros. Although not strictly required you should probably always install this packages. One thing I stumbled on is that a new type of check summing is used nowadays for the content of the rpms. If the correct macro isn't set you might run into installation conflicts, f.e. for multilib doc files.
I have created a user called 'rpmbuilder' under my home dir, and created the rpmbuild dirs under that.
If you make a different user to do builds you should rather give it its own home dir. But you can just as well build using your default account.
So what build dir shall I go for?
Whatever you prefer. Just using /usr/src/redhat is probably the easiest. If you want to use a different path scheme you can override the default settings in ~/.rpmmacros to suit your needs.
For example, I use %_sourcedir %{_topdir}/%{name}-%{version} %_specdir %{_sourcedir} so the source files end up in their own directory and not all in the same SOURCES dir.
Regards, Leonard.
On Thu, 16 Dec 2010, Leonard den Ottolander wrote:
To: CentOS mailing list centos@centos.org From: Leonard den Ottolander leonard@den.ottolander.nl Subject: Re: [CentOS] Building packages using RPMBUILD
Hello Keith,
(Oops, send out the previous mail before it was finished.)
OK!
On Thu, 2010-12-16 at 15:08 +0000, Keith Roberts wrote:
[rpmbuilder@karsites sox]$ rpm -iv ./sox-12.18.1-1.src.rpm error: cannot write to %sourcedir /usr/src/redhat/SOURCES
/usr/src/redhat and sub dirs are owned root.root. If you want to build as a normal user (and you should!) you should fix the ownership of those directories.
Right. I did su to root, and it work OK. But will chown those if I decide to use that branch of dirs.
Is there a package I need to install and run to set things up corectly?
redhat-rpm-config sets certain build macros. Although not strictly required you should probably always install this packages. One thing I stumbled on is that a new type of check summing is used nowadays for the content of the rpms. If the correct macro isn't set you might run into installation conflicts, f.e. for multilib doc files.
That's installed OK.
Installed Packages Name : redhat-rpm-config Arch : noarch Version : 8.0.45 Release : 32.el5.centos Size : 128 k Repo : installed Summary : CentOS specific rpm configuration files. License : GPL Description: CentOS specific rpm configuration files.
double-tabbing on rpm gives me:
[root@karsites ~]# rpm rpm rpmdev-diff rpmdev-sha384 rpmlint rpm2cpio rpmdev-extract rpmdev-sha512 rpmls rpmargs rpmdev-md5 rpmdev-sum rpmpeek rpmbuild rpmdev-newspec rpmdev-vercmp rpmquery rpmbuild-md5 rpmdev-rmdevelrpms rpmdev-wipetree rpmsign rpmdb rpmdev-setuptree rpmdiff rpmsodiff rpmdev-bumpspec rpmdev-sha1 rpmelfsym rpmsoname rpmdev-checksig rpmdev-sha224 rpmfile rpmverify rpmdev-cksum rpmdev-sha256 rpminfo
I have created a user called 'rpmbuilder' under my home dir, and created the rpmbuild dirs under that.
If you make a different user to do builds you should rather give it its own home dir. But you can just as well build using your default account.
Sorry, I meant I have created a new user account under the /home/rpmbuilder directory.
So what build dir shall I go for?
Whatever you prefer. Just using /usr/src/redhat is probably the easiest. If you want to use a different path scheme you can override the default settings in ~/.rpmmacros to suit your needs.
For example, I use %_sourcedir %{_topdir}/%{name}-%{version} %_specdir %{_sourcedir} so the source files end up in their own directory and not all in the same SOURCES dir.
That's a handy tip to know!
Thanks again.
I'll see how things go now.
Kind Regards,
Keith
Hello Keith,
On Thu, 2010-12-16 at 15:08 +0000, Keith Roberts wrote:
[rpmbuilder@karsites sox]$ rpm -iv ./sox-12.18.1-1.src.rpm error: cannot write to %sourcedir /usr/src/redhat/SOURCES
/usr/src/redhat and sub dirs are owned root.root. If you want to build as a normal user (and you should!) you should fix the ownership of those directories.
Is there a package I need to install and run to set things up corectly?
redhat-rpm-config sets certain build macros. Although not strictly required you should probably always install this packages. One thing I stumbled on is that a new type of check summing is used nowadays for the content of the rpms. If the correct macro isn't set you might run into installation conflicts, f.e. for multilib doc files.
I have created a user called 'rpmbuilder' under my home dir, and created the rpmbuild dirs under that.
If you make a different user to do builds you should rather give it its own home dir. But you can just as well build using your default account.
So what build dir shall I go for?
Whatever you prefer. Just using /usr/src/redhat is probably the easiest. If you want to use a different path scheme you can override the default settings in ~/.rpmmacros to suit your needs. %_sourcedir %{_topdir}/%{name}-%{version} %_binary_filedigest_algorithm 8 Regards, Leonard.
At Thu, 16 Dec 2010 17:00:23 +0100 CentOS mailing list centos@centos.org wrote:
Hello Keith,
On Thu, 2010-12-16 at 15:08 +0000, Keith Roberts wrote:
[rpmbuilder@karsites sox]$ rpm -iv ./sox-12.18.1-1.src.rpm error: cannot write to %sourcedir /usr/src/redhat/SOURCES
/usr/src/redhat and sub dirs are owned root.root. If you want to build as a normal user (and you should!) you should fix the ownership of those directories.
Even better would be to create the directories under your home dir and then include a line like:
%_topdir /home/rpmbuilder/src
in ~/.rpmmacros
Is there a package I need to install and run to set things up corectly?
redhat-rpm-config sets certain build macros. Although not strictly required you should probably always install this packages. One thing I stumbled on is that a new type of check summing is used nowadays for the content of the rpms. If the correct macro isn't set you might run into installation conflicts, f.e. for multilib doc files.
I have created a user called 'rpmbuilder' under my home dir, and created the rpmbuild dirs under that.
If you make a different user to do builds you should rather give it its own home dir. But you can just as well build using your default account.
So what build dir shall I go for?
Whatever you prefer. Just using /usr/src/redhat is probably the easiest. If you want to use a different path scheme you can override the default settings in ~/.rpmmacros to suit your needs. %_sourcedir %{_topdir}/%{name}-%{version} %_binary_filedigest_algorithm 8 Regards, Leonard.
On Thu, 16 Dec 2010, Robert Heller wrote:
To: CentOS mailing list centos@centos.org From: Robert Heller heller@deepsoft.com Subject: Re: [CentOS] Building packages using RPMBUILD
At Thu, 16 Dec 2010 17:00:23 +0100 CentOS mailing list centos@centos.org wrote:
Hello Keith,
On Thu, 2010-12-16 at 15:08 +0000, Keith Roberts wrote:
[rpmbuilder@karsites sox]$ rpm -iv ./sox-12.18.1-1.src.rpm error: cannot write to %sourcedir /usr/src/redhat/SOURCES
/usr/src/redhat and sub dirs are owned root.root. If you want to build as a normal user (and you should!) you should fix the ownership of those directories.
Even better would be to create the directories under your home dir and then include a line like:
%_topdir /home/rpmbuilder/src
in ~/.rpmmacros
OK.
Will try that as well.
Why is better to use a new user account under /home/rpmbuilder
than the default that rpm installs source rpms to?
Keith
On Thu, Dec 16, 2010 at 11:00 AM, Leonard den Ottolander leonard@den.ottolander.nl wrote:
Hello Keith,
On Thu, 2010-12-16 at 15:08 +0000, Keith Roberts wrote:
[rpmbuilder@karsites sox]$ rpm -iv ./sox-12.18.1-1.src.rpm error: cannot write to %sourcedir /usr/src/redhat/SOURCES
/usr/src/redhat and sub dirs are owned root.root. If you want to build as a normal user (and you should!) you should fix the ownership of those directories.
NO. Never do this.
Use a personal .rpmmacros file to reset your personal working directories, so you can compile locally.
%_topdir /home/username/rpm
On 12/16/2010 3:20 PM, Nico Kadel-Garcia wrote:
On Thu, Dec 16, 2010 at 11:00 AM, Leonard den Ottolander leonard@den.ottolander.nl wrote:
Hello Keith,
On Thu, 2010-12-16 at 15:08 +0000, Keith Roberts wrote:
[rpmbuilder@karsites sox]$ rpm -iv ./sox-12.18.1-1.src.rpm error: cannot write to %sourcedir /usr/src/redhat/SOURCES
/usr/src/redhat and sub dirs are owned root.root. If you want to build as a normal user (and you should!) you should fix the ownership of those directories.
NO. Never do this.
Use a personal .rpmmacros file to reset your personal working directories, so you can compile locally.
%_topdir /home/username/rpm
Here are the steps I use:
mkdir $HOME/rpm mkdir $HOME/rpm/SOURCES mkdir $HOME/rpm/SPECS mkdir $HOME/rpm/BUILD mkdir $HOME/rpm/SRPMS mkdir $HOME/rpm/RPMS mkdir $HOME/rpm/RPMS/i386 echo "%_topdir $HOME/rpm" >> $HOME/.rpmmacros
You may also want an x86_64 directory depending on what you are building.
At Thu, 16 Dec 2010 15:34:33 -0500 CentOS mailing list centos@centos.org wrote:
On 12/16/2010 3:20 PM, Nico Kadel-Garcia wrote:
On Thu, Dec 16, 2010 at 11:00 AM, Leonard den Ottolander leonard@den.ottolander.nl wrote:
Hello Keith,
On Thu, 2010-12-16 at 15:08 +0000, Keith Roberts wrote:
[rpmbuilder@karsites sox]$ rpm -iv ./sox-12.18.1-1.src.rpm error: cannot write to %sourcedir /usr/src/redhat/SOURCES
/usr/src/redhat and sub dirs are owned root.root. If you want to build as a normal user (and you should!) you should fix the ownership of those directories.
NO. Never do this.
Use a personal .rpmmacros file to reset your personal working directories, so you can compile locally.
%_topdir /home/username/rpm
Here are the steps I use:
mkdir $HOME/rpm mkdir $HOME/rpm/SOURCES mkdir $HOME/rpm/SPECS mkdir $HOME/rpm/BUILD mkdir $HOME/rpm/SRPMS mkdir $HOME/rpm/RPMS mkdir $HOME/rpm/RPMS/i386 echo "%_topdir $HOME/rpm" >> $HOME/.rpmmacros
You may also want an x86_64 directory depending on what you are building.
Some packages will want a i486, i586, i686, and/or athlon directory. Oh, you will need a noarch directory also.
On Thu, 16 Dec 2010, Bowie Bailey wrote:
To: centos@centos.org From: Bowie Bailey Bowie_Bailey@BUC.com Subject: Re: [CentOS] Building packages using RPMBUILD
On 12/16/2010 3:20 PM, Nico Kadel-Garcia wrote:
On Thu, Dec 16, 2010 at 11:00 AM, Leonard den Ottolander leonard@den.ottolander.nl wrote:
Hello Keith,
On Thu, 2010-12-16 at 15:08 +0000, Keith Roberts wrote:
[rpmbuilder@karsites sox]$ rpm -iv ./sox-12.18.1-1.src.rpm error: cannot write to %sourcedir /usr/src/redhat/SOURCES
/usr/src/redhat and sub dirs are owned root.root. If you want to build as a normal user (and you should!) you should fix the ownership of those directories.
NO. Never do this.
Use a personal .rpmmacros file to reset your personal working directories, so you can compile locally.
%_topdir /home/username/rpm
Here are the steps I use:
mkdir $HOME/rpm mkdir $HOME/rpm/SOURCES mkdir $HOME/rpm/SPECS mkdir $HOME/rpm/BUILD mkdir $HOME/rpm/SRPMS mkdir $HOME/rpm/RPMS mkdir $HOME/rpm/RPMS/i386 echo "%_topdir $HOME/rpm" >> $HOME/.rpmmacros
You may also want an x86_64 directory depending on what you are building.
I've done something similar now.
Here's what I have got so far:
[root@karsites rpmbuilder]# ls -la total 60 drwx------ 10 rpmbuilder rpmbuilder 4096 Dec 16 17:54 . drwxr-xr-x 5 root root 4096 Dec 16 14:09 .. -rw------- 1 rpmbuilder rpmbuilder 208 Dec 16 15:22 .bash_history -rw-r--r-- 1 rpmbuilder rpmbuilder 33 Jan 22 2009 .bash_logout -rw-r--r-- 1 rpmbuilder rpmbuilder 176 Jan 22 2009 .bash_profile -rw-r--r-- 1 rpmbuilder rpmbuilder 124 Jan 22 2009 .bashrc drwxrwxr-x 2 rpmbuilder rpmbuilder 4096 Dec 16 14:11 BUILD drwxr-xr-x 3 rpmbuilder rpmbuilder 4096 Aug 12 2002 .kde drwxrwxr-x 2 rpmbuilder rpmbuilder 4096 Dec 16 15:21 .mc drwxr-xr-x 4 rpmbuilder rpmbuilder 4096 Dec 9 23:44 .mozilla -rw-r--r-- 1 rpmbuilder rpmbuilder 34 Dec 16 17:54 .rpmmacros drwxrwxr-x 9 rpmbuilder rpmbuilder 4096 Dec 16 17:51 RPMS drwxrwxr-x 2 rpmbuilder rpmbuilder 4096 Dec 16 14:11 SOURCES drwxrwxr-x 2 rpmbuilder rpmbuilder 4096 Dec 16 14:11 SPECS drwxrwxr-x 2 rpmbuilder rpmbuilder 4096 Dec 16 14:11 SRPMS [root@karsites rpmbuilder]#
and:
[root@karsites home]# tree -Af -a rpmbuilder rpmbuilder ├── rpmbuilder/.bash_history ├── rpmbuilder/.bash_logout ├── rpmbuilder/.bash_profile ├── rpmbuilder/.bashrc ├── rpmbuilder/.kde │ └── rpmbuilder/.kde/Autostart │ └── rpmbuilder/.kde/Autostart/.directory ├── rpmbuilder/.mc │ ├── rpmbuilder/.mc/Tree │ ├── rpmbuilder/.mc/history │ └── rpmbuilder/.mc/ini ├── rpmbuilder/.mozilla │ ├── rpmbuilder/.mozilla/extensions │ └── rpmbuilder/.mozilla/plugins ├── rpmbuilder/.rpmmacros ├── rpmbuilder/BUILD ├── rpmbuilder/RPMS │ ├── rpmbuilder/RPMS/athlon │ ├── rpmbuilder/RPMS/geode │ ├── rpmbuilder/RPMS/i386 │ ├── rpmbuilder/RPMS/i486 │ ├── rpmbuilder/RPMS/i586 │ ├── rpmbuilder/RPMS/i686 │ └── rpmbuilder/RPMS/noarch ├── rpmbuilder/SOURCES ├── rpmbuilder/SP └── rpmbuilder/SRPMS
18 directories, 9 files
I also did a directory comparison using Kdif3, on /usr/src/redhat and /home/rpmbuilder. Then made the directories structures for rpmbuilder the same as redhat's - plus my extra files of course.
Thanks for all the input so far.
Keith
Hello Nico,
On Thu, 2010-12-16 at 15:20 -0500, Nico Kadel-Garcia wrote:
On Thu, Dec 16, 2010 at 11:00 AM, Leonard den Ottolander
/usr/src/redhat and sub dirs are owned root.root. If you want to build as a normal user (and you should!) you should fix the ownership of those directories.
NO. Never do this.
Why would that be a problem?
Regards, Leonard.
Leonard den Ottolander wrote:
Hello Nico,
On Thu, 2010-12-16 at 15:20 -0500, Nico Kadel-Garcia wrote:
On Thu, Dec 16, 2010 at 11:00 AM, Leonard den Ottolander
/usr/src/redhat and sub dirs are owned root.root. If you want to build as a normal user (and you should!) you should fix the ownership of those directories.
NO. Never do this.
Why would that be a problem?
One possibility: suppose someone cracks in as the user that owns those directories. They could then install whatever they want in there... and the next time you built and installed something, it could carry their payload.
mark
On Thu, 16 Dec 2010, m.roth@5-cent.us wrote:
To: CentOS mailing list centos@centos.org From: m.roth@5-cent.us Subject: Re: [CentOS] Building packages using RPMBUILD
Leonard den Ottolander wrote:
Hello Nico,
On Thu, 2010-12-16 at 15:20 -0500, Nico Kadel-Garcia wrote:
On Thu, Dec 16, 2010 at 11:00 AM, Leonard den Ottolander
/usr/src/redhat and sub dirs are owned root.root. If you want to build as a normal user (and you should!) you should fix the ownership of those directories.
NO. Never do this.
Why would that be a problem?
One possibility: suppose someone cracks in as the user that owns those directories. They could then install whatever they want in there... and the next time you built and installed something, it could carry their payload.
That's a good point, bu if they get in as root, they can access any build branch they want to, under any user account.
Keith
At Thu, 16 Dec 2010 21:26:19 +0000 (GMT) CentOS mailing list centos@centos.org wrote:
On Thu, 16 Dec 2010, m.roth@5-cent.us wrote:
To: CentOS mailing list centos@centos.org From: m.roth@5-cent.us Subject: Re: [CentOS] Building packages using RPMBUILD
Leonard den Ottolander wrote:
Hello Nico,
On Thu, 2010-12-16 at 15:20 -0500, Nico Kadel-Garcia wrote:
On Thu, Dec 16, 2010 at 11:00 AM, Leonard den Ottolander
/usr/src/redhat and sub dirs are owned root.root. If you want to build as a normal user (and you should!) you should fix the ownership of those directories.
NO. Never do this.
Why would that be a problem?
One possibility: suppose someone cracks in as the user that owns those directories. They could then install whatever they want in there... and the next time you built and installed something, it could carry their payload.
That's a good point, bu if they get in as root, they can access any build branch they want to, under any user account.
If they get in as root, you are totally hosed and probably need to do a wipe and re-install.
Keith
Hello Mark,
On Thu, 2010-12-16 at 16:21 -0500, m.roth@5-cent.us wrote:
One possibility: suppose someone cracks in as the user that owns those directories. They could then install whatever they want in there... and the next time you built and installed something, it could carry their payload.
How would that be more of an issue using /usr/src/redhat than any other directory?
And seeing that most builds start with either installing a srpm or building directly in which case that srpm is also being freshly installed how is this enabling an attacker to deliver a payload?
Regards, Leonard.
On Thu, Dec 16, 2010 at 3:49 PM, Leonard den Ottolander leonard@den.ottolander.nl wrote:
Hello Nico,
On Thu, 2010-12-16 at 15:20 -0500, Nico Kadel-Garcia wrote:
On Thu, Dec 16, 2010 at 11:00 AM, Leonard den Ottolander
/usr/src/redhat and sub dirs are owned root.root. If you want to build as a normal user (and you should!) you should fix the ownership of those directories.
NO. Never do this.
Why would that be a problem?
Regards, Leonard.
There are easily half a dozen reasons. The first one is that this is where root runs their builds: if you leave it with write permission for other users, they can replace components behind your back. Worse, they can replace the .spec file, so when software is built, it runs as the root user. Since various components do rely on RPM rebuilding, such as HP's "Proliant Service Pack", it inserts a great glaring vulnerability to leverage when the rebuild occurs.
Second, if you open the permissions there, multiple users can step on each other building similar packages at the same time, especially if they happen to be different versions of the same software.
The third reason one is that "/usr" is typically of modest size, and leaving it open for RPM development can lead to many gigabytes of inappropriate debris scattering it. Many modern systems have a much larger /usr than they used to, but having to allocate that much extra space for compilation efforts may cause other interesting resource allocation problems. And overflowing /usr can cause very serious problems indeed.
Hello Nico,
On Fri, 2010-12-17 at 08:01 -0500, Nico Kadel-Garcia wrote:
There are easily half a dozen reasons. The first one is that this is where root runs their builds: if you leave it with write permission for other users,
Second, if you open the permissions there, multiple users can step on each other building similar packages at the same time,
I only suggested chowning to a single trusted user, not opening that directory to all users.
The third reason one is that "/usr" is typically of modest size, and leaving it open for RPM development can lead to many gigabytes of inappropriate debris scattering it.
I didn't mention this, but of course I use a separate partition for /usr/src in this setup. This way my home directory doesn't get cluttered with the remains of multiple builds that don't need backing up.
Regards, Leonard.
Leonard den Ottolander wrote:
Hello Nico, On Fri, 2010-12-17 at 08:01 -0500, Nico Kadel-Garcia wrote:
There are easily half a dozen reasons. The first one is that this is where root runs their builds: if you leave it with write permission for other users,
Second, if you open the permissions there, multiple users can step on each other building similar packages at the same time,
I only suggested chowning to a single trusted user, not opening that directory to all users.
<snip> Yes, but.... I don't know if you're doing this at work, or home. If the former, what happens when someone else uses that to build, either a co-worker, or you move on to a better job (or get hit by a car), who doesn't know what's going on. It's better to leave the system in the way it was intended, in terms of ownership and permissions, and so it's in a known state.
mark
On Thursday, December 16, 2010 10:08:12 am Keith Roberts wrote:
Is there a package I need to install and run to set things up corectly?
[snip]
So what build dir shall I go for?
See the Fedora packaging guidelines, and install 'fedora-packager' from EPEL to get the tools that help you set up a normal user build environment. This works quite well for the most part, and should work better in 6.
On Thu, 16 Dec 2010, Lamar Owen wrote:
To: CentOS mailing list centos@centos.org From: Lamar Owen lowen@pari.edu Subject: Re: [CentOS] Building packages using RPMBUILD
On Thursday, December 16, 2010 10:08:12 am Keith Roberts wrote:
Is there a package I need to install and run to set things up corectly?
[snip]
So what build dir shall I go for?
See the Fedora packaging guidelines, and install 'fedora-packager' from EPEL to get the tools that help you set up a normal user build environment. This works quite well for the most part, and should work better in 6.
I've done that now.
I had already installed the packages mentioned in the Centos wiki.
These won't cause conflicts at all with each other?
Keith
On Thursday, December 16, 2010 11:11:17 am Keith Roberts wrote:
I had already installed the packages mentioned in the Centos wiki.
These won't cause conflicts at all with each other?
Don't know for sure, but in the case of RPMs I've built on CentOS 4 and 5 in the past they coexisted ok. But I need to double check the wiki to make sure I'm doing it the same way 'recommended'; I've been building my own RPMs for different purposes for a long time (right now 12 years total, and it's been 11 years since the start of my five year stint maintaining the PostgreSQL RPM set, some work of which you're still using if you're still using CentOS 3 or 4 in production), so I'm going to see things from a different point of view than someone who hasn't ever done it.
Try it out and see.
On Thu, Dec 16, 2010 at 8:11 AM, Keith Roberts keith@karsites.net wrote:
I had already installed the packages mentioned in the Centos wiki.
I assume you are referring to this wiki:
http://wiki.centos.org/HowTos/SetupRpmBuildEnvironment
If not, I strongly recommend reading it through. Up front it warns you to not do the build as root. It provides the details for setting up the build environment which will help you understand the whole process. Installing some rpms may be convenient but you may miss the chance of learning. :-)
Akemi
On Thu, 16 Dec 2010, Akemi Yagi wrote:
To: CentOS mailing list centos@centos.org From: Akemi Yagi amyagi@gmail.com Subject: Re: [CentOS] Building packages using RPMBUILD
On Thu, Dec 16, 2010 at 8:11 AM, Keith Roberts keith@karsites.net wrote:
I had already installed the packages mentioned in the Centos wiki.
I assume you are referring to this wiki:
Thanks Akemi.
I was refering to this Centos wiki article:
http://wiki.centos.org/HowTos/I_need_the_Kernel_Source
The second part.
I'll read up on the link you sent me.
Thanks for that.
Is the link you sent me more relevant than the MaxRPM guidelines:
http://www.rpm.org/max-rpm-snapshot/p5206.html
Kind Regards,
Keith
If not, I strongly recommend reading it through. Up front it warns you to not do the build as root. It provides the details for setting up the build environment which will help you understand the whole process. Installing some rpms may be convenient but you may miss the chance of learning. :-)
Akemi _______________________________________________ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
On Thu, Dec 16, 2010 at 8:33 AM, Keith Roberts keith@karsites.net wrote:
On Thu, 16 Dec 2010, Akemi Yagi wrote:
I was refering to this Centos wiki article:
http://wiki.centos.org/HowTos/I_need_the_Kernel_Source
The second part.
I'll read up on the link you sent me.
That is a "digest" version of the SetupRpmBuildEnvironment page.
Is the link you sent me more relevant than the MaxRPM guidelines:
The CentOS wiki has been written for ... CentOS users. :-O The info in there is supposed to be enough for building rpms under CentOS. If, on the other hand, you find something that is missing in the article, please report to the centos-docs mailing list. It's a wiki, so contributions from users are always welcomed.
Akemi
On Thu, 16 Dec 2010, Akemi Yagi wrote:
To: CentOS mailing list centos@centos.org From: Akemi Yagi amyagi@gmail.com Subject: Re: [CentOS] Building packages using RPMBUILD
On Thu, Dec 16, 2010 at 8:11 AM, Keith Roberts keith@karsites.net wrote:
I had already installed the packages mentioned in the Centos wiki.
I assume you are referring to this wiki:
http://wiki.centos.org/HowTos/SetupRpmBuildEnvironment
If not, I strongly recommend reading it through. Up front it warns you to not do the build as root. It provides the details for setting up the build environment which will help you understand the whole process. Installing some rpms may be convenient but you may miss the chance of learning. :-)
Is there a tutorial on how to create your own third party repository for Centos please?
That's something I've been meaning to do for a long time.
Now I have cloud hosting, the download bandwidth and usage is no longer an issue.
Keith
On Thu, Dec 16, 2010 at 9:40 AM, Keith Roberts keith@karsites.net wrote:
Is there a tutorial on how to create your own third party repository for Centos please?
That's something I've been meaning to do for a long time.
Now I have cloud hosting, the download bandwidth and usage is no longer an issue.
Here :)
http://wiki.centos.org/HowTos/CreateLocalMirror
and
http://wiki.centos.org/HowTos/CreateLocalRepos
Akemi
On Thu, 16 Dec 2010, Akemi Yagi wrote:
To: CentOS mailing list centos@centos.org From: Akemi Yagi amyagi@gmail.com Subject: Re: [CentOS] Building packages using RPMBUILD
On Thu, Dec 16, 2010 at 9:40 AM, Keith Roberts keith@karsites.net wrote:
Is there a tutorial on how to create your own third party repository for Centos please?
That's something I've been meaning to do for a long time.
Now I have cloud hosting, the download bandwidth and usage is no longer an issue.
Here :)
http://wiki.centos.org/HowTos/CreateLocalMirror
and
http://wiki.centos.org/HowTos/CreateLocalRepos
Akemi
Thanks for those links Akemi.
Something else to gen up on :)
Keith
On Thu, 16 Dec 2010, Akemi Yagi wrote:
To: CentOS mailing list centos@centos.org From: Akemi Yagi amyagi@gmail.com Subject: Re: [CentOS] Building packages using RPMBUILD
On Thu, Dec 16, 2010 at 8:11 AM, Keith Roberts keith@karsites.net wrote:
I had already installed the packages mentioned in the Centos wiki.
I assume you are referring to this wiki:
http://wiki.centos.org/HowTos/SetupRpmBuildEnvironment
If not, I strongly recommend reading it through. Up front it warns you to not do the build as root. It provides the details for setting up the build environment which will help you understand the whole process. Installing some rpms may be convenient but you may miss the chance of learning. :-)
I have followed the above tutorial, which was well written, and easy to understand.
Then I started on this one, linked to from the above Wiki page:
Building Source RPM as non-root under CentOS
http://www.owlriver.com/tips/non-root/
Got up to here:
Let's build something -- As a simple example, we have a local SRPM copy of the 'joe' text editor at a permanent location (backup is here). Let's get a copy and build it as non root [we have numbered the lines, so that we may refer to specifics after we are done]:
1 [herrold@dhcp-233 ~]$ cd 2 [herrold@dhcp-233 ~]$ mkdir build 3 [herrold@dhcp-233 ~]$ cd build 4 [herrold@dhcp-233 build]$ mkdir joe 5 [herrold@dhcp-233 build]$ cd joe 6 [herrold@dhcp-233 joe]$ joe README 7 [herrold@dhcp-233 joe]$ wget ftp://ftp.owlriver.com/pub/mirror/ORC/joe/joe-2.9.8-4.src.rpm 8 [herrold@dhcp-233 joe]$ rpmbuild --rebuild joe-2.9.8-4.src.rpm
In reviewing the commands above, we did this:
1. Move to the home directory 2. Make the ~/build/ subdirectory 3. Move into the ~/build/ subdirectory 4. Make the ~/build/joe/ subdirectory 5. Move into ~/build/joe/ subdirectory 6. Update our notes in the README 7. Retrieve the SRPM using wget 8. Build the binary RPM
When we inspect: ~/rpmbuild/RPMS/i386/ we find the binary file: joe-2.9.8-4.i386.rpm
...
and the build process works OK! I had to install ncurses-devel (did that as root) for joe to build OK.
Then I did my new sox program, which built fine first time. So I well pleased to have rebuilt 2 src.rpm files.
Now I know my build environment works OK, I can try building some other packages, by editing their spec files.
Thanks to everyone for all the help I received with this.
Looks like there might be another third party Centos repo on the horizon soon ;)
I guess I'll get my head down with another pass at MaximumRPM now.
Kind Regards,
Keith Roberts
Hi all.
I have downloaded the source rpm for qps fc6, but get the following error message:
[rpmbuilder@karsites qps]$ ls qps-1.9.18.6-1.fc6.src.rpm [rpmbuilder@karsites qps]$ rpm -K qps-1.9.18.6-1.fc6.src.rpm qps-1.9.18.6-1.fc6.src.rpm: (SHA1) DSA sha1 md5 (GPG) NOT OK (MISSING KEYS: GPG#1ac70ce6)
[rpmbuilder@karsites qps]$ rpm -Kv qps-1.9.18.6-1.fc6.src.rpm qps-1.9.18.6-1.fc6.src.rpm: Header V3 DSA signature: NOKEY, key ID 1ac70ce6 Header SHA1 digest: OK (d57f0bbeb1e8fe1cdbe0bc3cc70fdfeecc205831) MD5 digest: OK (47d180d6f6ca005dc78c5a65078c71c8) V3 DSA signature: NOKEY, key ID 1ac70ce6
I have found the missing FC6 key at:
http://keys.gnupg.net:11371/pks/lookup?search=0x1AC70CE6&op=index
But how do I add it to my GPG public keyring please?
Regards,
Keith
gpg --import-key yourkey.asc
done!
Sent from my iPhone
On Dec 18, 2010, at 1:31 PM, Keith Roberts keith@karsites.net wrote:
Hi all.
I have downloaded the source rpm for qps fc6, but get the following error message:
[rpmbuilder@karsites qps]$ ls qps-1.9.18.6-1.fc6.src.rpm [rpmbuilder@karsites qps]$ rpm -K qps-1.9.18.6-1.fc6.src.rpm qps-1.9.18.6-1.fc6.src.rpm: (SHA1) DSA sha1 md5 (GPG) NOT OK (MISSING KEYS: GPG#1ac70ce6)
[rpmbuilder@karsites qps]$ rpm -Kv qps-1.9.18.6-1.fc6.src.rpm qps-1.9.18.6-1.fc6.src.rpm: Header V3 DSA signature: NOKEY, key ID 1ac70ce6 Header SHA1 digest: OK (d57f0bbeb1e8fe1cdbe0bc3cc70fdfeecc205831) MD5 digest: OK (47d180d6f6ca005dc78c5a65078c71c8) V3 DSA signature: NOKEY, key ID 1ac70ce6
I have found the missing FC6 key at:
http://keys.gnupg.net:11371/pks/lookup?search=0x1AC70CE6&op=index
But how do I add it to my GPG public keyring please?
Regards,
Keith
-- In theory, theory and practice are the same; in practice they are not.
This email was sent from my laptop with Centos 5.5 _______________________________________________ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
On Sat, 18 Dec 2010, Tim Dunphy wrote:
To: CentOS mailing list centos@centos.org From: Tim Dunphy bluethundr@gmail.com Subject: Re: [CentOS] Building packages using RPMBUILD
gpg --import-key yourkey.asc
done!
Sent from my iPhone
Thanks for your reply Tim. It still does not work though.
[rpmbuilder@karsites qps]$ ls Fedora6-GPG-public-key.asc qps-1.9.18.6-1.fc6.src.rpm [rpmbuilder@karsites qps]$ gpg --import Fedora6-GPG-public-key.asc gpg: key 1AC70CE6: "Fedora Project fedora-extras@fedoraproject.org" not changed gpg: Total number processed: 1 gpg: unchanged: 1 [rpmbuilder@karsites qps]$ gpg --list-keys /home/rpmbuilder/.gnupg/pubring.gpg ----------------------------------- pub 1024D/1AC70CE6 2004-12-14 uid Fedora Project fedora-extras@fedoraproject.org uid Fedora Project fedora-extras@redhat.com uid Fedora Pre Extras Release pre-extras@fedoraproject.org sub 1024g/4E1A9D43 2004-12-14
[rpmbuilder@karsites qps]$ [rpmbuilder@karsites qps]$ rpm -K qps-1.9.18.6-1.fc6.src.rpm qps-1.9.18.6-1.fc6.src.rpm: (SHA1) DSA sha1 md5 (GPG) NOT OK (MISSING KEYS: GPG#1ac70ce6)
I copied the key from the website, and pasted it into the text file.
Any ideas what's happening please?
Kind Regards,
Keith
On Dec 18, 2010, at 1:31 PM, Keith Roberts keith@karsites.net wrote:
Hi all.
I have downloaded the source rpm for qps fc6, but get the following error message:
[rpmbuilder@karsites qps]$ ls qps-1.9.18.6-1.fc6.src.rpm [rpmbuilder@karsites qps]$ rpm -K qps-1.9.18.6-1.fc6.src.rpm qps-1.9.18.6-1.fc6.src.rpm: (SHA1) DSA sha1 md5 (GPG) NOT OK (MISSING KEYS: GPG#1ac70ce6)
[rpmbuilder@karsites qps]$ rpm -Kv qps-1.9.18.6-1.fc6.src.rpm qps-1.9.18.6-1.fc6.src.rpm: Header V3 DSA signature: NOKEY, key ID 1ac70ce6 Header SHA1 digest: OK (d57f0bbeb1e8fe1cdbe0bc3cc70fdfeecc205831) MD5 digest: OK (47d180d6f6ca005dc78c5a65078c71c8) V3 DSA signature: NOKEY, key ID 1ac70ce6
I have found the missing FC6 key at:
http://keys.gnupg.net:11371/pks/lookup?search=0x1AC70CE6&op=index
But how do I add it to my GPG public keyring please?
Regards,
Keith
-- In theory, theory and practice are the same; in practice they are not.
This email was sent from my laptop with Centos 5.5 _______________________________________________ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
On Sat, 18 Dec 2010, Keith Roberts wrote:
gpg --import-key yourkey.asc
Thanks for your reply Tim. It still does not work though.
[rpmbuilder@karsites qps]$ gpg --import Fedora6-GPG-public-key.asc
[rpmbuilder@karsites qps]$ rpm -K qps-1.9.18.6-1.fc6.src.rpm qps-1.9.18.6-1.fc6.src.rpm: (SHA1) DSA sha1 md5 (GPG) NOT OK (MISSING KEYS: GPG#1ac70ce6)
Different issue in play here -- rpm (and also perhaps rpmbuild if a --rebuild is used) needs the key in the rpm database to consult
Probably as root you want:
# rpm --import Fedora6-GPG-public-key.asc
and then that objection will be silenced
-- Russ herrold
On Sat, 18 Dec 2010, R P Herrold wrote:
To: CentOS mailing list centos@centos.org From: R P Herrold herrold@centos.org Subject: [CentOS] Building packages using RPMBUILD
On Sat, 18 Dec 2010, Keith Roberts wrote:
gpg --import-key yourkey.asc
Thanks for your reply Tim. It still does not work though.
[rpmbuilder@karsites qps]$ gpg --import Fedora6-GPG-public-key.asc
[rpmbuilder@karsites qps]$ rpm -K qps-1.9.18.6-1.fc6.src.rpm qps-1.9.18.6-1.fc6.src.rpm: (SHA1) DSA sha1 md5 (GPG) NOT OK (MISSING KEYS: GPG#1ac70ce6)
Different issue in play here -- rpm (and also perhaps rpmbuild if a --rebuild is used) needs the key in the rpm database to consult
Probably as root you want:
# rpm --import Fedora6-GPG-public-key.asc
and then that objection will be silenced
Thanks Russ.
That has cured the problem.
Do I need the .gpg subdirectory in my rpmbuilder homedir?
Also, is there an option to rpm and rpmbuild that would allow me to do all the verification checks, except for the package signer's pub key check?
Regards,
Keith
On Sun, 19 Dec 2010, Keith Roberts wrote:
# rpm --import Fedora6-GPG-public-key.asc
and then that objection will be silenced
Thanks Russ.
That has cured the problem.
Do I need the .gpg subdirectory in my rpmbuilder homedir?
no - that was created by GnuPG for maintaining a keystore, and as the issue was not with gnupg, the ./.gpg is unused
Also, is there an option to rpm and rpmbuild that would allow me to do all the verification checks, except for the package signer's pub key check?
yes as for rpm, no as for rpmbuild
-- Russ herrold
On Sun, 19 Dec 2010, R P Herrold wrote:
To: CentOS mailing list centos@centos.org From: R P Herrold herrold@centos.org Subject: [CentOS] Building packages using RPMBUILD
On Sun, 19 Dec 2010, Keith Roberts wrote:
# rpm --import Fedora6-GPG-public-key.asc
and then that objection will be silenced
Thanks Russ.
That has cured the problem.
Do I need the .gpg subdirectory in my rpmbuilder homedir?
no - that was created by GnuPG for maintaining a keystore, and as the issue was not with gnupg, the ./.gpg is unused
Also, is there an option to rpm and rpmbuild that would allow me to do all the verification checks, except for the package signer's pub key check?
yes as for rpm, no as for rpmbuild
OK. Thanks for all your help Russ.
Keith
-- Russ herrold _______________________________________________ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
On Sat, 18 Dec 2010, R P Herrold wrote:
To: CentOS mailing list centos@centos.org From: R P Herrold herrold@centos.org Subject: [CentOS] Building packages using RPMBUILD
On Sat, 18 Dec 2010, Keith Roberts wrote:
gpg --import-key yourkey.asc
Thanks for your reply Tim. It still does not work though.
[rpmbuilder@karsites qps]$ gpg --import Fedora6-GPG-public-key.asc
[rpmbuilder@karsites qps]$ rpm -K qps-1.9.18.6-1.fc6.src.rpm qps-1.9.18.6-1.fc6.src.rpm: (SHA1) DSA sha1 md5 (GPG) NOT OK (MISSING KEYS: GPG#1ac70ce6)
Different issue in play here -- rpm (and also perhaps rpmbuild if a --rebuild is used) needs the key in the rpm database to consult
Probably as root you want:
# rpm --import Fedora6-GPG-public-key.asc
and then that objection will be silenced
I have rebuilt qps now Russ.
Here's a snippet of the rebuild output. The full output has been copied and pasted into *.src.rpm-rebuild.txt
[rpmbuilder@karsites qps]$ ls Fedora6-GPG-public-key.asc qps-1.9.18.6-1.fc6.src.rpm-rebuild.txt qps-1.9.18.6-1.fc6.src.rpm [rpmbuilder@karsites qps]$ rpmbuild --rebuild qps-1.9.18.6-1.fc6.src.rpm Installing qps-1.9.18.6-1.fc6.src.rpm warning: user mockbuild does not exist - using root warning: group mockbuild does not exist - using root warning: user mockbuild does not exist - using root warning: group mockbuild does not exist - using root Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.71205 + umask 022 + cd /home/rpmbuilder/rpm-packages/BUILD + LANG=C + export LANG + unset DISPLAY + cd /home/rpmbuilder/rpm-packages/BUILD + rm -rf qps-1.9.18.6 + /usr/bin/bzip2 -dc /home/rpmbuilder/rpm-packages/SOURCES/qps-1.9.18.6.tar.bz2 Wrote: /home/rpmbuilder/rpm-packages/RPMS/i386/qps-1.9.18.6-1.i386.rpm Wrote: /home/rpmbuilder/rpm-packages/RPMS/i386/qps-debuginfo-1.9.18.6-1.i386.rpm Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.16535 + umask 022 + cd /home/rpmbuilder/rpm-packages/BUILD + cd qps-1.9.18.6 + rm -rf /var/tmp/qps-1.9.18.6-1-root-rpmbuilder + exit 0 Executing(--clean): /bin/sh -e /var/tmp/rpm-tmp.16535 + umask 022 + cd /home/rpmbuilder/rpm-packages/BUILD + rm -rf qps-1.9.18.6 + exit 0 [rpmbuilder@karsites qps]$
I shall test it works OK.
Kind Regards,
Keith
QPS works OK.
Here's a screenshot of what it looks like:
http://i55.tinypic.com/35l6t7b.jpg
And if you like it here's a temporary link to download it from my site:
http://www.karsites.net/centos/downloads/5.5/qps-1.9.18.6-1.i386.rpm
The binary is not signed by me, as I've not got that far yet.
Kind Regards,
Keith
On Sun, 2010-12-19 at 13:46 +0000, Keith Roberts wrote:
http://www.karsites.net/centos/downloads/5.5/qps-1.9.18.6-1.i386.rpm
You should have a /5/ /x86_64 /i386 /SRPMS Structure to the directories, with a "createrepo" on them.
The SRPM form Fedora 9, qps-1.9.19-0.2.b.fc7.src.rpm will build also with out a hitch. You go higher than Fedora 9 you in for a rude awakening, Don't try building a 32 bit version under a multilib system. "Qt4-make" is needed and major work needed to build the newer.
Rawhide laughed :-)
You made a key?rpm --import, rpm --sign then: rpm -Kvv rpm --checkig
John
On Sun, 19 Dec 2010, JohnS wrote:
To: CentOS mailing list centos@centos.org From: JohnS jses27@gmail.com Subject: Re: [CentOS] Building packages using RPMBUILD
On Sun, 2010-12-19 at 13:46 +0000, Keith Roberts wrote:
http://www.karsites.net/centos/downloads/5.5/qps-1.9.18.6-1.i386.rpm
You should have a /5/ /x86_64 /i386 /SRPMS Structure to the directories, with a "createrepo" on them.
The SRPM form Fedora 9, qps-1.9.19-0.2.b.fc7.src.rpm will build also with out a hitch. You go higher than Fedora 9 you in for a rude awakening, Don't try building a 32 bit version under a multilib system. "Qt4-make" is needed and major work needed to build the newer.
Rawhide laughed :-)
You made a key?rpm --import, rpm --sign then: rpm -Kvv rpm --checkig
Thanks for the guidance John.
This is not meant to be a repository - just a temporary place to upload some rpms I build.
My main development machine is still down, so I'm just testing a few things out ATM on my laptop, which is where I built the Centos 5.5 qps binary rpm.
You only have to point rpm or yum (or use wget) to download and then install the qps rpm locally.
I'm with you on the later versions of Fedora packages not working on Centos 5.5
Running Centos 5.5 is very similar IMO to running Fedora 8.
Kind Regards,
Keith
John
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos