[feat] Friendly filename (#5268)

Changes Cervantes, Kindle, Kobo, Pocketbook, and Sony to the following format:

```
koreader-kobo-v2018.11.1.zip
koreader-kobo-debug-v2018.11.1.zip
```

Changes Android to the following format:
```
koreader-android-arm-v2019.09.apk
koreader-android-arm-debug-v2019.09.apk
koreader-android-x86-v2019.09.apk
koreader-android-x86-debug-v2019.09.apk
```

Fixes <https://github.com/koreader/koreader/issues/4297>.
pull/5272/head
Frans de Jonge 5 years ago committed by GitHub
parent cddca1a5b5
commit 8e38b1c90b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

4
.gitignore vendored

@ -1,5 +1,6 @@
.DS_* .DS_*
._* ._*
*.AppImage
*.directory *.directory
*.swp *.swp
*.swo *.swo
@ -9,7 +10,10 @@ cscope.*
lua lua
lua-* lua-*
.reader.kpdfview.lua .reader.kpdfview.lua
*.kdev4
.kdev4/*
.vimrc .vimrc
.vscode/*
*.o *.o
tags tags
test/* test/*

@ -12,6 +12,7 @@ ifneq (,$(findstring -,$(VERSION)))
VERSION:=$(VERSION)_$(shell git describe HEAD | xargs git show -s --format=format:"%cd" --date=short) VERSION:=$(VERSION)_$(shell git describe HEAD | xargs git show -s --format=format:"%cd" --date=short)
endif endif
ANDROID_ARCH?=arm
# Use the git commit count as the (integer) Android version code # Use the git commit count as the (integer) Android version code
ANDROID_VERSION?=$(shell git rev-list --count HEAD) ANDROID_VERSION?=$(shell git rev-list --count HEAD)
ANDROID_NAME?=$(VERSION) ANDROID_NAME?=$(VERSION)
@ -26,6 +27,7 @@ endif
MACHINE=$(shell PATH=$(PATH) $(CC) -dumpmachine 2>/dev/null) MACHINE=$(shell PATH=$(PATH) $(CC) -dumpmachine 2>/dev/null)
ifdef KODEBUG ifdef KODEBUG
MACHINE:=$(MACHINE)-debug MACHINE:=$(MACHINE)-debug
KODEDUG_SUFFIX:=-debug
endif endif
ifdef TARGET ifdef TARGET
@ -182,30 +184,30 @@ kindleupdate: all
# create new package # create new package
cd $(INSTALL_DIR) && pwd && \ cd $(INSTALL_DIR) && pwd && \
zip -9 -r \ zip -9 -r \
../koreader-$(DIST)-$(MACHINE)-$(VERSION).zip \ ../koreader-$(DIST)$(KODEDUG_SUFFIX)-$(VERSION).zip \
extensions koreader $(KINDLE_LEGACY_LAUNCHER) \ extensions koreader $(KINDLE_LEGACY_LAUNCHER) \
-x "koreader/resources/fonts/*" "koreader/ota/*" \ -x "koreader/resources/fonts/*" "koreader/ota/*" \
"koreader/resources/icons/src/*" "koreader/spec/*" \ "koreader/resources/icons/src/*" "koreader/spec/*" \
$(ZIP_EXCLUDE) $(ZIP_EXCLUDE)
# generate kindleupdate package index file # generate kindleupdate package index file
zipinfo -1 koreader-$(DIST)-$(MACHINE)-$(VERSION).zip > \ zipinfo -1 koreader-$(DIST)$(KODEDUG_SUFFIX)-$(VERSION).zip > \
$(INSTALL_DIR)/koreader/ota/package.index $(INSTALL_DIR)/koreader/ota/package.index
echo "koreader/ota/package.index" >> $(INSTALL_DIR)/koreader/ota/package.index echo "koreader/ota/package.index" >> $(INSTALL_DIR)/koreader/ota/package.index
# update index file in zip package # update index file in zip package
cd $(INSTALL_DIR) && zip -u ../koreader-$(DIST)-$(MACHINE)-$(VERSION).zip \ cd $(INSTALL_DIR) && zip -u ../koreader-$(DIST)$(KODEDUG_SUFFIX)-$(VERSION).zip \
koreader/ota/package.index koreader/ota/package.index
# make gzip kindleupdate for zsync OTA update # make gzip kindleupdate for zsync OTA update
# note that the targz file extension is intended to keep ISP from caching # note that the targz file extension is intended to keep ISP from caching
# the file, see koreader#1644. # the file, see koreader#1644.
cd $(INSTALL_DIR) && \ cd $(INSTALL_DIR) && \
tar -I"gzip --rsyncable" -cah --no-recursion -f ../koreader-$(DIST)-$(MACHINE)-$(VERSION).targz \ tar -I"gzip --rsyncable" -cah --no-recursion -f ../koreader-$(DIST)$(KODEDUG_SUFFIX)-$(VERSION).targz \
-T koreader/ota/package.index -T koreader/ota/package.index
koboupdate: all koboupdate: all
# ensure that the binaries were built for ARM # ensure that the binaries were built for ARM
file $(INSTALL_DIR)/koreader/luajit | grep ARM || exit 1 file $(INSTALL_DIR)/koreader/luajit | grep ARM || exit 1
# remove old package if any # remove old package if any
rm -f koreader-kobo-$(MACHINE)-$(VERSION).zip rm -f koreader-kobo$(KODEDUG_SUFFIX)-$(VERSION).zip
# Kobo launching scripts # Kobo launching scripts
cp $(KOBO_DIR)/koreader.png $(INSTALL_DIR)/koreader.png cp $(KOBO_DIR)/koreader.png $(INSTALL_DIR)/koreader.png
cp $(KOBO_DIR)/fmon/README.txt $(INSTALL_DIR)/README_kobo.txt cp $(KOBO_DIR)/fmon/README.txt $(INSTALL_DIR)/README_kobo.txt
@ -214,27 +216,27 @@ koboupdate: all
# create new package # create new package
cd $(INSTALL_DIR) && \ cd $(INSTALL_DIR) && \
zip -9 -r \ zip -9 -r \
../koreader-kobo-$(MACHINE)-$(VERSION).zip \ ../koreader-kobo$(KODEDUG_SUFFIX)-$(VERSION).zip \
koreader -x "koreader/resources/fonts/*" \ koreader -x "koreader/resources/fonts/*" \
"koreader/resources/icons/src/*" "koreader/spec/*" \ "koreader/resources/icons/src/*" "koreader/spec/*" \
$(ZIP_EXCLUDE) $(ZIP_EXCLUDE)
# generate koboupdate package index file # generate koboupdate package index file
zipinfo -1 koreader-kobo-$(MACHINE)-$(VERSION).zip > \ zipinfo -1 koreader-kobo$(KODEDUG_SUFFIX)-$(VERSION).zip > \
$(INSTALL_DIR)/koreader/ota/package.index $(INSTALL_DIR)/koreader/ota/package.index
echo "koreader/ota/package.index" >> $(INSTALL_DIR)/koreader/ota/package.index echo "koreader/ota/package.index" >> $(INSTALL_DIR)/koreader/ota/package.index
# update index file in zip package # update index file in zip package
cd $(INSTALL_DIR) && zip -u ../koreader-kobo-$(MACHINE)-$(VERSION).zip \ cd $(INSTALL_DIR) && zip -u ../koreader-kobo$(KODEDUG_SUFFIX)-$(VERSION).zip \
koreader/ota/package.index koreader.png README_kobo.txt koreader/ota/package.index koreader.png README_kobo.txt
# make gzip koboupdate for zsync OTA update # make gzip koboupdate for zsync OTA update
cd $(INSTALL_DIR) && \ cd $(INSTALL_DIR) && \
tar -I"gzip --rsyncable" -cah --no-recursion -f ../koreader-kobo-$(MACHINE)-$(VERSION).targz \ tar -I"gzip --rsyncable" -cah --no-recursion -f ../koreader-kobo$(KODEDUG_SUFFIX)-$(VERSION).targz \
-T koreader/ota/package.index -T koreader/ota/package.index
pbupdate: all pbupdate: all
# ensure that the binaries were built for ARM # ensure that the binaries were built for ARM
file $(INSTALL_DIR)/koreader/luajit | grep ARM || exit 1 file $(INSTALL_DIR)/koreader/luajit | grep ARM || exit 1
# remove old package if any # remove old package if any
rm -f koreader-pocketbook-$(MACHINE)-$(VERSION).zip rm -f koreader-pocketbook$(KODEDUG_SUFFIX)-$(VERSION).zip
# Pocketbook launching script # Pocketbook launching script
mkdir -p $(INSTALL_DIR)/applications mkdir -p $(INSTALL_DIR)/applications
mkdir -p $(INSTALL_DIR)/system/bin mkdir -p $(INSTALL_DIR)/system/bin
@ -247,12 +249,12 @@ pbupdate: all
# create new package # create new package
cd $(INSTALL_DIR) && \ cd $(INSTALL_DIR) && \
zip -9 -r \ zip -9 -r \
../koreader-pocketbook-$(MACHINE)-$(VERSION).zip \ ../koreader-pocketbook$(KODEDUG_SUFFIX)-$(VERSION).zip \
applications -x "applications/koreader/resources/fonts/*" \ applications -x "applications/koreader/resources/fonts/*" \
"applications/koreader/resources/icons/src/*" "applications/koreader/spec/*" \ "applications/koreader/resources/icons/src/*" "applications/koreader/spec/*" \
$(ZIP_EXCLUDE) $(ZIP_EXCLUDE)
# generate koboupdate package index file # generate koboupdate package index file
zipinfo -1 koreader-pocketbook-$(MACHINE)-$(VERSION).zip > \ zipinfo -1 koreader-pocketbook$(KODEDUG_SUFFIX)-$(VERSION).zip > \
$(INSTALL_DIR)/applications/koreader/ota/package.index $(INSTALL_DIR)/applications/koreader/ota/package.index
echo "applications/koreader/ota/package.index" >> \ echo "applications/koreader/ota/package.index" >> \
$(INSTALL_DIR)/applications/koreader/ota/package.index $(INSTALL_DIR)/applications/koreader/ota/package.index
@ -260,11 +262,11 @@ pbupdate: all
sed -i -e 's/^/..\//' \ sed -i -e 's/^/..\//' \
$(INSTALL_DIR)/applications/koreader/ota/package.index $(INSTALL_DIR)/applications/koreader/ota/package.index
# update index file in zip package # update index file in zip package
cd $(INSTALL_DIR) && zip -ru ../koreader-pocketbook-$(MACHINE)-$(VERSION).zip \ cd $(INSTALL_DIR) && zip -ru ../koreader-pocketbook$(KODEDUG_SUFFIX)-$(VERSION).zip \
applications/koreader/ota/package.index system applications/koreader/ota/package.index system
# make gzip pbupdate for zsync OTA update # make gzip pbupdate for zsync OTA update
cd $(INSTALL_DIR)/applications && \ cd $(INSTALL_DIR)/applications && \
tar -I"gzip --rsyncable" -cah --no-recursion -f ../../koreader-pocketbook-$(MACHINE)-$(VERSION).targz \ tar -I"gzip --rsyncable" -cah --no-recursion -f ../../koreader-pocketbook$(KODEDUG_SUFFIX)-$(VERSION).targz \
-T koreader/ota/package.index -T koreader/ota/package.index
utupdate: all utupdate: all
@ -344,7 +346,7 @@ androidupdate: all
-x!resources/fonts -x!resources/icons/src -x!spec -x!resources/fonts -x!resources/icons/src -x!spec
$(MAKE) -C $(ANDROID_LAUNCHER_DIR) $(if $(KODEBUG), debug, release) ANDROID_APPNAME=KOReader ANDROID_VERSION=$(ANDROID_VERSION) ANDROID_NAME=$(ANDROID_NAME) ANDROID_FLAVOR=$(ANDROID_FLAVOR) $(MAKE) -C $(ANDROID_LAUNCHER_DIR) $(if $(KODEBUG), debug, release) ANDROID_APPNAME=KOReader ANDROID_VERSION=$(ANDROID_VERSION) ANDROID_NAME=$(ANDROID_NAME) ANDROID_FLAVOR=$(ANDROID_FLAVOR)
cp $(ANDROID_LAUNCHER_DIR)/bin/NativeActivity.apk \ cp $(ANDROID_LAUNCHER_DIR)/bin/NativeActivity.apk \
koreader-android-$(MACHINE)-$(VERSION).apk koreader-android-$(ANDROID_ARCH)$(KODEDUG_SUFFIX)-$(VERSION).apk
debianupdate: all debianupdate: all
mkdir -p $(INSTALL_DIR)/debian/usr/share/pixmaps mkdir -p $(INSTALL_DIR)/debian/usr/share/pixmaps
@ -368,40 +370,40 @@ sony-prstuxupdate: all
# ensure that the binaries were built for ARM # ensure that the binaries were built for ARM
file $(INSTALL_DIR)/koreader/luajit | grep ARM || exit 1 file $(INSTALL_DIR)/koreader/luajit | grep ARM || exit 1
# remove old package if any # remove old package if any
rm -f koreader-sony-prstux-$(MACHINE)-$(VERSION).zip rm -f koreader-sony-prstux$(KODEDUG_SUFFIX)-$(VERSION).zip
# Sony PRSTUX launching scripts # Sony PRSTUX launching scripts
cp $(SONY_PRSTUX_DIR)/*.sh $(INSTALL_DIR)/koreader cp $(SONY_PRSTUX_DIR)/*.sh $(INSTALL_DIR)/koreader
# create new package # create new package
cd $(INSTALL_DIR) && \ cd $(INSTALL_DIR) && \
zip -9 -r \ zip -9 -r \
../koreader-sony-prstux-$(MACHINE)-$(VERSION).zip \ ../koreader-sony-prstux$(KODEDUG_SUFFIX)-$(VERSION).zip \
koreader -x "koreader/resources/fonts/*" \ koreader -x "koreader/resources/fonts/*" \
"koreader/resources/icons/src/*" "koreader/spec/*" \ "koreader/resources/icons/src/*" "koreader/spec/*" \
$(ZIP_EXCLUDE) $(ZIP_EXCLUDE)
# generate update package index file # generate update package index file
zipinfo -1 koreader-sony-prstux-$(MACHINE)-$(VERSION).zip > \ zipinfo -1 koreader-sony-prstux$(KODEDUG_SUFFIX)-$(VERSION).zip > \
$(INSTALL_DIR)/koreader/ota/package.index $(INSTALL_DIR)/koreader/ota/package.index
echo "koreader/ota/package.index" >> $(INSTALL_DIR)/koreader/ota/package.index echo "koreader/ota/package.index" >> $(INSTALL_DIR)/koreader/ota/package.index
# update index file in zip package # update index file in zip package
cd $(INSTALL_DIR) && zip -u ../koreader-sony-prstux-$(MACHINE)-$(VERSION).zip \ cd $(INSTALL_DIR) && zip -u ../koreader-sony-prstux$(KODEDUG_SUFFIX)-$(VERSION).zip \
koreader/ota/package.index koreader/ota/package.index
# make gzip sonyprstux update for zsync OTA update # make gzip sonyprstux update for zsync OTA update
cd $(INSTALL_DIR) && \ cd $(INSTALL_DIR) && \
tar -I"gzip --rsyncable" -cah --no-recursion -f ../koreader-sony-prstux-$(MACHINE)-$(VERSION).targz \ tar -I"gzip --rsyncable" -cah --no-recursion -f ../koreader-sony-prstux$(KODEDUG_SUFFIX)-$(VERSION).targz \
-T koreader/ota/package.index -T koreader/ota/package.index
cervantesupdate: all cervantesupdate: all
# ensure that the binaries were built for ARM # ensure that the binaries were built for ARM
file $(INSTALL_DIR)/koreader/luajit | grep ARM || exit 1 file $(INSTALL_DIR)/koreader/luajit | grep ARM || exit 1
# remove old package if any # remove old package if any
rm -f koreader-cervantes-$(MACHINE)-$(VERSION).zip rm -f koreader-cervantes$(KODEDUG_SUFFIX)-$(VERSION).zip
# Cervantes launching scripts # Cervantes launching scripts
cp $(CERVANTES_DIR)/*.sh $(INSTALL_DIR)/koreader cp $(CERVANTES_DIR)/*.sh $(INSTALL_DIR)/koreader
cp $(COMMON_DIR)/spinning_zsync $(INSTALL_DIR)/koreader cp $(COMMON_DIR)/spinning_zsync $(INSTALL_DIR)/koreader
# create new package # create new package
cd $(INSTALL_DIR) && \ cd $(INSTALL_DIR) && \
zip -9 -r \ zip -9 -r \
../koreader-cervantes-$(MACHINE)-$(VERSION).zip \ ../koreader-cervantes$(KODEDUG_SUFFIX)-$(VERSION).zip \
koreader -x "koreader/resources/fonts/*" \ koreader -x "koreader/resources/fonts/*" \
"koreader/resources/icons/src/*" "koreader/spec/*" \ "koreader/resources/icons/src/*" "koreader/spec/*" \
$(ZIP_EXCLUDE) $(ZIP_EXCLUDE)
@ -410,11 +412,11 @@ cervantesupdate: all
$(INSTALL_DIR)/koreader/ota/package.index $(INSTALL_DIR)/koreader/ota/package.index
echo "koreader/ota/package.index" >> $(INSTALL_DIR)/koreader/ota/package.index echo "koreader/ota/package.index" >> $(INSTALL_DIR)/koreader/ota/package.index
# update index file in zip package # update index file in zip package
cd $(INSTALL_DIR) && zip -u ../koreader-cervantes-$(MACHINE)-$(VERSION).zip \ cd $(INSTALL_DIR) && zip -u ../koreader-cervantes$(KODEDUG_SUFFIX)-$(VERSION).zip \
koreader/ota/package.index koreader/ota/package.index
# make gzip cervantes update for zsync OTA update # make gzip cervantes update for zsync OTA update
cd $(INSTALL_DIR) && \ cd $(INSTALL_DIR) && \
tar -I"gzip --rsyncable" -cah --no-recursion -f ../koreader-cervantes-$(MACHINE)-$(VERSION).targz \ tar -I"gzip --rsyncable" -cah --no-recursion -f ../koreader-cervantes$(KODEDUG_SUFFIX)-$(VERSION).targz \
-T koreader/ota/package.index -T koreader/ota/package.index
update: update:

Loading…
Cancel
Save