Jon B
Jon B

Reputation: 133

Making a simple FreeBSD package with "make package"

This is sort of a Hello World situation for FreeBSD ports.

I'm trying to make a FreeBSD .tbz file for a small webapp I made. The project consists of a single foo.war file which I've zipped into foo.tgz. I put this .tgz in /usr/ports/distfiles. Then in /usr/ports/textproc/foo I made the files Makefile, distinfo, pkg-descr, and pkg-plist. I'd like to create the tbz by running "make package." When I run make package, my Makefile produces errors. I'm using an adapted Makefile from another port, and I don't fundamentally understand what a simple Makefile needs. Here is what I have in my Makefile:

8 PORTNAME=>  foo
9 PORTVERSION=>   1.0
10 CATEGORIES=>textproc java
11 MASTER_SITES=>  ftp://freefall.cdrom.com/pub/FreeBSD/LOCAL_PORTS/
12 MASTER_SITE_SUBDIR=>
13 EXTRACT_SUFX=>  .tgz
14
15 MAINTAINER=>...
16 COMMENT=>   ...
17
18 LICENSE=>   AL2
19 JAVA_VERSION=>  1.5+
20 NO_BUILD=>  yes
21 PLIST_SUB+=>PORTVERSION="${PORTVERSION}"
22 USE_JAVA=>  yes
23 PORTEXAMPLES=>  *
24
25 do-install:
26 >   cd ${WRKSRC}/dist && ${COPYTREE_SHARE} \* ${JAVAJARDIR}
27 .if !defined(NOPORTEXAMPLES)
28 >   ${MKDIR} ${EXAMPLESDIR}
29 >   cd ${WRKSRC}/example && ${COPYTREE_SHARE} \* ${EXAMPLESDIR}
30 .endif
31
32 .include <bsd.port.mk>

The do-install block is copied from another file, and that is where I'm seeing errors:

"Makefile", line 26: Missing dependency operator
"Makefile", line 28: Missing dependency operator
"Makefile", line 29: Missing dependency operator

What do I need to change in my Makefile? Or any advice for creating a tbz out of a single file on FreeBSD?

Thanks!

P.S. I'm currently also getting the following error and having trouble understanding it: "/usr/ports/Mk/bsd.port.mk", line 4370: warning: duplicate script for target "foo._usr_local" ignored.

Upvotes: 1

Views: 4040

Answers (1)

Craig
Craig

Reputation: 4840

Make sure you really do have tab characters. That error usually indicates a line with spaces where there should be tabs.

Upvotes: 1

Related Questions