First port: make: cannot open Makefile.

Having trouble or general questions about porting software to FreeBSD? Ask here.

First port: make: cannot open Makefile.

Postby Ben » 09 Apr 2010, 09:13

Hi,

I am trying to make a port for phpredis.

This is what I have:

Makefile:
Code: Select all
# New ports collection makefile for:   php-redis
# Date created:        9 April 2010
# Whom:                ben
#
# $FreeBSD$
#

PORTNAME=       php5-redis
PORTVERSION=    1.2.0
CATEGORIES=     databases
MASTER_SITES=   http://localhost/

MAINTAINER=     some@mail.net
COMMENT=        PHP5-Extension for Redis

USE_PHPIZE=     yes

PLIST_FILES=    lib/php/20060613/redis.so

.include <bsd.port.mk>

The php5-redis-1.2.0.tar.gz is in the root directory of localhost (for testing).

Fetching and unpacking works, but I get "make: cannot open Makefile."

My aim is to run phpize, ./configure, make and make install but I have no idea how to do it.

I read the Porters handbook but I dont see the mistake here.

Can anybody help?

Thanks a lot in advance!

EDIT:

I added the following lines which work if I call them directly (by make do-make etc) but this is not the way it should work:
Code: Select all
do-make:
        cd ${WRKSRC}/${PORTNAME}-${PORTVERSION}/ && /usr/local/bin/phpize
        cd ${WRKSRC}/${PORTNAME}-${PORTVERSION}/ && ./configure
        cd ${WRKSRC}/${PORTNAME}-${PORTVERSION}/ && /usr/bin/make

do-install:
        cd ${WRKSRC}/${PORTNAME}-${PORTVERSION}/ && make install
Ben
Member
 
Posts: 235
Joined: 17 Nov 2008, 21:34

Postby Ben » 09 Apr 2010, 16:00

Ok, I guess the error comes from a missing Makefile in the tar.gz-Archive.

What can I do to prevent this?
Ben
Member
 
Posts: 235
Joined: 17 Nov 2008, 21:34

Postby SirDice » 09 Apr 2010, 16:03

Senior UNIX Engineer at Unix Support Nederland
Experience is something you don't get until just after you need it.
User avatar
SirDice
Old Fart
 
Posts: 16185
Joined: 17 Nov 2008, 16:50
Location: Rotterdam, Netherlands

Postby Ben » 09 Apr 2010, 16:12

Thanks for your advice.

I tried this by setting GNU_CONFIGURE= yes but first I need to run "phpize" before I can run "configure".

Do you know a way how I can influence this?

Thanks for your help.

EDIT:

Coming closer. Now I get this error which is clear as the file is called "redis.so" not "php5-redis.so":
Code: Select all
install: /var/ports/usr/ports/databases/php5-redis/work/php5-redis-1.2.0/modules/php5-redis.so: No such file or directory
*** Error code 71


I need to find out how I can overwrite this. I tried by "do-install:" but then it says I defined this twice so it will be ignored.

Strange.
Ben
Member
 
Posts: 235
Joined: 17 Nov 2008, 21:34

Postby ckester » 09 Apr 2010, 20:54

Ben wrote:Thanks for your advice.

I tried this by setting GNU_CONFIGURE= yes but first I need to run "phpize" before I can run "configure".



You can use a "post-patch" target in your port Makefile to run phpize after the sources are unpacked and patched but before configure is run.
User avatar
ckester
Member
 
Posts: 288
Joined: 30 Nov 2008, 01:18
Location: near Seattle, WA (USA)

Postby Ben » 09 Apr 2010, 21:00

Actually this works now. Only the name of the extension is not correct.

It seems the script expects the extension to be called php5-redis.so but instead it is called redis.so.

I only want to overwrite this.
Ben
Member
 
Posts: 235
Joined: 17 Nov 2008, 21:34

Postby Ben » 14 Apr 2010, 09:06

I can't figure it out.

As there seems nobody able to help I will not port redis to FreeBSD. Thats a pitty.
Ben
Member
 
Posts: 235
Joined: 17 Nov 2008, 21:34

Postby expl » 14 Apr 2010, 16:31

Attach your current port in tar.gz/bz format and Ill take a look.
User avatar
expl
Member
 
Posts: 664
Joined: 30 Oct 2009, 23:54
Location: In your shell, stealing your cookies.

Postby Ben » 14 Apr 2010, 19:35

Thank you, that's very nice.

Please find the port attached!

Would be great if you can find the mistake and tell me what I did wrong.
Attachments
php5-redis.tar.bz2
(736 Bytes) Downloaded 34 times
Ben
Member
 
Posts: 235
Joined: 17 Nov 2008, 21:34

Postby expl » 15 Apr 2010, 05:09

Ok after having a look at [FILE]bsd.php.mk[/FILE] I found a line
Code: Select all
PHP_MODNAME?=   ${PORTNAME}


So simply adding:
Code: Select all
PHP_MODNAME=redis


to port's makefile should fix this error at "make install" stage.
User avatar
expl
Member
 
Posts: 664
Joined: 30 Oct 2009, 23:54
Location: In your shell, stealing your cookies.

Postby Ben » 15 Apr 2010, 06:05

I found this line also but I didn't know that I can overwrite variables this way easily.

Dude, a long way to go :)

Thank you very much for your help!!

Now I will make tests to check if I can submit the port officially soon.

Thanks!!
Ben
Member
 
Posts: 235
Joined: 17 Nov 2008, 21:34

Postby Ben » 17 Apr 2010, 20:17

Fyi: The port is in the tree now: http://www.freshports.org/databases/php5-redis/

Thanks for the fast commit and your help!
Ben
Member
 
Posts: 235
Joined: 17 Nov 2008, 21:34


Return to Porting New Software

Who is online

Users browsing this forum: No registered users and 0 guests