# attach & use custom files from portdir



## vecihi (Feb 15, 2013)

Hello,

With "make package-recursive" command in port directory, I can create port's package. Package includes files, directories those belong to port dist file ( custom-port.tar.gz - MASTER_SITE=http://.../ PORT:custom-port).

I have extra configuration files and dist file doesn't include those configuration files.
But I want to attach them to tbz package and I want to use them in pkg-install file.

For instance:

pkg-install:

```
#!/bin/sh
[ "$2" != "POST-INSTALL" ] && exit 0
#============================================================
# POST-INSTALL
#============================================================
cp -pfr $MY_CUSTOM_SCRIPT_DIR/daemon-control-service-1-path /service/
cp -pfr $MY_CUSTOM_SCRIPT_DIR/daemon-control-service-2-path /service/
```

Is there a way to attach and use MY_CUSTOM_SCRIPT_DIR in package file? (MY_CUSTOM_SCRIPT_DIR should be located in port directory not in dist file)

Thanks,
Best regards


----------



## jb_fvwm2 (Feb 16, 2013)

Makefile.local, probably, I've used it for something similar.  But I haven't a clue about how to set it up for adding files to the build, maybe search the forum for that Makefile.local and someone may have put one up which does that. Howsoever, even the simple one I crafted (works flawlessly) took several hours to test and resolve the correct syntax within it.  You may wish to start with Makefile(s) which add such actions for the syntax, UNLESS your syntax is *already* correct, and you can use it right away in such a file. 
I've forgotten many of the details...


----------



## vecihi (Feb 18, 2013)

```
MASTER_SITES=	ftp://ftp.example1.com/:source1 \
		ftp://ftp.example2.com/:source2
DISTFILES=	source1.tar.gz:source1 \
		source2.tar.gz:source2 \
		source3.tar.gz:source2
```

I used multiple distfiles-mastersites property. It worked.
Reference: http://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/makefile-distfiles.html#porting-patchfiles

Best regards


----------

