socsvn commit: r253070 - in soc2013/dpl: bzip2 mk

dpl at FreeBSD.org dpl at FreeBSD.org
Mon Jun 17 10:41:51 UTC 2013


Author: dpl
Date: Mon Jun 17 10:41:51 2013
New Revision: 253070
URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=253070

Log:
  Added Makefiles for bzip2 in a different directory.
  Added cap_enter() to bzip.c
  

Added:
  soc2013/dpl/mk/
  soc2013/dpl/mk/Makefile.bzip2
  soc2013/dpl/mk/Makefile.bzip2recover
Modified:
  soc2013/dpl/bzip2/bzip2.c

Modified: soc2013/dpl/bzip2/bzip2.c
==============================================================================
--- soc2013/dpl/bzip2/bzip2.c	Mon Jun 17 09:49:07 2013	(r253069)
+++ soc2013/dpl/bzip2/bzip2.c	Mon Jun 17 10:41:51 2013	(r253070)
@@ -88,6 +88,15 @@
 
 #   define SET_BINARY_MODE(fd) /**/
 
+/* Capsicum Support */
+#	ifdef __FreeBSD__
+#		include <osreldate.h>
+#		if __FreeBSD_version >= 900041
+#			define CAPSICUM
+#			include <sys/capabilities.h>
+#		endif
+#	endif
+
 #   ifdef __GNUC__
 #      define NORETURN __attribute__ ((noreturn))
 #   else
@@ -1812,6 +1821,11 @@
 #  endif
 #  endif
 
+	/* Enter in Capability mode */
+#	if CAPSICUM
+	cap_enter();
+#	endif
+
    copyFileName ( inName,  (Char*)"(none)" );
    copyFileName ( outName, (Char*)"(none)" );
 

Added: soc2013/dpl/mk/Makefile.bzip2
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ soc2013/dpl/mk/Makefile.bzip2	Mon Jun 17 10:41:51 2013	(r253070)
@@ -0,0 +1,51 @@
+# $FreeBSD: soc2013/dpl/head/usr.bin/bzip2/Makefile 201429 2010-01-02 10:27:05Z ed $
+
+BZ2DIR=	${.CURDIR}/../bzip2
+.PATH: ${BZ2DIR}
+
+PROG=	bzip2
+CFLAGS+= -D_FILE_OFFSET_BITS=64
+
+WARNS?=	3
+
+DPADD=	${LIBBZ2}
+LDADD=	-lbz2
+
+LINKS=	${BINDIR}/bzip2 ${BINDIR}/bunzip2
+LINKS+=	${BINDIR}/bzip2 ${BINDIR}/bzcat
+MLINKS= bzip2.1 bunzip2.1 bzip2.1 bzcat.1
+
+REFFILES=	sample1.ref sample2.ref sample3.ref 
+DREFFILES=	sample1.bz2 sample2.bz2 sample3.bz2 
+TESTFILES=	${REFFILES} ${DREFFILES}
+
+CLEANFILES+=	${TESTFILES} \
+		sample1.rb2 sample2.rb2 sample3.rb2 \
+		sample1.tst sample2.tst sample3.tst
+
+.for f in ${REFFILES}
+${f}:	${f}.gz.uu
+	uudecode -p ${BZ2DIR}/${f}.gz.uu | gunzip > ${f}
+.endfor
+.for f in ${DREFFILES}
+${f}:	${f}.uu
+	uudecode ${BZ2DIR}/${f}.uu
+.endfor
+
+test:  bzip2 ${TESTFILES}
+	@cat ${BZ2DIR}/words1
+	./bzip2 -1  < sample1.ref > sample1.rb2
+	./bzip2 -2  < sample2.ref > sample2.rb2
+	./bzip2 -3  < sample3.ref > sample3.rb2
+	./bzip2 -d  < sample1.bz2 > sample1.tst
+	./bzip2 -d  < sample2.bz2 > sample2.tst
+	./bzip2 -ds < sample3.bz2 > sample3.tst
+	cmp sample1.bz2 sample1.rb2 
+	cmp sample2.bz2 sample2.rb2
+	cmp sample3.bz2 sample3.rb2
+	cmp sample1.tst sample1.ref
+	cmp sample2.tst sample2.ref
+	cmp sample3.tst sample3.ref
+	@cat ${BZ2DIR}/words3
+
+.include <bsd.prog.mk>

Added: soc2013/dpl/mk/Makefile.bzip2recover
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ soc2013/dpl/mk/Makefile.bzip2recover	Mon Jun 17 10:41:51 2013	(r253070)
@@ -0,0 +1,11 @@
+# $FreeBSD: soc2013/dpl/head/usr.bin/bzip2recover/Makefile 250858 2013-04-19 19:45:00Z ed $
+
+BZ2DIR=	${.CURDIR}/../bzip2
+.PATH: ${BZ2DIR}
+
+PROG=	bzip2recover
+NO_MAN=
+
+NO_WMISSING_VARIABLE_DECLARATIONS=
+
+.include <bsd.prog.mk>


More information about the svn-soc-all mailing list