Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 10 Apr 2000 11:09:42 +0300 (EEST)
From:      "Maxim Sobolev" <sobomax@altavista.net>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   ports/17893: [PATCH] Cleanup of build process of the py-MySQL port
Message-ID:  <200004100809.LAA07054@vega.vega.com>

next in thread | raw e-mail | index | archive | help

>Number:         17893
>Category:       ports
>Synopsis:       [PATCH] Cleanup of build process of the py-MySQL port
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon Apr 10 01:20:01 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     Maxim Sobolev
>Release:        FreeBSD 3.4-STABLE i386
>Organization:
Vega International Capital
>Environment:

	

>Description:

Cleanup of build process of the py-MySQL port. Previously port used custom Makefile for this purpose,
which led to resulting module being bloated (~600K) by linking all Python code from libpython1.5
into it. With this patch the module will use standard Python's way to build supplemental modules,
which should generally be cleaner. Other good sideeffect is that after this patch resulting module
is only 20K in size.

>How-To-Repeat:

	

>Fix:

diff -ruN /usr/ports/databases/py-MySQL/Makefile py-MySQL/Makefile
--- /usr/ports/databases/py-MySQL/Makefile	Mon Apr 10 10:06:48 2000
+++ py-MySQL/Makefile	Mon Apr 10 11:05:10 2000
@@ -17,18 +17,19 @@
 LIB_DEPENDS=	mysqlclient.6:${PORTSDIR}/databases/mysql322-client
 RUN_DEPENDS=	python:${PORTSDIR}/lang/python
 
-pre-build:
-	${CP} ${FILESDIR}/Makefile ${WRKSRC}/Makefile
+ALL_TARGET=	MySQLmodule.so
+
+pre-configure:
+	${CP} ${FILESDIR}/Setup ${WRKSRC}/Setup
+	${LN} -s ${LOCALBASE}/lib/python1.5/config/Makefile.pre.in ${WRKSRC}/
+
+do-configure:
+	cd ${WRKSRC} && ${MAKE} -f Makefile.pre.in boot
 
-do-install:
-	${INSTALL_DATA} ${WRKSRC}/MySQLmodule.so ${PREFIX}/lib/python1.5/site-packages
 .if !defined(NOPORTDOCS)
+post-install:
 	${MKDIR} ${PREFIX}/share/doc/py-MySQL
 	${INSTALL_DATA} ${WRKSRC}/README ${PREFIX}/share/doc/py-MySQL
-.endif
-
-post-install:
-.if !defined(NOPORTDOCS)
 	${ECHO} "share/doc/py-MySQL/README" >> ${TMPPLIST}
 	${ECHO} "@dirrm share/doc/py-MySQL" >> ${TMPPLIST}
 .endif
diff -ruN /usr/ports/databases/py-MySQL/files/Makefile py-MySQL/files/Makefile
--- /usr/ports/databases/py-MySQL/files/Makefile	Fri Jan 14 17:00:07 2000
+++ py-MySQL/files/Makefile	Thu Jan  1 03:00:00 1970
@@ -1,9 +0,0 @@
-CC?=/usr/bin/gcc
-CFLAGS+=-I$(PREFIX)/include/python1.5 -I$(PREFIX)/include/mysql 
-LIBS=-L$(PREFIX)/lib/python1.5/config -L$(PREFIX)/lib/mysql -lmysqlclient -lpython1.5
-
-all:
-	${CC} MySQLmodule.c -shared ${CFLAGS} ${LIBS} -o MySQLmodule.so
-
-clean:
-	rm -f *~ core MySQLmodule.so
diff -ruN /usr/ports/databases/py-MySQL/files/Setup py-MySQL/files/Setup
--- /usr/ports/databases/py-MySQL/files/Setup	Thu Jan  1 03:00:00 1970
+++ py-MySQL/files/Setup	Mon Apr 10 10:45:12 2000
@@ -0,0 +1,2 @@
+*shared*
+MySQL MySQLmodule.c -I${LOCALBASE}/include/mysql -L${LOCALBASE}/lib/mysql -lmysqlclient


>Release-Note:
>Audit-Trail:
>Unformatted:


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




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