Hi,
given this simple install target for my Makefile:
install: zrm $(CONF)
install -D -m 0755 -o mysql -g mysql conf/lvm0.conf $(DESTDIR)/$(CONFDIR)/lvm0/mysql-zrm.conf
install -D -m 0755 -o mysql -g mysql conf/inc1.conf $(DESTDIR)/$(CONFDIR)/inc1/mysql-zrm.conf
install -D -m 0755 -o mysql -g mysql conf/dump0.conf $(DESTDIR)/$(CONFDIR)/dump0/mysql-zrm.conf
install -d -m 0755 -o mysql -g mysql $(DESTDIR)/$(PLUGIN)
install -m 0755 -o mysql -g mysql post-backup-st-zrm.pl $(DESTDIR)/$(PLUGIN)
install -d -m 0755 -o root -g root $(DESTDIR)/$(BINDIR)
install -m 4755 -o root -g root zrm $(DESTDIR)/$(BINDIR)
I can simply do make install
as root (or use sudo
) and it will beautifully install.
As foo (unprivileged) user, calling make install
will returns an error (-o option needs super-user).
I need to change this so that I can both sudo make install
, make install DESTDIR=/tmp/foo
or even package this into .deb or .rpm and just call the install target from my Makefile.
What will be the best solution for me ? Replace install calls to cp ? Remove -o and put a chown/chmod ?
Thank you.