Add WIP recipes, moved existing WIP recipes in wip/

This commit is contained in:
Karchnu 2021-04-24 00:00:41 +02:00
parent 8db9a7f641
commit 44b02ddebf
86 changed files with 2396 additions and 0 deletions

52
wip/atop/APKBUILD Normal file
View File

@ -0,0 +1,52 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=atop
pkgver=2.6.0
pkgrel=0
pkgdesc="Resource-specific view of processes"
url="https://www.atoptool.nl/"
arch="all"
license="GPL-2.0-or-later"
makedepends="zlib-dev ncurses-dev linux-headers"
subpackages="$pkgname-doc"
source="https://www.atoptool.nl/download/atop-$pkgver.tar.gz
atop-daily-bb.patch
atop-include-macros.patch
fix-limits-on-ppc64le.patch
atop.initd
"
options="suid"
prepare() {
cd "$builddir"
default_prepare
sed -i -e '/^CFLAGS/s: = -O : += :' \
-e '/DEFPATH/d' \
-e '/^LDFLAGS/s: = : += :' Makefile
cp "$srcdir"/atop.initd atop.init
chmod a+rx atop.init
}
build() {
cd "$builddir"
}
package() {
cd "$builddir"
mkdir -p "$pkgdir"/var/log/atop "$pkgdir"/var/run "$pkgdir"/usr/sbin
make -j1 DESTDIR="$pkgdir" \
INIPATH=/etc/init.d \
SCRPATH=/etc/periodic/daily \
sysvinstall
rm -fr "$pkgdir"/etc/cron.d
mv "$pkgdir"/etc/periodic/daily/atop.daily \
"$pkgdir"/etc/periodic/daily/atop
}
sha512sums="8d4e2ae56a63738fc615f294d1f4e27cd9eab20acaf5d36c82d87390f96d38cf28cab0a00507459c3ce6e535294a442c4546e0cf732bad253cb518a14cdf5e88 atop-2.6.0.tar.gz
664225450074962aac0e13484c9b2feaf08620bbe1e0f9c5dc1b02f1ecd315224cd04df53134f2d107210fc9223a64d8885ae70d33d0663c2335fa6d46f6ddfd atop-daily-bb.patch
f30c9e6051332af8c8cafcd881f89a0e2d2a8e1d84eee8ac0c8c6b58f3ae3431fcf9c40dea6d03e271f8969802de449d33b4323c13045bdb38a539732c81a8b6 atop-include-macros.patch
87cc78832774299227d435643551d099c3d88babb13049fe71e170e1220204a26be9ab570a59eccc90c9cb4faabd371e1c031063c70cb20a0c4620566c906425 fix-limits-on-ppc64le.patch
172c9d367b936427ccbbbd1140c7808ec8ffe3194b3557ba024820dac8fa68c9919f7dc34d332e91283fde64d731db7bdbfee3c2d6caad3cd291e0f1c227cb03 atop.initd"

View File

@ -0,0 +1,18 @@
--- a/atop.daily 2019-01-12 23:37:19.000000000 +0100
+++ b/atop.daily 2019-09-21 14:30:57.905978235 +0200
@@ -30,13 +30,13 @@
# verify if atop still runs for daily logging
#
-if [ -e "$PIDFILE" ] && ps -p `cat "$PIDFILE"` | grep 'atop$' > /dev/null
+if [ -e $PIDFILE ] && ps | grep `cat $PIDFILE` > /dev/null
then
kill -USR2 `cat "$PIDFILE"` # final sample and terminate
CNT=0
- while ps -p `cat "$PIDFILE"` > /dev/null
+ while ps | grep `cat $PIDFILE` > /dev/null
do
let CNT+=1

View File

@ -0,0 +1,10 @@
--- a/photosyst.c
+++ b/photosyst.c
@@ -152,6 +152,7 @@
static const char rcsid[] = "$Id: photosyst.c,v 1.38 2010/11/19 07:40:40 gerlof Exp $";
#include <sys/types.h>
+#include <sys/sysmacros.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>

21
wip/atop/atop.initd Normal file
View File

@ -0,0 +1,21 @@
#!/sbin/openrc-run
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sys-process/atop/files/atop.rc,v 1.1 2005/06/14 23:01:10 vapier Exp $
_daily=/etc/periodic/daily/atop
start(){
ebegin "Starting atop"
if [ -f "$_daily" ] ; then
start-stop-daemon --start --quiet --exec "$_daily"
eend $?
else
eend 1 "/etc/cron.d/atop doesnt exist!"
fi
}
stop(){
ebegin "Stopping atop"
start-stop-daemon --stop --pidfile /var/run/atop.pid
eend $?
}

View File

@ -0,0 +1,10 @@
--- a/photosyst.c 2020-12-25 13:13:46.569591017 +0000
+++ b/photosyst.c 2020-12-25 13:13:52.399619155 +0000
@@ -165,6 +165,7 @@
#include <dirent.h>
#include <sys/ioctl.h>
#include <sys/sysmacros.h>
+#include <limits.h>
#define SCALINGMAXCPU 8 // threshold for scaling info per CPU

98
wip/bash/APKBUILD Normal file
View File

@ -0,0 +1,98 @@
# Contributor: Łukasz Jendrysik <scadu@yandex.com>
# Contributor: TBK <alpine@jjtc.eu>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=bash
pkgver=5.1.4
_patchlevel=${pkgver##*.}
_myver=${pkgver%.*}
_patchbase=${_myver/./}
pkgrel=0
pkgdesc="The GNU Bourne Again shell"
url="https://www.gnu.org/software/bash/bash.html"
arch="all"
license="GPL-3.0-or-later"
makedepends_build="bison flex"
makedepends_host="readline-dev>8 ncurses-dev"
install="$pkgname.post-install $pkgname.post-upgrade $pkgname.pre-deinstall"
subpackages="$pkgname-dbg $pkgname-dev $pkgname-doc"
source="https://ftp.gnu.org/gnu/bash/bash-$_myver.tar.gz
bash-noinfo.patch
"
# generate url's to patches. note: no forks allowed!
_i=1
_pad=00
while [ $_i -le $_patchlevel ]; do
[ $_i -ge 10 ] && _pad="0"
[ $_i -ge 100 ] && _pad=
source="$source https://ftp.gnu.org/gnu/bash/bash-$_myver-patches/bash$_patchbase-$_pad$_i"
_i=$(( $_i + 1))
done
# secfixes:
# 4.4.12-r1:
# - CVE-2016-0634
builddir="$srcdir/$pkgname-$_myver"
prepare() {
# NOTE: This section is for applying the vendor patches, which are required to fix
# security holes. `default_prepare` does *not* apply vendor patches in the format
# shipped with bash. We also need to make sure vendor patches are applied before
# our own.
# If you disagree, please request an experimental rebuild with bash as /bin/sh,
# before removing this section.
for p in $source; do
case $p in
*/bash[0-9][0-9]-[0-9]*)
msg "$p (vendor)"
patch -p0 -i "$srcdir"/${p##*/}
;;
esac
done
default_prepare
# preventively set Version to please 'apk version --check'
sed -i "s/@PACKAGE_VERSION@/$pkgver/" "$builddir"/support/bash.pc.in
}
build() {
./configure \
--build=$CBUILD \
--host=$CHOST \
--prefix=/usr \
--bindir=/bin \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
--with-curses \
--disable-nls \
--enable-readline \
--without-bash-malloc \
--with-installed-readline
# parallel build workarounds
make y.tab.c && make builtins/libbuiltins.a && make
}
check() {
make test
}
package() {
make DESTDIR="$pkgdir" install
rm -rf "$pkgdir"/usr/share/locale
}
dev() {
default_dev
mkdir -p "$subpkgdir"/bin "$subpkgdir"/usr/lib/$pkgname
mv "$pkgdir"/bin/${pkgname}bug "$subpkgdir"/bin
mv "$pkgdir"/usr/lib/$pkgname/Makefile* "$subpkgdir"/usr/lib/$pkgname
}
sha512sums="c44a0ce381469219548a3a27589af3fea4f22eda1ca4e9434b59fc16da81b471c29ce18e31590e0860a6a251a664b68c2b45e3a17d22cfc02799ffd9a208390c bash-5.1.tar.gz
9d8845491d0fe335bdd8e9a2bd98bda54bfed2ae3c35b2196c6d5a38bdf96c4d97572ba7d6b19ab605ef4e8f001f64cf3312f87dedebb9e37a95ad2c44e33cdb bash-noinfo.patch
1cd86805a2639614372aec29a710bc456e330abcbbaa0867820c94f714a1fa5fb5c1b18aa2c10263ae0bce9dad7579c7af2f732282315c1c34bfd6a90777bfd2 bash51-001
923e7822a9629645347d3aea0058fb5e2d52223507159a62369309f264612df44a84931c19e0ccb3852e98ce672dfbd454477090b4041b5a0de477c94eb61088 bash51-002
01e952dcfdae58624723d64912ea3444eed2fdcd266ba1a929b95ec3abd70f914bf400607c3f7bb7a94ac2925f794f91f37c1929d5bb987de2ba7f60a19cb8bd bash51-003
10ff24cd91a2cd88818bfa7218050843af6b409e43fcca89f5ec70d8266020c6c2a55132426271f165cd0f154f49eb0f8ec2761b80fc066c921b83120bb543ce bash51-004"

View File

@ -0,0 +1,11 @@
--- a/doc/Makefile.in
+++ b/doc/Makefile.in
@@ -247,7 +247,7 @@
$(SHELL) $(SUPPORT_SRCDIR)/mkinstalldirs $(DESTDIR)$(htmldir) ; \
fi
-install: info installdirs
+install: installdirs
-$(INSTALL_DATA) $(srcdir)/bash.1 $(DESTDIR)$(man1dir)/bash${man1ext}
-$(INSTALL_DATA) $(srcdir)/bashbug.1 $(DESTDIR)$(man1dir)/bashbug${man1ext}
-$(INSTALL_DATA) $(OTHER_DOCS) $(DESTDIR)$(docdir)

View File

@ -0,0 +1,3 @@
#!/bin/sh
add-shell '/bin/bash'
exit 0

1
wip/bash/bash.post-upgrade Symbolic link
View File

@ -0,0 +1 @@
bash.post-install

View File

@ -0,0 +1,3 @@
#!/bin/sh
remove-shell '/bin/bash'
exit 0

14
wip/build.zsh/Makefile Normal file
View File

@ -0,0 +1,14 @@
name = build.zsh
version = 0.4.1
release = 0
URL = https://git.baguette.netlib.re/Baguette/build.zsh/archive/$(version).tar.gz
dependencies = make zsh
MAKE_INSTALL_OPTIONS_USER = PREFIX=$(PREFIX)
pkg_build_par_dir = $(pkg_working_dir)/build/
pkg_build_dir = $(pkg_build_par_dir)/$(name)
SYSCONF ?= ../../
include $(SYSCONF)/package.mk

1
wip/busybox/FIXME Normal file
View File

@ -0,0 +1 @@
To finish, currently limited by the chroot.

22
wip/busybox/Makefile Normal file
View File

@ -0,0 +1,22 @@
name = busybox
version = 1.33.0
release = 0
URL = https://busybox.net/downloads/busybox-$(version).tar.bz2
SYSCONF ?= ../../
include $(SYSCONF)/package.mk
configure:
cd $(bdir) ; \
make defconfig ; \
sed -e 's/.*CONFIG_STATIC.*/CONFIG_STATIC=y/' .config > config-new ; \
mv config-new .config
fake_root_install:
mkdir -p '$(pkg_fake_root_dir)/bin'
mkdir -p '$(pkg_fake_root_dir)/sbin'
mkdir -p '$(pkg_fake_root_dir)/usr/bin'
mkdir -p '$(pkg_fake_root_dir)/usr/sbin'
cp $(bdir)/busybox '$(pkg_fake_root_dir)/bin/busybox'
chroot '$(pkg_fake_root_dir)' /bin/busybox --install -s
mv '$(pkg_fake_root_dir)/usr/sbin/killall5' '$(pkg_fake_root_dir)/sbin/'

1
wip/clang/FIXME Normal file
View File

@ -0,0 +1 @@
Did not even really tried.

43
wip/clang/Makefile Normal file
View File

@ -0,0 +1,43 @@
name = clang
version = 11.1.0
release = 0
#URL = https://github.com/llvm/llvm-project/releases/download/llvmorg-$(version)/cfe-$(version).src.tar.gz
URL = https://github.com/llvm/llvm-project/archive/refs/tags/llvmorg-$(version).tar.gz
# labs.h clang
dirname = build
pkg_build_dir = $(pkg_working_dir)/build/llvm-project-llvmorg-$(version)
# Minimalist version
CMAKE_OPTIONS_USER = -DCMAKE_PREFIX_PATH=$(PREFIX) \
-DCMAKE_INSTALL_PREFIX=$(PREFIX) \
-DCMAKE_BUILD_TYPE=Release
#CMAKE_OPTIONS_USER = -DCMAKE_PREFIX_PATH=$(PREFIX) \
# -DCMAKE_INSTALL_PREFIX=$(PREFIX) \
# -DCLANG_CONFIG_FILE_SYSTEM_DIR=$(PREFIX)/etc/clang \
# -DCLANG_DEFAULT_CXX_STDLIB=libc++ \
# -DCMAKE_CXX_COMPILER="clang++" \
# -DCMAKE_CXX_FLAGS="$CXXFLAGS -stdlib=libc++ -include /usr/baguette/include/c++/v1/math.h -include $(pwd)/../labs.h -D__DEFINED_max_align_t" \
# -DCMAKE_C_COMPILER="clang" \
# -DCMAKE_C_FLAGS="$CFLAGS" \
# -DCMAKE_EXE_LINKER_FLAGS="$LDFLAGS -lc++" \
# -DCMAKE_SHARED_LINKER_FLAGS="$LDFLAGS -lc++" \
# -DCMAKE_BUILD_TYPE=Release
SYSCONF ?= ../../
include $(SYSCONF)/package.mk
#configure:
# @#sed -i '/^ return ToolChain::CST_Libstdcxx/s@stdcxx@cxx@' cfe-$(version).src/tools/lib/Driver/ToolChain.cpp
# mkdir -p $(bdir)/$(dirname)
# $(Q)cd $(bdir)/$(dirname) ; \
# cmake ../cfe-$(version).src \
post_fake_root_install:
rm $(pkg_fake_root_dir)/$(PREFIX)/bin/clang
rm $(pkg_fake_root_dir)/$(PREFIX)/bin/clang++
cp clang $(pkg_fake_root_dir)/$(PREFIX)/bin/
ln -s $(pkg_fake_root_dir)/$(PREFIX)/bin/clang $(pkg_fake_root_dir)/$(PREFIX)/bin/clang++

52
wip/clang/clang Executable file
View File

@ -0,0 +1,52 @@
#!/bin/sh
requires_linking="true"
is_cpp=false
if [ "$(basename $0)" = "clang++" ]; then
is_cpp=true
fi
for i; do
case "$i" in
-c)
requires_linking="false"
;;
-std=*)
std="$(printf "%s" "$i" | sed 's:-std=::')"
if echo "$std" | grep -E -q '(c\+\+|gnu\+\+)'; then
is_cpp=true
else
is_cpp=false
fi
;;
esac
done
cpp_flags=
if $is_cpp; then
cpp_flags="
-cxx-isystem /usr/weirdos/lib/c++/v1
"
fi
linker_flags=
if $requires_linking; then
linker_flags="
-L /usr/weirdos/lib
-L /usr/weirdos/lib/gcc/x86_64-weird-linux-musl/9.1.0/
-B /usr/weirdos/lib/gcc/x86_64-weird-linux-musl/9.1.0/
-Wl,--dynamic-linker /lib/ld-musl-x86_64.so.1
"
if $is_cpp; then
cpp_flags="$cpp_flags -lc++ -lc++abi"
fi
fi
clang-8 \
-isystem /usr/weirdos/include/ \
$linker_flags \
$cpp_flags \
"$@"

7
wip/clang/labs.h Normal file
View File

@ -0,0 +1,7 @@
#include <cstdlib>
namespace std {
static inline long abs(long a) { return std::labs(a); }
static inline long long abs(long long a) { return std::labs(a); }
}

View File

@ -0,0 +1,8 @@
#!/bin/sh
clang-8 -L %{prefix}/lib \
-L %{prefix}/lib/gcc/x86_64-weird-linux-musl/9.1.0/ \
-B %{prefix}/lib/gcc/x86_64-weird-linux-musl/9.1.0/ \
-Wl,--dynamic-linker /lib/ld-musl-x86_64.so.1 \
-isystem %{prefix}/include/ \
"$@"

4
wip/clang/x86_64.cfg Normal file
View File

@ -0,0 +1,4 @@
-L /usr/weirdos/lib/gcc/x86_64-weird-linux-musl/9.1.0/
-B /usr/weirdos/lib/gcc/x86_64-weird-linux-musl/9.1.0/
-Wl,--dynamic-linker /lib/ld-musl-x86_64.so.1
-I /usr/weirdos/include/

54
wip/fakeroot/APKBUILD Normal file
View File

@ -0,0 +1,54 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=fakeroot
pkgver=1.25.3
pkgrel=3
pkgdesc="Gives a fake root environment, useful for building packages as a non-privileged user"
arch="all"
license="GPL-3.0-or-later"
url="https://packages.debian.org/fakeroot"
checkdepends="bash"
makedepends_build="libtool autoconf automake po4a"
makedepends_host="libcap-dev acl-dev linux-headers"
makedepends="$makedepends_build $makedepends_host"
subpackages="$pkgname-dbg $pkgname-doc"
source="http://ftp.debian.org/debian/pool/main/f/fakeroot/fakeroot_$pkgver.orig.tar.gz
fakeroot-no64.patch
fakeroot-stdint.patch
xstatjunk.patch
fix-shell-in-fakeroot.patch
fakeroot-skip-ipc-sanity-check.patch
"
check() {
make check
}
build() {
if [ "$CLIBC" = "musl" ]; then
# musl does not have _STAT_VER, it's really not used for
# anything, so define it as zero (just like uclibc does)
export CFLAGS="-D_STAT_VER=0 $CFLAGS"
fi
CONFIG_SHELL=/bin/sh ./bootstrap
CONFIG_SHELL=/bin/sh ./configure \
--build=$CBUILD \
--host=$CHOST \
--prefix=/usr \
--disable-static
make
cd doc
po4a -k 0 --rm-backups --variable "srcdir=../doc/" po4a/po4a.cfg
}
package() {
make DESTDIR="$pkgdir" install
}
sha512sums="b54366ef82b49af414d7214d069a4bc7dd188dfa4f8e3121f6bd65fd67268b02346ff72e857087243ab0efe9fa82faaa9f9c3309cac4b5af0ea00908c2e5eb6e fakeroot_1.25.3.orig.tar.gz
7a832e6bed3838c7c488e0e12ba84b8d256e84bbb06d6020247452a991de505fa5c6bd7bcb84dce8753eb242e0fcab863b5461301cd56695f2b003fe8d6ff209 fakeroot-no64.patch
ed7a58b0d201139545420f9e5429f503c00e00f36dea84473e77ea99b23bb8d421da1a8a8ce98ff90e72e378dff4cb9ea3c1a863a969899a5f50dfac3b9c5fac fakeroot-stdint.patch
5efd33fd778bd94a529ed7e439fb8fea25ff865dda3f6f9e431264e942b37f3b5d7a0ad14107b55c5fa81b86efd5a82aedb3803cfab08ec57f27f5b229d2fe88 xstatjunk.patch
47593b3d86a66bab832c50a1d967cdc70e42bbd9ef4436f18140067ccefdd6418516e5157102c67e604f3623ed1b9f4fe1423fc5dad4dfe5356fc250c12818a7 fix-shell-in-fakeroot.patch
f1dcd9c34e74eb225c6a96262847e70f86f437c6bcf41c5d554ced2e3d08798296a66310296cc0ab177a7ea5a0271151326a3e79f72e4ed640b3bd20dbaabec1 fakeroot-skip-ipc-sanity-check.patch"

30
wip/fakeroot/Makefile Normal file
View File

@ -0,0 +1,30 @@
name = fakeroot
version = 1.25.3
URL = http://ftp.debian.org/debian/pool/main/f/fakeroot/fakeroot_$(version).orig.tar.gz
url = "https://packages.debian.org/fakeroot"
patches != ls *.patch
makedepends_build = libtool autoconf automake po4a
makedepends_host = libcap-dev acl-dev linux-headers
build-dependencies = $(makedepends_build) $(makedepends_host)
CONFIG_SHELL = /bin/sh
export CONFIG_SHELL
CONFIGURE_OPTIONS_USER = --build=$(CBUILD) --host=$(CHOST)
SYSCONF ?= ../../
include $(SYSCONF)/package.mk
ifeq ($(CLIBC), musl)
# musl does not have _STAT_VER, it's really not used for
# anything, so define it as zero (just like uclibc does)
CFLAGS = "-D_STAT_VER=0 $(CFLAGS)"
endif
pre_configure:
$(Q)cd $(bdir) && ./bootstrap
pre_fake_root_install:
$(Q)cd $(bdir)/doc && po4a -k 0 --rm-backups --variable "srcdir=../doc/" po4a/po4a.cfg

View File

@ -0,0 +1,17 @@
--- a/libfakeroot.c
+++ b/libfakeroot.c
@@ -81,12 +81,14 @@
#define SEND_STAT64(a,b,c) send_stat64(a,b,c)
#define SEND_GET_STAT(a,b) send_get_stat(a,b)
#define SEND_GET_STAT64(a,b) send_get_stat64(a,b)
+#define SEND_GET_XATTR(a,b,c) send_get_xattr(a,b,c)
#define SEND_GET_XATTR64(a,b,c) send_get_xattr64(a,b,c)
#else
#define SEND_STAT(a,b,c) send_stat(a,b)
#define SEND_STAT64(a,b,c) send_stat64(a,b)
#define SEND_GET_STAT(a,b) send_get_stat(a)
#define SEND_GET_STAT64(a,b) send_get_stat64(a)
+#define SEND_GET_XATTR(a,b,c) send_get_xattr(a,b)
#define SEND_GET_XATTR64(a,b,c) send_get_xattr64(a,b)
#endif

View File

@ -0,0 +1,46 @@
diff -urN fakeroot-1.25.3.orig/configure.ac fakeroot-1.25.3/configure.ac
--- fakeroot-1.25.3.orig/configure.ac 2020-12-15 02:33:22.866626448 -0700
+++ fakeroot-1.25.3/configure.ac 2020-12-15 02:33:40.563359415 -0700
@@ -25,42 +25,6 @@
[ac_cv_use_ipc],
[ac_cv_use_ipc=sysv])
-if test $ac_cv_use_ipc = "sysv"; then
- AC_MSG_CHECKING([whether SysV IPC message queues are actually working on the host])
-
- AC_LANG_PUSH(C)
- AC_TRY_RUN([
-#include <stdlib.h>
-#include <sys/types.h>
-#include <sys/ipc.h>
-#include <sys/msg.h>
-#include <time.h>
-#include <unistd.h>
-
-int main() {
-
- srandom(time(NULL)+getpid()*33151);
- key_t msg_key = random();
- int msg_get = msgget(msg_key, IPC_CREAT|0600);
-
- if (msg_get==-1) {
- return 1;
- } else {
- msgctl(msg_get, IPC_RMID, NULL);
- return 0;
- }
-
-}], [ac_cv_use_ipc=sysv], [ac_cv_use_ipc=tcp])
-
- if test $ac_cv_use_ipc = "tcp"; then
- AC_MSG_RESULT([No, using TCP])
- else
- AC_MSG_RESULT([Yes])
- fi
-
- AC_LANG_POP(C)
-fi
-
AC_ARG_WITH([dbformat],
AS_HELP_STRING([--with-dbformat@<:@=DBFORMAT@:>@],
[database format to use: either inode (default) or path]),

View File

@ -0,0 +1,34 @@
--- fakeroot-1.18.2.orig/faked.c
+++ fakeroot-1.18.2/faked.c
@@ -514,11 +514,11 @@
#ifdef FAKEROOT_DB_PATH
if (find_path(i->buf.dev, i->buf.ino, roots, path))
- fprintf(f,"mode=%llo,uid=%llu,gid=%llu,nlink=%llu,rdev=%llu %s\n",
+ fprintf(f,"mode=%"PRIo64",uid=%"PRIu64",gid=%"PRIu64",nlink=%"PRIu64",rdev=%"PRIu64" %s\n",
(uint64_t) i->buf.mode,(uint64_t) i->buf.uid,(uint64_t) i->buf.gid,
(uint64_t) i->buf.nlink,(uint64_t) i->buf.rdev,path);
#else
- fprintf(f,"dev=%llx,ino=%llu,mode=%llo,uid=%llu,gid=%llu,nlink=%llu,rdev=%llu\n",
+ fprintf(f,"dev=%"PRIx64",ino=%"PRIu64",mode=%"PRIo64",uid=%"PRIu64",gid=%"PRIu64",nlink=%"PRIu64",rdev=%"PRIu64"\n",
(uint64_t) i->buf.dev,(uint64_t) i->buf.ino,(uint64_t) i->buf.mode,
(uint64_t) i->buf.uid,(uint64_t) i->buf.gid,(uint64_t) i->buf.nlink,
(uint64_t) i->buf.rdev);
@@ -544,7 +544,7 @@
while(1){
#ifdef FAKEROOT_DB_PATH
- r=scanf("mode=%llo,uid=%llu,gid=%llu,nlink=%llu,rdev=%llu "DB_PATH_SCAN"\n",
+ r=scanf("mode=%"PRIo64",uid=%"PRIu64",gid=%"PRIu64",nlink=%"PRIu64",rdev=%"PRIu64" "DB_PATH_SCAN"\n",
&stmode, &stuid, &stgid, &stnlink, &strdev, &path);
if (r != 6)
break;
@@ -559,7 +559,7 @@
stdev = path_st.st_dev;
stino = path_st.st_ino;
#else
- r=scanf("dev=%llx,ino=%llu,mode=%llo,uid=%llu,gid=%llu,nlink=%llu,rdev=%llu\n",
+ r=scanf("dev=%"PRIx64",ino=%"PRIu64",mode=%"PRIo64",uid=%"PRIu64",gid=%"PRIu64",nlink=%"PRIu64",rdev=%"PRIu64"\n",
&stdev, &stino, &stmode, &stuid, &stgid, &stnlink, &strdev);
if (r != 7)
break;

View File

@ -0,0 +1,13 @@
Description: Fix shell in fakeroot.in
Use /bin/sh instead of @SHELL@ in fakeroot.in
Author: Juan Picca <jumapico@gmail.com>
Last-Update: 2016-06-27
---
--- a/scripts/fakeroot.in
+++ b/scripts/fakeroot.in
@@ -1,4 +1,4 @@
-#!@SHELL@
+#!/bin/sh
# This script first starts faked (the daemon), and then it will run
# the requested program with fake root privileges.

View File

@ -0,0 +1,11 @@
--- fakeroot-1.18.4.orig/configure.ac 2012-06-02 18:23:41.000000000 +0000
+++ fakeroot-1.18.4configure.ac 2015-09-24 23:15:56.917470073 +0000
@@ -301,7 +301,7 @@
FUNC=`echo $SEARCH|sed -e 's/.*%//'`
PRE=`echo $SEARCH|sed -e 's/%.*//'`
FOUND=
- for WRAPPED in __${PRE}x${FUNC} _${PRE}x${FUNC} __${PRE}${FUNC}13 ${PRE}${FUNC}; do
+ for WRAPPED in ${PRE}${FUNC}; do
AC_CHECK_FUNCS($WRAPPED,FOUND=$WRAPPED)
dnl
dnl to unconditionally define only the _* functions, comment out the 2 lines above,

43
wip/gcc/Makefile Normal file
View File

@ -0,0 +1,43 @@
name = gcc
version = 10.3.0
release = 0
URL = - https://ftp.gnu.org/gnu/gcc/gcc-$(version)/gcc-$(version).tar.xz
build-dependencies = gmp-dev mpfr-dev mpc-dev
dependencies = gmp mpfr mpc binutils
pkg_build_dir = $(pkg_build_par_dir)/build
configure:
mkdir $(dirname)
cd $(dirname)
if [ "$(uname -m)" = x86_64 ]; then
sed -e '/m64=/s/lib64/lib/' ../gcc-$(version)/gcc/config/i386/t-linux64 > tmp
mv tmp ../gcc-$(version)/gcc/config/i386/t-linux64
fi
export CC=gcc
export CXX=g++
../gcc-$(version)/configure \
CFLAGS="$CFLAGS -isystem $(prefix)/include" \
CXXFLAGS="$CXXFLAGS -isystem $(prefix)/include" \
--with-tune=generic \
\
--prefix=$(prefix) \
--libdir=$(prefix)/lib \
--disable-multilib \
--disable-libssp \
--disable-libmpx \
--disable-libmudflap \
--disable-libsanitizer \
--disable-bootstrap \
--disable-nls \
--disable-werror \
--enable-languages=c,c++ \
--build=x86_64-weird-linux-musl
SYSCONF ?= ../../
include $(SYSCONF)/package.mk

3
wip/libcxx/FIXME Normal file
View File

@ -0,0 +1,3 @@
Make Error at CMakeLists.txt:5 (message):
libc++ now requires being built in a monorepo layout with libcxxabi
available

15
wip/libcxx/Makefile Normal file
View File

@ -0,0 +1,15 @@
name = libcxx
version = 11.1.0
URL = https://github.com/llvm/llvm-project/releases/download/llvmorg-$(version)/$(name)-$(version).src.tar.xz
CMAKE_OPTIONS_USER = -DCMAKE_INSTALL_PREFIX=$(PREFIX) \
-DCMAKE_BUILD_TYPE=Release \
-DLIBCXX_HAS_MUSL_LIBC=ON \
-DCMAKE_CXX_FLAGS="$(CXXFLAGS)" \
-DLIBCXX_CXX_ABI=libcxxabi \
-DCMAKE_C_FLAGS="$(CFLAGS)"
pkg_build_dir = $(pkg_build_par_dir)/$(name)-$(version).src
SYSCONF ?= ../../
include $(SYSCONF)/package.mk

44
wip/libcxxabi/recipe.spec Normal file
View File

@ -0,0 +1,44 @@
name: libcxxabi
version: 8.0.1
# for version 9.X and later
# sources: http://releases.llvm.org/%{version}/libcxxabi-%{version}.src.tar.xz
sources:
- https://github.com/llvm/llvm-project/releases/download/llvmorg-%{version}/libcxxabi-%{version}.src.tar.xz
- https://gist.github.com/jhuntwork/5805976/raw/110325d22d689a87727a03ebe8c5fee4bf45cede/libcxxabi.patch
dirname: %{name}-%{version}.src/lib
@configure
mkdir build
cd build
#sed -i -e "/-nostdinc++/d" CMakeLists.txt
cmake ../%{name}-%{version}.src \
-DLIBCXXABI_LIBCXX_INCLUDES=%{prefix}/include/c++/v1 \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_COMPILER="clang" \
-DCMAKE_CXX_FLAGS="$CXXFLAGS -D__DEFINED_max_align_t" \
-DCMAKE_C_COMPILER="clang" \
-DCMAKE_C_FLAGS="$CFLAGS" \
-DLIBCXXABI_INCLUDE_TESTS=OFF \
-DLLVM_ENABLE_LIBCXX=ON \
-DCMAKE_INSTALL_PREFIX=%{prefix}
@build
cd build
make
@install
cd build
make DESTDIR="%{pkg}" install
mkdir -p %{pkg}%{prefix}/include
cp ../%{name}-%{version}.src/include/* %{pkg}%{prefix}/include
#@build
# cd libcxxabi-%{version}.src/lib
# export CXX="clang++ $CXXFLAGS -I%{prefix}/include/c++/v1/ -I%{prefix}/include"
# ./buildit
#@install
# cd libcxxabi-%{version}.src/lib
# mkdir -p %{pkg}%{prefix}/lib
# cp -a libc++abi.* %{pkg}%{prefix}/lib

View File

@ -0,0 +1,6 @@
name = libgpg-error
version = 1.42
URL = https://gnupg.org/ftp/gcrypt/libgpg-error/libgpg-error-$(version).tar.bz2
SYSCONF ?= ../../
include $(SYSCONF)/package.mk

6
wip/libksba/Makefile Normal file
View File

@ -0,0 +1,6 @@
name = libksba
version = 1.5.0
URL = https://gnupg.org/ftp/gcrypt/libksba/libksba-$(version).tar.bz2
SYSCONF ?= ../../
include $(SYSCONF)/package.mk

75
wip/mdadm/APKBUILD Normal file
View File

@ -0,0 +1,75 @@
# Contributor: Valery Kartel <valery.kartel@gmail.com>
# Contributor: Carlo Landmeter <clandmeter@alpinelinux.org>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=mdadm
pkgver=4.1
pkgrel=4
pkgdesc="a tool for managing Linux Software RAID arrays"
url="https://neil.brown.name/blog/mdadm"
arch="all"
license="GPL-2.0-only"
depends="lsblk"
makedepends="groff linux-headers"
checkdepends="bash eudev e2fsprogs"
subpackages="$pkgname-doc $pkgname-udev::noarch $pkgname-misc::noarch"
source="https://www.kernel.org/pub/linux/utils/raid/mdadm/mdadm-$pkgver.tar.gz
$pkgname.initd
$pkgname.confd
$pkgname-raid.initd
no-werror.patch
mdadm-include-sysmacros.patch
fix-use-after-free.patch
fix-monitor-tv_sec.patch
"
options="!check"
build() {
make
make raid6check
}
# This doesn't build in Alpine CI. But it should work on bare-metal as root.
check() {
export PATH="$PWD:$PATH" # Test needs built binaries
make test
./test
}
package() {
make DESTDIR="$pkgdir" install
install -Dm755 raid6check "$pkgdir"/sbin/raid6check
install -Dm644 raid6check.8 "$pkgdir"/usr/share/man/man8/raid6check.8
install -Dm644 $pkgname.conf-example "$pkgdir"/etc/$pkgname.conf
install -Dm644 "$srcdir"/$pkgname.confd "$pkgdir"/etc/conf.d/$pkgname
install -Dm755 "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname
install -Dm755 "$srcdir"/$pkgname-raid.initd "$pkgdir"/etc/init.d/$pkgname-raid
}
udev() {
pkgdesc="$pkgdesc (udev rules)"
install_if="udev $pkgname=$pkgver-r$pkgrel"
mkdir -p "$subpkgdir"
mv "$pkgdir"/lib "$subpkgdir"/
}
misc() {
pkgdesc="$pkgdesc (misc scripts)"
depends="$pkgname bash"
cd "$builddir"
install -Dm755 misc/mdcheck "$subpkgdir"/usr/sbin/mdcheck
install -Dm755 misc/syslog-events "$subpkgdir"/usr/sbin/handle-mdadm-events
}
sha512sums="f9bff760795ba7361f19fd1cbc02efedcdaa4b0125b99cf1369e78f30e5c128126751915fde41407d46c544514d864bf82b508419bc08f1db7aa447557e2ca9e mdadm-4.1.tar.gz
ca5f4e3ff5b284102b44e818d11622e1889066e3d18edce2d62c1a44ee8f4cfdc0979121c0462a916c638423c5ebc706c46aa996a7c4f68e030589adc62803f4 mdadm.initd
7d45bf489ef93a4f217ffcf72311eb661b8de7fbf63a5344697252c0d3a684b0123ff60efa5f218da4eb4cda7c88d91c2ef3625d5e44a588e3e1210cb60b0ab9 mdadm.confd
10d2456ca82c353c9b8540ca996de48575a60b83ede5b0bb7e960b4dd28aac2aa73eaeff4bdb99d03ce9630f986c2023b38fe332c5be74e0234985af6273a934 mdadm-raid.initd
794d6c31fbc0a9ef2f56d7b0afdb94490f0b677414d4f2b1b5104a51c4f39948491fc21aaa30ca75c90c9f056369317f48ea2f78e04ee740327114bee5d959b4 no-werror.patch
e711c15fada5fc98984f43f90a8ab3b6a2a20e9b91c56b5672fdb0ea127b61934b2f0c6ca986bd91c96c56b66f46326cb616101a62e4bfebe3a2b0d33ed2465c mdadm-include-sysmacros.patch
5f3544af7a6e16d78581ed468766203991118a43f131538b39c52f5d38d4458e2e57f2ec32d3558b5fdec4952cad3d969955d0efc1392b785e8345d352ab5b7b fix-use-after-free.patch
d7aeac1ce8e1b17bfdc6178551aaee364b731003e03b1d0c713ee879ac3f82164dff70999ad56c0e91c4bf90c5bca7708bdbb5d2a57e032fd0291828a917b054 fix-monitor-tv_sec.patch"

View File

@ -0,0 +1,16 @@
diff --git monitor.c monitor.c
index 81537ed..08027ac 100644
--- a/monitor.c
+++ b/monitor.c
@@ -447,9 +447,9 @@ static int read_and_act(struct active_array *a, fd_set *fds)
}
gettimeofday(&tv, NULL);
- dprintf("(%d): %ld.%06ld state:%s prev:%s action:%s prev: %s start:%llu\n",
+ dprintf("(%d): %lld.%06ld state:%s prev:%s action:%s prev: %s start:%llu\n",
a->info.container_member,
- tv.tv_sec, tv.tv_usec,
+ (long long)tv.tv_sec, (long)tv.tv_usec,
array_states[a->curr_state],
array_states[a->prev_state],
sync_actions[a->curr_action],

View File

@ -0,0 +1,20 @@
From Rich Felker.
Fixed upstream in:
https://git.kernel.org/pub/scm/utils/mdadm/mdadm.git/commit/policy.c?id=cd72f9d114da206baa01fd56ff2d8ffcc08f3239
diff --git a/policy.c b/policy.c
index c0d18a7e..78ad34cd 100644
--- a/policy.c
+++ b/policy.c
@@ -214,8 +214,9 @@ static char *disk_path(struct mdinfo *disk)
continue;
if (stb.st_rdev != makedev(disk->disk.major, disk->disk.minor))
continue;
+ char *result = xstrdup(ent->d_name);
closedir(by_path);
- return xstrdup(ent->d_name);
+ return result;
}
closedir(by_path);
}

View File

@ -0,0 +1,10 @@
--- a/mdadm.h
+++ b/mdadm.h
@@ -34,6 +34,7 @@
#endif
#include <sys/types.h>
+#include <sys/sysmacros.h>
#include <sys/stat.h>
#include <stdint.h>
#include <stdlib.h>

View File

@ -0,0 +1,48 @@
#!/sbin/openrc-run
# script to start raid devices described in /etc/mdadm.conf.
depend() {
before checkfs fsck swap
after modules
}
array_devices() {
awk '/^ARRAY/ {print $2}' /etc/mdadm.conf
}
start() {
[ -f /etc/mdadm.conf ] || return 0
# start all devices that are not already started
[ -f /proc/mdstat ] || modprobe md > /dev/null 2>&1
local tostart=
for i in $(array_devices); do
[ -b "$i" ] && continue
tostart="$tostart $i"
done
[ -z "$tostart" ] && return 0
ebegin "Starting RAID devices"
mdadm --assemble --scan --quiet $tostart
eend $?
}
is_mounted_as() {
local mnt
for mnt in $(lsblk -o MOUNTPOINT $1); do
[ "$mnt" = "$2" ] && return 0
done
return 1
}
stop() {
# stop all raid devices except anything mounted as /
[ -f /etc/mdadm.conf ] || return 0
ebegin "Stopping RAID devices"
local tostop=
for i in $(array_devices); do
is_mounted_as $i / && continue
tostop="$tostop $i"
done
mdadm --stop --quiet $tostop
eend $?
}

5
wip/mdadm/mdadm.confd Normal file
View File

@ -0,0 +1,5 @@
# Misc options to pass to mdadm in monitor mode.
# For more info, run `mdadm --monitor --help` or see
# the mdadm(8) manpage.
OPTS="--syslog"

28
wip/mdadm/mdadm.initd Normal file
View File

@ -0,0 +1,28 @@
#!/sbin/openrc-run
# Sample init.d file for alpine linux.
NAME=mdadm
DAEMON=/sbin/$NAME
depend() {
use logger dns net
after firewall
}
start() {
ebegin "Starting ${NAME}"
start-stop-daemon --start --quiet --background \
--exec ${DAEMON} -- \
--monitor --scan \
--daemonise ${OPTS}
eend $?
}
stop() {
ebegin "Stopping ${NAME}"
start-stop-daemon --stop --quiet \
--exec ${DAEMON}
eend $?
}

13
wip/mdadm/no-werror.patch Normal file
View File

@ -0,0 +1,13 @@
diff --git a/Makefile b/Makefile
index 5fd7f16..5095a42 100644
--- a/Makefile
+++ b/Makefile
@@ -43,7 +43,7 @@ KLIBC_GCC = gcc -nostdinc -iwithprefix include -I$(KLIBC)/klibc/include -I$(KLIB
CC ?= $(CROSS_COMPILE)gcc
CXFLAGS ?= -ggdb
-CWFLAGS = -Wall -Werror -Wstrict-prototypes -Wextra -Wno-unused-parameter
+CWFLAGS = -Wall -Wstrict-prototypes -Wextra -Wno-unused-parameter
ifdef WARN_UNUSED
CWFLAGS += -Wp,-D_FORTIFY_SOURCE=2 -O3
endif

26
wip/metasploit/Makefile Normal file
View File

@ -0,0 +1,26 @@
name = metasploit-omnibus
version = 6.0.40
release = 0
URL = https://github.com/rapid7/metasploit-omnibus/archive/refs/tags/$(version).tar.gz
dependencies = ruby rubygems libpcap-devel postgresql-dev
build-dependencies = git ruby-bundler bison flex autoconf automake
#MAKE_INSTALL_OPTIONS_USER = prefix=$(PREFIX)
configure_backend = configure_custom
build_backend =
SYSCONF ?= ../../
include $(SYSCONF)/package.mk
## TODO: remove this somehow, metasploit installer sucks.
#pre_configure:
# sudo mkdir -p /var/cache/omnibus
# sudo mkdir -p /opt/metasploit-framework
# sudo chown `whoami` /var/cache/omnibus
# sudo chown `whoami` /opt/metasploit-framework
configure_custom:
cd $(bdir) && bundle binstubs --all

42
wip/mksh/APKBUILD Normal file
View File

@ -0,0 +1,42 @@
# Contributor: Eivind Uggedal <eu@eju.no>
# Maintainer: Sören Tempel <soeren+alpinelinux@soeren-tempel.net>
pkgname=mksh
pkgver=59c
_pkgver=R$pkgver
pkgrel=2
pkgdesc="MirBSD KSH Shell"
url="https://www.mirbsd.org/mksh"
arch="all"
license="MirOS AND Unicode-DFS-2016"
checkdepends="perl"
install="$pkgname.post-install $pkgname.post-upgrade $pkgname.pre-deinstall"
subpackages="$pkgname-doc"
source="https://www.mirbsd.org/MirOS/dist/mir/mksh/mksh-$_pkgver.tgz"
builddir="$srcdir/$pkgname"
prepare() {
default_prepare
# This test case checks if a controlling tty is not present when
# '-C regress:no-ctty' has been passed. However, a controlling
# tty might be present when building this APKBUILD locally but
# isn't present on the builder. To make sure the tests pass both
# locally and on the builders we remove this test case.
sed -i "$builddir"/check.t -e '/^name: selftest-tty-absent$/,/^---$/d'
}
build() {
sh Build.sh -r
}
check() {
./test.sh -v -f -C regress:no-ctty
}
package() {
install -Dm755 mksh "$pkgdir"/bin/mksh
install -Dm644 dot.mkshrc "$pkgdir"/etc/skel/.mkshrc
install -Dm644 mksh.1 "$pkgdir"/usr/share/man/man1/mksh.1
}
sha512sums="f56b6956f9e1dd88ddce2294301a5eb698050d9d4f49286fdcd8f9df8554eabbcc71d37e2bf3eb7234e3968a17231cc6de8aa7efbf17768834a90b14e8cdf340 mksh-R59c.tgz"

34
wip/mksh/Makefile Normal file
View File

@ -0,0 +1,34 @@
name = mksh
version = 59c
URL = https://www.mirbsd.org/MirOS/dist/mir/mksh/mksh-R$(version).tgz
dependencies =
build-dependencies =
pkg_build_dir = $(pkg_build_par_dir)/mksh
# This test case checks if a controlling tty is not present when
# '-C regress:no-ctty' has been passed. However, a controlling
# tty might be present when building this APKBUILD locally but
# isn't present on the builder. To make sure the tests pass both
# locally and on the builders we remove this test case.
pre_build:
$(Q)sed -i $(bdir)/check.t -e '/^name: selftest-tty-absent$/,/^---$/d'
# Static build.
LDSTATIC=-static
export LDSTATIC
build_backend = build_custom
build_custom:
@echo "$(bdir) $$ sh Build.sh -r"
$(Q)cd $(bdir); sh Build.sh -r $(log_it)
fake_root_install_backend = fake_root_install_custom
fake_root_install_custom:
$(Q)cd $(bdir); install -Dm755 mksh "$(pkg_fake_root_dir)"/$(PREFIX)/mksh
$(Q)cd $(bdir); install -Dm644 dot.mkshrc "$(pkg_fake_root_dir)"/etc/skel/.mkshrc
$(Q)cd $(bdir); install -Dm644 mksh.1 "$(pkg_fake_root_dir)"/$(MANDIR)/man1/mksh.1
SYSCONF ?= ../../
include $(SYSCONF)/package.mk

BIN
wip/mksh/mksh-59c-r2.apk Normal file

Binary file not shown.

View File

@ -0,0 +1,3 @@
#!/bin/sh
add-shell '/bin/mksh'
exit 0

1
wip/mksh/mksh.post-upgrade Symbolic link
View File

@ -0,0 +1 @@
mksh.post-install

View File

@ -0,0 +1,3 @@
#!/bin/sh
remove-shell '/bin/mksh'
exit 0

33
wip/mtools/APKBUILD Normal file
View File

@ -0,0 +1,33 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=mtools
pkgver=4.0.26
pkgrel=0
pkgdesc="collection of utilities to access MS-DOS disks from Unix without mounting them"
url="https://www.gnu.org/software/mtools/"
arch="all"
license="GPL-3.0-or-later"
makedepends="texinfo linux-headers"
source="https://ftp.gnu.org/gnu/mtools/mtools-$pkgver.tar.bz2"
subpackages="$pkgname-doc"
build() {
./configure \
--build=$CBUILD \
--host=$CHOST \
--prefix=/usr \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
--sysconfdir=/etc/mtools \
--without-x
make
}
check() {
make check
}
package() {
make -j1 install DESTDIR="$pkgdir"
}
sha512sums="32303ea16314ca00f33aee103451958f13c71ab1f3975e9a1dd9236c8e775286985ee776c38c64a1f8f5f8d0a66cbf84643182913e4e2c2dcaff384a9acd8633 mtools-4.0.26.tar.bz2"

44
wip/sed/APKBUILD Normal file
View File

@ -0,0 +1,44 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=sed
pkgver=4.8
pkgrel=0
subpackages="$pkgname-doc"
pkgdesc="GNU stream editor"
url="https://www.gnu.org/software/sed"
arch="all"
license="GPL-3.0-or-later"
makedepends="perl"
checkdepends="diffutils"
install="$pkgname.post-deinstall"
# GNU's master site seems to be down. use a mirror for now
#source="https://ftp.gnu.org/pub/gnu/$pkgname/$pkgname-$pkgver.tar.xz
source="https://ftp.heanet.ie/mirrors/ftp.gnu.org/gnu/sed/sed-$pkgver.tar.xz
"
# testsuite fails because busybox provides a /usr/bin/timeout
options="!check"
build() {
./configure \
--build=$CBUILD \
--host=$CHOST \
--prefix=/usr \
--bindir=/bin \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
--disable-i18n \
--disable-nls
make
}
check() {
make check
}
package() {
make DESTDIR="$pkgdir" install
rm -rf "$pkgdir"/usr/lib/charset.alias || true
rmdir -p "$pkgdir"/usr/lib 2>/dev/null || true
}
sha512sums="7de25d9bc2981c63321c2223f3fbcab61d7b0df4fcf7d4394b72400b91993e1288d8bf53948ed5fffcf5a98c75265726a68ad4fb98e1d571bf768603a108c1c8 sed-4.8.tar.xz"

View File

@ -0,0 +1,6 @@
#!/bin/sh
# we cannot rely on the busybox trigger since sed might be used from install
# scripts
[ -x /bin/busybox ] && exec /bin/busybox --install -s

View File

@ -0,0 +1,36 @@
From: Lukas Schwaighofer <lukas@schwaighofer.name>
Date: Tue, 26 Feb 2019 23:13:58 +0100
Subject: Prevent optimizing the pow() function
With the current GCC 8.2.0 from Debian, a section of code calling pow() in
zzjson_parse.c is turned into a sequence calling exp(). Since no exp()
implementation is available in syslinux those optimizations need to be
disabled.
---
com32/gpllib/zzjson/zzjson_parse.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/com32/gpllib/zzjson/zzjson_parse.c b/com32/gpllib/zzjson/zzjson_parse.c
index ecb6f61..e66a9d8 100644
--- a/com32/gpllib/zzjson/zzjson_parse.c
+++ b/com32/gpllib/zzjson/zzjson_parse.c
@@ -138,6 +138,10 @@ static ZZJSON *parse_string2(ZZJSON_CONFIG *config) {
return zzjson;
}
+static double __attribute__((optimize("O0"))) pow_noopt(double x, double y) {
+ return pow(x, y);
+}
+
static ZZJSON *parse_number(ZZJSON_CONFIG *config) {
ZZJSON *zzjson;
unsigned long long ival = 0, expo = 0;
@@ -213,7 +217,7 @@ skipexpo:
if (dbl) {
dval = sign * (long long) ival;
dval += sign * frac;
- dval *= pow(10.0, (double) signexpo * expo);
+ dval *= pow_noopt(10.0, (double) signexpo * expo);
}
zzjson = config->calloc(1, sizeof(ZZJSON));

53
wip/syslinux/APKBUILD Normal file
View File

@ -0,0 +1,53 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=syslinux
pkgver=6.04_pre1
pkgrel=8
_ver=${pkgver/_/-}
pkgdesc="Boot loader for the Linux operating system"
url="https://syslinux.org"
arch="x86 x86_64"
license="GPL-2.0-or-later"
makedepends="linux-headers nasm perl util-linux-dev gnu-efi-dev"
depends="mtools blkid mkinitfs"
triggers="syslinux.trigger=/boot"
install="syslinux.post-upgrade"
options="textrels"
ldpath="/usr/share/syslinux"
subpackages="$pkgname-doc $pkgname-dev"
source="https://www.kernel.org/pub/linux/utils/boot/syslinux/Testing/${pkgver%_pre*}/syslinux-$_ver.tar.xz
update-extlinux.conf
update-extlinux
0018-prevent-pow-optimization.patch
fix-sysmacros.patch
gcc-10.patch
"
case "$CARCH" in
x86) _loaderarch=efi32;;
x86_64) _loaderarch=efi64;;
esac
builddir="$srcdir"/$pkgname-$_ver
build() {
unset LDFLAGS
make $_loaderarch installer
}
package() {
make -j1 INSTALLROOT="$pkgdir" MANDIR=/usr/share/man \
bios $_loaderarch install
mkdir -p "$pkgdir"/etc/update-extlinux.d
cp "$srcdir"/update-extlinux.conf "$pkgdir"/etc/
sed "/^version=/s/=.*/=$pkgver-r$pkgrel/" "$srcdir"/update-extlinux \
> "$pkgdir"/sbin/update-extlinux
chmod 755 "$pkgdir"/sbin/update-extlinux
}
sha512sums="7927dd39be8e2dcf4138a6fea33def67d19d938379d694f15b48fdd2f5924c028b7a9e7bd71d0c7c6630c203e9e2a54296628e530632ad5e6f55b1ebefe8fc98 syslinux-6.04-pre1.tar.xz
9d2b82c91525de584daad6b0c0e2df5d13092c47e91a812e26405f5ff78d4587a8ae7f7a8590124687307f83efb15f686e4090193adc7b4e3601a4200f9283cd update-extlinux.conf
8a46d4c601bd6a1e1308138af73792ef6eda9a1eac1cbcd13af27cf31ecf2960a130b22ad3439c4d5df3c5fd9dc934900b29e449ea958d1496b331885a7f5af6 update-extlinux
92fa48133ef702092d7acafae0e0e20f9355cd2b5fe199b96fcccba5a1e688c360de4d069391815255f5493228ad03998d20b99748323396d20d12a1f27c60cd 0018-prevent-pow-optimization.patch
6fb63b50a6c746445a58badc81cbf8525f38e2a7868b97ac21aa9d20c162f2318fab6c25505614700033a840aa5c06c3cef3065f11b5b5f4e514474194ff4b54 fix-sysmacros.patch
62a45f94107300b05a93be18a228c15ae9ce90addeee39a1ef35845077b493e72ebed35791bf8db21c406c379a83220cc4db4e1919c01fcd387ae10b2cfc8861 gcc-10.patch"

1
wip/syslinux/FIXME Normal file
View File

@ -0,0 +1 @@
For now, some applications are installed in /usr/bin.

50
wip/syslinux/Makefile Normal file
View File

@ -0,0 +1,50 @@
name = syslinux
#version = 6.03
#URL = https://mirrors.edge.kernel.org/pub/linux/utils/boot/syslinux/$(name)-$(version).tar.gz
version_abbr = 6.04
version = $(version_abbr)-pre1
URL = https://mirrors.edge.kernel.org/pub/linux/utils/boot/syslinux/Testing/$(version_abbr)/syslinux-$(version).tar.xz
patches != ls *.patch
dependencies = util-linux
build-dependencies = nasm linux-dev util-linux-dev
loaderarch_ = efi64
ifeq ($(ARCH),x86)
loaderarch_ = efi32
endif
loaderarch ?= $(loaderarch_)
build_backend = build_custom
build_custom:
$(Q)cd $(bdir); LDFLAGS= make $(loaderarch) installer
MAKE_INSTALL_OPTIONS_USER = -j1 \
INSTALLROOT="$(pkg_fake_root_dir)" \
DATADIR=$(PREFIX) \
BINDIR=$(BINDIR) \
SBINDIR=$(SBINDIR) \
LIBDIR=$(LIBDIR) \
INCDIR=$(INCLUDEDIR) \
MANDIR=$(MANDIR) \
TFTPBOOT=$(PREFIX)/tftpboot \
bios $(loaderarch)
post_fake_root_install:
mkdir -p "$(pkg_fake_root_dir)"/etc/update-extlinux.d
cp update-extlinux.conf "$(pkg_fake_root_dir)"/etc/
sed "/^version=/s/=.*/=$(version)-r$(release)/" update-extlinux \
> "$(pkg_fake_root_dir)"/sbin/update-extlinux
chmod 755 "$(pkg_fake_root_dir)"/sbin/update-extlinux
#build_custom:
# cd $(bdir) ; \
# (echo '#include <sys/sysmacros.h>'; cat extlinux/main.c) > main.c.new && \
# mv main.c.new extlinux/main.c ; \
# make efi32 efi64 bios installer
#MAKE_INSTALL_OPTIONS_USER = INSTALLROOT="$(pkg_fake_root_dir)" EXTLINUXDIR=/boot/extlinux
SYSCONF ?= ../../
include $(SYSCONF)/package.mk

View File

@ -0,0 +1,12 @@
diff --git a/extlinux/main.c b/extlinux/main.c
index a7ebd49..69bb164 100644
--- a/extlinux/main.c
+++ b/extlinux/main.c
@@ -41,6 +41,7 @@
#include <sys/types.h>
#include <sys/mount.h>
#include <sys/vfs.h>
+#include <sys/sysmacros.h>
#include "linuxioctl.h"

109
wip/syslinux/gcc-10.patch Normal file
View File

@ -0,0 +1,109 @@
From 951928f2cad5682c2844e6bd0f7201236c5d9b66 Mon Sep 17 00:00:00 2001
From: Merlin Mathesius <mmathesi@redhat.com>
Date: Wed, 13 May 2020 08:02:27 -0500
Subject: [PATCH] Workaround multiple definition of symbol errors
---
com32/cmenu/Makefile | 2 +-
com32/elflink/ldlinux/Makefile | 2 +-
com32/gpllib/Makefile | 2 +-
com32/hdt/Makefile | 2 +-
core/Makefile | 2 +-
dos/Makefile | 2 +-
efi/Makefile | 2 +-
7 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/com32/cmenu/Makefile b/com32/cmenu/Makefile
index b81b68ed..2ae989c4 100644
--- a/com32/cmenu/Makefile
+++ b/com32/cmenu/Makefile
@@ -49,7 +49,7 @@ makeoutputdirs:
@mkdir -p $(OBJ)/libmenu
libmenu/libmenu.elf: $(LIBMENU)
- $(LD) -shared $(LDFLAGS) -soname $(patsubst %.elf,%.c32,$(@F)) \
+ $(LD) -shared $(LDFLAGS) -z muldefs -soname $(patsubst %.elf,%.c32,$(@F)) \
-o $@ $^
tidy dist:
diff --git a/com32/elflink/ldlinux/Makefile b/com32/elflink/ldlinux/Makefile
index 87c0d362..2be2a01a 100644
--- a/com32/elflink/ldlinux/Makefile
+++ b/com32/elflink/ldlinux/Makefile
@@ -33,7 +33,7 @@ endif
all: $(BTARGET) ldlinux_lnx.a
ldlinux.elf : $(OBJS)
- $(LD) $(LDFLAGS) -soname $(SONAME) -o $@ $^ $(LIBS)
+ $(LD) $(LDFLAGS) -z muldefs -soname $(SONAME) -o $@ $^ $(LIBS)
LNXCFLAGS += -D__export='__attribute__((visibility("default")))'
LNXLIBOBJS = get_key.lo
diff --git a/com32/gpllib/Makefile b/com32/gpllib/Makefile
index 1fec9145..2d764d0b 100644
--- a/com32/gpllib/Makefile
+++ b/com32/gpllib/Makefile
@@ -24,7 +24,7 @@ makeoutputdirs:
$(addprefix $(OBJ),$(sort $(dir $(LIBOBJS)))),$(b))
libgpl.elf : $(LIBOBJS)
- $(LD) -shared $(LDFLAGS) -soname $(patsubst %.elf,%.c32,$(@F)) -o $@ $^
+ $(LD) -shared $(LDFLAGS) -z muldefs -soname $(patsubst %.elf,%.c32,$(@F)) -o $@ $^
tidy dist clean:
find . \( -name \*.o -o -name .\*.d -o -name \*.tmp \) -print0 | \
diff --git a/com32/hdt/Makefile b/com32/hdt/Makefile
index 61736d05..1d947857 100644
--- a/com32/hdt/Makefile
+++ b/com32/hdt/Makefile
@@ -52,7 +52,7 @@ QEMU ?= qemu-kvm
all: $(MODULES) $(TESTFILES)
hdt.elf : $(OBJS) $(LIBS) $(C_LIBS)
- $(LD) $(LDFLAGS) -o $@ $^
+ $(LD) $(LDFLAGS) -z muldefs -o $@ $^
memtest:
-[ ! -f $(FLOPPY_DIR)/$(MEMTEST) ] && $(WGET) $(MEMTEST_URL) -O $(FLOPPY_DIR)/$(MEMTEST)
diff --git a/core/Makefile b/core/Makefile
index 46cb037c..f0cfcbe9 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -156,7 +156,7 @@ LDSCRIPT = $(SRC)/$(ARCH)/syslinux.ld
NASM_ELF = elf
%.elf: %.o $(LIBDEP) $(LDSCRIPT) $(AUXLIBS)
- $(LD) $(LDFLAGS) -pie -Bsymbolic \
+ $(LD) $(LDFLAGS) -z muldefs -pie -Bsymbolic \
-T $(LDSCRIPT) \
--unresolved-symbols=report-all \
-E --hash-style=gnu -M -o $@ $< \
diff --git a/dos/Makefile b/dos/Makefile
index 4c930d19..5d1c72ca 100644
--- a/dos/Makefile
+++ b/dos/Makefile
@@ -19,7 +19,7 @@ include $(MAKEDIR)/embedded.mk
CFLAGS += -D__MSDOS__ -mregparm=3 -DREGPARM=3
# CFLAGS += -DDEBUG
-LDFLAGS = -T $(SRC)/dosexe.ld
+LDFLAGS = -T $(SRC)/dosexe.ld -z muldefs
OPTFLAGS = -g
INCLUDES = -include code16.h -nostdinc -iwithprefix include \
-I$(SRC) -I$(SRC)/.. -I$(SRC)/../libfat \
diff --git a/efi/Makefile b/efi/Makefile
index bbf23f24..3dd922d5 100644
--- a/efi/Makefile
+++ b/efi/Makefile
@@ -69,7 +69,7 @@ $(OBJS): | $(OBJ)/$(ARCH)
BTARGET = syslinux.efi
syslinux.so: $(OBJS) $(CORE_OBJS) $(LIB_OBJS)
- $(LD) $(LDFLAGS) --strip-debug -o $@ $^ -lgnuefi -lefi
+ $(LD) $(LDFLAGS) -z muldefs --strip-debug -o $@ $^ -lgnuefi -lefi
# We need to rename the .hash section because the EFI firmware
# linker really doesn't like it.
--
2.25.1

View File

@ -0,0 +1,61 @@
#!/bin/sh
# find given append opt
get_append_opt() {
awk -v search="$1" '
$1 == "append" || $1 == "APPEND" {
split($0, a);
for (i in a) {
if (index(a[i], search) == 1) {
print a[i];
}
}
}' /boot/extlinux.conf | sort | uniq
}
# print default kernel options
get_default_opts() {
awk '
$1 == "append" || $1 == "APPEND" {
opts="";
space="";
split($0, a);
for (i in a) {
if (i != 1 \
&& (index(a[i], "root=") != 1) \
&& (index(a[i], "initrd=") != 1) \
&& (index(a[i], "modules=") != 1)) {
opts = opts space a[i];
space = " ";
}
}
print opts;
}
' /boot/extlinux.conf | sort | uniq
}
if ! [ -f /boot/extlinux.conf ]; then
exit 0
fi
# check if we already have a generated extlinux.conf
if grep -q '^# Generated by update-extlinux' /boot/extlinux.conf; then
exit 0
fi
# try fish out the kernel opts from extlinuix.conf's append line
root=$(get_append_opt 'root=' | head -n 1)
modules=$(get_append_opt 'modules=' | head -n 1)
opts=$(get_default_opts | head -n 1)
# populate update-extlinux.conf with the info we know
if [ -n "$root" ]; then
sed -i -e "/^root=/s|.*|$root|g" /etc/update-extlinux.conf
fi
if [ -n "$modules" ]; then
sed -i -e "/^modules=/s|.*|$modules|g" /etc/update-extlinux.conf
fi
if [ -n "$opts" ]; then
sed -i -e "/^default_kernel_opts=/s|.*|default_kernel_opts=\"$opts\"|g" /etc/update-extlinux.conf
fi

View File

@ -0,0 +1,3 @@
#!/bin/sh
update-extlinux --warn-only

262
wip/syslinux/update-extlinux Executable file
View File

@ -0,0 +1,262 @@
#!/bin/sh
version=
default=0
timeout=5
verbose=0
conf=/boot/extlinux.conf
myconf=/etc/update-extlinux.conf
# read in extlinux settings
if [ -f "$myconf" ]; then
. $myconf
fi
everbose() {
if [ "$verbose" = "0" ]; then
return
fi
echo $*
}
ewarn() {
echo "WARNING:" $@ >&2
}
eerror() {
echo "ERROR:" $@ >&2
return 1
}
usage() {
echo "usage: $0 [-v|--verbose] [--warn-only]"
}
while [ $# -gt 0 ]; do
opt="$1"
shift
case "$opt" in
-v|--verbose)
verbose=1
;;
--warn-only)
warn_only=1
;;
--)
break
;;
-*)
usage
exit 1
;;
esac
done
everbose "Updating extlinux configuration."
if [ "x$root" = "x" ]; then
ewarn "Root device is not specified in $myconf."
blkid_export=$(blkid -o export /dev/root)
if [ -n "$blkid_export" ]; then
export $blkid_export
fi
if [ -z "$UUID" ]; then
# try parse /proc/mount for mounted /
dev=$(awk '$2 == "/" {dev=$1} END {print dev}' /proc/mounts)
if [ -n "$dev" ]; then
blkid_export=$(blkid -o export $dev)
if [ -n "$blkid_export" ]; then
export "$blkid_export"
fi
fi
fi
if [ -z "$UUID" ]; then
if [ -z "$dev" ]; then
if [ -n "$warn_only" ]; then
ewarn "Failed to detect root device. extlinux.conf is not updated"
exit 0
else
eerror "Failed to detect root device"
exit 1
fi
else
root=$dev
fi
else
root=UUID=$UUID
fi
everbose "Root device is: $root"
fi
rtimeout=$(( ${timeout} * 10 ))
syslinux_menu=menu.c32
menu_hidden=
# vesa menu has been requested?
if [ "$vesa_menu" = "1" ]; then
syslinux_menu=vesamenu.c32
fi
umask 0022
rm -f $conf.new
echo "# Generated by update-extlinux $version" > $conf.new
if [ -n "$serial_port" ]; then
echo "SERIAL $serial_port ${serial_baud:-115200}" >> $conf.new
fi
echo "DEFAULT $syslinux_menu" >> $conf.new
echo "PROMPT 0" >> $conf.new
echo "MENU TITLE Alpine/$(uname -s) Boot Menu" >> $conf.new
if [ "$hidden" = "1" ]; then
echo "MENU HIDDEN" >> $conf.new
fi
echo "MENU AUTOBOOT Alpine will be booted automatically in # seconds." >> $conf.new
echo "TIMEOUT $rtimeout" >> $conf.new
lst=0
if [ -f "/boot/xen.gz" ]; then
for kernel in $(find /boot -name "vmlinuz-*" -type f); do
tag=$(basename $kernel | cut -b9-)
everbose "Found Xen hypervisor: /boot/xen.gz, kernel: $kernel"
if [ -f "/boot/initramfs-$tag" ]; then
everbose "Found initramfs: /boot/initramfs-$tag"
initramfs="initramfs-$tag"
else
initramfs=
fi
label=xen-$(grep -w -l $tag /usr/share/kernel/*/kernel.release \
| cut -d/ -f5)
if [ "$label" = "xen-" ]; then
label=xen-$lst
fi
echo "LABEL $label" >> $conf.new
if [ "$label" = "$default" ]; then
echo " MENU DEFAULT" >> $conf.new
fi
echo " MENU LABEL Xen + Linux $tag" >> $conf.new
echo " COM32 mboot.c32" >> $conf.new
echo " APPEND xen.gz $xen_opts --- $(basename $kernel) root=$root modules=${modules}${TYPE:+,$TYPE} $default_kernel_opts --- $initramfs" >> $conf.new
echo "" >> $conf.new
lst=$(($lst + 1))
done
fi
for kernel in $(find /boot -name "vmlinuz*" -type f); do
case $kernel in
*vmlinuz) tag=vanilla;;
*vmlinuz-*) tag=$(basename $kernel | cut -b9-);;
*) continue;;
esac
everbose "Found kernel: $kernel"
label=$(grep -w -l $tag /usr/share/kernel/*/kernel.release | cut -d/ -f5)
if [ -z "$label" ]; then
if [ "$tag" = vanilla ]; then
label="vanilla"
else
label=$lst
fi
fi
echo "LABEL $label" >> $conf.new
if [ "$label" = "$default" ]; then
echo " MENU DEFAULT" >> $conf.new
fi
echo " MENU LABEL Linux $tag" >> $conf.new
echo " LINUX $(basename $kernel)" >> $conf.new
initrd=
if [ -f "/boot/initramfs-$tag" ]; then
everbose "Found initramfs: /boot/initramfs-$tag"
initrd="initramfs-$tag"
fi
if [ -f "/boot/amd-ucode.img" ]; then
everbose "Found microcode for AMD CPUs: /boot/amd-ucode.img"
initrd="amd-ucode.img${initrd:+,}${initrd}"
fi
if [ -f "/boot/intel-ucode.img" ]; then
everbose "Found microcode for Intel CPUs: /boot/intel-ucode.img"
initrd="intel-ucode.img${initrd:+,}${initrd}"
fi
echo " INITRD ${initrd}" >> $conf.new
echo " APPEND root=$root modules=${modules}${TYPE:+,$TYPE} $default_kernel_opts" >> $conf.new
echo "" >> $conf.new
lst=$(($lst + 1))
done
if [ -n "$password" ]; then
echo "NOESCAPE 1" >> $conf.new
echo "MENU MASTER PASSWD $password" >> $conf.new
echo "" >> $conf.new
chmod o-r $conf.new
fi
everbose "$lst entries found."
for entry in /etc/update-extlinux.d/*; do
[ -f "$entry" ] && { cat $entry; echo ""; } >> $conf.new
done
echo "MENU SEPARATOR" >> $conf.new
echo "" >> $conf.new
if [ -f "/boot/hdt.c32" ]; then
everbose "Found Hardware Detection Tool: /boot/hdt.c32"
echo "LABEL hdt" >> $conf.new
echo " MENU LABEL Hardware info" >> $conf.new
if [ -n "$password" ]; then
echo " MENU PASSWD" >> $conf.new
fi
echo " COM32 hdt.c32" >> $conf.new
if [ -f "/boot/memtest" ]; then
everbose "Found memtest86+: /boot/memtest"
echo " APPEND memtest=memtest" >> $conf.new
fi
echo "" >> $conf.new
elif [ -f "/boot/memtest" ]; then
everbose "Found memtest86+: /boot/memtest"
echo "LABEL memtest" >> $conf.new
echo " MENU LABEL Memtest86+" >> $conf.new
echo " KERNEL memtest" >> $conf.new
echo "" >> $conf.new
fi
for i in reboot poweroff; do
[ -f "/boot/$i.c32" ] || continue
everbose "Found $i"
# make first char capital
cap=$( echo $i | awk '{sub(".", substr(toupper($0),1,1), $0); print}' )
echo "LABEL $i" >> $conf.new
echo " MENU LABEL $cap" >> $conf.new
echo " COM32 $i.c32" >> $conf.new
echo "" >> $conf.new
done
if cmp -s $conf.new $conf; then
everbose "Configuration unchanged."
rm $conf.new
fi
if [ "$overwrite" != "1" ]; then
exit 0
elif [ -f "$conf.new" ]; then
# keep a backup just in case
if [ -f "$conf" ]; then
mv $conf $conf.old
fi
mv $conf.new $conf
fi
everbose "Installing libutil.c32 libcom32.c32 mboot.c32 menu.c32 vesamenu.c32 to /boot."
cp /usr/share/syslinux/libutil.c32 \
/usr/share/syslinux/libcom32.c32 \
/usr/share/syslinux/mboot.c32 \
/usr/share/syslinux/menu.c32 \
/usr/share/syslinux/vesamenu.c32 \
/boot
case "$(stat -f -c '%T' /boot)" in
ext*) extlinux --update /boot || [ -n "$warn_only" ];;
esac

View File

@ -0,0 +1,74 @@
# configuration for extlinux config builder
# overwrite
# Overwrite current /boot/extlinux.conf. If this is not '1' we will only
# write to /boot/extlinux.conf.new
overwrite=1
# vesa_menu
# use fancy vesa menu (vesamenu.c32) menus, won't work with serial
vesa_menu=0
# default_kernel_opts
# default kernel options
default_kernel_opts=quiet
# modules
# modules which should be loaded before pivot_root
modules=sd-mod,usb-storage,ext4
# root
# root device - if not specified, will be guessed using
# blkid -o export /dev/root
root=
# verbose
# if set to non-zero, update-extlinux will be a lot more verbose.
verbose=0
# hidden
# if set to non-zero, the boot menu will be hidden by default.
hidden=1
# timeout
# number of seconds to wait before booting default
timeout=3
# default
# default kernel to boot
default=lts
# serial_port
# serial port number - if not specified, serial console will be disabled
serial_port=
# serial_baud
# the baudrate for the serial port. Will use 115200 if unset
serial_baud=115200
# xen_opts
# options to hand to xen hypervisor, useful ones are:
# dom0_mem=384M (give domain-0 environment 384M ram)
xen_opts=dom0_mem=384M
# if you copy /usr/share/syslinux/reboot.c32 to /boot/, a menu entry
# will be auto-generated for it
# if you copy hdt.c32, libgpl.c32, and libmenu.c32 from /usr/share/syslinux/
# to /boot/, a menu entry will be auto-generated for HDT
# if you download and install /boot/memtest, then if HDT is present it
# will use it, else a separate menu entry will be auto-generated for
# memtest
# optional password
# you can generate a SHA512 password using: mkpasswd
#
# if you assign a password, you should make this file world-unreadable
#
# if a password is assigned, the menu entries can't be edited at boot
# time, and HDT if present is password-protected
#
# you can also include "MENU PASSWD" in any custom entries you have in
# /etc/update-extlinux.d/
password=''

178
wip/syslog-ng/APKBUILD Normal file
View File

@ -0,0 +1,178 @@
# Contributor: Michael Pirogov <vbnet.ru@gmail.com>
# Contributor: jv <jens@eisfair.org>
# Contributor: Adrian Guenter <adrian@gntr.me>
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: jv <jens@eisfair.org>
pkgname=syslog-ng
pkgver=3.30.1
pkgrel=0
pkgdesc="Next generation logging daemon"
url="https://www.syslog-ng.com/products/open-source-log-management/"
arch="all"
license="GPL-2.0-or-later"
options="!check" # unit tests require https://github.com/Snaipe/Criterion with deps
makedepends="
curl-dev
eventlog-dev
file
bison
flex
autoconf
automake
libtool
glib-dev
hiredis-dev
ivykis-dev>=0.42.4
libdbi-dev
json-c-dev
openssl-dev
pcre-dev
python3-dev
rabbitmq-c-dev
"
install="$pkgname.post-install $pkgname.post-upgrade"
subpackages="
$pkgname-scl::noarch
$pkgname-dev
$pkgname-doc
$pkgname-openrc
py3-$pkgname:_python3
"
source="https://github.com/balabit/syslog-ng/releases/download/syslog-ng-$pkgver/syslog-ng-$pkgver.tar.gz
$pkgname.conf
$pkgname.logrotate
$pkgname.initd
"
_modules="
add-contextual-data
amqp:afamqp
examples
graphite
http
json:json-plugin
map-value-pairs
redis
sql:afsql
stardate
stomp:afstomp
tags-parser
xml
"
for _i in $_modules; do
subpackages="$subpackages $pkgname-${_i%%:*}:_module"
done
prepare() {
default_prepare
# Remove bundled libraries
rm -rf lib/ivykis
rm -rf modules/afamqp/rabbitmq-c
rm -rf modules/afmongodb/mongo-c-driver
autoreconf -if
}
build() {
./configure \
--prefix=/usr \
--sysconfdir=/etc/syslog-ng \
--localstatedir=/run \
--enable-extra-warnings \
--enable-ipv6 \
--enable-manpages \
\
--enable-sql \
--disable-linux-caps \
--disable-mongodb \
--enable-json \
--enable-amqp \
--enable-stomp \
--disable-smtp \
--enable-http \
--enable-redis \
--enable-geoip \
--disable-geoip2 \
--disable-riemann \
--disable-systemd \
--enable-python \
--disable-java \
--disable-java-modules \
--enable-native \
--enable-rdrand \
--with-ivykis=system \
--with-jsonc=system \
--with-librabbitmq-client=system
make
}
package() {
make -j1 DESTDIR="$pkgdir" install
cd "$pkgdir"
rm -rf run usr/lib/$pkgname/libtest
# getent module doesn't build properly as musl doesn't support reentrant
# getprotoby[number|name] funcs. The provided compat lib only patches
# solaris, which does provide reentrant versions under a different sig
rm -f usr/lib/$pkgname/libtfgetent.so
# Remove static file
rm -f usr/lib/libsyslog-ng-native-connector.a
install -m 644 "$srcdir"/$pkgname.conf etc/$pkgname/$pkgname.conf
install -D -m 755 "$srcdir"/$pkgname.initd etc/init.d/$pkgname
install -D -m 644 "$srcdir"/$pkgname.logrotate etc/logrotate.d/$pkgname
install -d -m 755 etc/$pkgname/conf.d
install -d -m 700 "$pkgdir"/var/lib/syslog-ng
}
scl() {
pkgdesc="$pkgdesc (configuration library)"
depends="$pkgname=$pkgver-r$pkgrel"
_submv usr/share/syslog-ng/include/scl
}
dev() {
default_dev
_submv usr/share/syslog-ng/tools \
usr/share/syslog-ng/xsd
}
_python3() {
pkgdesc="$pkgdesc (python3 module)"
_submv usr/lib/syslog-ng/libmod-python.so
local site_pkgs="$(python3 -c 'import site; print(site.getsitepackages()[0])')"
mkdir -p "$subpkgdir"/"$site_pkgs"
mv "$pkgdir"/usr/lib/syslog-ng/python/* \
"$subpkgdir"/"$site_pkgs"
}
_module() {
local name="${subpkgname#$pkgname-}"
pkgdesc="$pkgdesc (${name//-/ } module)"
local libname=$(printf '%s\n' $_modules | grep "^$name:" | cut -d: -f2)
local soname="lib${libname:-$name}.so"
_submv usr/lib/syslog-ng/$soname
}
_submv() {
local path; for path in "$@"; do
mkdir -p "$subpkgdir/${path%/*}"
mv "$pkgdir"/$path "$subpkgdir"/${path%/*}/
done
}
sha512sums="ac7ed4978c6db9464add30aa7aeb71a646f841593b02884c8d4ad34c0508c8d3243bcbe6ee98e81c04698895305334eadd9e624ba71e510c14d79155723efb52 syslog-ng-3.30.1.tar.gz
3fcdf42da3bd6ac4352925c686d07958b37780cd58de8c3c73835a442ffec51a0488390611bac011239b4e94f42c216ca178ba4b1b498bc0105c06cbaf8252f4 syslog-ng.conf
1825b85fb584c5cecf0ad370e81a7473b5c973ce10adce386d1ba5f68432abe4e2f54c937d7d94edb22dbd9031eff483bd113bc3244ce0d0072cf4bf4ab5c2cc syslog-ng.logrotate
873fef8815131f0acc618fa4911cd1eda59e260adc1eaae6eb91034900ce789f05ee48fa8afa4a87763026c18c87aef351e7ea76e0cbb46bcd5297f9ca14d527 syslog-ng.initd"

View File

@ -0,0 +1,120 @@
@version:3.30
@include "scl.conf"
# syslog-ng configuration file.
#
# See syslog-ng(8) and syslog-ng.conf(5) for more information.
#
# Note: It also sources additional configuration files (*.conf)
# located in /etc/syslog-ng/conf.d/.
#
# Options
#
options {
# Create destination directories if missing.
create_dirs(yes);
# The default action of syslog-ng is to log a MARK line to the file every
# 20 minutes. That's seems high for most people so turn it down to once an
# hour. Set it to zero if you don't want the functionality at all.
mark_freq(3600);
# The default action of syslog-ng is to log a STATS line to the file every
# 10 minutes. That's pretty ugly after a while. Change it to every 12 hours
# so you get a nice daily update of how many messages syslog-ng missed (0).
stats_freq(43200);
# Time to wait before a died connection is re-established (default is 60).
time_reopen(5);
# Disable DNS usage.
# syslog-ng blocks on DNS queries, so enabling DNS may lead to a DoS attack.
use_dns(no);
dns-cache(no);
# Default owner, group, and permissions for log files.
owner(root);
group(adm);
perm(0640);
# Default permissions for created directories.
dir_perm(0755);
};
#
# Templates
#
template t_file {
template("${YEAR}-${MONTH}-${DAY} ${HOUR}:${MIN}:${SEC} ${LEVEL} ${MSGHDR}${MSG}\n");
};
#
# Sources
#
source s_sys {
# Standard system log source.
system();
# Messages generated by syslog-ng.
internal();
};
#
# Destinations
#
destination d_auth { file("/var/log/auth.log" template(t_file)); };
destination d_boot { file("/var/log/boot.log" template(t_file)); };
destination d_cron { file("/var/log/cron.log" template(t_file)); };
destination d_kern { file("/var/log/kern.log" template(t_file)); };
destination d_mail { file("/var/log/mail.log" template(t_file) flush_lines(10)); };
destination d_mesg { file("/var/log/messages" template(t_file)); };
# Send messages to console of everyone logged in.
destination d_cons_all { usertty("*"); };
# Send message to the root's console.
destination d_cons_root { usertty("root"); };
#
# Filters
#
filter f_auth { facility(auth, authpriv); };
filter f_boot { facility(local7); };
filter f_cron { facility(cron); };
filter f_emerg { level(emerg); };
filter f_kern { facility(kern); };
filter f_mail { facility(mail); };
filter f_default {
level(info..emerg)
and not (facility(auth)
or facility(authpriv)
or facility(cron)
or facility(kern)
or facility(mail));
};
#
# Logs
#
log { source(s_sys); filter(f_auth); destination(d_auth); };
log { source(s_sys); filter(f_boot); destination(d_boot); };
log { source(s_sys); filter(f_cron); destination(d_cron); };
log { source(s_sys); filter(f_emerg); destination(d_cons_root); };
log { source(s_sys); filter(f_kern); destination(d_kern); };
log { source(s_sys); filter(f_mail); destination(d_mail); };
log { source(s_sys); filter(f_default); destination(d_mesg); };
# Source additional configuration files (.conf extension only)
@include "/etc/syslog-ng/conf.d/*.conf"

View File

@ -0,0 +1,46 @@
#!/sbin/openrc-run
extra_commands="checkconfig"
extra_started_commands="reload"
description_checkconfig="Check the configuration file"
description_reload="Reload the configuration without exiting"
: ${cfgfile:="/etc/syslog-ng/$RC_SVCNAME.conf"}
: ${statedir:="/var/lib/syslog-ng"}
: ${control_file:="$statedir/$RC_SVCNAME.ctl"}
: ${persist_file:="$statedir/$RC_SVCNAME.persist"}
pidfile="/run/$RC_SVCNAME.pid"
command="/usr/sbin/syslog-ng"
command_args="
--cfgfile $cfgfile
--control $control_file
--persist-file $persist_file
--pidfile $pidfile
$command_args"
required_files="$cfgfile"
required_dirs="$statedir"
depend() {
use clock
need hostname localmount
before net
after bootmisc
provide logger
}
checkconfig() {
ebegin "Checking $RC_SVCNAME configuration"
syslog-ng -s -f "$cfgfile"
eend $? "Configuration error. Please fix your configfile ($cfgfile)"
}
reload() {
checkconfig || return 1
ebegin "Reloading configuration and re-opening log files"
start-stop-daemon --signal HUP --pidfile "$pidfile"
eend $?
}

View File

@ -0,0 +1,14 @@
/var/log/auth.log
/var/log/boot.log
/var/log/cron.log
/var/log/kern.log
/var/log/mail.log
/var/log/messages
{
notifempty
compress
sharedscripts
postrotate
/etc/init.d/syslog-ng --ifstarted reload >/dev/null
endscript
}

View File

@ -0,0 +1,6 @@
#!/bin/sh
[ -f /var/log/auth.log ] || touch /var/log/auth.log
[ -f /var/log/error.log ] || touch /var/log/error.log
[ -f /var/log/mail.log ] || touch /var/log/mail.log
[ -f /var/log/kern.log ] || touch /var/log/kern.log

View File

@ -0,0 +1,21 @@
#!/bin/sh
ver_new="$1"
ver_old="$2"
if [ "$(apk version -t "$ver_old" "3.18.1-r2")" = "<" ]; then
cat >&2 <<-EOF
*
* The following modules has been moved to separate packages:
* add-contextual-data, examples, graphite, map-value-pairs,
* python2, redis, stardate, stomp, tags-parser, xml, geoip,
* http.
* If you use one of these, install the relevant package(s), e.g.:
* apk add syslog-ng-redis
*
* Custom modularized configuration has been replaced with single
* syslog-ng.conf file that loads fragments from /etc/syslog-ng/conf.d
* using syslog-ng's include directive.
*
EOF
fi

37
wip/which/APKBUILD Normal file
View File

@ -0,0 +1,37 @@
# Contributor: Stuart Cardall <developer@it-offshore.co.uk>
# Maintainer: Stuart Cardall <developer@it-offshore.co.uk>
pkgname=which
pkgver=2.21
pkgrel=1
pkgdesc="A utility to show the full path of commands"
url="http://savannah.gnu.org/projects/which"
arch="all"
license="GPL-3.0"
depends=""
depends_dev=""
makedepends="$depends_dev"
install=""
subpackages="$pkgname-doc"
source="https://ftp.gnu.org/gnu/$pkgname/$pkgname-$pkgver.tar.gz"
builddir="$srcdir"/$pkgname-$pkgver
build() {
cd "$builddir"
./configure \
--build=$CBUILD \
--host=$CHOST \
--prefix=/usr
make
}
check() {
cd "$builddir"
make check
}
package() {
cd "$builddir"
make DESTDIR="$pkgdir" install
}
sha512sums="d2f04a5c5291f2d7d1226982da7cf999d36cfe24d3f7bda145508efcfb359511251d3c68b860c0ddcedd66b15a0587b648a35ab6d1f173707565305c506dfc61 which-2.21.tar.gz"

80
wip/zfs/APKBUILD Normal file
View File

@ -0,0 +1,80 @@
# Contributor: Carlo Landmeter <clandmeter@alpinelinux.org>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=zfs
pkgver=2.0.3
pkgrel=0
pkgdesc="ZFS for Linux"
url="https://zfsonlinux.org"
arch="all !armhf !armv7"
license="CDDL-1.0"
provides="spl" # Mitigate upgrade conflicts
depends_dev="attr-dev e2fsprogs-dev glib-dev libtirpc-dev openssl-dev util-linux-dev"
makedepends="$depends_dev automake autoconf libtool linux-headers python3-dev py3-cffi py3-setuptools"
options="!check" # need to be run on live system w/ ZFS loaded.
subpackages="$pkgname-dev $pkgname-doc $pkgname-openrc $pkgname-libs $pkgname-dracut::noarch
$pkgname-udev $pkgname-scripts $pkgname-utils-py:utils_py:noarch py3-pyzfs:pyzfs:noarch"
source="https://github.com/zfsonlinux/zfs/releases/download/zfs-$pkgver/zfs-$pkgver.tar.gz"
prepare() {
default_prepare
autoreconf -vif
}
build() {
export LIBS="$LIBS -lintl"
./configure --prefix=/usr \
--with-tirpc \
--sysconfdir=/etc \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
--localstatedir=/var \
--with-config=user \
--with-udevdir=/lib/udev \
--disable-systemd \
--disable-static \
--with-python=3 \
--enable-pyzfs
make
}
package() {
make DESTDIR="$pkgdir" install
rm -rf "$pkgdir"/usr/share/initramfs-tools
}
dracut() {
pkgdesc="$pkgdesc (dracut)"
mkdir -p "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/lib/dracut "$subpkgdir"/usr/lib
}
udev() {
pkgdesc="$pkgdesc (udev)"
mkdir -p "$subpkgdir"/lib
mv "$pkgdir"/lib/udev "$subpkgdir"/lib
}
scripts() {
pkgdesc="$pkgdesc (scripts)"
mkdir -p "$subpkgdir"/usr/share
mv "$pkgdir"/usr/share/zfs "$subpkgdir"/usr/share
}
utils_py() {
pkgdesc="$pkgdesc (python utils)"
depends="python3"
mkdir -p "$subpkgdir"/usr/bin
local file
for file in arc_summary arcstat dbufstat; do
mv "$pkgdir"/usr/bin/$file "$subpkgdir"/usr/bin
done
}
pyzfs() {
pkgdesc="$pkgdesc (Python lib to interact with ZFS)"
depends="python3 $pkgname"
mkdir -p "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/lib/python* "$subpkgdir"/usr/lib
}
sha512sums="8b2a6e0edfb3c85441076b2c6163ad3d7d239e11db128ab74d60bf8dc802d67b7f5b8d1cc7227316a7dc3917f14e9ac072ebf1583957f2a45c1b8438e4068200 zfs-2.0.3.tar.gz"

View File

@ -0,0 +1,36 @@
respect build environment settings
--- a/unix/configure Wed Jan 28 22:22:13 2009
+++ b/unix/configure Wed Jan 28 22:23:54 2009
@@ -18,7 +18,7 @@
CC=${1-cc}
CFLAGS=${2-"-I. -DUNIX"}
-LFLAGS1=''
+LFLAGS1="${LDFLAGS}"
LFLAGS2=''
LN="ln -s"
@@ -118,7 +118,7 @@
fi
# optimization flags
-if test -n "${CFLAGS_OPT}"; then
+if false; then
CFLAGS="${CFLAGS} ${CFLAGS_OPT}"
CFLAGS_BZ="${CFLAGS_BZ} ${CFLAGS_OPT}"
fi
@@ -220,13 +220,6 @@
echo Check for the C preprocessor
# on SVR4, cc -E does not produce correct assembler files. Need /lib/cpp.
CPP="${CC} -E"
-# solaris as(1) needs -P, maybe others as well ?
-[ -f /usr/ccs/lib/cpp ] && CPP="/usr/ccs/lib/cpp -P"
-[ -f /usr/lib/cpp ] && CPP=/usr/lib/cpp
-[ -f /lib/cpp ] && CPP=/lib/cpp
-[ -f /usr/bin/cpp ] && CPP=/usr/bin/cpp
-[ -f /xenix ] && CPP="${CC} -E"
-[ -f /lynx.os ] && CPP="${CC} -E"
echo "#include <stdio.h>" > conftest.c
$CPP conftest.c >/dev/null 2>/dev/null || CPP="${CC} -E"

View File

@ -0,0 +1,22 @@
add proper GNU stack markings so we dont get the default: executable
--- a/crc_i386.S Wed Jan 28 22:22:13 2009
+++ b/crc_i386.S Wed Jan 28 22:27:04 2009
@@ -302,3 +302,7 @@
#endif /* i386 || _i386 || _I386 || __i386 */
#endif /* !USE_ZLIB && !CRC_TABLE_ONLY */
+
+#if defined __ELF__ && defined __linux__
+.section .note.GNU-stack,"",@progbits
+#endif
--- a/match.S Wed Jan 28 22:22:13 2009
+++ b/match.S Wed Jan 28 22:27:04 2009
@@ -405,3 +405,7 @@
#endif /* i386 || _I386 || _i386 || __i386 */
#endif /* !USE_ZLIB */
+
+#if defined __ELF__ && defined __linux__
+.section .note.GNU-stack,"",@progbits
+#endif

View File

@ -0,0 +1,15 @@
if our toolchain generates PIC by default, then do not use the hand written
assembly files as none of it is PIC friendly.
--- a/unix/configure Wed Jan 28 22:23:54 2009
+++ b/unix/configure Wed Jan 28 22:29:51 2009
@@ -228,6 +228,9 @@
echo Check if we can use asm code
OBJA=""
OCRCU8=""
+piclib="$(echo | $CPP -dM $CFLAGS - | grep -i __pic__)"
+echo "Checking if compiler wants to create pic code"
+[ "$piclib" == "" ] && \
if eval "$CPP match.S > _match.s 2>/dev/null"; then
if test ! -s _match.s || grep error < _match.s > /dev/null; then
:

View File

@ -0,0 +1,15 @@
Fixes zipnote, see https://gitlab.alpinelinux.org/alpine/aports/issues/8602
diff --git a/zipnote.c b/zipnote.c
index 5e02cb6..996f012 100644
--- a/zipnote.c
+++ b/zipnote.c
@@ -661,7 +661,7 @@ char **argv; /* command line tokens */
if ((r = zipcopy(z)) != ZE_OK)
ziperr(r, "was copying an entry");
}
- fclose(x);
+ fclose(in_file);
/* Write central directory and end of central directory with new comments */
if ((c = zftello(y)) == (zoff_t)-1) /* get start of central */

37
wip/zip/APKBUILD Normal file
View File

@ -0,0 +1,37 @@
# Maintainer: Carlo Landmeter <clandmeter@alpinelinux.org>
pkgname=zip
pkgver=3.0
_pkgver=${pkgver%.*}${pkgver##*.}
pkgrel=9
pkgdesc="Creates PKZIP-compatible .zip files"
url="http://www.info-zip.org/pub/infozip/Zip.html"
arch="all"
options="!check" # No test suite.
license="Info-ZIP"
depends="unzip" #unzip is needed for `zip -T`
makedepends=""
subpackages="$pkgname-doc"
source="https://downloads.sourceforge.net/infozip/${pkgname}${_pkgver}.tar.gz
10-zip-3.0-build.patch
20-zip-3.0-exec-stack.patch
30-zip-3.0-pic.patch
40-fix-zipnote.patch"
builddir="$srcdir"/${pkgname}${_pkgver}
build() {
cd "$builddir"
make -f unix/Makefile LOCAL_ZIP="${CFLAGS} ${CPPFLAGS}" prefix=/usr generic
}
package() {
cd "$builddir"
make -f unix/Makefile prefix=${pkgdir}/usr MANDIR=${pkgdir}/usr/share/man/man1 install
install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}
sha512sums="c1c3d62bf1426476c0f9919b568013d6d7b03514912035f09ee283226d94c978791ad2af5310021e96c4c2bf320bfc9d0b8f4045c48e4667e034d98197e1a9b3 zip30.tar.gz
e71f7c6f6dd6f8f576018581b155f324eaf6810a2f7c5c402843bdfc3ce6772f09be166b33ff34dcb703774694b18584c8de1763f29895c1d563661679f43d71 10-zip-3.0-build.patch
2a6824066543684e02731bd36930e0ffa6ab48162c61d5e7af08e8ea0795401271ef28bdd0f6ace865d91fdb1a05b643813cdd458a9fdf554f1ca298ea7f50e3 20-zip-3.0-exec-stack.patch
fcb2d728d79160128064af90eb17a9c03e980d9619c4d930c4dbf79cb13842c7bb694036dcbf5cd9b412efc6fc0b86bb94a88b3f110b6b63bf6bda2b97fe0568 30-zip-3.0-pic.patch
f22649d1cbe94ffcacf622493400489393d6fac80067211e6ba12b85d7b062f76b041f318068731b267167e715b7749589bfe9205670a61c6e56e1ffdfaea29b 40-fix-zipnote.patch"