=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<pigz>, B<bzip2>, B<lz4> and B<xz> (default is B<gzip>).
=item B<-a> I<compressor-args>
Specify the arguments used by the compressor. Overrides the default values.
=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>.