Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 30 May 2014 07:12:00 +0200
From:      olli hauer <ohauer@gmx.de>
To:        freebsd-ports <freebsd-ports@freebsd.org>
Cc:        Raghu HB <raghu.hb@avagotech.com>
Subject:   Re: Creating new port
Message-ID:  <53881320.4030307@gmx.de>
In-Reply-To: <6667825af05f6ed0e9e5cc649b18477f@mail.gmail.com>
References:  <cd7ad7c8eb71a187b377418d02519420@mail.gmail.com> <5385AFFA.7050206@sorbs.net> <bd5c3395f00ce16563c3cd4bede979f3@mail.gmail.com> <5386E901.5090803@gmx.de> <6667825af05f6ed0e9e5cc649b18477f@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
H, Raghu,

at first it looks good, but there are some issues in your Makefile that are correct in the examples provided to you.

your port should
- use STAGEDIR (in short time we deprecate all ports without stage support, also we have checks in place to test the port before a package is created)

- do not use a 'deinstall' target, with a proper pkg-plist everything is handed from the pkg tools
  (If you run the command `pkg_deinstall testport-2.1' you will notice nothing happens, without a pkg-plist)

- WRKSRC= ${WRKDIR} and later using '${WRKSRC}/${DISTNAME}' is not required in your test port, remove the line.
  (in the ports framework WRKSRC is already set to ${WRKDIR}/${DISTNAME})

PS:
In Sept. 2014 the old pkg_(install|deinstall|...) tools will be deprecated and everything is build with the new pkg tools (ports-mgmt/pkg)


The required changes in your case (written in svn diff notation)

- 	COMMENT=        test
-
- 	ONLY_FOR_ARCHS= amd64
-
- 	WRKSRC=         ${WRKDIR}
- 	NO_BUILD=       yes
-
-
- 	.include <bsd.port.options.mk>
-
-
- 	do-install:
-
-         	@${MKDIR} ${PREFIX}/sbin/test/
-         	${INSTALL_PROGRAM} ${WRKSRC}/${DISTNAME}/bin/test/testbinary ${PREFIX}/sbin/test/
-
- 	deinstall:
-         	@${RMDIR} ${PREFIX}/sbin/test
-
- 	.include <bsd.port.mk>
+ 	COMMENT=        test
+
+	LICENSE=	??? (if there is one)
+
+ 	ONLY_FOR_ARCHS= amd64
+
+ 	NO_BUILD=       yes
+
+ 	.include <bsd.port.options.mk>
+
+ 	do-install:
+         	@${MKDIR} ${STAGEDIR}${PREFIX}/sbin/test
+         	${INSTALL_PROGRAM} ${WRKDIR}/bin/test/testbinary ${STAGEDIR}${PREFIX}/sbin/test
+
+ 	.include <bsd.port.mk>

Index: pkg-plist
===========================
+sbin/test/testbinary
+@dirrm sbin/test


// hth. olli



On 2014-05-30 06:18, Raghu HB wrote:
> Olli and Michelle,
> 
> Thanks a lot, this is what I was looking for (example for the port
> creation), I referred simple sysutils/tw_cli port and created new port and
> package.
> 
> Below are the steps I followed.
> 
> STEP1: Created a test port directory /usr/ports/sysutils/testport
> 
> STEP2: Created Makefile with below content.
> 
> 	
> --------------------------------------------------------------------------
> ----------------------------------------------------------------
> 	# $FreeBSD$
> 	
> 	PORTNAME=       testport
> 	PORTVERSION=    2.1
> 	CATEGORIES=     sysutils
> 	MASTER_SITES=   ftp://support.com
> 	DISTNAME=       testport-2.1
> 
> 	MAINTAINER=     youremail@example.com
> 	COMMENT=        test
> 
> 	ONLY_FOR_ARCHS= amd64
> 
> 	WRKSRC=         ${WRKDIR}
> 	NO_BUILD=       yes
> 
> 
> 	.include <bsd.port.options.mk>
> 
> 
> 	do-install:
> 
>         	@${MKDIR} ${PREFIX}/sbin/test/
>         	${INSTALL_PROGRAM} ${WRKSRC}/${DISTNAME}/bin/test/testbinary ${PREFIX}/sbin/test/
> 
> 	deinstall:
>         	@${RMDIR} ${PREFIX}/sbin/test
> 
> 	.include <bsd.port.mk>
> 	
> --------------------------------------------------------------------------
> ----------------------------------------------------------------
> 
> STEP3: Created the tar file testport-2.1.tar.gz and placed the tar file in
> /usr/ports/distfiles
> 
> 	./ testport-2.1
> 	./ testport-2.1/bin
> 	./ testport-2.1/bin/test
> 	./ testport-2.1/bin/test/testbinary
> 
> STEP4: Change the directory to /usr/ports/sysutils/testport  and run the
> command : make makesum
> 
> STEP5: Run the command "make package"
>               I can see that the port is created and installed.
> 
> STEP6:  try uninstall the port: "make deinstall"
> 
> STEP7: Create the package from the port using the below commands and
> verify the package.
> 
> 	pkg_create -b testport-2.1
> 	pkg_add -f testport-2.1.tbz
> 	pkg_delete testport-2.1
> 
> As I mentioned above I created a test package and which is working fine.
> Please suggest if any changes needed or if something is wrong in above
> steps.
> 
> Now I would say I will create a package for my new application
> "finalpackage.tbz".
> I would like to know if I can ship the "finalpackage.tbz" file to customer
> to use the package on their system for new application?  or it has to be
> registered with FreeBSD community?
> Please guide us with the future steps to release the application to
> customer.
> 
> -----Original Message-----
> From: olli hauer [mailto:ohauer@gmx.de]
> Sent: Thursday, May 29, 2014 1:30 PM
> To: freebsd-ports
> Cc: Raghu HB
> Subject: Re: Creating new port
> 
> On 2014-05-28 12:01, Raghu HB wrote:
>> Thanks Michelle for quick response.
>>
>>
>> First I would like to explain what is the application and how I am
>> trying to create port.
>>
>> We have some command line utilities to run on FreeBSD (Storage
>> controller software).
>> The installer should contain few binaries and scripts which will be
>> deployed on FreeBSD OS.
>> The binaries are pre-compiled and scripts will be used to
>> start/stop/restart the services or daemons.
>>
>> Created below directory structure "/usr/ports/distfiles/":
>>
>> ./mrmonitor-1.1
>> ./mrmonitor-1.1/bin
>> ./mrmonitor-1.1/bin/mrmonitor
>> ./mrmonitor-1.1/bin/mrmonitor/testmonitor
>> ./mrmonitor-1.1/Makefile
>>
>> I created a tar.gz file which contains the above directory structure
>> with the name mrmonitor-1.1.tar.gz.
>>
>> The Makefile contents:
>> ----------------------------------------------------------
>> # $FreeBSD$
>> PORTNAME=       mrmonitor
>> PORTVERSION=    1.1
>> CATEGORIES=     misc
>> MASTER_SITES=
>>
>> MAINTAINER=    Raghu.hb@avagotech.com
>> COMMENT=       MRMonitor
>> .include <bsd.port.mk>
>> ----------------------------------------------------------
>>
>>
>> Created a home directory /home/Raghu, Created 3 new files Makefile,
>> pkg-descr
>>
>> The Makefile contents:
>> ----------------------------------------------------------
>> # $FreeBSD$
>> PORTNAME=       mrmonitor
>> PORTVERSION=    1.1
>> CATEGORIES=     misc
>> MASTER_SITES=
>>
>> MAINTAINER=    Raghu.hb@avagotech.com
>> COMMENT=       MRMonitor
>> .include <bsd.port.mk>
>> ----------------------------------------------------------
>>
>>
>> pkg-descr
>>
>> ----------------------------------------------------------
>> This is MRMonitor port
>> ----------------------------------------------------------
>>
>> pkg-plist
>> ----------------------------------------------------------
>> bin/mrmonitor
>> bin/mrmonitor/testmonitor
>> @dirrm bin/mrmonitor
>> ----------------------------------------------------------
>>
>>
>>
>> Now I run the command make makesum which is successful, then I ran the
>> command make package I got the errors (attached the error  messages) .
>>
>> May be I am doing something wrong in some basic configuration, please
>> correct me.
>>
>>
>> Thanks,
>> Raghu
>>
>> -----Original Message-----
>> From: Michelle Sullivan [mailto:michelle@sorbs.net]
>> Sent: Wednesday, May 28, 2014 3:14 PM
>> To: Raghu HB
>> Cc: FreeBSD Ports ML
>> Subject: Re: Creating new port
>>
>> Raghu HB wrote:
>>> Hello,
>>>
>>>
>>>
>>> I am new to FreeBSD and I am in a process of creating new port for
>>> one of the application.
>>>
>>> I have gone through the steps in handbook and I tried to create new
>>> port but I am not successful.
>>>
>>>
>>>
>>> I would request you to send one sample example to create new port
>>> with all the steps explained would be a great help.
>>>
>>>
>>
>> What's the application, can you send me your Makefile so far and what
>> errors you're getting?
>>
>> And I'll try and take a look.
>>
>> Michelle
>>
>> --
>> Michelle Sullivan
>> http://www.mhix.org/
>>
> 
> Reading the make-error log it looks like `make' is called recursive.
> In case the the port does not compile anything try to add the keyword
> NO_BUILD=yes into the port Makefile and use a 'do-install:' target.
> 
> e.g.
> 
> COMMENT= 	...
> 
> NO_BUILD=	yes
> 
> do-install:
> 	${INSTALL} ${WRKSRC}/${ARCH}/mrmonitor ${STAGEDIR}${LOCALBASE}/bin
> 	${INSTALL_SCRIPT} ${WRKSRC}/scripts/$scriptXX
> ${STAGEDIR}${LOCALBASE}/bin ...
> .include <bsd.port.mk>
> 
> 
> If you could provide your full Makefile and a link to the distfile I'm
> sure the port can be finished in short time.
> As a hint look at the simple sysutils/tw_cli port
> 
> 
> --
> Regards,
> olli
> _______________________________________________
> freebsd-ports@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-ports
> To unsubscribe, send any mail to "freebsd-ports-unsubscribe@freebsd.org"
> 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?53881320.4030307>