socsvn commit: r223166 - soc2011/lassi/pkg

lassi at FreeBSD.org lassi at FreeBSD.org
Sun Jun 12 21:07:08 UTC 2011


Author: lassi
Date: Sun Jun 12 21:07:06 2011
New Revision: 223166
URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=223166

Log:
  - Added: ``pkg create'' man page
  - Added: convert command base

Added:
  soc2011/lassi/pkg/
  soc2011/lassi/pkg/convert.c
  soc2011/lassi/pkg/convert.h
  soc2011/lassi/pkg/pkg-create.1

Added: soc2011/lassi/pkg/convert.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ soc2011/lassi/pkg/convert.c	Sun Jun 12 21:07:06 2011	(r223166)
@@ -0,0 +1,59 @@
+#include <stdio.h>
+#include <sysexits.h>
+#include <unistd.h>
+
+#include "convert.h"
+
+void
+usage_convert(void)
+{
+	fprintf(stderr, "usage: pkg convert [-f outfmt] [-o outdir] [-p prefix] package\n\n");
+	fprintf(stderr, "For more information see 'pkg help convert'.\n");
+}
+
+int
+exec_convert(int argc, char **argv)
+{
+	const char *outfmt = NULL;
+	const char *outdir = NULL;
+	const char *prefix = NULL;
+	int ch;
+
+	while ((ch = getopt(argc, argv, "f:o:p:")) != -1) {
+		switch (ch) {
+		case 'f':
+			outfmt = optarg;
+			break;
+		case 'o':
+			outdir = optarg;
+			break;
+		case 'p':
+			prefix = optarg;
+			break;
+		case '?':
+		default:
+			usage_convert();
+			return (EX_USAGE);
+		}
+	}
+	argc -= optind;
+	argv += optind;
+
+	if (argc == 0) {
+		usage_convert();
+		return (EX_USAGE);
+	}
+
+	if (outfmt == NULL) {
+	}
+
+	if (outdir == NULL) {
+		outdir = "./";
+	}
+
+	if (prefix == NULL) {
+		prefix = "/compat/linux";
+	}
+
+	return (0);
+}

Added: soc2011/lassi/pkg/convert.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ soc2011/lassi/pkg/convert.h	Sun Jun 12 21:07:06 2011	(r223166)
@@ -0,0 +1,7 @@
+#ifndef _CONVERT_H_
+#define _CONVERT_H_
+
+int	exec_convert(int argc, char **argv);
+void	usage_convert(void);
+
+#endif /* !_CONVERT_H_ */

Added: soc2011/lassi/pkg/pkg-create.1
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ soc2011/lassi/pkg/pkg-create.1	Sun Jun 12 21:07:06 2011	(r223166)
@@ -0,0 +1,213 @@
+.\"
+.\" FreeBSD pkg - a next generation package for the installation and maintenance
+.\" of non-core utilities.
+.\"
+.\" 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.
+.\"
+.\"
+.\"     @(#)pkg.1
+.\" $FreeBSD$
+.\"
+.Dd June 07, 2011
+.Os
+.Dt PKG-CREATE 1
+.\" ---------------------------------------------------------------------------
+.Sh NAME
+.Nm "pkg create"
+.Nd a utility for creating software package distributions
+.\" ---------------------------------------------------------------------------
+.Sh SYNOPSIS
+.Nm
+.Op Fl gxX
+.Op Fl r Ar rootdir
+.Op Fl m Ar manifest
+.Op Fl f Ar format
+.Op Fl o Ar outdir
+.Ar pkg-name ...
+.Nm
+.Fl a
+.Op Fl r Ar rootdir
+.Op Fl m Ar manifest
+.Op Fl f Ar format
+.Op Fl o Ar outdir
+.\" ---------------------------------------------------------------------------
+.Sh DESCRIPTION
+.Nm
+is used to create packages from binaries installed on your computer. Packages
+thus created can be distributed and subsequently installed on other machines
+using the
+.Cm pkg add
+command.
+.\" ---------------------------------------------------------------------------
+.Sh OPTIONS
+The following options are supported by
+.Nm :
+.Bl -tag -width ".Fl m Ar manifest"
+.It Fl a
+Create packages for all binaries installed on your system. You can't use this
+option along with the
+.Fl g , x
+or
+.Fl X
+option.
+.It Fl g
+Interpret
+.Ar pkg-name
+as a shell glob pattern and create package only for installed binaries whose
+name match this pattern.
+.It Fl x
+Like
+.Fl g ,
+but interpret
+.Ar pkg-name
+as a regular expression.
+.It Fl X
+Like
+.Fl g ,
+but interpret
+.Ar pkg-name
+as an extended regular expression.
+.It Fl r Ar rootdir
+Specify root directory for the package \" TODO: New description
+.It Fl m Ar manifest
+Specify manifest directory \" TODO: New description
+.It Fl f Ar format
+Set
+.Ar format
+as the package output format. It can be one of
+.Ar txz , tbz , tgz
+or
+.Ar tar
+which are currently the only supported format.
+If an invalid or no format is specified
+.Ar txz
+is assumed.
+.It Fl o Ar outdir
+Set
+.Ar outdir
+as the output directory. If this option is not given, all created packages will
+be saved in the current directory.
+.El
+.\" ---------------------------------------------------------------------------
+.Sh MANIFEST FILE DETAILS
+.Bl -tag -width ".Cm www"
+.It Cm name Ar pkg-name
+This entry sets the package's name to
+.Ar pkg-name . \" TODO: Find out why there is a space after the ``.''
+Among other things, this name is used - with the version and the origin of the
+concerned package - to identify a dependency.
+.It Cm version Ar pkg-version
+This entry sets the package's version to
+.Ar pkg-version .
+.It Cm origin Ar pkg-origin
+This entry sets the package's origin to
+.Ar pkg-origin .
+This is a string of the form
+.Pa category/port-dir
+which designate the port this package was built from.
+.It Cm comment Ar comment-string
+.Ar comment-string
+is a one-line description of this package. It is the equivalent of the
+.Dv COMMENT
+variable for a port, not a way to put comments in a
+.Pa +MANIFEST
+file.
+.It Cm arch Ar cpu-type
+The architecture of the machine the package was built on.
+.Ar cpu-type
+takes values like x86, amd64...
+.It Cm osversion Ar os-version
+Version of the OS used to build the package.
+.It Cm www Ar url
+The software's official website.
+.It Cm maintainer Ar mail-address
+The maintainer's mail address.
+.It Cm prefix Ar path-prefix
+The path where the files contained in this package are installed
+.Pq usually Pa /usr/local .
+.It Cm flatsize Ar size
+The size that the files contained in this package will occupy on your system
+once uncompressed. This value does not take into account files stored in the
+package database.
+.It Cm dep Ar dep-name dep-origin dep-version
+Declare a dependency on the package which name, origin and version match
+.Ar dep-name , dep-origin
+and
+.Ar dep-version
+respectively.
+.It Cm conflict Ar pkg-glob
+Flag this package as incompatible with the one designated by
+.Ar pkg-glob .
+Conflicting packages cannot be installed on the same system as they may contain
+references to the sames files.
+.It Cm option Ar option-name option-value
+Set the option
+.Ar option-name
+to the value
+.Ar option-value .
+.It Cm file Ar sha256-hash path
+.Cm file
+entries list files included in the package. If the file is a regular one, such
+an entry contains its sha256 digest along with its path. If a packaged file is
+a link, you must use this entry's other form, as described below.
+.It Cm file Ar - path
+Same as above but for file links. The sha256 hash is replaced with a
+.Ar -
+(dash).
+.It Cm dir Ar path
+Mimics the
+.Cm file
+entry but for directories.
+.El
+.\" ---------------------------------------------------------------------------
+.Sh ENVIRONMENT
+The following environment variables affect the execution of
+.Nm :
+.Bl -tag -width ".Ev PKG_DBDIR"
+.It Ev PKG_DBDIR
+Specifies an alternative location for the installed package database.
+.El
+.\" ---------------------------------------------------------------------------
+.Sh FILES
+.Bl -tag -width ".Pa /etc/pkg.conf"
+.It Pa /etc/pkg.conf
+Systemwide configuration file. This file format and available configuration
+options are described in
+.Xr pkg_config 5 .
+.El
+.\" ---------------------------------------------------------------------------
+.\" .Sh EXAMPLES
+.\" ---------------------------------------------------------------------------
+.Sh SEE ALSO
+.Xr pkg 1 ,
+.Xr pkg-add 1 ,
+.Xr pkg-delete 1 ,
+.Xr pkg-info 1 ,
+.Xr pkg-register 1 ,
+.Xr pkg-repo 1 ,
+.Xr pkg-update 1 ,
+.Xr pkg-upgrade 1 ,
+.Xr pkg-version 1 ,
+.Xr pkg-which 1 ,
+.Xr pkg_config 5
+.\" ---------------------------------------------------------------------------
+.Sh HISTORY
+The
+.Nm
+command first appeared in
+.Fx \" TODO: Put release there
+.\" ---------------------------------------------------------------------------
+.Sh AUTHORS AND CONTRIBUTORS
+.An Baptiste Daroussin Aq bapt at FreeBSD.org
+.An Julien Laffaye Aq jlaffaye at FreeBSD.org
+.An Philippe Pepiot Aq phil at philpep.org
+.An Will Andrews Aq will at FreeBSD.org
+.\" ---------------------------------------------------------------------------
+.\" .Sh BUGS


More information about the svn-soc-all mailing list