From 2d7fda348b3d3110abfaecaf8e5ba88dbe44d6c3 Mon Sep 17 00:00:00 2001 From: hubertf Date: Fri, 6 Aug 1999 16:37:22 +0000 Subject: NetBSD's getopt_long put into a library, until we have this somewhere else available to (all!) users. --- devel/libgetopt/Makefile | 26 ++++++++++++++ devel/libgetopt/files/Makefile.libgetopt | 9 +++++ devel/libgetopt/files/getopt.h | 58 ++++++++++++++++++++++++++++++++ devel/libgetopt/files/md5 | 4 +++ devel/libgetopt/files/shlib_version | 5 +++ devel/libgetopt/pkg/COMMENT | 1 + devel/libgetopt/pkg/DESCR | 2 ++ devel/libgetopt/pkg/PLIST | 7 ++++ 8 files changed, 112 insertions(+) create mode 100644 devel/libgetopt/Makefile create mode 100644 devel/libgetopt/files/Makefile.libgetopt create mode 100644 devel/libgetopt/files/getopt.h create mode 100644 devel/libgetopt/files/md5 create mode 100644 devel/libgetopt/files/shlib_version create mode 100644 devel/libgetopt/pkg/COMMENT create mode 100644 devel/libgetopt/pkg/DESCR create mode 100644 devel/libgetopt/pkg/PLIST (limited to 'devel/libgetopt') diff --git a/devel/libgetopt/Makefile b/devel/libgetopt/Makefile new file mode 100644 index 00000000000..8c6e48a3b3c --- /dev/null +++ b/devel/libgetopt/Makefile @@ -0,0 +1,26 @@ +# $NetBSD: Makefile,v 1.1.1.1 1999/08/06 16:37:22 hubertf Exp $ +# + +DISTNAME= libgetopt-1.0 +CATEGORIES= pkgtools sysutils +MASTER_SITES= ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-current/src/lib/libc/stdlib/ \ + ftp://ftp.de.netbsd.org/pub/NetBSD/NetBSD-current/src/lib/libc/stdlib/ +DISTFILES= getopt_long.c getopt_long.3 + +MAINTAINER= hubertf@netbsd.org,mcr@netbsd.org + +WRKSRC= ${WRKDIR}/libgetopt +# I have NFC why the mkdir in pre-extract doesn't work, so do it here: +EXTRACT_CMD= ${MKDIR} ${WRKSRC} && ${CP} ${DOWNLOADED_DISTFILE} ${WRKSRC} +MANCOMPRESSED_IF_MANZ= yes +INSTALL_TARGET= install NOLINT=1 LIBDIR=${PREFIX}/lib MANDIR=${PREFIX}/man + +post-extract: + ${CP} ${FILESDIR}/getopt.h ${WRKSRC} + ${CP} ${FILESDIR}/shlib_version ${WRKSRC} + ${CP} ${FILESDIR}/Makefile.libgetopt ${WRKSRC}/Makefile + +post-install: + ${INSTALL_DATA} ${FILESDIR}/getopt.h ${PREFIX}/include/getopt.h + +.include "../../mk/bsd.pkg.mk" diff --git a/devel/libgetopt/files/Makefile.libgetopt b/devel/libgetopt/files/Makefile.libgetopt new file mode 100644 index 00000000000..77951a20b96 --- /dev/null +++ b/devel/libgetopt/files/Makefile.libgetopt @@ -0,0 +1,9 @@ +# $NetBSD: Makefile.libgetopt,v 1.1.1.1 1999/08/06 16:37:22 hubertf Exp $ + +LIB= getopt +SRCS= getopt_long.c +MAN= getopt_long.3 + +MKPROFILE=no + +.include diff --git a/devel/libgetopt/files/getopt.h b/devel/libgetopt/files/getopt.h new file mode 100644 index 00000000000..b0080a182eb --- /dev/null +++ b/devel/libgetopt/files/getopt.h @@ -0,0 +1,58 @@ +/* $NetBSD: getopt.h,v 1.1.1.1 1999/08/06 16:37:22 hubertf Exp $ */ + +/*- + * Copyright (c) 1997 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Jaromir Dolecek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the NetBSD + * Foundation, Inc. and its contributors. + * 4. Neither the name of The NetBSD Foundation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef _GETOPT_H_ +#define _GETOPT_H_ + +struct option { + char * name; + int has_arg; + int * flag; + int val; +}; + +/* Values for has_arg: */ +#define no_argument 0 +#define required_argument 1 +#define optional_argument 2 + +__BEGIN_DECLS +int getopt_long(int nargc, char **nargv, char *options, + struct option *long_options, int *index); +__END_DECLS + +#endif /* _GETOPT_H_ */ diff --git a/devel/libgetopt/files/md5 b/devel/libgetopt/files/md5 new file mode 100644 index 00000000000..542eea98762 --- /dev/null +++ b/devel/libgetopt/files/md5 @@ -0,0 +1,4 @@ +$NetBSD: md5,v 1.1.1.1 1999/08/06 16:37:22 hubertf Exp $ + +MD5 (getopt_long.c) = d1db4c1164da0cb0059028fb25dd287b +MD5 (getopt_long.3) = 2292a66016b0206768aebad1e1e4bd25 diff --git a/devel/libgetopt/files/shlib_version b/devel/libgetopt/files/shlib_version new file mode 100644 index 00000000000..0b6d84abec7 --- /dev/null +++ b/devel/libgetopt/files/shlib_version @@ -0,0 +1,5 @@ +# $NetBSD: shlib_version,v 1.1.1.1 1999/08/06 16:37:22 hubertf Exp $ +# Don't forget to edit pkg/PLIST when changing +# +major=1 +minor=0 diff --git a/devel/libgetopt/pkg/COMMENT b/devel/libgetopt/pkg/COMMENT new file mode 100644 index 00000000000..53d8cf24527 --- /dev/null +++ b/devel/libgetopt/pkg/COMMENT @@ -0,0 +1 @@ +Library for handling --long options diff --git a/devel/libgetopt/pkg/DESCR b/devel/libgetopt/pkg/DESCR new file mode 100644 index 00000000000..b572d68583a --- /dev/null +++ b/devel/libgetopt/pkg/DESCR @@ -0,0 +1,2 @@ +Library for handling --long options, needed as this is not (yet) +available with what is shipped by NetBSD. diff --git a/devel/libgetopt/pkg/PLIST b/devel/libgetopt/pkg/PLIST new file mode 100644 index 00000000000..d47f7982684 --- /dev/null +++ b/devel/libgetopt/pkg/PLIST @@ -0,0 +1,7 @@ +@comment $NetBSD: PLIST,v 1.1.1.1 1999/08/06 16:37:22 hubertf Exp $ +lib/libgetopt.a +lib/libgetopt_pic.a +lib/libgetopt.so.1.0 +man/man3/getopt_long.3 +man/cat3/getopt_long.0 +include/getopt.h -- cgit v1.2.3