From owner-freebsd-ports@FreeBSD.ORG Sun Dec 2 21:38:00 2007 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7952416A418 for ; Sun, 2 Dec 2007 21:38:00 +0000 (UTC) (envelope-from godpost@gmail.com) Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.174]) by mx1.freebsd.org (Postfix) with ESMTP id CCA8813C467 for ; Sun, 2 Dec 2007 21:37:59 +0000 (UTC) (envelope-from godpost@gmail.com) Received: by ug-out-1314.google.com with SMTP id y2so2764617uge for ; Sun, 02 Dec 2007 13:37:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to:subject:date:mime-version:content-type:content-transfer-encoding:x-priority:x-msmail-priority:x-mailer:x-mimeole; bh=xSJMc085yy3GGVtKrdgOYhsoa0m/IB76WWPnyS5nlDk=; b=Vn6aC8Cnyu1QHWwbzRBktQI0PsOy7wlRvJMH+YvMvIdWc1gdOQhJ/0YMaARfaCVrQgeBsPzyoXF4bUJVTH+XsJi6sJdzEAVIquyQ2YLk8I9lT7IqKrVDtmBEmCeKXxxQzZwfEBCfXyGcBWPwhN3c8ad0eFTvzRjnH+v+W14iQ7A= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=received:message-id:from:to:subject:date:mime-version:content-type:content-transfer-encoding:x-priority:x-msmail-priority:x-mailer:x-mimeole; b=ed6jOPoC26426gyXv5UGilHEKJrnPp+lcCPoR2KjGy+E/Mcj53WO5P0XQMfsVEu9qI7/GIVqGlgia/45c/9mPWmVEJS5VZenPLke/nXGNXnB3MO6jl4y8JUlGS0HJEgtZ+DmKz/Fgj9I+mGBmRSiirO0joUuX8/iL6zr0jhdsu0= Received: by 10.67.92.20 with SMTP id u20mr1279869ugl.1196631477504; Sun, 02 Dec 2007 13:37:57 -0800 (PST) Received: from pi ( [212.242.117.72]) by mx.google.com with ESMTPS id m1sm6716617ugc.2007.12.02.13.37.56 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 02 Dec 2007 13:37:56 -0800 (PST) Message-ID: <002401c8352b$9ba33750$6300000a@pi> From: "GP" To: Date: Sun, 2 Dec 2007 22:37:57 +0100 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=response Content-Transfer-Encoding: 8bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.3138 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198 Subject: HELP needed by experienced porter for simple review X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Dec 2007 21:38:00 -0000 Any body? >>>> I'm new to porting for FreeBSD and make files aren't my strongest suit. >>>> So >>>> I would be greatful if I could get an experienced porter to review my >>>> make >>>> files, for at very simple deamon. >>>> >>>> I've read the porter handbook and the port seems to be working fine. >>>> But >>>> I'm uncertain as to what is best practise and since this will hopefully >>>> be >>>> the first of many ports, I would like to get i right. >>>> >>>> If you want to help, please drop me a note and I will send you the two >>>> small makefiles to review. >> >> Hi and welcome! >> First of all you should install ports-mgmt/portlint and run it against >> your port (if you haven't done it already). Be sure to use the switch to >> enable additional checks (I got bitten once because I forgot it). >> Then you could perhaps put your work online somewhere and provide a link, >> so everybody can take a look at it and test. >> >> Best regards, >> Jona >> Ok. thanks. Its simple so I will just put in in this mail. I hope to have the ability to make changes in the source, so I've included the proposed application Makefile as well. Its all working, but I would like to know if the concepts are sound? Portlint throws a warning, but I don't se any reasonable way arrount that: /usr/ports/distfiles>portlint WARN: Makefile: possible use of absolute pathname "/etc/rc.conf.bak". 0 fatal errors and 1 warning found. Root Makefile: -------------------------------------------------------------------------------------- # New ports collection makefile for: kissdx # Date created: 20. November 2007 # Whom: Simon I. Rigét # # $FreeBSD$ PORTNAME= kissdx PORTVERSION= 0.13.10a CATEGORIES= multimedia net MASTER_SITES= http://freebsd.paragi.dk/kissdx/ \ http://kissdx.vidartysse.net/ DISTNAME= ${PORTNAME}-${PORTVERSION} MAINTAINER= freebsd@paragi.dk COMMENT= A multimedia streaming server for KiSS/Linksys player USE_ICONV= yes # Dependencies of other packeges LIB_DEPENDS= libdvdread:${PORTSDIR}/multimedia/libdvdread \ libiconv:${PORTSDIR}/converters/libiconv \ gd-2:${PORTSDIR}/graphics/gd jpeg-6b_4:${PORTSDIR}/graphics/jpeg # Man pages MAN1= kissdx.1 MANCOMPRESSED= yes # RC start and stop service USE_RC_SUBR= kissdx # set enviroment variables for port makefile MAKE_ENV= FreeBSD=defined # Convert CR/LF to LF in source files USE_DOS2UNIX= yes post-patch: ${REINPLACE_CMD} -e 's|Linux|Unix|g' ${WRKSRC}/kissdx.1 ${REINPLACE_CMD} -e 's|/etc/|/usr/local/etc/|' ${WRKSRC}/kissdx.1 $(GZIP_CMD) -c ${INSTALL_WRKSRC}/kissdx.1 >${INSTALL_WRKSRC}/kissdx.1.gz $(MKDIR) $(FILESDIR) $(CP) ${WRKSRC}/kissdx.in ${FILESDIR} do-install: all $(INSTALL_PROGRAM) ${INSTALL_WRKSRC}/kissdx ${TARGETDIR}/sbin/kissdx $(INSTALL_DATA) ${INSTALL_WRKSRC}/kissdx.conf ${TARGETDIR}/etc/kissdx.conf $(INSTALL_MAN) ${INSTALL_WRKSRC}/kissdx.1.gz ${TARGETDIR}/man/man1/kissdx.1.gz echo "kissdx_enabled=\"YES\"" >> /etc/rc.conf do-deinstall: $(RM) ${TARGETDIR}/sbin/kissdx $(RM) ${TARGETDIR}/etc/kissdx.conf $(RM) ${TARGETDIR}/man/man1/kissdx.* $(RM) ${TARGETDIR}/etc/rc.d/kissdx $(CP) ${/etc/rc.conf} ${/etc/rc.conf}.bak ${GREP} -v kissdx_ /etc/rc.conf.bak >/etc/rc.conf .include pkg-plist: ------------------------------------------------------------------------------------ sbin/kissdx etc/kissdx.conf etc/rc.d/kissdx Application Makefile: ------------------------------------------------------------------------------------ ################################################################################# KiSS DX multi OS Makefile# By SR. 2007-11-30################################################################################ ################################################################################# Operating system# Uncomment for onr of the desired OS (Execpt FreeBSD which will be definedby# the master makefile)################################################################################ #env= Environment(**ARGUMENTS)#NSLU2= defined#CYGWIN= definedLinux= defined ################################################################################# Generic settings## In some UNIX systems build options that affect all ports can be setglobally.# this makefile should not override the existing value.################################################################################CC?= gcc# compiler directives (defines)# Sendfile# -DUSE_INTERNAL_SENDFILE (less performance) if you cannot use the sendfilesyscall on your# target platform with 64-bit file access. Needed for Unslung 5.5 on NSLU2.# -DUSE_INTERNAL_SENDFILE_MMAP (better performance)# with -DUSE_INTERNAL_SENDFILE if your target platform supports memorymapped# files with 64-bit file access and you want to use it. Not possible with# >2GB files on Unslung 5.5 on NSLU2.CFLAGS+= -DUSE_INTERNAL_SENDFILE # Support for lage file sizes >2GbCFLAGS+= -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64CFLAGS+= -D_GNU_SOURCE# Compile optionsCFLAGS+= -Wall -Wstrict-prototypes# LiberariesLIBS+= -ldvdread# remove -liconv below if your system has libiconv built inLIBS+= -liconvLIBS+= -ljpegLIBS+= -lm# Link optionsLDFLAGS+= -O2 -s -L/usr/lib -L/usr/local/lib################################################################################# Operating system dependend settings################################################################################.if defined(FreeBSD)# FreeBSD definitionsCFLAGS+= -DFreeB SDCFLAGS+= -I. -I/usr/include -I/usr/local/includeCFLAGS+=-D_CONF_DIR=${TARGETDIR}/etc/.undef(Linux).undef(NSLU2).undef(CYGWIN).else#Linux definitionCFLAGS+= -DLinux# Install settings.create-install-target=definedINSTALL_PROGRAM?= install -b -S .old -o root -g root -m 755INSTALL_SCRIPT?= install -b -S .old -o root -g root -m 755INSTALL_DATA?= install -b -S .old -o root -g root -m 644INSTALL_MAN?= install -o root -g root -m 644INSTALL_WRKSRC= .TARGETDIR= $(DISTDIR)/usrMANTARGETDIR= /usr/share/man.endif.if defined(NSLU2)CC= arm-linux-gccCFLAGS+= -mcpu=xscale -mbig-endianCFLAGS+= -I/opt/includeLIBS+= -L/opt/lib.undef(create-install-target).endif################################################################################# Make a list of object files as targets for compilation################################################################################OBJS= kissdx.o connection.o sendfile.o dvdread.o playlist.o jpeg.opiccache.oOBJS+= utils.o config.o backtoback.oOBJS+= gdst uff/gdstuff.o gdstuff/gd.o gdstuff/gdfontg.o gdstuff/gd_jpeg.oOBJS+= gdstuff/gdhelpers.o gdstuff/gd_io_dp.o gdstuff/gd_io.oOBJS+= gdstuff/gd_security.o################################################################################# Compile and link rules## Build in macros:#$@ The file name of the target.#$< The name of the first dependency.#$* The part of a filename which matched a suffix rule.#$? The names of all the dependencies newer than the target separated byspaces.#$^ The names of all the dependencies separated by spaces, but withduplicate# names removed.#$+ The names of all the dependencies separated by spaces with duplicatenames# included and in the same order as in the rule.################################################################################ .c.o:$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $< .o :$(CC) -o $@ $(LIBS) $(LDFLAGS) $(OBJS)# Do all the compiling and linkingall: $(OBJS) kissdx######################################################################## ######### Linux install rules################################################################################.if !defined(FreeBSD).if defined(create-install-target)#Install files on the systeminstall:$(INSTALL_PROGRAM) ${INSTALL_WRKSRC}/kissdx $(TARGETDIR)/sbin/kissdx$(INSTALL_DATA) ${INSTALL_WRKSRC}/kissdx.conf $(TARGETDIR)/etc/kissdx.conf$(INSTALL_MAN) ${INSTALL_WRKSRC}/kissdx.1 $(MANTARGETDIR)/man1/kissdx.1 #Remove all installed filesuninstall:rm $(TARGETDIR)/sbin/kissdxrm $(TARGETDIR)/etc/kissdx.confrm $(MANTARGETDIR)/man1/kissdx.1echo "All files successfully removed".endif# This clean only removes compiled files.clean:rm -rf kissdx.exe kissdx $(OBJS) *.bak *~echo "Clean as a whistle".endif