jordansissel / fpm

Effing package management! Build packages for multiple platforms (deb, rpm, etc) with great ease and sanity.
http://fpm.readthedocs.io/en/latest/
Other
11.16k stars 1.07k forks source link

Invalid RPM if empty system directory exists #1294

Open MartinMikita opened 7 years ago

MartinMikita commented 7 years ago

Hello,

I have a problem with creating RPM using FPM from the directory.

If there is an empty system directory (for example usr/lib64), then the arguments --rpm-auto-add-directories and --rpm-auto-add-exclude-directories /usr/lib64 are not working as expected.

$ mkdir -p path/usr/lib64
$ fpm --rpm-auto-add-exclude-directories "/usr/lib64" --rpm-auto-add-directories -f -n package -p package.rpm -C path/ -s dir -t rpm --verbose usr
Setting workdir {:workdir=>"/tmp", :level=>:info}
Setting from flags: epoch= {:level=>:info}
Setting from flags: iteration= {:level=>:info}
Setting from flags: name=package {:level=>:info}
Setting from flags: url=http://example.com/no-uri-given {:level=>:info}
Setting from flags: version=1.0 {:level=>:info}
Converting dir to rpm {:level=>:info}
Reading template {:path=>"/usr/local/share/gems/gems/fpm-1.8.0/templates/rpm.erb", :level=>:info}
Running rpmbuild {:args=>["rpmbuild", "-bb", "--define", "buildroot /tmp/package-rpm-build-8e0407396b178078d0fc4f87a137e2657bf28e319d641bbb10d3655e7a61/BUILD", "--define", "_topdir /tmp/package-rpm-build-8e0407396b178078d0fc4f87a137e2657bf28e319d641bbb10d3655e7a61", "--define", "_sourcedir /tmp/package-rpm-build-8e0407396b178078d0fc4f87a137e2657bf28e319d641bbb10d3655e7a61", "--define", "_rpmdir /tmp/package-rpm-build-8e0407396b178078d0fc4f87a137e2657bf28e319d641bbb10d3655e7a61/RPMS", "--define", "_tmppath /tmp", "/tmp/package-rpm-build-8e0407396b178078d0fc4f87a137e2657bf28e319d641bbb10d3655e7a61/SPECS/package.spec"], :level=>:info}
Executing(%prep): /bin/sh -e /tmp/rpm-tmp.KKA97C {:level=>:info}
Executing(%build): /bin/sh -e /tmp/rpm-tmp.Gxl7g3 {:level=>:info}
Executing(%install): /bin/sh -e /tmp/rpm-tmp.KzPgqt {:level=>:info}
Processing files: package-1.0-1.x86_64 {:level=>:info}
Provides: package = 1.0-1 package(x86-64) = 1.0-1 {:level=>:info}
Requires(rpmlib): rpmlib(PayloadFilesHavePrefix) <= 4.0-1 rpmlib(CompressedFileNames) <= 3.0.4-1 {:level=>:info}
Wrote: /tmp/package-rpm-build-8e0407396b178078d0fc4f87a137e2657bf28e319d641bbb10d3655e7a61/RPMS/x86_64/package-1.0-1.x86_64.rpm {:level=>:info}
Executing(%clean): /bin/sh -e /tmp/rpm-tmp.AV09Ij {:level=>:info}
Created package {:path=>"package.rpm"}
$ rpm -qlp package.rpm
/usr/lib64
nyetsche commented 7 years ago

👍 I have encountered this as well. My workaround was to use multiple -x *glob* entries, but that has it's own problems in a sufficiently large package.

shell $ fpm --version
1.9.3