Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
(There are similar threads but they cover much more
complex cases that the one I'm having trouble with.)
My goal is to use rpmbuild to create a binary rpm package
that will copy files to a fixed location under usr/share
on a client machine.
I can build source and binary packages without errors and
I can run them under rpm without errors, but the source
package seems only to recreate the source file and the spec
file under usr/src/redhat/SOURCES and usr/src/redhat/SPECS.
The binary package doesn't seem to do anything at all.
For testing, I have a file, baz-1.0.tar.gz which has one directory, baz-1.0 which has two files called "one" and "two".
I want to end up with
/usr/share/baz-1.0
/usr/share/baz-1.0/one
/usr/share/baz-1.0/two
Here's my spec file.
************************************************************
Summary: my summary
Name: baz
Version: 1.0
Release: 1
Copyright: my copyright
Group: my group
Source: baz-1.0.tar.gz
URL: ** not allowed to post a usr **
Distribution: my distribution
Vendor: my vendor
Packager: my packager
Buildroot: /usr/src/redhat/myroot
I've used RPM version 4.2.3 on CentOS-3 and your .spec file creates RPM's OK. Two things. If you don't need to build debuginfo packages (if you don't know you won't need it) add a line "%define debug_package %{nil}" to the top of the .spec file. Next don't focus on .src.rpm's for checking stuff. You only supply .src.rpm's if you need people to recreate packages from scratch on their system.
Thanks for the suggestion. %define debug_package %{nil} cleans up the tree nicely.
Forgetting about the src.rpm, as you suggest - here's an exec of the binary rpm. It does not
lay down the files I want under /usr/share, and I can't actually see that it does anything at
all. I must be missing something.
rpm -Uvv /usr/src/redhat/RPMS/i386/baz-1.0-1.i386.rpm
D: ============== /usr/src/redhat/RPMS/i386/baz-1.0-1.i386.rpm
D: Expected size: 1991 = lead(96)+sigs(180)+pad(4)+data(1711)
D: Actual size: 1991
D: /usr/src/redhat/RPMS/i386/baz-1.0-1.i386.rpm: MD5 digest: OK (27fbe6ef53c9bcaa4cf077501e05cbe3)
D: opening db environment /var/lib/rpm/Packages joinenv
D: opening db index /var/lib/rpm/Packages rdonly mode=0x0
D: locked db index /var/lib/rpm/Packages
D: opening db index /var/lib/rpm/Providename rdonly mode=0x0
D: read h# 1938 Header SHA1 digest: OK (3792490fab916a80f8c1a94de02ff5da908de7e9)
D: added binary package [0]
D: found 0 source and 1 binary packages
D: ========== +++ baz-1.0-1 i386/linux 0x0
D: opening db index /var/lib/rpm/Depends create mode=0x0
D: Requires: rpmlib(CompressedFileNames) <= 3.0.4-1 YES (rpmlib provides)
D: Requires: rpmlib(PayloadFilesHavePrefix) <= 4.0-1 YES (rpmlib provides)
D: opening db index /var/lib/rpm/Conflictname rdonly mode=0x0
D: closed db index /var/lib/rpm/Depends
D: ========== recording tsort relations
D: ========== tsorting packages (order, #predecessors, #succesors, tree, depth)
D: 0 0 0 0 0 +baz-1.0-1
D: installing binary packages
D: closed db index /var/lib/rpm/Conflictname
D: closed db index /var/lib/rpm/Providename
D: closed db index /var/lib/rpm/Packages
D: closed db environment /var/lib/rpm/Packages
D: opening db environment /var/lib/rpm/Packages joinenv
D: opening db index /var/lib/rpm/Packages create mode=0x42
D: mounted filesystems:
D: i dev bsize bavail iavail mount point
D: 0 0xfd00 4096 15869575 13496392 /
D: 1 0x0003 4096 0 -1 /proc
D: 2 0x0000 4096 0 -1 /sys
D: 3 0x0009 4096 0 -1 /dev/pts
D: 4 0x000e 4096 0 -1 /proc/bus/usb
D: 5 0x0801 1024 76942 26054 /boot
D: 6 0x0011 4096 129263 129262 /dev/shm
D: 7 0x0012 4096 0 -1 /proc/sys/fs/binfmt_misc
D: 8 0x0013 4096 0 -1 /var/lib/nfs/rpc_pipefs
D: 9 0x0014 4096 0 -1 /net
D: 10 0x0015 4096 0 -1 /viewstor
D: 11 0x0016 4096 0 -1 /home
D: 12 0x0017 4096 0 -1 /u
D: 13 0x0018 4096 0 -1 /proc/fs/nfsd
D: 14 0x0010 32768 2629879 28855923 /home/qatest
D: sanity checking 1 elements
D: opening db index /var/lib/rpm/Name create mode=0x42
D: read h# 1938 Header SHA1 digest: OK (3792490fab916a80f8c1a94de02ff5da908de7e9)
D: computing 2 file fingerprints
Preparing packages for installation...
D: computing file dispositions
D: opening db index /var/lib/rpm/Basenames create mode=0x42
package baz-1.0-1 is already installed
D: closed db index /var/lib/rpm/Basenames
D: closed db index /var/lib/rpm/Name
D: closed db index /var/lib/rpm/Packages
D: closed db environment /var/lib/rpm/Packages
/usr/src/redhat $ ls /usr/share/baz*
ls /usr/share/baz*
ls: /usr/share/baz*: No such file or directory
OK, files seem to be there. I don't see any problems.
Tried removing "rpm -e baz", then installing "rpm -i baz-1.0-1.i386.rpm"?
Tried building something real from .src.rpm (as unprivileged user) and installing the rpm as root afterwards?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.