mirror of
https://git.FreeBSD.org/ports.git
synced 2025-01-02 06:03:50 +00:00
- Clean-up build system a bit;
- fix remaining two places where CFLAGS weren't respected; - use cpio(1) to copy hierarchies instead of tar(1), so that it is possible to build the port as ordinary user, but still have installed files be owned by root; - use slightly different solution for the problem with 777 permissions on directories created during the build. Instead of harcoding resulting prmission apply umask(2) to all mode arguments of [f]chmod() calls. Since Rotor has no notion of file-level security anyway this should be an optimal way to fix the problem. Submitted by: Patrick Backlund <pbacklun@cc.hut.fi> (cpio fix) sobomax (the rest)
This commit is contained in:
parent
b96bf6c412
commit
1b712c05fc
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=57762
@ -7,7 +7,7 @@
|
||||
|
||||
PORTNAME= cli
|
||||
PORTVERSION= 20020326
|
||||
PORTREVISION= 2
|
||||
PORTREVISION= 3
|
||||
CATEGORIES= lang
|
||||
MASTER_SITES= http://download.microsoft.com/download/.netframesdk/CLI/Beta1/WXP/EN-US/ \
|
||||
http://download.microsoft.com/download/.netframesdk/Beta1/WXP/EN-US/ \
|
||||
@ -25,8 +25,11 @@ NO_CDROM= ${RESTRICTED}
|
||||
NO_PACKAGE= ${RESTRICTED}
|
||||
|
||||
GNU_CONFIGURE= yes
|
||||
CONFIGURE_SCRIPT= env.sh ./configure
|
||||
CONFIGURE_ARGS= ${BUILD_TYPE}
|
||||
CONFIGURE_SCRIPT= portconfigure
|
||||
MAKEFILE= makefile
|
||||
MAKE_ENV= CC_NAME="${CC}"
|
||||
BUILD_TYPE= retail
|
||||
|
||||
.include <bsd.port.pre.mk>
|
||||
|
||||
@ -35,15 +38,10 @@ EXTRA_PATCHES!= ${ECHO_CMD} ${PKGDIR}/files.5/patch-*
|
||||
.endif
|
||||
|
||||
post-extract:
|
||||
@${CHMOD} 755 ${WRKSRC}/env.sh
|
||||
|
||||
post-configure:
|
||||
@for file in `/usr/bin/find ${WRKSRC} -type f -name "makefile*"`; do \
|
||||
${LN} -sf $${file} `${ECHO_CMD} $${file} | ${SED} 's|makefile|Makefile|'` ; \
|
||||
done
|
||||
@${CP} ${SCRIPTDIR}/portconfigure ${WRKSRC}
|
||||
|
||||
do-build:
|
||||
@(cd ${BUILD_WRKSRC}; ${SETENV} ${MAKE_ENV} ${SH} env.sh ./buildall)
|
||||
@(cd ${BUILD_WRKSRC}; ${SETENV} ${MAKE_ENV} ./buildall ${BUILD_TYPE})
|
||||
|
||||
.if !defined(I_AGREE_TO_LICENSE_TERMS)
|
||||
pre-install:
|
||||
@ -57,7 +55,7 @@ pre-install:
|
||||
do-install:
|
||||
@${MKDIR} ${PREFIX}/cli-${PORTVERSION}
|
||||
@${INSTALL_DATA} ${WRKSRC}/license.txt ${PREFIX}/cli-${PORTVERSION}
|
||||
@${TAR} -C ${WRKSRC}/build/v1.x86fre.rotor -c -f - . | \
|
||||
${TAR} -C ${PREFIX}/cli-${PORTVERSION} --unlink -x -f -
|
||||
@cd ${WRKSRC}/build/v1.x86fre.rotor && ${FIND} . | \
|
||||
/usr/bin/cpio -pdmu -R ${LIBOWN}:${LIBGRP} ${PREFIX}/cli-${PORTVERSION}
|
||||
|
||||
.include <bsd.port.post.mk>
|
||||
|
14
lang/cli/files/patch-buildall
Normal file
14
lang/cli/files/patch-buildall
Normal file
@ -0,0 +1,14 @@
|
||||
|
||||
$FreeBSD$
|
||||
|
||||
--- buildall 2002/04/16 15:44:18 1.1
|
||||
+++ buildall 2002/04/16 15:44:34
|
||||
@@ -17,6 +17,8 @@
|
||||
# Make command errors fatal
|
||||
set -e
|
||||
|
||||
+. env.sh
|
||||
+
|
||||
if test X"${TARGETCOMPLUS}" = "X"
|
||||
then
|
||||
echo "ERROR: The TARGETCOMPLUS environment variable isn't set."
|
@ -2,27 +2,29 @@
|
||||
$FreeBSD$
|
||||
|
||||
--- env.sh.orig Fri Mar 22 03:47:54 2002
|
||||
+++ env.sh Fri Mar 29 20:01:48 2002
|
||||
@@ -69,14 +69,14 @@
|
||||
+++ env.sh Tue Apr 16 18:38:49 2002
|
||||
@@ -69,7 +69,15 @@
|
||||
export DEBUGGING_SUPPORTED_BUILD=1
|
||||
export SVR_WKS_DIRS=wks
|
||||
|
||||
-if test X"$1" = "Xfree"
|
||||
+if true
|
||||
+if test X"$1" = "Xretail"
|
||||
+then
|
||||
+echo "Retail Environment"
|
||||
+export DDKBUILDENV=free
|
||||
+export C_DEFINES="${C_DEFINES} -DNTMAKEENV -DNDEBUG -DPERF_TRACKING"
|
||||
+export BUILD_ALT_DIR=r
|
||||
+export TARGETCOMPLUS="${ROTOR_DIR}/build/v1.x86fre.rotor"
|
||||
+export NTDEBUG=retail
|
||||
+else if test X"$1" = "Xfree"
|
||||
then
|
||||
echo "Free Environment"
|
||||
export DDKBUILDENV=free
|
||||
export C_DEFINES="${C_DEFINES} -DNTMAKEENV -DNDEBUG -DPERF_TRACKING"
|
||||
export BUILD_ALT_DIR=r
|
||||
export TARGETCOMPLUS="${ROTOR_DIR}/build/v1.x86fre.rotor"
|
||||
-export NTDEBUG=ntsdnodbg
|
||||
+export NTDEBUG=retail
|
||||
else if test X"$1" = "Xchecked"
|
||||
then
|
||||
echo "Checked Environment"
|
||||
@@ -104,3 +104,5 @@
|
||||
export PATH=${PATH}:${TARGETCOMPLUS}/int_tools
|
||||
export LD_LIBRARY_PATH="${TARGETCOMPLUS}"
|
||||
export LD_LIB_DIRS="-L${TARGETCOMPLUS}"
|
||||
+
|
||||
+exec "$@"
|
||||
@@ -93,6 +101,7 @@
|
||||
export BUILD_ALT_DIR=df
|
||||
export TARGETCOMPLUS="${ROTOR_DIR}/build/v1.x86fstchk.rotor"
|
||||
export NTDEBUG=ntsd
|
||||
+fi
|
||||
fi
|
||||
fi
|
||||
|
||||
|
@ -1,25 +1,42 @@
|
||||
|
||||
$FreeBSD$
|
||||
|
||||
--- pal/unix/file/file.c 2002/04/09 22:17:33 1.1
|
||||
+++ pal/unix/file/file.c 2002/04/09 22:19:43
|
||||
@@ -2822,18 +2822,10 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
- /* give write permission to anyone that has read permission */
|
||||
+ /* give write permission to owner if it has read permission */
|
||||
if ( new_mode & S_IRUSR )
|
||||
{
|
||||
new_mode |= S_IWUSR;
|
||||
- }
|
||||
- if ( new_mode & S_IRGRP )
|
||||
- {
|
||||
- new_mode |= S_IWGRP;
|
||||
- }
|
||||
- if ( new_mode & S_IROTH )
|
||||
- {
|
||||
- new_mode |= S_IWOTH;
|
||||
}
|
||||
}
|
||||
TRACE("new mode is 0x%lx\n", new_mode);
|
||||
--- pal/unix/file/file.c.orig Fri Mar 22 03:48:20 2002
|
||||
+++ pal/unix/file/file.c Wed Apr 10 11:52:45 2002
|
||||
@@ -37,6 +37,9 @@
|
||||
#include <sys/stat.h>
|
||||
#include <errno.h>
|
||||
|
||||
+#define chmod( path, mode ) chmod( ( path ), ( mode ) & ~GetUmask() )
|
||||
+#define fchmod( fd, mode ) fchmod( ( fd ), ( mode ) & ~GetUmask() )
|
||||
+#define lchmod( path, mode ) lchmod( ( path ), ( mode ) & ~GetUmask() )
|
||||
|
||||
SET_DEFAULT_DEBUG_CHANNEL(FILE);
|
||||
|
||||
@@ -44,6 +47,8 @@
|
||||
static int FILECloseStdHandle( HOBJSTRUCT *handle_data);
|
||||
static int FILEDuplicateHandle( HANDLE handle, HOBJSTRUCT *handle_data);
|
||||
|
||||
+static mode_t GetUmask( void );
|
||||
+
|
||||
static file *FILENewFileData( void );
|
||||
|
||||
static BOOL FILEAddNewLockedRgn(SHMFILELOCKS* fileLocks,
|
||||
@@ -2342,6 +2347,17 @@
|
||||
HMGRUnlockHandle(handle,&file_data->handle_data);
|
||||
}
|
||||
|
||||
+static mode_t GetUmask( void )
|
||||
+{
|
||||
+ mode_t mask;
|
||||
+
|
||||
+ /* XXX: Probably need to block signals to avoid race here */
|
||||
+ mask = umask( 0 );
|
||||
+ umask( mask );
|
||||
+ /* XXX: Unblock here */
|
||||
+
|
||||
+ return mask;
|
||||
+}
|
||||
|
||||
/*++
|
||||
Function:
|
||||
|
14
lang/cli/files/patch-pal::unix::startup::makefile.in
Normal file
14
lang/cli/files/patch-pal::unix::startup::makefile.in
Normal file
@ -0,0 +1,14 @@
|
||||
|
||||
$FreeBSD$
|
||||
|
||||
--- pal/unix/startup/makefile.in.orig Fri Mar 22 03:48:22 2002
|
||||
+++ pal/unix/startup/makefile.in Wed Apr 10 12:14:41 2002
|
||||
@@ -50,6 +50,8 @@
|
||||
OPTCFLAGS+= -g
|
||||
.endif
|
||||
|
||||
+OPTCFLAGS=$(CFLAGS)
|
||||
+
|
||||
#################
|
||||
# Targets
|
||||
|
15
lang/cli/files/patch-tools::cppmunge::makefile
Normal file
15
lang/cli/files/patch-tools::cppmunge::makefile
Normal file
@ -0,0 +1,15 @@
|
||||
|
||||
$FreeBSD$
|
||||
|
||||
--- tools/cppmunge/makefile.orig Fri Mar 22 03:49:22 2002
|
||||
+++ tools/cppmunge/makefile Wed Apr 10 12:10:29 2002
|
||||
@@ -17,7 +17,8 @@
|
||||
# makefile for cppmunge
|
||||
# ============================================================================
|
||||
|
||||
-CFLAGS = -g -Wall -O2
|
||||
+CFLAGS ?= -g -Wall -O2
|
||||
+CFLAGS += -fno-builtin -fno-exceptions -fno-rtti
|
||||
TARGET_NAME = $(TARGETCOMPLUS)/cppmunge
|
||||
|
||||
SOURCES=cppmunge.c
|
Loading…
Reference in New Issue
Block a user