tjko / jpeginfo

jpeginfo - prints information and tests integrity of JPEG/JFIF files
http://www.iki.fi/tjko/projects.html
GNU General Public License v3.0
139 stars 17 forks source link

make install wants to write to root filesystem #16

Closed szotsaki closed 1 year ago

szotsaki commented 1 year ago

I create a package from jpeginfo for openSUSE and when using the standard rpm script %make_install it fails with the following:

[    3s] + /usr/bin/rm -rf /home/abuild/rpmbuild/BUILDROOT/jpeginfo-1.7.0-0.x86_64
[    3s] + /usr/bin/mkdir -p /home/abuild/rpmbuild/BUILDROOT
[    3s] + /usr/bin/mkdir /home/abuild/rpmbuild/BUILDROOT/jpeginfo-1.7.0-0.x86_64
[    3s] + cd jpeginfo-1.7.0
[    3s] + make install DESTDIR=/home/abuild/rpmbuild/BUILDROOT/jpeginfo-1.7.0-0.x86_64
[    3s] /usr/bin/install -c -d -m 755 //usr/bin
[    3s] /usr/bin/install: cannot change permissions of '//usr/bin': Operation not permitted
[    3s] make: *** [Makefile:91: install.dirs] Error 1
[    3s] error: Bad exit status from /var/tmp/rpm-tmp.PNZ1B9 (%install)

It seems that the installation script unconditionally writes into / without considering DESTDIR.

Perhaps related but I also saw some warnings during compilation:

[    2s] configure.in:83: warning: AC_OUTPUT should be used without arguments.
[    2s] configure.in:83: You should run autoupdate.
tjko commented 1 year ago

Makefile doesn't write unconditionally to / , it supports specifying INSTALL_ROOT. This dates back 20+ years it seems, maybe use of DESTDIR wasn't that common back then...

I checked in fix to use DESTDIR if INSTALL_ROOT is not set: 7d74c87649c8553e9ea3d395f997a3307d7b72b8

Looks like configure.in syntax is getting bit old. I updated configure.in, but that didn't result actual change to configure script (only white space change): 5e2be7a0981e31e847e381f696baa7d36c8b823c

szotsaki commented 1 year ago

Verified and it's indeed fixed. Thank you!