From 34ff79359b3d6bc768e3463a9b64cc328ceda631 Mon Sep 17 00:00:00 2001 From: Karchnu Date: Fri, 23 Apr 2021 19:43:58 +0200 Subject: [PATCH] Add fakeroot recipe. --- recipes/fakeroot/Makefile | 38 +++++++++++++++ recipes/fakeroot/fakeroot-no64.patch | 17 +++++++ .../fakeroot-skip-ipc-sanity-check.patch | 46 +++++++++++++++++++ recipes/fakeroot/fakeroot-stdint.patch | 34 ++++++++++++++ recipes/fakeroot/fix-shell-in-fakeroot.patch | 13 ++++++ recipes/fakeroot/xstatjunk.patch | 11 +++++ 6 files changed, 159 insertions(+) create mode 100644 recipes/fakeroot/Makefile create mode 100644 recipes/fakeroot/fakeroot-no64.patch create mode 100644 recipes/fakeroot/fakeroot-skip-ipc-sanity-check.patch create mode 100644 recipes/fakeroot/fakeroot-stdint.patch create mode 100644 recipes/fakeroot/fix-shell-in-fakeroot.patch create mode 100644 recipes/fakeroot/xstatjunk.patch diff --git a/recipes/fakeroot/Makefile b/recipes/fakeroot/Makefile new file mode 100644 index 0000000..161afa7 --- /dev/null +++ b/recipes/fakeroot/Makefile @@ -0,0 +1,38 @@ +name = fakeroot +version = 1.25.3 +release = 0 +URL = http://ftp.debian.org/debian/pool/main/f/fakeroot/fakeroot_$(version).orig.tar.gz +url = "https://packages.debian.org/fakeroot" +arch="all" +license="GPL-3.0-or-later" + +pkgdesc="Gives a fake root environment, useful for building packages as a non-privileged user" + +patches != ls *.patch + +dependencies = util-linux +build-dependencies = nasm linux-dev util-linux-dev + +makedepends_build = libtool autoconf automake po4a +makedepends_host = libcap-dev acl-dev linux-headers +makedepends = $(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 diff --git a/recipes/fakeroot/fakeroot-no64.patch b/recipes/fakeroot/fakeroot-no64.patch new file mode 100644 index 0000000..ff95f96 --- /dev/null +++ b/recipes/fakeroot/fakeroot-no64.patch @@ -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 + diff --git a/recipes/fakeroot/fakeroot-skip-ipc-sanity-check.patch b/recipes/fakeroot/fakeroot-skip-ipc-sanity-check.patch new file mode 100644 index 0000000..fc96c29 --- /dev/null +++ b/recipes/fakeroot/fakeroot-skip-ipc-sanity-check.patch @@ -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 +-#include +-#include +-#include +-#include +-#include +- +-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]), diff --git a/recipes/fakeroot/fakeroot-stdint.patch b/recipes/fakeroot/fakeroot-stdint.patch new file mode 100644 index 0000000..bb4f67f --- /dev/null +++ b/recipes/fakeroot/fakeroot-stdint.patch @@ -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; diff --git a/recipes/fakeroot/fix-shell-in-fakeroot.patch b/recipes/fakeroot/fix-shell-in-fakeroot.patch new file mode 100644 index 0000000..ce5d23f --- /dev/null +++ b/recipes/fakeroot/fix-shell-in-fakeroot.patch @@ -0,0 +1,13 @@ +Description: Fix shell in fakeroot.in + Use /bin/sh instead of @SHELL@ in fakeroot.in +Author: Juan Picca +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. diff --git a/recipes/fakeroot/xstatjunk.patch b/recipes/fakeroot/xstatjunk.patch new file mode 100644 index 0000000..12f2759 --- /dev/null +++ b/recipes/fakeroot/xstatjunk.patch @@ -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,