142b0 [Solved] First port: make: cannot open Makefile. - The FreeBSD Forums
The FreeBSD Forums  

Go Back   The FreeBSD Forums > Ports & Packages > Porting New Software

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

Reply
 
Thread Tools Display Modes
  #1  
Old April 9th, 2010, 10:13
Ben Ben is offline
Member
 
Join Date: Nov 2008
Posts: 195
Thanks: 13
Thanked 1 Time in 1 Post
Default First port: make: cannot open Makefile.

Hi,

I am trying to make a port for phpredis.

This is what I have:

Makefile:
Code:
# 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:
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

Last edited by DutchDaemon; April 9th, 2010 at 13:17.
Reply With Quote
  #2  
Old April 9th, 2010, 17:00
Ben Ben is offline
Member
 
Join Date: Nov 2008
Posts: 195
Thanks: 13
Thanked 1 Time in 1 Post
Default

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

What can I do to prevent this?
Reply With Quote
  #3  
Old April 9th, 2010, 17:03
SirDice's Avatar
SirDice SirDice is offline
Moderator
 
Join Date: Nov 2008
Location: Rotterdam, Netherlands
Posts: 13,713
Thanks: 47
Thanked 2,022 Times in 1,861 Posts
Default

It probably needs to run ./configure first.

http://www.freebsd.org/doc/en_US.ISO...SING-CONFIGURE
__________________
Senior UNIX Engineer at Unix Support Nederland
Experience is something you don't get until just after you need it.
Reply With Quote
  #4  
Old April 9th, 2010, 17:12
Ben Ben is offline
Member
 
Join Date: Nov 2008
Posts: 195
Thanks: 13
Thanked 1 Time in 1 Post
Default

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:
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.

Last edited by Ben; April 9th, 2010 at 17:37.
Reply With Quote
  #5  
Old April 9th, 2010, 21:54
ckester's Avatar
ckester ckester is offline
Member
 
Join Date: Nov 2008
Location: near Seattle, WA (USA)
Posts: 288
Thanks: 28
Thanked 36 Times in 31 Posts
Default

Quote:
Originally Posted by Ben View Post
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.
Reply With Quote
  #6  
Old April 9th, 2010, 22:00
Ben Ben is offline
Member
 
Join Date: Nov 2008
Posts: 195
Thanks: 13
Thanked 1 Time in 1 Post
Default

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.
Reply With Quote
  #7  
Old April 14th, 2010, 10:06
Ben Ben is offline
Member
 
Join Date: Nov 2008
Posts: 195
Thanks: 13
Thanked 1 Time in 1 Post
Default

I can't figure it out.

As there seems nobody able to help I will not port redis to FreeBSD. Thats a pitty.
Reply With Quote
  #8  
Old April 14th, 2010, 17:31
expl's Avatar
expl expl is offline
Member
 
Join Date: Oct 2009
Location: In your shell, stealing your cookies.
Posts: 639
Thanks: 0
Thanked 113 Times in 104 Posts
Default

Attach your current port in tar.gz/bz format and Ill take a look.
Reply With Quote
  #9  
Old April 14th, 2010, 20:35
Ben Ben is offline
Member
 
Join Date: Nov 2008
Posts: 195
Thanks: 13
Thanked 1 Time in 1 Post
Default

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.
Attached Files
File Type: bz2 php5-redis.tar.bz2 (736 Bytes, 16 views)
Reply With Quote
  #10  
Old April 15th, 2010, 06:09
expl's Avatar
expl expl is offline
Member
 
Join Date: Oct 2009
Location: In your shell, stealing your cookies.
Posts: 639
Thanks: 0
Thanked 113 Times in 104 Posts
Default

Ok after having a look at bsd.php.mk I found a line
Code:
PHP_MODNAME?=	${PORTNAME}
So simply adding:
Code:
PHP_MODNAME=redis
to port's makefile should fix this error at "make install" stage.
Reply With Quote
The Following User Says Thank You to expl For This Useful Post:
Ben (April 15th, 2010)
  #11  
Old April 15th, 2010, 07:05
Ben Ben is offline
Member
 
Join Date: Nov 2008
Posts: 195
Thanks: 13
Thanked 1 Time in 1 Post
Default

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!!
Reply With Quote
  #12  
Old April 17th, 2010, 21:17
Ben Ben is offline
Member
 
Join Date: Nov 2008
Posts: 195
Thanks: 13
Thanked 1 Time in 1 Post
Default

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

Thanks for the fast commit and your help!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Which is superceeding when installing from ports: make.conf or port options? johnblue Installation and Maintenance of FreeBSD Ports or Packages 6 January 10th, 2010 03:35
Port make in jail hangs on "Making all in doc" jabber Installation and Maintenance of FreeBSD Ports or Packages 0 September 17th, 2009 21:06
[Solved] re-Make failed port... clear options sberry2a Installation and Maintenance of FreeBSD Ports or Packages 2 August 17th, 2009 15:38
How to make Kpdf open a PDF file inside Firefox? everypot KDE 5 August 11th, 2009 18:28
Cannot open a port (80) hernysun Web & Network Services 28 July 30th, 2009 13:13


All times are GMT +1. The time now is 03:38.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
The mark FreeBSD is a registered trademark of The FreeBSD Foundation and is used by The FreeBSD Project with the permission of The FreeBSD Foundation.
Web protection and acceleration provided by CloudFlare
0