-
-
Notifications
You must be signed in to change notification settings - Fork 577
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Erik Bjäreholt <erik.bjareholt@gmail.com>
- Loading branch information
1 parent
8d68f8b
commit 94e6f89
Showing
3 changed files
with
68 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Package: activitywatch | ||
Architecture: amd64 | ||
Maintainer: Erik Bjäreholt <erik@bjareho.lt> | ||
Depends: | ||
Priority: optional | ||
Version: SCRIPT_VERSION_HERE | ||
Description: Open source time tracker | ||
https://github.com/ActivityWatch/activitywatch |
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,54 @@ | ||
#!/usr/bin/bash | ||
# Setting the shell is required, as `sh` doesn't support slicing. | ||
|
||
# Fail fast | ||
set -e | ||
# Verbose commands for CI verification | ||
set -x | ||
|
||
VERSION=$(scripts/package/getversion.sh) | ||
# Slice off the "v" from the tag, which is probably guaranteed | ||
VERSION_NUM=${VERSION:1} | ||
echo $VERSION_NUM | ||
PKGDIR="activitywatch_$VERSION_NUM" | ||
|
||
# Package tools | ||
sudo apt-get install sed jdupes wget | ||
|
||
if [ -d "PKGDIR" ]; then | ||
sudo rm -rf $PKGDIR | ||
fi | ||
|
||
# .deb meta files | ||
mkdir -p $PKGDIR/DEBIAN | ||
# activitywatch's install location | ||
mkdir -p $PKGDIR/opt | ||
# Allows aw-qt to autostart. | ||
mkdir -p $PKGDIR/etc/xdg/autostart | ||
# Allows users to manually start aw-qt from their start menu. | ||
mkdir -p $PKGDIR/usr/share/applications | ||
|
||
# While storing the control file in a variable here, dumping it in a file is so unnecessarily | ||
# complicated that it's easier to just dump move and sed. | ||
cp ./scripts/package/deb/control $PKGDIR/DEBIAN/control | ||
sed -i "s/SCRIPT_VERSION_HERE/${VERSION_NUM}/" $PKGDIR/DEBIAN/control | ||
|
||
# Verify the file content | ||
cat $PKGDIR/DEBIAN/control | ||
# The entire opt directory (should) consist of dist/activitywatch/* | ||
|
||
cp -r dist/activitywatch/ $PKGDIR/opt/ | ||
|
||
# Hard link duplicated libraries | ||
# (I have no idea what this is for) | ||
jdupes -L -r -S -Xsize-:1K $PKGDIR/opt/ | ||
|
||
sudo chown -R root:root $PKGDIR | ||
|
||
# Prepare the .desktop file | ||
sudo sed -i 's!Exec=aw-qt!Exec=/opt/activitywatch/aw-qt!' $PKGDIR/opt/activitywatch/aw-qt.desktop | ||
sudo cp $PKGDIR/opt/activitywatch/aw-qt.desktop $PKGDIR/etc/xdg/autostart/ | ||
sudo cp $PKGDIR/opt/activitywatch/aw-qt.desktop $PKGDIR/usr/share/applications/ | ||
|
||
dpkg-deb --build $PKGDIR | ||
sudo mv activitywatch_${VERSION_NUM}.deb dist/activitywatch-${VERSION}-linux-x86_64.deb |