This repository has been archived by the owner on Feb 2, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 81
Fix minor issues in linux packaging #172
Closed
digital-dreamer
wants to merge
6
commits into
vinumeris:lighthouse
from
digital-dreamer:fix-linux-packaging
Closed
Changes from 5 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
6a114ec
Brand as Lighthouse using proprietary artwork and logos.
mikehearn 64c4fe7
Add packaging scripts and icons for Lighthouse
mikehearn d097384
Add an experimental/temporary ad to the new sub-reddit, where people …
mikehearn 583c3e5
Fix bugs in the Windows repackaging scripts.
mikehearn c564600
Fix minor issues in linux packaging
digital-dreamer e12e850
Keep old JAR files, choose resources individually
digital-dreamer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
# Extract the version number. | ||
ver=$( sed -n 's/^.*final int VERSION = //p' client/src/main/java/lighthouse/Main.java ) | ||
ver="${ver:0:${#ver}-1}" | ||
build=updates/builds/processed/$ver.jar | ||
|
||
if [ ! -e "$build" ]; then | ||
echo "Must run package.sh first to generate build" | ||
exit 1 | ||
fi | ||
|
||
javapackager -deploy \ | ||
-BappVersion=$ver \ | ||
-Bcategory=Office,Finance \ | ||
-BlicenseType=Apache \ | ||
-BlicenseFile=LICENSE \ | ||
[email protected] \ | ||
-Bicon=client/icons/icon.png \ | ||
-native deb \ | ||
-name lighthouse \ | ||
-title "Lighthouse: a peer to peer crowdfunding app that uses Bitcoin" \ | ||
-vendor Vinumeris \ | ||
-outdir deploy \ | ||
-appclass lighthouse.Main \ | ||
-srcdir updates/builds/processed \ | ||
-outfile lighthouse |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
# Extract the version number. | ||
ver=$( sed -n 's/^.*final int VERSION = //p' client/src/main/java/lighthouse/Main.java ) | ||
ver="${ver:0:${#ver}-1}" | ||
build=updates/builds/processed/$ver.jar | ||
|
||
# Generate the plist from the template | ||
sed "s|JAR_NAME_STRING_GOES_HERE|<string>$ver.jar</string>|" package/macosx/Info.template.plist >package/macosx/Info.plist | ||
|
||
if [ ! -e "$build" ]; then | ||
echo "Must run package.sh first to generate build" | ||
exit 1 | ||
fi | ||
|
||
jh=$(/usr/libexec/java_home -v 1.8) | ||
if [ -e ../min-jdk ]; then | ||
jh=`pwd`/../min-jdk/Contents/Home | ||
fi | ||
$jh/bin/javapackager -deploy \ | ||
-BappVersion=$ver \ | ||
-Bmac.CFBundleIdentifier=com.vinumeris.lighthouse \ | ||
-Bmac.CFBundleName=Lighthouse \ | ||
-Bicon=client/icons/mac.icns \ | ||
-Bruntime="$jh/../../" \ | ||
-native dmg \ | ||
-name Lighthouse \ | ||
-title Lighthouse \ | ||
-vendor Vinumeris \ | ||
-outdir deploy \ | ||
-appclass lighthouse.Main \ | ||
-srcfiles $build \ | ||
-outfile Lighthouse |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
if grep 'String UPDATES_BASE_URL = null' client/src/main/java/lighthouse/Main.java >/dev/null; then | ||
echo "Don't use this for Crowdfunding App" | ||
exit 1 | ||
fi | ||
# Extract the version number. | ||
ver=$( sed -n 's/^.*final int VERSION = //p' client/src/main/java/lighthouse/Main.java ) | ||
ver="${ver:0:${#ver}-1}" | ||
|
||
echo "Building version $ver..." | ||
rm -f updates/builds/processed/* | ||
mvn -q -U clean package -DskipTests | ||
[ ! -e updates ] && mkdir -p updates/builds | ||
|
||
dest=updates/builds/$ver.jar | ||
|
||
echo "Running ProGuard to delete dead code and shrink JAR ..." | ||
java -jar ~/.m2/repository/net/sf/proguard/proguard-base/5.0/proguard-base-5.0.jar @client/proguard.pro | ||
|
||
du -h client/target/shaded.jar client/target/lighthouse.jar | ||
|
||
cp client/target/lighthouse.jar $dest | ||
echo "Copied build as version $ver to $dest" | ||
|
||
echo "Generating Windows build script" | ||
sed "s/__VERSION__/$ver/g" package/windows/Lighthouse.iss.template >package/windows/Lighthouse.iss | ||
echo "& 'C:\Program Files\Java\stripped8u31-64\bin\javapackager.exe' -deploy -BappVersion=$ver -native exe -name Lighthouse -title Lighthouse -vendor Vinumeris -outdir deploy -appclass lighthouse.Main -srcfiles .\\updates\\builds\\processed\\$ver.jar -outfile Lighthouse -Bruntime='c:\Program Files\Java\stripped8u31-64\jre'" >win-build.ps1 | ||
echo "& 'C:\Program Files (x86)\Java\jdk1.8.0_31\bin\javapackager.exe' -deploy -BappVersion=$ver -native exe -name Lighthouse -title Lighthouse -vendor Vinumeris -outdir deploy -appclass lighthouse.Main -srcfiles .\\updates\\builds\\processed\\$ver.jar -outfile Lighthouse -Bruntime='c:\Program Files (x86)\Java\jdk1.8.0_31\jre'" >>win-build.ps1 | ||
|
||
if [[ "$1" != "--nosign" ]]; then | ||
echo "Generating online update site" | ||
rm updates/site/* || true | ||
java -jar tools/updatefx.jar --url=https://s3-eu-west-1.amazonaws.com/vinumeris/lighthouse/updates --gzip-from=7 updates | ||
fi | ||
|
||
if [[ $1 == "--package" ]]; then | ||
if [ -e /Library ]; then | ||
./mac-package.sh | ||
elif [ -e /proc ]; then | ||
./linux-package.sh | ||
fi | ||
fi |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this change really correct? This looks like it might try and package every single JAR in that directory instead of only the one that corresponds to the right version number.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, only one JAR will be packaged, along with license file and postinst / prerm scripts. The directory contents are erased before build in package.sh.
An alternative solution is to keep old updates in the processed folder, and use -srcfiles to specify only $build, postinst, prerm and LICENSE. Would you prefer this solution? I can add another commit, it's a small change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, so that's why my attempts to make LICENSE work failed - it has to be listed in the source files.
I've been meaning to improve the UpdateFX workflow I use as the current one is prone to mistakes. Your approach of emptying the processed directory might work, I need to check that the UpdateFX tool is OK with that. I'll get back to you soon. The current commit looks OK assuming it doesn't mess with the updates system. Thanks for fixing this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're welcome. I've tested the .deb package installation on Ubuntu 14.04 LTS using DPKG, but I didn't do any testing with UpdateFX.