[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

preserving file attributes from make install in rpm spec file



I am new to rpm building and trying to do the right thing.

I want to build an rpm from a set of files which comes
 with a Makefile install target that sets ownership
 and permissions differently for different files.

When executing make install (as root) everything is ok,
 but trying to build the rpm as non-root fails
 with "cannot change ownership of `/var/tmp/...' : Operation not permitted"

The Makefile has (simplified version)
install:
   $(INSTALL) -d $(DESTDIR)$(BINDIR)
#any group
   $(INSTALL) -m 755 file01 $(DESTDIR)$(BINDIR)
   $(INSTALL) -m 644 file02 $(DESTDIR)$(BINDIR)
#wheel group
   $(INSTALL) -m 750 -g wheel file03 $(DESTDIR)$(BINDIR)
#aaa group
   $(INSTALL) -m 750 -g aaa file04 $(DESTDIR)$(BINDIR)
#bbb group
   $(INSTALL) -m 750 -g bbb file05 $(DESTDIR)$(BINDIR)

The spec file has:

%install
make DESTDIR=%buildroot/ install

Obviously I'm overlooking something.  I am sure this is not that unusual.

BTW, and I know I should not do it, if I build the rpm as root,
 the permissions are fine, but all files are root:root.

-Bob


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]