# wrksrc-directory



## talsamon (Jul 6, 2015)

I am trying to create a new port. Everything seems fine, except the port creates the wrong WRKSRC dir.
`PORTNAME=  my_portXY`. It creates work/my_port, instead of work/my_portXY. Any hint what I am overlooked?.
I can create it only with `WRKSRC=  ${WRKDIR}/my_portXY.` If I am right, It should create automatically work/my_portXY. `${WRKDIR}/${PORTNAME}` do it also wrong.


----------



## talsamon (Jul 6, 2015)

Found it, it was the slash between`${WRKDIR}` and `${PORTNAME}`


----------



## talsamon (Jul 6, 2015)

Sorry, was the wrong forum, should  be in Porting new software.


----------



## talsamon (Jul 6, 2015)

Sorry not solved, this causes an other problem. If I set no slash, I got the right directory. The port is mod_evasive(24).
But `apxs` then misses the slash.


```
(cd /home/user/.testport/workmod_evasive24 && /usr/local/sbin/apxs -c  -o mod_evasive24.la mod_evasive24.c)
cd: /home/user/.testport/workmod_evasive24: No such file or directory
*** Error code 2
```

Need a command to change the path in Makefile.tmpl.

Workaround is 

```
WRKSRC=     ${WRKDIR}/${PORTNAME}
....
pre-build:
   ${MV} work/mod_evasive work/mod_evasive24
```

But this seems for me not a really proper way.


----------



## junovitch@ (Jul 6, 2015)

Do you have your work in progress somewhere?  Github, Pastebin, etc.?


----------



## talsamon (Jul 6, 2015)

In the moment I try it for myself, if I it works I will consider Github.
I have posted a patch for the existing www/mod_evasive under PR 201306. This is for apache22 and I try to make a www/evasive24 port for apache24. (There is a newer source from the author https://github.com/shivaas/mod_evasive/blob/master/mod_evasive24.c  I used - make one or two syntax changes). I have also  patches for www/mod_cband and www/mod_bw - for this I have not make a PR yet. All three marked as broken, and just  a less of changes will fix this.

In the moment I had some problems to understand what all the macros do in the port Makefiles, crawling step for step forward.


----------



## wblock@ (Jul 6, 2015)

If there are parts of the Porter's Handbook that are not clear, please submit bug reports for them.


----------



## talsamon (Jul 6, 2015)

Thanks, ok I will do it. But it's my first try to do this, and you know there are a lot of misunderstoods and simply it needs some time.


----------



## talsamon (Jul 6, 2015)

The thing with the slash isn't true. Maybe, I overlooked something. The port already provides a wrong WRKSRCDIR.
But if I put @${ECHO_MSG} ${WRKSRC} before the move-command in my pre-build target it prints the right path.
I think

```
DISTNAME=   mod_evasive24_${PORTVERSION}
```
 and 
	
	



```
PORTNAME=   mod_evasive24
```
 should be right. And WRKSRC derives from DISTNAME.


----------



## talsamon (Jul 7, 2015)

Found the reason, forget to change paths in the archive.
But now I have another problem. If I try to start `make`, the port deletes the distfile.
How could I prevent this?


----------



## talsamon (Jul 7, 2015)

Found a way, I copied the port with another number (just temporarily).


----------

