From owner-freebsd-ports Sat Sep 23 18:45:44 2000 Delivered-To: freebsd-ports@freebsd.org Received: from ns1.sunesi.net (ns1.sunesi.net [196.15.192.194]) by hub.freebsd.org (Postfix) with ESMTP id 8DFE237B43E for ; Sat, 23 Sep 2000 18:45:27 -0700 (PDT) Received: from nbm by ns1.sunesi.net with local (Exim 3.03 #1) id 13d0r8-000CE1-00 for ports@FreeBSD.org; Sun, 24 Sep 2000 03:45:26 +0200 Date: Sun, 24 Sep 2000 03:45:26 +0200 From: Neil Blakey-Milner To: FreeBSD Ports Subject: makeport part deux - automated port creation tools. Message-ID: <20000924034526.A46867@mithrandr.moria.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0.1i Organization: Sunesi Clinical Systems X-Operating-System: FreeBSD 3.3-RELEASE i386 X-URL: http://rucus.ru.ac.za/~nbm/ Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Hi, For some time, I've been using a script called "makeport.pl" to auto-generate port skeletons for new ports. Unfortunately, just as I was about to release it to the world, a whole slew of changes hit the ports tree, and it was way out of date. I'm now recreating the automated generation tools, and they're available at http://mithrandr.moria.org/nbm/mkptools/ . mkpskel takes a tarball and creates an empty ports skeleton in a directory. It'll guess what PORTNAME, PORTVERSION, DISTNAME, and friends are supposed to be. For example gopher2_3.tar.gz becomes: PORTNAME= gopher PORTVERSION= 2.3 DISTNAME= gopher2_3 But bzip2-1.0.1.tar.gz becomes: PORTNAME= bzip2 PORTVERSION= 1.0.1 And Squishdot-0-7-1.tar.gz (incorrectly, due to capitalization) becomes: PORTNAME= Squishdot PORTVERSION= 0.7.1 DISTNAME= Squishdot-0-7-1 And so on. mkpextr extracts the tarball, and figures a few things out. Firstly, it works out what WRKSRC or NO_WRKSUBDIR should be set to, if necessary. Then it checks if there's a Makefile, and sets NO_BUILD and NO_INSTALL if not, or finds the right Makefile. It then checks for 'configure', and sees what options it recognizes in there. For gview, I get: LIB_DEPENDS= gtk12.2:${PORTSDIR}/x11-toolkits/gtk12 GNU_CONFIGURE= YES CONFIGURE_ENV= GTK_CONFIG="${GTK_CONFIG}" GTK_CONFIG= ${X11BASE}/bin/gtk12-config For gicq, I get: LIB_DEPENDS= gnome.4:${PORTSDIR}/x11/gnomelibs \ gtk12.2:${PORTSDIR}/x11-toolkits/gtk12 GNU_CONFIGURE= YES CONFIGURE_ENV= GTK_CONFIG="${GTK_CONFIG}" GTK_CONFIG= ${X11BASE}/bin/gtk12-config For kicq, I get: LIB_DEPENDS= kdecore.4:${PORTSDIR}/x11/kdelibs2 GNU_CONFIGURE= YES USE_QT= YES mkpmerge merges the result of mkpskel and mkpextr, in a way that allows it to be run as often as desired - it places # -- eos --- at the end of Makefile after mkpskel, and mkpextr after it. mkpclean removes Makefile.extr, Makefile.old, and 'make clean's. Anyway, I've only just got back to hacking on these. makeport.pl also attempted USE_GMAKE if 'make' failed in a specific way, and searched for ALL_TARGET, if it wasn't 'all'. Anyway, I'd love some comments. Cheers, Neil -- Neil Blakey-Milner Sunesi Clinical Systems nbm@mithrandr.moria.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message