Skip to content
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

SynoCli-misc: initial package #5498

Merged
merged 6 commits into from Dec 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions cross/bc/Makefile
@@ -1,5 +1,6 @@
PKG_NAME = bc
PKG_VERS = 1.06
# REMARKS: update to 1.07 discarded (cross compilation does not work).
PKG_EXT = tar.gz
PKG_DIST_NAME = $(PKG_NAME)-$(PKG_VERS).$(PKG_EXT)
PKG_DIST_SITE = https://ftp.gnu.org/gnu/bc/
Expand Down
61 changes: 61 additions & 0 deletions cross/misc-util-linux/Makefile
@@ -0,0 +1,61 @@
PKG_NAME = misc-util-linux
PKG_REAL_NAME = util-linux
PKG_VERS = 2.38.1
PKG_VERS_MAJOR = $(word 1,$(subst ., ,$(PKG_VERS))).$(word 2,$(subst ., ,$(PKG_VERS)))
PKG_EXT = tar.xz
PKG_DIST_NAME = $(PKG_REAL_NAME)-$(PKG_VERS).$(PKG_EXT)
PKG_DIST_SITE = https://www.kernel.org/pub/linux/utils/$(PKG_REAL_NAME)/v$(PKG_VERS_MAJOR)
# use dedicated folder to build independent of other libraries built from util-linux (i.e. libuuid, libblkid)
PKG_DIR = $(PKG_NAME)/$(PKG_REAL_NAME)-$(PKG_VERS)
EXTRACT_PATH = $(WORK_DIR)/$(PKG_NAME)

DEPENDS =

HOMEPAGE = https://github.com/karelzak/util-linux
COMMENT = Random collection of Linux utilities. We use this only to build ... out of util-linux.
LICENSE = GPLv2

GNU_CONFIGURE = 1

ADDITIONAL_CFLAGS = -Wno-unused-parameter
CONFIGURE_ARGS = --without-python

# fails to build sys-utils/eject.c
CONFIGURE_ARGS += --disable-eject
# avoid chgrp on install (bin/wall):
CONFIGURE_ARGS += --disable-use-tty-group
# avoid chown on install (bin/mount):
CONFIGURE_ARGS += --disable-makeinstall-chown

# disable unused tools
CONFIGURE_ARGS += --disable-libuuid --disable-uuidd
CONFIGURE_ARGS += --disable-libblkid --disable-blkid
CONFIGURE_ARGS += --disable-losetup
CONFIGURE_ARGS += --disable-hwclock
CONFIGURE_ARGS += --disable-agetty
CONFIGURE_ARGS += --disable-fallocate
CONFIGURE_ARGS += --disable-cramfs
CONFIGURE_ARGS += --disable-bfs
CONFIGURE_ARGS += --disable-mkfs
CONFIGURE_ARGS += --disable-minix
CONFIGURE_ARGS += --disable-wipefs
CONFIGURE_ARGS += --disable-mountpoint
CONFIGURE_ARGS += --disable-plymouth_support

# fails to build for: hi3535-6.1
CONFIGURE_ARGS += --disable-schedutils

# fails to build for: armv7-1.2
CONFIGURE_ARGS += --disable-lsfd

# fails to build for: 88f6281-6.1, 88f6281-5.2, qoriq-6.1
# taken from <linux/fiemap.h> for toolchains without this header file
ADDITIONAL_CFLAGS += -DFIEMAP_EXTENT_SHARED=0x00002000
### disk-utils/mkswap.c:294:22: error: 'FIEMAP_EXTENT_SHARED' undeclared (first use in this function)

# fails to build for: ppc853x-5.2
CONFIGURE_ARGS += --disable-scriptutils
CONFIGURE_ARGS += --disable-unshare


include ../../mk/spksrc.cross-cc.mk
15 changes: 15 additions & 0 deletions cross/misc-util-linux/PLIST
@@ -0,0 +1,15 @@
bin:bin/cal
bin:bin/col
bin:bin/colcrt
bin:bin/colrm
bin:bin/column
bin:bin/hexdump
bin:bin/lscpu
bin:bin/lsipc
bin:bin/lsirq
bin:bin/rev
bin:bin/wall
bin:bin/whereis
lnk:lib/libsmartcols.so
lnk:lib/libsmartcols.so.1
lib:lib/libsmartcols.so.1.1.0
3 changes: 3 additions & 0 deletions cross/misc-util-linux/digests
@@ -0,0 +1,3 @@
util-linux-2.38.1.tar.xz SHA1 f62a7b6fe64ce7f4569b57d7d2d0875b39f79836
util-linux-2.38.1.tar.xz SHA256 60492a19b44e6cf9a3ddff68325b333b8b52b6c59ce3ebd6a0ecaa4c5117e84f
util-linux-2.38.1.tar.xz MD5 cd11456f4ddd31f7fbfdd9488c0c0d02
27 changes: 27 additions & 0 deletions cross/moreutils/Makefile
@@ -0,0 +1,27 @@
PKG_NAME = moreutils
PKG_VERS = 0.67
PKG_EXT = tar.gz
PKG_DIST_NAME = $(PKG_NAME)_$(PKG_VERS).orig.$(PKG_EXT)
PKG_DIST_SITE = https://deb.debian.org/debian/pool/main/m/moreutils/
PKG_DIR = $(PKG_NAME)-$(PKG_VERS)

DEPENDS =

HOMEPAGE = https://joeyh.name/code/moreutils/
COMMENT = moreutils is a collection of the unix tools that nobody thought to write long ago when unix was young.
LICENSE = GPLv2

CONFIGURE_TARGET = moreutils_configure
INSTALL_TARGET = moreutils_install

include ../../mk/spksrc.cross-cc.mk

.PHONY: moreutils_configure
# remove the x64 binaries in the package (and ignore configure)
moreutils_configure:
@$(RUN) $(MAKE) clean

.PHONY: moreutils_install
moreutils_install:
@install -d -m 755 $(STAGING_INSTALL_PREFIX)/bin
@$(RUN) install -t $(STAGING_INSTALL_PREFIX)/bin/ isutf8 ifdata ifne pee sponge mispipe lckdo parallel errno
9 changes: 9 additions & 0 deletions cross/moreutils/PLIST
@@ -0,0 +1,9 @@
bin:bin/errno
bin:bin/ifdata
bin:bin/ifne
bin:bin/isutf8
bin:bin/lckdo
bin:bin/mispipe
bin:bin/parallel
bin:bin/pee
bin:bin/sponge
3 changes: 3 additions & 0 deletions cross/moreutils/digests
@@ -0,0 +1,3 @@
moreutils_0.67.orig.tar.gz SHA1 a21214d388ea7077d9f67bb74d10fbb80c732aac
moreutils_0.67.orig.tar.gz SHA256 03872f42c22943b21c62f711b693c422a4b8df9d1b8b2872ef9a34bd5d13ad10
moreutils_0.67.orig.tar.gz MD5 7c08d066e954b05cc4a661d3e9966183
38 changes: 38 additions & 0 deletions cross/moreutils/patches/001-makefile_create-build-targets.patch
@@ -0,0 +1,38 @@
# create build targets for each tool
#

--- Makefile.orig 2021-12-21 19:39:00.000000000 +0000
+++ Makefile 2022-11-19 19:37:50.240222872 +0000
@@ -23,6 +23,32 @@
$(MAKE) -C is_utf8/
cp is_utf8/isutf8 .

+
+ifdata:
+ $(CC) $(CFLAGS) -o ifdata ifdata.c $(LDFLAGS)
+
+ifne:
+ $(CC) $(CFLAGS) -o ifne ifne.c $(LDFLAGS)
+
+pee:
+ $(CC) $(CFLAGS) -o pee pee.c $(LDFLAGS)
+
+sponge:
+ $(CC) $(CFLAGS) -o sponge sponge.c $(LDFLAGS)
+
+mispipe:
+ $(CC) $(CFLAGS) -o mispipe mispipe.c $(LDFLAGS)
+
+lckdo:
+ $(CC) $(CFLAGS) -o lckdo lckdo.c $(LDFLAGS)
+
+parallel:
+ $(CC) $(CFLAGS) -o parallel parallel.c $(LDFLAGS)
+
+errno: errno.o
+ $(CC) $(CFLAGS) -o errno errno.o $(LDFLAGS)
+
+
install:
mkdir -p $(DESTDIR)$(PREFIX)/bin
$(INSTALL_BIN) $(BINS) $(DESTDIR)$(PREFIX)/bin
@@ -0,0 +1,14 @@
# make CC configurable
#

--- is_utf8/Makefile.orig 2021-12-21 19:39:00.000000000 +0000
+++ is_utf8/Makefile 2022-11-18 22:52:11.868059458 +0000
@@ -37,7 +37,7 @@
SONAME = $(LINKERNAME).$(VERSION)
REALNAME = $(SONAME).$(MINOR).$(RELEASE)

-CC = gcc
+CC ?= gcc
CFLAGS ?= -O3 -Wextra -Wall -ansi -Wstrict-prototypes

$(NAME): $(OBJ)
1 change: 0 additions & 1 deletion diyspk/bc/Makefile
Expand Up @@ -16,5 +16,4 @@ HELP_URL = https://www.gnu.org/software/bc/manual/html_mono/bc.html

SPK_COMMANDS = bin/bc bin/dc


include ../../mk/spksrc.spk.mk
47 changes: 47 additions & 0 deletions spk/synocli-misc/Makefile
@@ -0,0 +1,47 @@
SPK_NAME = synocli-misc
SPK_VERS = 1.0
SPK_REV = 1
SPK_ICON = src/synocli-misc.png

DEPENDS = cross/bc cross/moreutils cross/misc-util-linux

MAINTAINER = SynoCommunity
DISPLAY_NAME = SynoCli misc. Tools

DESCRIPTION = "SynoCli misc. Tools provide a set of miscellaneous small command-line utilities: bc, errno, ifdata, ifne, isutf8, lckdo, mispipe, parallel, pee, sponge, cal, col, colcrt, colrm, column, hexdump, lscpu, lsipc, lsirq, rev, wall, whereis."
STARTABLE = no
CHANGELOG = "Initial package release."

HOMEPAGE = https://github.com/SynoCommunity/spksrc/wiki/FAQ-SynoCliMisc
LICENSE = Each tool is licensed under it's respective license.

# gnu:
SPK_COMMANDS = bin/bc bin/dc

# moreutils:
SPK_COMMANDS += bin/errno
SPK_COMMANDS += bin/ifdata
SPK_COMMANDS += bin/ifne
SPK_COMMANDS += bin/isutf8
SPK_COMMANDS += bin/lckdo
SPK_COMMANDS += bin/mispipe
SPK_COMMANDS += bin/parallel
SPK_COMMANDS += bin/pee
SPK_COMMANDS += bin/sponge

# util-linux:
SPK_COMMANDS += bin/cal
SPK_COMMANDS += bin/col
SPK_COMMANDS += bin/colcrt
SPK_COMMANDS += bin/colrm
SPK_COMMANDS += bin/column
SPK_COMMANDS += bin/hexdump
SPK_COMMANDS += bin/lscpu
SPK_COMMANDS += bin/lsipc
SPK_COMMANDS += bin/lsirq
SPK_COMMANDS += bin/rev
SPK_COMMANDS += bin/wall
SPK_COMMANDS += bin/whereis


include ../../mk/spksrc.spk.mk
58 changes: 58 additions & 0 deletions spk/synocli-misc/src/SynoPackagegreen-misc.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added spk/synocli-misc/src/synocli-misc.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.