summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Shadura <andrew.shadura@collabora.co.uk>2016-10-05 14:24:03 +0200
committerAlejandro del Castillo <alejandro.delcastillo@ni.com>2016-10-05 13:33:37 -0500
commit9830ab38ea2a7b2854d6c10b30a99d000fe8059a (patch)
tree52637bc0521b272a4b9d7b0b7a0fc7c1798d4e49
parent1eddbee4b2a9a80e1eba36bf56b0f64c25ec973e (diff)
downloadopkg-utils-9830ab38ea2a7b2854d6c10b30a99d000fe8059a.tar.gz
opkg-utils-9830ab38ea2a7b2854d6c10b30a99d000fe8059a.tar.bz2
opkg-utils-9830ab38ea2a7b2854d6c10b30a99d000fe8059a.zip
opkg-build: Add a manpage in POD format.
Add a manpage for opkg-build and a corresponding Makefile snippet to build it using pod2man. Signed-off-by: Andrew Shadura <andrew.shadura@collabora.co.uk> Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
-rw-r--r--Makefile18
-rwxr-xr-xopkg-build70
2 files changed, 85 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 23aebbe..92b45f1 100644
--- a/Makefile
+++ b/Makefile
@@ -2,14 +2,28 @@ UTILS = opkg-build opkg-unbuild opkg-make-index opkg.py opkg-list-fields \
arfile.py opkg-buildpackage opkg-diff opkg-extract-file opkg-show-deps \
opkg-compare-indexes update-alternatives
+MANPAGES = opkg-build.1
+
DESTDIR=
PREFIX=/usr/local
bindir=$(PREFIX)/bin
+mandir=$(PREFIX)/man
+
+.SUFFIXES: .1
+
+%.1: %
+ pod2man -r "" -c "opkg-utils Documentation" $< $@
-all:
+all: $(UTILS) $(MANPAGES)
-install:
+install: all
install -d $(DESTDIR)$(bindir)
install -m 755 $(UTILS) $(DESTDIR)$(bindir)
+ install -d $(DESTDIR)$(mandir)
+ for m in $(MANPAGES); \
+ do \
+ install -d $(DESTDIR)$(mandir)/man$${m##*.}; \
+ install -m 644 $(MANPAGES) $(DESTDIR)$(mandir)/man$${m##*.}; \
+ done
.PHONY: install all
diff --git a/opkg-build b/opkg-build
index 792aef9..5dbf903 100755
--- a/opkg-build
+++ b/opkg-build
@@ -1,6 +1,11 @@
#!/bin/sh
-# opkg-build -- construct a .opk from a directory
+: <<=cut
+=head1 NAME
+
+opkg-build - construct an .opk from a directory
+
+=cut
# Carl Worth <cworth@east.isi.edu>
# based on a script by Steve Redler IV, steve@sr-tech.com 5-21-2001
# 2003-04-25 rea@sr.unh.edu
@@ -203,6 +208,13 @@ compressor_ext() {
esac
}
+: <<=cut
+=head1 SYNOPSIS
+
+B<opkg-build> [B<-c>] [B<-C>] [B<-Z> I<compressor>] [B<-O>] [B<-o> I<owner>] [B<-g> I<group>] I<pkg_directory> [I<destination_directory>]
+
+=cut
+
usage="Usage: $0 [-c] [-C] [-Z compressor] [-O] [-o owner] [-g group] <pkg_directory> [<destination_directory>]"
while getopts "cCg:ho:vOZ:" opt; do
case $opt in
@@ -303,3 +315,59 @@ rm $tmp_dir/debian-binary $tmp_dir/data.tar.$cext $tmp_dir/control.tar.gz
rmdir $tmp_dir
echo "Packaged contents of $pkg_dir into $pkg_file"
+
+exit 0
+: <<=cut
+=head1 DESCRIPTION
+
+B<opkg-build> creates an opkg package from a filesystem tree stored in I<pkg_directory>. I<pkg_directory> must have a B<CONTROL> directory, which contains the control information files, including the control file itself. This directory will I<not> appear in the binary package's filesystem archive, but instead the files in it will be put in the binary package's control information area.
+
+B<opkg-build> will read B<CONTROL/control> file and parse it. It will check it for syntax errors and other problems, and it will stop if it finds any.
+
+If no I<destination_directory> is specified, B<opkg-build> will write the package into a file in the current directory. The name of the package file will be I<package>B<_>I<version>B<_>I<arch>B<.ipk>.
+
+If the archive to be created already exists, it will be overwritten.
+
+=head1 OPTIONS
+
+A summary of options is included below.
+
+=over
+
+=item B<-c>
+
+Generate a binary package in an older B<tar> format.
+
+=item B<-C>
+
+Stop with an error if any files ending with B<~> are found. The default behaviour is to remove such files.
+
+=item B<-Z> I<compressor>
+
+Specify which compression type to use when building a package. Allowed values are B<gzip>, B<bzip2> and B<xz> (default is B<gzip>).
+
+=item B<-O>
+
+Use B<.opk> extension. By default, B<.ipk> is used.
+
+=item B<-o> I<owner>
+
+Force I<owner> as the owner of all files in the package.
+
+=item B<-g> I<group>
+
+Force I<group> as the group of all files in the package.
+
+=back
+
+=head1 FILES
+
+B<opkg-build> creates a temporary directory named B<IPKG_BUILD.>I<$$> in the destination directory (where I<$$> stands for the PID of the running B<opkg-build>). There currently isn't a way to override this.
+
+For compatibility with Debian's B<dpkg-deb>, the directory with control files can also be named B<DEBIAN>. If both B<DEBIAN> and B<CONTROL> directories present, B<CONTROL> takes the precedence.
+
+=head1 AUTHORS
+
+This manual page was written by Andrew Shadura based on the manual page of B<dpkg-deb>.
+
+=cut