opkg maven plugin

The OPKG maven plugin is used to build native opkg packages for installation on linux systems.

Goals Overview

All goals are run automaticly. There is no need to specify one. The only goal that you might want to run is opkg:generate to generate an OPKG control for interactive inspection.

The goal opkg::package specifies which files should be included in the OPKG. Refer to this goal for configuration options.

Packaging process overview

  • Generate a control file. This file specifies the OPKG name, architecture and dependencies
  • Collect control file and possibly postinst, preinst, postrm, prerm scripts into a control.tar.gz
  • Collect and Filter all files for inclusion in the OPKG. Write them as data.tar.gz
  • Bundle tarballs and debian package marker into an ar archive.
  • Attach this archive to the project

Usage

Include plugin in the project configuration and activate the goals

<project>
        <build>
                <plugins>
                        <plugin>
                                <groupId>de.gsi.cs.co.maven.plugins</groupId>
                                <artifactId>opkg-maven-plugin</artifactId>
                                <version>...</version>
                                <extensions>true</extensions>
                                <executions>
                                        <execution>
                                                <goals>
                                                        <goal>generate</goal>
                                                        <goal>package</goal>
                                                </goals>
                                        </execution>
                                </executions>
                        </plugin>
                </plugins>
        </build>
</project>

Examples

Build an OPKG that includes all binaries from this artifact and it's dependencies.

<project>
        <build>
                <plugins>
                        <plugin>
                                <groupId>de.gsi.cs.co.maven.plugins</groupId>
                                <artifactId>opkg-maven-plugin</artifactId>
                                <version>...</version>
                                <extensions>true</extensions>
                                <executions>
                                        <execution>
                                                <goals>
                                                        <goal>generate</goal>
                                                        <goal>package</goal>
                                                </goals>
                                        </execution>
                                </executions>                           
                                <configuration>
                                        <includeDependencies>true</includeDependencies>
                                        <excludeDependencies>
                                                <excludeDependency>inc*</excludeDependency>
                                        </excludeDependencies>
                                        <excludeHeader>true</excludeHeader>
                                        <attach>true</attach>
                                </configuration>

                        </plugin>
                </plugins>
        </build>
</project>
includeDependencies
content of all maven dependencies (including transients) that are zip files.
excludeDependencies
filter out any maven dependency which artifactId matches glob.
excludeHeader
of the unpacked zips exclude all folders with name include.
attach
attach the final OPKG to the project.