PDA

View Full Version : simple port does not work


izotov
February 9th, 2011, 10:29
Hi,
I try to create the simplest possible port for testing reasons: the port should install a sh script to /tmp that echoes some words.

The distfile's directory tree is:
testport-1.0/
grub_install.sh

The port's Makefile is in /usr/ports/misc/testport:
# $FreeBSD:$ #

PORTNAME= testport
PORTVERSION= 1.0
CATEGORIES= misc

MAINTAINER= izotov
COMMENT= test port
PLIST_FILES= tmp/grub_install.sh
PREFIX= /
NO_BUILD= yes


I thought that this should work but I get the error:
freebsd02# make install
===> Installing for testport-1.0
===> Generating temporary packing list
===> Checking if misc/testport already installed
make: cannot open Makefile.
*** Error code 2

Stop in /usr/ports/misc/testport.

What is missing?

SirDice
February 9th, 2011, 15:35
PLIST_FILES and PREFIX are both wrong. Since there's nothing to build you'll have to add the do-install: section yourself. Have a look at ports-mgmt/portmaster. It's a relatively simple port, it doesn't even download a distfile.

izotov
February 10th, 2011, 08:31
PLIST_FILES and PREFIX are both wrong.
But if I do not use them this way then make package creates a package that would not install my files as I want....

With do-install: target you were right; I have not found it in the documentation so far.

SirDice
February 10th, 2011, 08:56
You shouldn't set PREFIX yourself as that would break things like DESTDIR. On hind sight PLIST_FILES might be ok.