Skip to content

Commit

Permalink
Create deb source using only runtime dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
ibauersachs committed May 3, 2021
1 parent 89ce673 commit 33e8622
Show file tree
Hide file tree
Showing 11 changed files with 133 additions and 32 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/installers.yml
Expand Up @@ -141,13 +141,13 @@ jobs:
- name: Cache Maven dependencies
uses: actions/cache@v2
with:
path: debian/maven-repo
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
path: debian/local-maven-repo
key: ${{ runner.os }}-offlinemaven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-offlinemaven-
- name: Prepare go-offline
run: mvn -B -DskipTests -Dmaven.repo.local=debian/maven-repo de.qaware.maven:go-offline-maven-plugin:1.2.8:resolve-dependencies
run: mvn -B -DskipTests -DtargetRepository=debian/local-maven-repo -DcopyPoms=true -DartifactTypes=Dependency org.jitsi:go-offline-maven-plugin:1.2.8-jitsi.1:resolve-dependencies

deb_src:
name: ${{ matrix.vendor }} ${{ matrix.dist }} ${{ matrix.arch }}
Expand Down Expand Up @@ -180,14 +180,11 @@ jobs:
- name: Cache Maven dependencies
uses: actions/cache@v2
with:
path: debian/maven-repo
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
path: debian/local-maven-repo
key: ${{ runner.os }}-offlinemaven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-offlinemaven-
- name: Prepare go-offline
run: mvn -B -DskipTests -Dmaven.repo.local=debian/maven-repo de.qaware.maven:go-offline-maven-plugin:1.2.8:resolve-dependencies

- name: Install dev packages
env:
DEBIAN_FRONTEND: noninteractive
Expand Down Expand Up @@ -224,6 +221,9 @@ jobs:
run: |
cat <(echo -e "${{ secrets.GPG_KEY }}") | gpg --batch --import
#SINCE=$(git describe --match "v[0-9\.]*" --abbrev=0)
# mh_pathpoms cannot handle ${revision} resulting in failed builds
mvn -B versions:set -DgenerateBackupPoms=false -DnewVersion=${{ needs.version.outputs.jitsi_version_deb }}~${{ matrix.dist }}
# truncate changelog
export SINCE=6c43def42
gbp dch \
--ignore-branch \
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -14,6 +14,7 @@ sip-communicator.utest.bin
target/
out/
build/
debian/local-maven-repo/
debian/maven-repo/
lib/native/
test-reports/
Expand Down
9 changes: 8 additions & 1 deletion debian/control
Expand Up @@ -12,7 +12,14 @@ Build-Depends:
javahelper,
dpkg-dev (>= 1.16.1),
default-jdk,
maven,
maven-debian-helper,
libbuild-helper-maven-plugin-java,
libmaven-dependency-plugin-java,
libmaven-bundle-plugin-java,
libmaven-jar-plugin-java,
libwagon-ssh-java,
libjitsi-lgpl-dependencies-java,
rsync,
cmake (>= 3.10),
pkg-config,
libdbus-1-dev,
Expand Down
24 changes: 9 additions & 15 deletions debian/copyright
@@ -1,21 +1,15 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: jitsi-lgpl-dependencies
Upstream-Name: Jitsi Desktop
Source: https://github.com/jitsi/jitsi

Files: *
Copyright: 2021, 8x8 Inc.
License: Apache-2.0
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
.
http://www.apache.org/licenses/LICENSE-2.0
.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
.
On Debian systems, the complete text of the Apache License, Version 2
can be found in "/usr/share/common-licenses/Apache-2.0".

Files: debian/local-maven-repo
Copyright: various
License: various

License: Apache-2.0
On Debian GNU/Linux system you can find the complete text of the
Apache-2.0 license in '/usr/share/common-licenses/Apache-2.0'.
1 change: 1 addition & 0 deletions debian/jitsi.links
@@ -0,0 +1 @@
/usr/share/java/jitsi-lgpl-dependencies.jar usr/share/jitsi/lib/jitsi-lgpl-dependencies.jar
28 changes: 28 additions & 0 deletions debian/jitsi.poms
@@ -0,0 +1,28 @@
# List of POM files for the package
# Format of this file is:
# <path to pom file> [option]*
# where option can be:
# --ignore: ignore this POM and its artifact if any
# --ignore-pom: don't install the POM. To use on POM files that are created
# temporarily for certain artifacts such as Javadoc jars. [mh_install, mh_installpoms]
# --no-parent: remove the <parent> tag from the POM
# --package=<package>: an alternative package to use when installing this POM
# and its artifact
# --has-package-version: to indicate that the original version of the POM is the same as the upstream part
# of the version for the package.
# --keep-elements=<elem1,elem2>: a list of XML elements to keep in the POM
# during a clean operation with mh_cleanpom or mh_installpom
# --artifact=<path>: path to the build artifact associated with this POM,
# it will be installed when using the command mh_install. [mh_install]
# --java-lib: install the jar into /usr/share/java to comply with Debian
# packaging guidelines
# --usj-name=<name>: name to use when installing the library in /usr/share/java
# --usj-version=<version>: version to use when installing the library in /usr/share/java
# --no-usj-versionless: don't install the versionless link in /usr/share/java
# --dest-jar=<path>: the destination for the real jar.
# It will be installed with mh_install. [mh_install]
# --classifier=<classifier>: Optional, the classifier for the jar. Empty by default.
# --site-xml=<location>: Optional, the location for site.xml if it needs to be installed.
# Empty by default. [mh_install]
#
pom.xml --has-package-version
19 changes: 19 additions & 0 deletions debian/maven.ignoreRules
@@ -0,0 +1,19 @@
# Maven ignore rules - ignore some Maven dependencies and plugins
# Format of this file is:
# [group] [artifact] [type] [version] [classifier] [scope]
# where each element can be either
# - the exact string, for example org.apache for the group, or 3.1
# for the version. In this case, the element is simply matched
# and left as it is
# - * (the star character, alone). In this case, anything will
# match and be left as it is. For example, using * on the
# position of the artifact field will match any artifact id
# All elements much match before a rule can be applied
# Example rule: match jar with groupid= junit, artifactid= junit
# and version starting with 3., this dependency is then removed
# from the POM
# junit junit jar s/3\..*/3.x/
org.apache.maven.plugins maven-source-plugin * * * *
org.sonatype.plugins nexus-staging-maven-plugin * * * *
com.outbrain.swinfra ci-friendly-flatten-maven-plugin * * * *
org.apache.maven.plugins maven-antrun-plugin * * * *
28 changes: 28 additions & 0 deletions debian/maven.rules
@@ -0,0 +1,28 @@
# Maven rules - transform Maven dependencies and plugins
# Format of this file is:
# [group] [artifact] [type] [version] [classifier] [scope]
# where each element can be either
# - the exact string, for example org.apache for the group, or 3.1
# for the version. In this case, the element is simply matched
# and left as it is
# - * (the star character, alone). In this case, anything will
# match and be left as it is. For example, using * on the
# position of the artifact field will match any artifact id
# - a regular expression of the form s/match/replace/
# in this case, elements that match are transformed using
# the regex rule.
# All elements must match before a rule can be applied
# Example rule: match jar with groupid= junit, artifactid= junit
# and version starting with 3., replacing the version with 3.x
# junit junit jar s/3\..*/3.x/

# the only dependency that is in the ppa
org.jitsi jitsi-lgpl-dependencies * s/.*/debian/ *

# plugins
org.apache.felix maven-bundle-plugin * s/.*/3.5.1/ *
org.apache.maven.wagon wagon-ssh * s/.*/debian/ *
org.apache.maven.plugins * * s/.*/debian/ *

# override the automatic * -> debian rule
* * * s/(.*)/$1/ * *
15 changes: 9 additions & 6 deletions debian/rules
Expand Up @@ -7,33 +7,36 @@ export JAVA_HOME=/usr/lib/jvm/default-java
#export DH_VERBOSE=1

DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
RULES_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
MVN_CMD := mvn -B -Dmaven.repo.local=$(RULES_DIR)/maven-repo -DskipTests -Dnotimestamp=true -Dlocale=en_US -Drevision=$(DEB_VERSION_UPSTREAM)

%:
dh $@

override_dh_auto_configure:
dh_auto_configure -Smaven
rsync -a debian/local-maven-repo/ debian/maven-repo
dh_auto_configure -Scmake --sourcedirectory=native -- \
-DCMAKE_LIBRARY_ARCHITECTURE="$(DEB_HOST_MULTIARCH)" \
-DSKIP_CUSTOM_INSTALL_DESTINATION=ON

override_dh_auto_build:
$(MVN_CMD) package
dh_auto_build -Smaven
sed -E 's/\:/\n/g' target/launcher-classpath | awk -F "/" '{print "lib/"$$NF}' > target/classpath
echo lib/`find target/bundles -type f -iname "jitsi-launcher-*.jar*" -printf "%f"` >> target/classpath
dh_auto_build -Scmake

override_dh_auto_test:
# do nothing, the test don't work
# do nothing, the tests don't work

override_dh_install:
# do nothing, indep and arch will take care of it

override_dh_auto_install-indep:
dh_install -pjitsi -Xorange -Xsparkle -Xgrowl -Xmac_widgets -X.pom
dh_install -pjitsi -Xorange -Xsparkle -Xgrowl -Xmac_widgets -X.pom -Xjitsi-lgpl-dependencies

override_dh_auto_install-arch:
dh_auto_install -plibjitsi-jni -Scmake
dh_install -plibjitsi-jni usr/lib/$(DEB_HOST_MULTIARCH)/*.so usr/lib/jni/

override_dh_auto_clean:
$(MVN_CMD) clean
dh_auto_clean -Smaven
dh_auto_clean -Scmake
1 change: 0 additions & 1 deletion modules/impl/version/pom.xml
Expand Up @@ -53,7 +53,6 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>3.2.0</version>
<executions>
<execution>
<id>set-version</id>
Expand Down
23 changes: 22 additions & 1 deletion pom.xml
Expand Up @@ -195,8 +195,18 @@
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
</exclusion>
<exclusion>
<groupId>org.igniterealtime.jbosh</groupId>
<artifactId>jbosh</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<!-- pin jbosh to avoid requiring maven-metadata.xml in the local repo -->
<groupId>org.igniterealtime.jbosh</groupId>
<artifactId>jbosh</artifactId>
<version>0.9.2</version>
</dependency>
<dependency><groupId>org.igniterealtime.smack</groupId><artifactId>smack-tcp</artifactId><version>${smackVersion}</version></dependency>
<dependency><groupId>org.igniterealtime.smack</groupId><artifactId>smack-debug</artifactId><version>${smackVersion}</version></dependency>
<dependency><groupId>org.igniterealtime.smack</groupId><artifactId>smack-extensions</artifactId><version>${smackVersion}</version></dependency>
Expand Down Expand Up @@ -306,6 +316,11 @@
<artifactId>maven-deploy-plugin</artifactId>
<version>3.0.0-M1</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>3.2.0</version>
</plugin>
</plugins>
</pluginManagement>

Expand Down Expand Up @@ -388,13 +403,19 @@
</goals>
<configuration>
<outputDirectory>${maven.multiModuleProjectDirectory}/target/repo</outputDirectory>
<includeScope>runtime</includeScope>
<useRepositoryLayout>true</useRepositoryLayout>
<excludeGroupIds>${project.groupId}</excludeGroupIds>
<excludeArtifactIds>jitsi-lgpl-dependencies</excludeArtifactIds>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ssh</artifactId>
<version>3.4.3</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down

0 comments on commit 33e8622

Please sign in to comment.