Files
David Kocher 18b2297a8d Fix #11762.
2021-09-11 14:28:09 +02:00

118 lines
5.1 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (c) 2002-2016 iterate GmbH. All rights reserved.
~ https://cyberduck.io/
~
~ This program is free software; you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation; either version 2 of the License, or
~ (at your option) any later version.
~
~ This program is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
-->
<project name="Cyberduck CLI Linux" basedir="."
xmlns:unless="ant:unless">
<import file="../../build.xml"/>
<property name="app.name" value="duck"/>
<property name="app.icon" value="${home}/cyberduck-application.png"/>
<property name="rpm.spec" value="${build.bundles}/package/linux"/>
<property name="license" value="${home}/LICENSE.txt"/>
<property name="build.input" value="${build}/package"/>
<property name="build.resources" value="${build}/resources"/>
<target name="build" depends="version">
<mkdir dir="${build.input}"/>
<mkdir dir="${build.resources}"/>
<mkdir dir="${build.resources}/images/duck"/>
<copy todir="${build.input}">
<fileset dir="${build}">
<include name="*.jar"/>
<include name="*.so"/>
<include name="profiles/*.cyberduckprofile"/>
</fileset>
</copy>
<copy file="${setup}/rpm/duck.spec" tofile="${build.resources}/duck.spec"/>
<replace file="${build.resources}/duck.spec" summary="true" encoding="UTF-8">
<replacefilter token="${VERSION}" value="${version}"/>
<replacefilter token="${REVISION}" value="${revision}"/>
<replacefilter token="${LICENSEFILE}" value="${license}"/>
</replace>
<copy file="${app.icon}" tofile="${build.resources}/duck.png"/>
<copy file="${setup}/deb/duck.postinstall" tofile="${build.resources}/postinst"/>
<copy file="${setup}/deb/duck.control" tofile="${build.resources}/control"/>
<copy file="${setup}/deb/duck.prerm" tofile="${build.resources}/prerm"/>
<copy file="${setup}/deb/duck.postrm" tofile="${build.resources}/postrm"/>
<copy file="${license}" tofile="${build.resources}/copyright"/>
<antcall target="jpackage">
<param name="type" value="rpm"/>
</antcall>
<antcall target="jpackage">
<param name="type" value="deb"/>
</antcall>
<antcall target="jpackage">
<param name="type" value="app-image"/>
</antcall>
</target>
<target name="jpackage">
<condition property="is-app-image">
<equals arg1="${type}" arg2="app-image"/>
</condition>
<echo message="Create native ${type} bundle"/>
<exec executable="${java.home}/bin/jpackage">
<arg value="--name"/>
<arg value="${app.name}"/>
<arg value="--input"/>
<arg value="${build.input}"/>
<arg value="--dest"/>
<arg value="${build.deploy}"/>
<arg value="--app-version"/>
<arg value="${version}.${revision}"/>
<arg value="--java-options"/>
<arg value="-Djna.nounpack=true"/>
<arg value="--java-options"/>
<arg value="-Djna.nounpack=true"/>
<arg value="--java-options"/>
<arg value="-Djna.noclasspath=true"/>
<arg value="--java-options"/>
<arg value="-Djava.awt.headless=true"/>
<arg value="--java-options"/>
<arg value="-Dsun.jnu.encoding=utf-8"/>
<arg value="--java-options"/>
<arg value="-Dfile.encoding=utf-8"/>
<arg value="--java-options"/>
<arg value="-Djava.security.egd=file:/dev/./urandom"/>
<arg value="--java-options"/>
<arg value="-Djava.net.useSystemProxies=true"/>
<arg value="--main-jar"/>
<arg value="cli-${fullversion}.jar"/>
<arg value="--main-class"/>
<arg value="ch.cyberduck.cli.Terminal"/>
<arg value="--resource-dir"/>
<arg value="${build.resources}"/>
<arg value="--copyright"/>
<arg value="${copyright}"/>
<arg value="--description"/>
<arg value="${app.name}"/>
<arg value="--vendor"/>
<arg value="cyberduck.io"/>
<arg value="--license-file" unless:true="${is-app-image}"/>
<arg value="${license}" unless:true="${is-app-image}"/>
<arg value="--linux-deb-maintainer" unless:true="${is-app-image}"/>
<arg value="&lt;feedback@cyberduck.io&gt;" unless:true="${is-app-image}"/>
<arg value="--linux-rpm-license-type" unless:true="${is-app-image}"/>
<arg value="GPL" unless:true="${is-app-image}"/>
<arg value="--type"/>
<arg value="${type}"/>
<arg value="--verbose"/>
</exec>
</target>
</project>