HELP NEEDED USING RPMBUILD

Hello.

I have to modify a *.spec file before recreating a rpm file because I need vendor name when the package is installed.

I have an error in the last step ( calling rpmbuild ) after directories are create and files are copied into the right folders.

From the tar file ( project_name-version_number.tar.bz2 ) I get all the stuff in :
~/project_name-version_number
~/project_name-version_number/doc
~/project_name-version_number/src
~/project_name-version_number/test
~/project_name.spec

In ~/project_name-version_number directory are the makefile., configure., libtools

First :
I modify project_name.spec by adding :
%define vendor vendor_name

and after other macro definitions
Vendor: %{vendor}

this spec file contains :
%define name project_name
%define version version_number
%define release release_number
%define major major_number

then
I use a macro file “.rpmmacros” which contain :

%_topdir /tmp/rpmbuild/project_name/rpm

this redirect all the files in
/tmp/rpmbuild/project_name/rpm/BUILD
/tmp/rpmbuild/project_name/rpm/SOURCE
/tmp/rpmbuild/project_name/rpm/SPECS
/tmp/rpmbuild/project_name/rpm/RPMS
/tmp/rpmbuild/project_name/rpm/SRPMS

and then
I use a shell file which delete and recreate all directories,

from /tmp/rpmbuild/project_name/rpm/SOURCE
copy all files from ~/project_name-version_number

cp   ~/project_name-version_number/*
 /tmp/rpmbuild/project_name/rpm/SOURCE/project_name-version_number

there is no project_name.spec file in that directory

from /tmp/rpmbuild/project_name/rpm/SOURCE

tar  -cvjf    /tmp/rpmbuild/project_name/rpm/SOURCE/project_name-version_number.tar.bz2
/tmp/rpmbuild/project_name/rpm/SOURCE/project_name-version_number
cp   ~/project_name.spec   /tmp/rpmbuild/project_name/rpm/SPECS

Then call

rpmbuild  -ba   /tmp/rpmbuild/project_name/rpm/SPECS/project_name.spec

Here is the error :


...............
no errors
..............
+ /usr/bin/bzip2 -dc /tmp/rpmbuild/project_name/rpm/SOURCES/project_name-project_numpber.tar.bz2
+ /bin/tar -xf -
+ STATUS=0
+ '' 0 -ne 0 ']'
+ cd project_name-project_number
/var/tmp/rpm-tmp.S6sP4v: line 32: cd: project_name-project_number: No such file or directory
error: Bad exit status from /var/tmp/rpm-tmp.S6sP4v (%prep)

in /var/tmp/rpm-tmp.S6sv I can read


cd '/tmp/rpmbuild/project_name/rpm/BUILD'
rm -rf 'project_name-project_number'
/usr/bin/bzip2 -dc '/tmp/rpmbuild/project_name/rpm/SOURCES/project_name-project_number.tar.bz2' | /bin/tar -xf - 
STATUS=$?
if  $STATUS -ne 0 ]; then
  exit $STATUS
fi
cd 'project_name-project_number'

There is no project_name-project_number in the directory /tmp/rpmbuild/project_name/rpm/BUILD
But there is a directory project_name

I think that rpmbuild using project_name.spec parameters use the directory project_name in /tmp/rpmbuild/project_name/rpm/BUILD instead of project_name-project_number

Assistance would be welcome.

Take a look at this example maybe: http://forums.opensuse.org/english/get-technical-help-here/applications/469840-problem-warning-nokey-while-installing-source-rpm.html#post2418989.

I am going to read your link.

But I am wondering if rpmbuild is using some other configuration file.

Where does “/var/tmp/rpm-tmp.S6sv” come from. I can imagine that some temp directories are necessary but why using /var.

Set your build environment properly first! And don’t build as root!

Re reading screen logs I found the problem.

I get this

tar  -cvjf    /tmp/rpmbuild/project_name/rpm/SOURCE/project_name-version_number-version_number.tar.bz2
/tmp/rpmbuild/project_name/rpm/SOURCE/project_name-version_number-version_number

but I want that :

tar  -cvjf    /tmp/rpmbuild/project_name/rpm/SOURCE/project_name-version_number.tar.bz2
/tmp/rpmbuild/project_name/rpm/SOURCE/project_name-version_number

Correcting my script it is running correctly.

Please read following reply.

Hello,

Now when extracting files from the internet tarball, running and following the readme :
./configure --prefix=/usr
make
I get no error.

Now when using the script with rpmbuild :

make → error: Installed (but unpackaged) file(s) found:
/usr/lib64/pkgconfig/libdvdcss.pc

any idea

RPM build errors:
Installed (but unpackaged) file(s) found:
/usr/lib64/pkgconfig/libdvdcss.pc

I di

Add /usr/lib64/pkgconfig/libdvdcss.pc in the %files section of your .spec file.

Hi
You just need to use the %setup macro to expand how you want is the src
tarball is different, no need to change anything from defaults.
http://www.rpm.org/max-rpm/s1-rpm-inside-macros.html

Just make sure your buildroot is set to default


BuildRoot: %{_tmppath}/%{name}-%{version}-build


Cheers Malcolm °¿° (Linux Counter #276890)
openSUSE 12.1 (x86_64) Kernel 3.1.0-1.2-desktop
up 1 day 20:09, 3 users, load average: 0.10, 0.11, 0.07
CPU Intel i5 CPU M520@2.40GHz | Intel Arrandale GPU

hello.

When extracting files from the internet tarball, running and following the readme :
./configure --prefix=/usr
make
It seems to make a 32bits library
and not using the spec file


....................
test -z "/usr/include/dvdcss" || /bin/mkdir -p "/usr/include/dvdcss"
 /usr/bin/install -c -m 644 'dvdcss.h' '/usr/include/dvdcss/dvdcss.h'
....................
....................
....................
....................
test -z "/usr/lib" || /bin/mkdir -p "/usr/lib"
 /bin/sh ../libtool --mode=install /usr/bin/install -c  'libdvdcss.la' '/usr/lib/libdvdcss.la'
libtool: install: /usr/bin/install -c .libs/libdvdcss.so.2.1.0 /usr/lib/libdvdcss.so.2.1.0

When I try to make the rpm package running rpmbuild, rpmbuild try to make a 64bit library because it using the spec file and ran configure with these parameters
./configure --host=x86_64-unknown-linux-gnu --build=x86_64-unknown-linux-gnu --program-prefix= --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64 --libexecdir=/usr/lib --localstatedir=/var --sharedstatedir=/usr/com --mandir=/usr/share/man --infodir=/usr/share/info

....................
test -z "/usr/include/dvdcss" || /bin/mkdir -p "/tmp/rpmbuild/libdvdcss/rpm/BUILDROOT/libdvdcss-1.2.11-1.x86_64/usr/include/dvdcss"
 /usr/bin/install -c -m 644 'dvdcss.h' '/tmp/rpmbuild/libdvdcss/rpm/BUILDROOT/libdvdcss-1.2.11-1.x86_64/usr/include/dvdcss/dvdcss.h'
....................
....................
....................
test -z "/usr/lib64" || /bin/mkdir -p "/tmp/rpmbuild/libdvdcss/rpm/BUILDROOT/libdvdcss-1.2.11-1.x86_64/usr/lib64"
 /bin/sh ../libtool --mode=install /usr/bin/install -c  'libdvdcss.la' '/tmp/rpmbuild/libdvdcss/rpm/BUILDROOT/libdvdcss-1.2.11-1.x86_64/usr/lib64/libdvdcss.la'
libtool: install: /usr/bin/install -c .libs/libdvdcss.so.2.1.0 /tmp/rpmbuild/libdvdcss/rpm/BUILDROOT/libdvdcss-1.2.11-1.x86_64/usr/lib64/libdvdcss.so.2.1.0

so I suppose that I must modify the spec file ?

nota : I am doing this for :
1°) install and update this package
2°) add the vendor name in the rpm database by modifying the spec file. I want

 rpm -qa --queryformat '%{NAME} -> %{VENDOR}
' | grep -i Vendor-name

return the package with the vendor name (which is not in the initial internet package).

merry Christmas and happy holidays.

Remove this stupidity on my part.
Read :
When extracting files from the internet tarball, running and following the readme :
./configure --prefix=/usr
make
It seems it is not using the spec file.

happy holidays.

Of course not!
Humm … Do you understand how rpmbuild works?

  • you don’t have to extract tarballs.
  • you don’t have to type ./configure and make.
  • you might have to edit the .spec file if compiling or packaging fails though.

Or, other possibility: you extract the tarball and run configure and make manually. I guess that’s what you are doing. But you’re not using rpmbuild and you’re not building a rpm package. I wondered why you had the stuff in /tmp. Everyhting should land in your ~/rpmbuild directory. You obviously didn’t read or understood and certainly didn’t follow the method I explained here:

Donc, voici la même explication en français si c’est plus clair: Comment installer des sources?

  • The readme is not going to explain to you how to use rpmbuild, not even to mention it, and a tarball doesn’t necessarely include a .spec file (sometimes it does). You should use a src.rpm (if you can find one), not a tarball. The src.rpm includes the tarball and the .spec file, and the command rpm -i will will copy them in the right place.