Re: Makefile question... please help...

2006-12-06 Thread VeeJay

Thanks

Where can I make above mentioned required changes... can you please give me
a little hint... since I am novice to Unix

Thanks...

VJ
On 12/6/06, VeeJay [EMAIL PROTECTED] wrote:


Hi there,

Is it possible to make configuration changes in Makefile to install a port
as per one's requirments?

I want to accomplish two tasks

1. I want to configure mysql port before installation with following
parameters: Could someone tell me that where in the Makefile, I need to put
these paramenters in order to get my required results? Makefile is at the
end of my message.
Required Configuration paramenters:

--prefix=/usr/local/mysql
--with-mysqld-user=mysql
--with-unix-socket-path=/tmp/mysql.sock
--with-mysqld-ldflags=-all-static


2. I want to install mysql at my given path, so I could be able to assign
the path to mysql user and chroot it PLEASE HELP!!!

Becuase, with default Makefile configuration, mysql installs all scripts
under /usr/local/sbin folder which other deamons also access for example
apache. so, if I alow the access only for mysql ... then other deamons will
not have any access...

chown -R root /usr/local/bin/mysql
chown -R mysql /usr/local/mysql/var
chgrp -R mysql /usr/local/mysql




# New ports collection makefile for:MySQL-server
# Date created: Fri Apr 11 10:06:26 CET 2003
# Whom: Alex Dupre [EMAIL PROTECTED]

#
# $FreeBSD: ports/databases/mysql50-server/Makefile,v 1.188 2005/03/21
14:08:49 pav Exp $
#

PORTNAME?=  mysql
PORTVERSION=5.0.2
PORTREVISION?=  0
CATEGORIES= databases
MASTER_SITES=   ${MASTER_SITE_MYSQL}
MASTER_SITE_SUBDIR= MySQL-5.0
PKGNAMESUFFIX?= -server
DISTNAME=   ${PORTNAME}-${PORTVERSION}-alpha

MAINTAINER= [EMAIL PROTECTED]
COMMENT?=   Multithreaded SQL database (server)

WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION}-alpha
SLAVEDIRS=  databases/mysql50-client
PKGINSTALL?=${WRKDIR}/pkg-install
DB_DIR?=/var/db/mysql
USE_LIBTOOL_VER=15
USE_REINPLACE=  yes
USE_RC_SUBR=yes

CONFIGURE_TARGET=--build=${MACHINE_ARCH}-portbld-freebsd${OSREL}
CONFIGURE_ARGS= --localstatedir=${DB_DIR} \
--without-debug \
--without-readline \
--without-libedit \
--without-bench \
--without-extra-tools \
--with-libwrap \
--with-mysqlfs \
--with-vio \
--with-low-memory \
--with-comment='FreeBSD port: ${PKGNAME}' \
--enable-thread-safe-client

.ifdef USE_MYSQL
.error You have `USE_MYSQL' variable defined either in environment or in
make(1) arguments. Please undefine and try again.
.endif

.if defined(WITH_CHARSET)  ${WITH_CHARSET} != 
CONFIGURE_ARGS+=--with-charset=${WITH_CHARSET}
.endif
.if defined(WITH_XCHARSET)  ${WITH_XCHARSET} != 
CONFIGURE_ARGS+=--with-extra-charsets=${WITH_XCHARSET}
.endif
.if defined(WITH_OPENSSL)
USE_OPENSSL=yes
CONFIGURE_ARGS+=--with-openssl=${OPENSSLBASE}
.endif
.if defined(BUILD_STATIC)
CONFIGURE_ARGS+=--with-mysqld-ldflags=-all-static
.endif
.if defined(WITHOUT_INNODB)
CONFIGURE_ARGS+=--without-innodb
.endif
.if defined(WITH_NDB)
CONFIGURE_ARGS+=--with-ndbcluster
.endif
.if defined(WITH_COLLATION)  ${WITH_COLLATION} != 
CONFIGURE_ARGS+=--with-collation=${WITH_COLLATION}
.endif

.include bsd.port.pre.mk

.if ${ARCH} == i386
CONFIGURE_ARGS+=--enable-assembler --with-berkeley-db
.endif
.if defined(WITH_LINUXTHREADS)

CONFIGURE_ARGS+=--with-named-thread-libs='-DHAVE_GLIBC2_STYLE_GETHOSTBYNAME_R
CONFIGURE_ARGS+=-D_THREAD_SAFE -I${LOCALBASE}/include/pthread/linuxthreads
CFLAGS+=-D__USE_UNIX98 -D_REENTRANT -D_THREAD_SAFE
CFLAGS+=-I${LOCALBASE}/include/pthread/linuxthreads
.if ${OSVERSION}  50
LIB_DEPENDS+=   lthread.[35]:${PORTSDIR}/devel/linuxthreads
CONFIGURE_ARGS+=-L${LOCALBASE}/lib -llthread -llgcc_r -llstdc++ -llsupc++'

.else
LIB_DEPENDS+=   lthread.[24]:${PORTSDIR}/devel/linuxthreads
CONFIGURE_ARGS+=-L${LOCALBASE}/lib -llthread -llgcc_r'
.endif
.else
CONFIGURE_ARGS+=--with-named-thread-libs=${PTHREAD_LIBS}
CFLAGS+=${PTHREAD_CFLAGS}
.endif

.if ${OSVERSION}  50
CXX=${CC}
.endif
.if defined(BUILD_OPTIMIZED)
CFLAGS+=-O3 -fno-omit-frame-pointer
.if ${OSVERSION}  50 || (defined(USE_GCC)  (${USE_GCC} == 3.0 ||
${USE_GCC} == 3.1 || ${USE_GCC} == 3.2 || ${USE_GCC} == 3.3))
CFLAGS+=-fno-gcse
.endif
.endif
CXXFLAGS+=  ${CFLAGS} -felide-constructors -fno-rtti
.if ${OSVERSION} = 42
CXXFLAGS+=  -fno-exceptions
.endif

# MySQL-Server part
.if !defined(CLIENT_ONLY)  !defined(SCRIPTS_ONLY)
USE_MYSQL=  yes
WANT_MYSQL_VER= 50

LATEST_LINK=mysql50-server

CONFLICTS=  mysql-server-3.* mysql-server-4.*

PLIST_SUB=  DB_DIR=${DB_DIR} \
VER=${PORTVERSION}-alpha
.if defined(WITH_NDB)
PLIST_SUB+= NDB=
.else
PLIST_SUB+= NDB=@comment 
.endif

MAN1=   isamchk.1 isamlog.1 mysqld.1 

Re: Makefile question... please help...

2006-12-06 Thread Koushik Narayanan
On Wed, Dec 06, 2006 at 12:38:49AM +0100, VeeJay wrote:
 Hi there,
 
 Is it possible to make configuration changes in Makefile to install a port
 as per one's requirments?

It is possible. But it is better to avoid as it gets overwritten when you cvsup 
or portsnap.

 
 I want to accomplish two tasks
 
 1. I want to configure mysql port before installation with following
 parameters: Could someone tell me that where in the Makefile, I need to put
 these paramenters in order to get my required results? Makefile is at the
 end of my message.

For each of these options there are usually knobs to set at the command line. 
You can easily find out these knobs from the MakeFile.

If there are no knobs for a particular option then AFAIK you have to change the 
Makefile. CONFIGURE_ARGS is the variable that holds all arguments that will be 
passed. You can add to it as you requre.
  
 Required Configuration paramenters:
 
 --prefix=/usr/local/mysql
 --with-mysqld-user=mysql
 --with-unix-socket-path=/tmp/mysql.sock

These three donot have any knobs AFAIK. So you have to change your Makefile.

 --with-mysqld-ldflags=-all-static

This one has a knob named BUILD_STATIC. So you could do make -DBUILD_STATIC 
install to add this configuration alone.

snip

 CONFIGURE_ARGS= --localstatedir=${DB_DIR} \
--without-debug \
--without-readline \
--without-libedit \
--without-bench \
--without-extra-tools \
--with-libwrap \
--with-mysqlfs \
--with-vio \
--with-low-memory \
--with-comment='FreeBSD port: ${PKGNAME}' \
--enable-thread-safe-client

This is the CONFIGURE_ARGS variable. Modify it as you like. Donot forget the 
'\'at the end of each non terminating line.

snip

 .if defined(BUILD_STATIC)
 CONFIGURE_ARGS+=--with-mysqld-ldflags=-all-static
 .endif

This is what I meant by a knob. If you pass -DBUILD_STATIC to make, this 'if' 
returns true and the extra option to CONFIGURE_ARGS is concatenated. You could 
also define BUILD_STATIC in your shell from which you run make. It has the same 
effect.

When you change your Makefile, make sure to rename it to so that it survives a 
cvsup.

HTH

Koushik Narayanan
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Makefile question... please help...

2006-12-05 Thread VeeJay

Hi there,

Is it possible to make configuration changes in Makefile to install a port
as per one's requirments?

I want to accomplish two tasks

1. I want to configure mysql port before installation with following
parameters: Could someone tell me that where in the Makefile, I need to put
these paramenters in order to get my required results? Makefile is at the
end of my message.
Required Configuration paramenters:

--prefix=/usr/local/mysql
--with-mysqld-user=mysql
--with-unix-socket-path=/tmp/mysql.sock
--with-mysqld-ldflags=-all-static


2. I want to install mysql at my given path, so I could be able to assign
the path to mysql user and chroot it PLEASE HELP!!!

Becuase, with default Makefile configuration, mysql installs all scripts
under /usr/local/sbin folder which other deamons also access for example
apache. so, if I alow the access only for mysql ... then other deamons will
not have any access...

chown -R root /usr/local/bin/mysql
chown -R mysql /usr/local/mysql/var
chgrp -R mysql /usr/local/mysql




# New ports collection makefile for:MySQL-server
# Date created: Fri Apr 11 10:06:26 CET 2003
# Whom: Alex Dupre [EMAIL PROTECTED]
#
# $FreeBSD: ports/databases/mysql50-server/Makefile,v 1.188 2005/03/21
14:08:49 pav Exp $
#

PORTNAME?=  mysql
PORTVERSION=5.0.2
PORTREVISION?=  0
CATEGORIES= databases
MASTER_SITES=   ${MASTER_SITE_MYSQL}
MASTER_SITE_SUBDIR= MySQL-5.0
PKGNAMESUFFIX?= -server
DISTNAME=   ${PORTNAME}-${PORTVERSION}-alpha

MAINTAINER= [EMAIL PROTECTED]
COMMENT?=   Multithreaded SQL database (server)

WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION}-alpha
SLAVEDIRS=  databases/mysql50-client
PKGINSTALL?=${WRKDIR}/pkg-install
DB_DIR?=/var/db/mysql
USE_LIBTOOL_VER=15
USE_REINPLACE=  yes
USE_RC_SUBR=yes

CONFIGURE_TARGET=--build=${MACHINE_ARCH}-portbld-freebsd${OSREL}
CONFIGURE_ARGS= --localstatedir=${DB_DIR} \
   --without-debug \
   --without-readline \
   --without-libedit \
   --without-bench \
   --without-extra-tools \
   --with-libwrap \
   --with-mysqlfs \
   --with-vio \
   --with-low-memory \
   --with-comment='FreeBSD port: ${PKGNAME}' \
   --enable-thread-safe-client

.ifdef USE_MYSQL
.error You have `USE_MYSQL' variable defined either in environment or in
make(1) arguments. Please undefine and try again.
.endif

.if defined(WITH_CHARSET)  ${WITH_CHARSET} != 
CONFIGURE_ARGS+=--with-charset=${WITH_CHARSET}
.endif
.if defined(WITH_XCHARSET)  ${WITH_XCHARSET} != 
CONFIGURE_ARGS+=--with-extra-charsets=${WITH_XCHARSET}
.endif
.if defined(WITH_OPENSSL)
USE_OPENSSL=yes
CONFIGURE_ARGS+=--with-openssl=${OPENSSLBASE}
.endif
.if defined(BUILD_STATIC)
CONFIGURE_ARGS+=--with-mysqld-ldflags=-all-static
.endif
.if defined(WITHOUT_INNODB)
CONFIGURE_ARGS+=--without-innodb
.endif
.if defined(WITH_NDB)
CONFIGURE_ARGS+=--with-ndbcluster
.endif
.if defined(WITH_COLLATION)  ${WITH_COLLATION} != 
CONFIGURE_ARGS+=--with-collation=${WITH_COLLATION}
.endif

.include bsd.port.pre.mk

.if ${ARCH} == i386
CONFIGURE_ARGS+=--enable-assembler --with-berkeley-db
.endif
.if defined(WITH_LINUXTHREADS)
CONFIGURE_ARGS+=--with-named-thread-libs='-DHAVE_GLIBC2_STYLE_GETHOSTBYNAME_R
CONFIGURE_ARGS+=-D_THREAD_SAFE -I${LOCALBASE}/include/pthread/linuxthreads
CFLAGS+=-D__USE_UNIX98 -D_REENTRANT -D_THREAD_SAFE
CFLAGS+=-I${LOCALBASE}/include/pthread/linuxthreads
.if ${OSVERSION}  50
LIB_DEPENDS+=   lthread.[35]:${PORTSDIR}/devel/linuxthreads
CONFIGURE_ARGS+=-L${LOCALBASE}/lib -llthread -llgcc_r -llstdc++ -llsupc++'
.else
LIB_DEPENDS+=   lthread.[24]:${PORTSDIR}/devel/linuxthreads
CONFIGURE_ARGS+=-L${LOCALBASE}/lib -llthread -llgcc_r'
.endif
.else
CONFIGURE_ARGS+=--with-named-thread-libs=${PTHREAD_LIBS}
CFLAGS+=${PTHREAD_CFLAGS}
.endif

.if ${OSVERSION}  50
CXX=${CC}
.endif
.if defined(BUILD_OPTIMIZED)
CFLAGS+=-O3 -fno-omit-frame-pointer
.if ${OSVERSION}  50 || (defined(USE_GCC)  (${USE_GCC} == 3.0 ||
${USE_GCC} == 3.1 || ${USE_GCC} == 3.2 || ${USE_GCC} == 3.3))
CFLAGS+=-fno-gcse
.endif
.endif
CXXFLAGS+=  ${CFLAGS} -felide-constructors -fno-rtti
.if ${OSVERSION} = 42
CXXFLAGS+=  -fno-exceptions
.endif

# MySQL-Server part
.if !defined(CLIENT_ONLY)  !defined(SCRIPTS_ONLY)
USE_MYSQL=  yes
WANT_MYSQL_VER= 50

LATEST_LINK=mysql50-server

CONFLICTS=  mysql-server-3.* mysql-server-4.*

PLIST_SUB=  DB_DIR=${DB_DIR} \
   VER=${PORTVERSION}-alpha
.if defined(WITH_NDB)
PLIST_SUB+= NDB=
.else
PLIST_SUB+= NDB=@comment 
.endif

MAN1=   isamchk.1 isamlog.1 mysqld.1 \
   mysqld_safe.1 perror.1 replace.1

.if !defined(NOPORTDOCS)
PORTDOCS=   manual.html manual.txt manual_toc.html
.endif

INFO=   mysql

pre-fetch:
   @${ECHO} 
   @${ECHO} 

RE: Makefile question... please help...

2006-12-05 Thread Wood, Russell

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:owner-freebsd-
 [EMAIL PROTECTED] On Behalf Of VeeJay
 Sent: Wednesday, 6 December 2006 8:39 AM
 To: [EMAIL PROTECTED]; FreeBSD-Questions
 Subject: Makefile question... please help...
 
 edit ports Makefile


Yes, you can. But when you update your Ports directory, your edited
Makefile will be overwritten.

Regards,
Russell Wood


DISCLAIMER:
Disclaimer.  This e-mail is private and confidential. If you are not the 
intended recipient, please advise us by return e-mail immediately, and delete 
the e-mail and any attachments without using or disclosing the contents in any 
way. The views expressed in this e-mail are those of the author, and do not 
represent those of this company unless this is clearly indicated. You should 
scan this e-mail and any attachments for viruses. This company accepts no 
liability for any direct or indirect damage or loss resulting from the use of 
any attachments to this e-mail.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]