arpit7275 / redis

Automatically exported from code.google.com/p/redis
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

redis-2.2 Makefile doesn't honour the PREFIX variable #632

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
This error is affecting installation of Redis 2.2.12 stable, on SUSE Linux 
Enterprise Server 10 (x86_64)

The INSTALL docs suggest the following to have redis installed into a 
non-standard path:

"Alternatively:

    make PREFIX=/some/other/directory

to have the binaries in /some/other/directory/bin."

Neither this, nor the more correct-seeming "PREFIX=/some/other/directory make" 
change where "make install" tries to copy the binaries to.

To reproduce the problem:

$ wget http://redis.googlecode.com/files/redis-2.2.12.tar.gz
$ tar xzf redis-2.2.12.tar.gz
$ cd redis-2.2.12/src
$ make PREFIX=/opt
Or
$ PREFIX=/opt make
$ make install

Output of error:

mkdir -p /usr/local/bin
cp -p redis-server /usr/local/bin
cp: cannot create regular file `/usr/local/bin/redis-server': Permission denied
make: *** [install] Error 1

The Makefile contains the following lines, which seem to hardcode the install 
path in all cases:

PREFIX= /usr/local
INSTALL_BIN= $(PREFIX)/bin
INSTALL= cp -p

Perhaps something like the following would fix it:
PREFIX:={$PREFIX:-/usr/local}

Original issue reported on code.google.com by googlec...@d5ve.com on 16 Aug 2011 at 12:55

GoogleCodeExporter commented 8 years ago
Thanks, I'll take a look at the docs. You can override the PREFIX for the 
"install" target like so:

    make install PREFIX=/opt

Original comment by pcnoordh...@gmail.com on 16 Aug 2011 at 1:00