masak / ufo

Swoops down and creates your Perl 6 project Makefile for you
27 stars 6 forks source link

$DESTDIR for ufo #5

Closed cnd closed 11 years ago

cnd commented 11 years ago

formed makefile

.PHONY: all build test install clean distclean purge

PERL6  = perl6
DESTDIR= 
PREFIX = /usr/lib/parrot/5.1.0/languages/perl6/site
BLIB   = blib
P6LIB  = $(PWD)/$(BLIB)/lib:$(PWD)/lib:$(PERL6LIB)
CP     = cp -p
MKDIR  = mkdir -p

SCRIPTS= bin/ignore
BLIB_PIRS =

all build: $(BLIB_PIRS)

test: build
        env PERL6LIB=$(P6LIB) prove -e '$(PERL6)' -r t/

loudtest: build
        env PERL6LIB=$(P6LIB) prove -ve '$(PERL6)' -r t/

timetest: build
        env PERL6LIB=$(P6LIB) PERL6_TEST_TIMES=1 prove -ve '$(PERL6)' -r t/

install: $(BLIB_PIRS)
        $(MKDIR) $(DESTDIR)$(PREFIX)/bin
        $(CP) $(SCRIPTS) $(DESTDIR)$(PREFIX)/bin

clean:
        rm -fr $(BLIB)

distclean purge: clean
        rm -r Makefile
tadzik commented 11 years ago

How is that different from the existing PREFIX?

cnd commented 11 years ago

PREFIX determines where the port will be installed. It defaults to /usr/local, but can be set by the user to a custom path like /opt. Your port must respect the value of this variable.

DESTDIR, if set by the user, determines the complete alternative environment, usually a jail or an installed system mounted somewhere other than /. A port will actually install into DESTDIR/PREFIX, and register with the package database in DESTDIR/var/db/pkg. As DESTDIR is handled automatically by the ports infrastructure with chroot(8), you do not need any modifications or any extra care to write DESTDIR-compliant ports.

source: http://www.freebsd.org/doc/en/books/porters-handbook/porting-prefix.html