Skip to content

Commit

Permalink
generic linux package
Browse files Browse the repository at this point in the history
Co-authored-by: Benoit Pierre <benoit.pierre@gmail.com>
  • Loading branch information
pazos and benoit-pierre committed May 12, 2024
1 parent f0a3bcf commit b6dd46c
Show file tree
Hide file tree
Showing 12 changed files with 164 additions and 201 deletions.
13 changes: 12 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ endif

# releases do not contain tests and misc data
IS_RELEASE := $(if $(or $(EMULATE_READER),$(WIN32)),,1)
IS_RELEASE := $(if $(or $(IS_RELEASE),$(APPIMAGE),$(DEBIAN),$(MACOS)),1,)
IS_RELEASE := $(if $(or $(IS_RELEASE),$(APPIMAGE),$(LINUX),$(MACOS)),1,)

ifeq ($(ANDROID_ARCH), arm64)
ANDROID_ABI?=arm64-v8a
Expand All @@ -29,6 +29,17 @@ endif
ANDROID_VERSION?=$(shell git rev-list --count HEAD)
ANDROID_NAME?=$(VERSION)

LINUX_ARCH?=native
ifeq ($(LINUX_ARCH), native)
LINUX_ARCH_NAME:=$(shell uname -m)
else ifeq ($(LINUX_ARCH), arm64)
LINUX_ARCH_NAME:=aarch64
else ifeq ($(LINUX_ARCH), arm)
LINUX_ARCH_NAME:=armv7l
endif
LINUX_ARCH_NAME?=$(LINUX_ARCH)


MACHINE=$(TARGET_MACHINE)
ifdef KODEBUG
MACHINE:=$(MACHINE)-debug
Expand Down
2 changes: 1 addition & 1 deletion base
52 changes: 8 additions & 44 deletions kodev
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,7 @@ SUPPORTED_TARGETS="
pocketbook
ubuntu-touch
appimage
debian Debian package for current arch
debian-armel Debian package for generic armel devices
debian-armhf Debian package for generic armhf devices
debian-arm64 Debian package for generic 64 bits arm devices
linux
macos MacOS app bundle. You need a mac to build this package
emu (*default) If no TARGET is given, assume emulator
win32
Expand Down Expand Up @@ -268,20 +265,8 @@ ${SUPPORTED_TARGETS}"
make TARGET=appimage
assert_ret_zero $?
;;
debian)
make TARGET=debian
assert_ret_zero $?
;;
debian-armel)
make TARGET=debian-armel
assert_ret_zero $?
;;
debian-armhf)
make TARGET=debian-armhf
assert_ret_zero $?
;;
debian-arm64)
make TARGET=debian-arm64
linux)
make TARGET=linux
assert_ret_zero $?
;;
macos)
Expand Down Expand Up @@ -389,17 +374,8 @@ ${SUPPORTED_TARGETS}"
appimage)
make TARGET=appimage clean
;;
debian)
make TARGET=debian clean
;;
debian-armel)
make TARGET=debian-armel clean
;;
debian-armhf)
make TARGET=debian-armhf clean
;;
debian-arm64)
make TARGET=debian-arm64 clean
linux)
make TARGET=linux clean
;;
macos)
is_mac
Expand Down Expand Up @@ -540,21 +516,9 @@ ${SUPPORTED_RELEASE_TARGETS}"
kodev-build appimage
make TARGET=appimage update
;;
debian)
kodev-build debian
make TARGET=debian update
;;
debian-armel)
kodev-build debian-armel
make TARGET=debian-armel update
;;
debian-armhf)
kodev-build debian-armhf
make TARGET=debian-armhf update
;;
debian-arm64)
kodev-build debian-arm64
make TARGET=debian-arm64 update
linux)
kodev-build linux
make TARGET=linux update
;;
macos)
is_mac
Expand Down
25 changes: 0 additions & 25 deletions make/debian.mk

This file was deleted.

34 changes: 34 additions & 0 deletions make/linux.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
LINUX_DIR = $(PLATFORM_DIR)/linux
LINUX_PACKAGE:=koreader-linux-$(LINUX_ARCH_NAME)$(KODEDUG_SUFFIX)-$(VERSION).tar.xz

update: all
mkdir -pv \
$(INSTALL_DIR)/linux/usr/bin \
$(INSTALL_DIR)/linux/usr/lib \
$(INSTALL_DIR)/linux/usr/share/pixmaps \
$(INSTALL_DIR)/linux/usr/share/applications \
$(INSTALL_DIR)/linux/usr/share/doc/koreader \
$(INSTALL_DIR)/linux/usr/share/man/man1
cp -pv resources/koreader.png $(INSTALL_DIR)/linux/usr/share/pixmaps
cp -pv $(LINUX_DIR)/koreader.desktop $(INSTALL_DIR)/linux/usr/share/applications
cp -pv $(LINUX_DIR)/copyright COPYING $(INSTALL_DIR)/linux/usr/share/doc/koreader
cp -pv $(LINUX_DIR)/koreader.sh $(INSTALL_DIR)/linux/usr/bin/koreader
cp -Lr $(INSTALL_DIR)/koreader $(INSTALL_DIR)/linux/usr/lib
gzip -cn9 $(LINUX_DIR)/koreader.1 > $(INSTALL_DIR)/linux/usr/share/man/man1/koreader.1.gz
chmod 644 \
$(INSTALL_DIR)/linux/usr/share/doc/koreader/copyright \
$(INSTALL_DIR)/linux/usr/share/man/man1/koreader.1.gz
rm -rf \
$(INSTALL_DIR)/linux/usr/lib/koreader/{ota,cache,clipboard,screenshots,spec,tools,resources/fonts,resources/icons/src}

# remove leftovers
find $(INSTALL_DIR)/linux -type f \( -name ".git" -o -name ".gitignore" -o -name "discovery2spore" -o -name "wadl2spore" -o -name "*.txt" -o -name "LICENSE*" -o -name "NOTICE" -o -name "README.md" \) -print0 | xargs -0 rm -rf
find $(INSTALL_DIR)/linux -type d \( -name "test" -o -name ".github" \) -print0 | xargs -0 rm -rf

# fix permissions
chmod -R u=rwX,og=rX $(INSTALL_DIR)/linux
XZ_OPT=9 tar -C $(INSTALL_DIR)/linux/usr -cvJf $(LINUX_PACKAGE) .

rm -rf $(INSTALL_DIR)/linux

.PHONY: update
11 changes: 0 additions & 11 deletions platform/debian/changelog

This file was deleted.

119 changes: 0 additions & 119 deletions platform/debian/do_debian_package.sh

This file was deleted.

File renamed without changes.

0 comments on commit b6dd46c

Please sign in to comment.