New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add support for debian packages #4434
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
0257bcd
add support for debian packages
pazos 50cc5c5
make shellcheck happy
pazos 82c8c08
remove duplicated fonts
pazos 2d298dd
add a subdescription to avoid string duplication
pazos 9b197b1
move installation from /usr/local/share/koreader to /usr/lib/koreader
pazos 8dbf928
move custom fonts to user config path (/home/pazos/.config/koreader/f…
pazos fcfcf33
SDL: add device probe
pazos File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
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
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,63 @@ | ||
#!/bin/bash | ||
# Script to generate debian packages for KOReader | ||
|
||
if [ -z "${1}" ]; then | ||
echo "${0}: can't find KOReader build, please specify a path" | ||
exit 1 | ||
else | ||
INSTALL_DIR="${1}" | ||
VERSION="$(cut -f2 -dv "${1}/koreader/git-rev" | cut -f1,2 -d-)" | ||
fi | ||
|
||
uname_to_debian() { | ||
if [ "$(uname -m)" == "x86_64" ]; then | ||
echo "amd64" | ||
elif [ "$(uname -m)" == "i686" ]; then | ||
echo "i686" | ||
elif [ "$(uname -m)" == "arm64" ]; then | ||
echo "aarch64" | ||
else | ||
echo "any" | ||
fi | ||
} | ||
|
||
if [ -z "${2}" ]; then | ||
ARCH="$(uname_to_debian)" | ||
else | ||
ARCH="${2}" | ||
fi | ||
|
||
command_exists() { | ||
type "$1" >/dev/null 2>/dev/null | ||
} | ||
|
||
# Run only if dpkg-deb exists | ||
COMMAND="dpkg-deb" | ||
if command_exists "$COMMAND"; then | ||
mkdir -p "${INSTALL_DIR}/debian/DEBIAN" | ||
{ | ||
echo "Section: graphics" | ||
echo "Priority: optional" | ||
echo "Depends: libsdl2-2.0-0" | ||
echo "Architecture: ${ARCH}" | ||
echo "Version: ${VERSION}" | ||
echo "Installed-Size: $(du -ks "${INSTALL_DIR}/debian/usr/" | cut -f 1)" | ||
|
||
echo "Package: KOReader" | ||
echo "Maintainer: KOReader team" | ||
echo "Homepage: https://koreader.rocks" | ||
echo "Description: An ebook reader application supporting PDF, DjVu, EPUB, FB2 and many more formats" | ||
echo " KOReader is a document viewer application, originally created for Kindle e-ink readers." | ||
echo " It currently runs on Kindle, Kobo, PocketBook, Ubuntu Touch, Android and Linux devices" | ||
|
||
} >"${INSTALL_DIR}/debian/DEBIAN/control" | ||
|
||
(cd "${INSTALL_DIR}/.." \ | ||
&& fakeroot dpkg-deb -b "${INSTALL_DIR}/debian" "koreader-${VERSION}-${ARCH}.deb") | ||
else | ||
echo "${COMMAND} not found, unable to build Debian package" | ||
exit 1 | ||
fi | ||
|
||
exit 0 | ||
|
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,9 @@ | ||
[Desktop Entry] | ||
Name=KOReader | ||
Comment=KOReader is a document viewer | ||
Exec=koreader %u | ||
Icon=koreader | ||
Terminal=false | ||
Type=Application | ||
Categories=Graphics; | ||
MimeType=application/pdf;application/x-cbz;application/epub+zip;image/vnd.djvu;text/plain; |
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,42 @@ | ||
#!/bin/bash | ||
export LC_ALL="en_US.UTF-8" | ||
|
||
# writable storage: ${HOME}/.config/koreader. | ||
export KO_MULTIUSER=1 | ||
|
||
if [ -z "${1}" ]; then | ||
ARGS="${HOME}" | ||
else | ||
if [ $# -eq 1 ] && [ -e "$(pwd)/${1}" ]; then | ||
ARGS="$(pwd)/${1}" | ||
else | ||
ARGS="${*}" | ||
fi | ||
fi | ||
|
||
# working directory of koreader | ||
KOREADER_DIR="/usr/lib/koreader" | ||
|
||
# we're always starting from our working directory | ||
cd "${KOREADER_DIR}" || exit | ||
|
||
# export load library path | ||
export LD_LIBRARY_PATH=${KOREADER_DIR}/libs:$LD_LIBRARY_PATH | ||
|
||
# export external font directory | ||
export EXT_FONT_DIR="${HOME}/.config/koreader/fonts" | ||
[ ! -d "${EXT_FONT_DIR}" ] && mkdir -pv "${EXT_FONT_DIR}" | ||
|
||
RETURN_VALUE=85 | ||
while [ $RETURN_VALUE -eq 85 ]; do | ||
./reader.lua "${ARGS}" | ||
RETURN_VALUE=$? | ||
# do not restart with saved arguments | ||
ARGS="${HOME}" | ||
done | ||
|
||
# remove the flag to avoid emulator confusion | ||
export -n KO_MULTIUSER | ||
|
||
exit $RETURN_VALUE | ||
|
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.
Not just shellcheck. Hail spaces! :-P