Skip to content

Commit

Permalink
Merge pull request #58 from RetGal/makeself
Browse files Browse the repository at this point in the history
Makeself
  • Loading branch information
RetGal authored Apr 10, 2023
2 parents e9f4a94 + 125d7a1 commit 36a391f
Show file tree
Hide file tree
Showing 126 changed files with 12,485 additions and 61 deletions.
16 changes: 6 additions & 10 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
<exclude name="deb/"/>
<exclude name="snap/"/>
<exclude name="jre/"/>
<exclude name="jrex/"/>
<exclude name="license/azul_zulu_license.txt"/>
</fileset>
</copy>
Expand All @@ -91,9 +92,7 @@
<exclude name="deb/"/>
<exclude name="snap/"/>
<exclude name="jre/"/>
<exclude name="dayon"/>
<exclude name="dayon_assisted"/>
<exclude name="dayon_assistant"/>
<exclude name="jrex/"/>
<exclude name="license/azul_zulu_license.txt"/>
<exclude name="readme.txt"/>
<exclude name="setup.sh"/>
Expand All @@ -117,23 +116,20 @@
<copy todir="${dir.dist}/tar/dayon">
<fileset dir="${dir.dist}">
<exclude name="jre/"/>
<exclude name="jrex/"/>
<exclude name="license/azul_zulu_license.txt"/>
</fileset>
</copy>
<tar destfile="${dir.dist}/dayon.${version}.tgz" longfile="gnu" compression="gzip">
<tarfileset dir="${dir.dist}/tar">
<include name="**/*"/>
<exclude name="**/*.sh"/>
<exclude name="**/dayon"/>
<exclude name="**/dayon_assistant"/>
<exclude name="**/dayon_assisted"/>
<exclude name="**/favicon.ico"/>
</tarfileset>
<tarfileset dir="${dir.dist}/tar" filemode="755">
<include name="**/*.sh"/>
<include name="**/dayon"/>
<include name="**/dayon_assistant"/>
<include name="**/dayon_assisted"/>
<include name="**/dayon.sh"/>
<include name="**/dayon_assistant.sh"/>
<include name="**/dayon_assisted.sh"/>
</tarfileset>
</tar>
<delete dir="${dir.dist}/tar"/>
Expand Down
137 changes: 131 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
<xz.version>1.9</xz.version>
<junit.jupiter.version>5.9.2</junit.jupiter.version>
<mockito.core.version>4.9.0</mockito.core.version>
<maven-surefire-plugin.version>2.22.0</maven-surefire-plugin.version>
</properties>

<dependencies>
Expand Down Expand Up @@ -296,7 +295,7 @@
<plugins>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven-surefire-plugin.version}</version>
<version>2.22.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down Expand Up @@ -417,6 +416,7 @@
<include>**/*</include>
<excludes>
<exclude>deb/</exclude>
<exclude>jrex/</exclude>
<exclude>snap/</exclude>
</excludes>
</resource>
Expand Down Expand Up @@ -448,9 +448,6 @@
<executable>chmod</executable>
<arguments>
<argument>+x</argument>
<argument>${basedir}/dist/dayon</argument>
<argument>${basedir}/dist/dayon_assistant</argument>
<argument>${basedir}/dist/dayon_assisted</argument>
<argument>${basedir}/dist/dayon.sh</argument>
<argument>${basedir}/dist/dayon_assistant.sh</argument>
<argument>${basedir}/dist/dayon_assisted.sh</argument>
Expand All @@ -463,12 +460,140 @@
</plugins>
</build>
</profile>
<profile>
<id>assisted</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.3.0</version>
<configuration>
<includeEmptyDirs>true</includeEmptyDirs>
</configuration>
<executions>
<execution>
<id>copy-resources</id>
<phase>package</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${basedir}/dist</outputDirectory>
<resources>
<resource>
<directory>resources</directory>
<include>**/*</include>
<excludes>
<exclude>deb/</exclude>
<exclude>jre/</exclude>
<exclude>snap/</exclude>
</excludes>
</resource>
<resource>
<directory>${basedir}/target</directory>
<include>dayon.jar</include>
</resource>
<resource>
<directory>${basedir}/docs</directory>
<include>favicon.ico</include>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.github.hazendaz.maven</groupId>
<artifactId>makeself-maven-plugin</artifactId>
<version>1.5.1</version>
<configuration>
<archiveDir>../dist/</archiveDir>
<fileName>assisted.sh</fileName>
<label>Dayon! Assisted ${project.version}</label>
<startupScript>./dayon_assisted.sh</startupScript>
</configuration>
<executions>
<execution>
<id>makeself</id>
<phase>package</phase>
<goals>
<goal>makeself</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>assistant</id>
<properties>
<dayon.mainClass>mpo.dayon.assistant.AssistantRunner</dayon.mainClass>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.3.0</version>
<configuration>
<includeEmptyDirs>true</includeEmptyDirs>
</configuration>
<executions>
<execution>
<id>copy-resources</id>
<phase>package</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${basedir}/dist</outputDirectory>
<resources>
<resource>
<directory>resources</directory>
<include>**/*</include>
<excludes>
<exclude>deb/</exclude>
<exclude>jre/</exclude>
<exclude>snap/</exclude>
</excludes>
</resource>
<resource>
<directory>${basedir}/target</directory>
<include>dayon.jar</include>
</resource>
<resource>
<directory>${basedir}/docs</directory>
<include>favicon.ico</include>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.github.hazendaz.maven</groupId>
<artifactId>makeself-maven-plugin</artifactId>
<version>1.5.1</version>
<configuration>
<archiveDir>../dist/</archiveDir>
<fileName>assistant.sh</fileName>
<label>Dayon! Assistant ${project.version}</label>
<startupScript>./dayon_assistant.sh</startupScript>
</configuration>
<executions>
<execution>
<id>makeself</id>
<phase>package</phase>
<goals>
<goal>makeself</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>

</project>
14 changes: 0 additions & 14 deletions resources/dayon

This file was deleted.

23 changes: 17 additions & 6 deletions resources/dayon.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,25 @@
#!/bin/sh
DAYON_HOME=$(dirname "$(realpath "$0")")
cross_realpath() {
if ! realpath "${1}" 2>/dev/null; then
[[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}"
fi
}
DAYON_HOME=$(dirname "$(cross_realpath "$0")")
if which java >/dev/null; then
JAVA=$(which java)
elif [ ! -f /etc/alternatives/java ]; then
JAVA=/app/jre/bin/java
if [ ! -d /usr/libexec/java_home ]; then
if [ -f /app/jre/bin/java ]; then
JAVA=/app/jre/bin/java
else
JAVA=$(cross_realpath "jrex/bin/java")
fi
else
JAVA=/usr/libexec/java_home/bin/java
fi
else
JAVA_HOME=$(ls -l /etc/alternatives/java | awk -F'> ' '{print $2}' | awk -F'/bin/java' '{print $1}')
#JAVA_HOME="/usr/lib/jvm/java-8-openjdk-amd64/jre"
JAVA=${JAVA_HOME}/bin/java
JAVA=$(ls -l /etc/alternatives/java | awk -F'> ' '{print $2}' | awk -F'/bin/java' '{print $1}')/bin/java
fi
JAVA_OPTS=
CLASSPATH="${DAYON_HOME}/dayon.jar"
${JAVA} ${JAVA_OPTS} -Ddayon.log=file -cp "${CLASSPATH}" "$@"
${JAVA} ${JAVA_OPTS} -Ddayon.log=file -cp "${CLASSPATH}" "$@"
11 changes: 0 additions & 11 deletions resources/dayon_assistant

This file was deleted.

7 changes: 6 additions & 1 deletion resources/dayon_assistant.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
#!/bin/sh
ABS_PATH=$(dirname "$(realpath "$0")")
cross_realpath() {
if ! realpath "${1}" 2>/dev/null; then
[[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}"
fi
}
ABS_PATH=$(dirname "$(cross_realpath "$0")")
if [ ! -f "${ABS_PATH}/dayon.sh" ]; then
ABS_PATH=${ABS_PATH}/dayon/dayon.sh
else
Expand Down
11 changes: 0 additions & 11 deletions resources/dayon_assisted

This file was deleted.

7 changes: 6 additions & 1 deletion resources/dayon_assisted.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
#!/bin/sh
ABS_PATH=$(dirname "$(realpath "$0")")
cross_realpath() {
if ! realpath "${1}" 2>/dev/null; then
[[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}"
fi
}
ABS_PATH=$(dirname "$(cross_realpath "$0")")
if [ ! -f "${ABS_PATH}/dayon.sh" ]; then
ABS_PATH=${ABS_PATH}/dayon/dayon.sh
else
Expand Down
27 changes: 27 additions & 0 deletions resources/jrex/ASSEMBLY_EXCEPTION
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@

OPENJDK ASSEMBLY EXCEPTION

The OpenJDK source code made available by Oracle America, Inc. (Oracle) at
openjdk.java.net ("OpenJDK Code") is distributed under the terms of the GNU
General Public License <http://www.gnu.org/copyleft/gpl.html> version 2
only ("GPL2"), with the following clarification and special exception.

Linking this OpenJDK Code statically or dynamically with other code
is making a combined work based on this library. Thus, the terms
and conditions of GPL2 cover the whole combination.

As a special exception, Oracle gives you permission to link this
OpenJDK Code with certain code licensed by Oracle as indicated at
http://openjdk.java.net/legal/exception-modules-2007-05-08.html
("Designated Exception Modules") to produce an executable,
regardless of the license terms of the Designated Exception Modules,
and to copy and distribute the resulting executable under GPL2,
provided that the Designated Exception Modules continue to be
governed by the licenses under which they were offered by Oracle.

As such, it allows licensees and sublicensees of Oracle's GPL2 OpenJDK Code
to build an executable that includes those portions of necessary code that
Oracle could not provide under GPL2 (or that Oracle has provided under GPL2
with the Classpath exception). If you modify or add to the OpenJDK code,
that new GPL2 code may still be combined with Designated Exception Modules
if the new code is made subject to this exception by its copyright holder.
Loading

0 comments on commit 36a391f

Please sign in to comment.