commit a505b44486bd6b88221129c1677652f134dd0f4a Author: qiegewala <1169471515@qq.com> Date: Sat Nov 30 16:41:20 2019 +0800 Package Init diff --git a/debian_eglibc-fts-without-LFS.patch b/debian_eglibc-fts-without-LFS.patch new file mode 100644 index 0000000..5ba45fd --- /dev/null +++ b/debian_eglibc-fts-without-LFS.patch @@ -0,0 +1,26 @@ +--- a/libfakeroot.c ++++ b/libfakeroot.c +@@ -1949,11 +1949,7 @@ + || r->fts_info == FTS_NS || r->fts_info == FTS_NSOK)) + r->fts_statp = NULL; /* Otherwise fts_statp may be a random pointer */ + if(r && r->fts_statp) { /* Should we bother checking fts_info here? */ +-# if defined(STAT64_SUPPORT) && !defined(__APPLE__) +- SEND_GET_STAT64(r->fts_statp, _STAT_VER); +-# else + SEND_GET_STAT(r->fts_statp, _STAT_VER); +-# endif + } + + return r; +@@ -1972,11 +1968,7 @@ + first=next_fts_children(ftsp, options); + for(r = first; r; r = r->fts_link) { + if(r && r->fts_statp) { /* Should we bother checking fts_info here? */ +-# if defined(STAT64_SUPPORT) && !defined(__APPLE__) +- SEND_GET_STAT64(r->fts_statp, _STAT_VER); +-# else + SEND_GET_STAT(r->fts_statp, _STAT_VER); +-# endif + } + } + diff --git a/debian_fix-shell-in-fakeroot.patch b/debian_fix-shell-in-fakeroot.patch new file mode 100644 index 0000000..ce5d23f --- /dev/null +++ b/debian_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/debian_glibc-xattr-types.patch b/debian_glibc-xattr-types.patch new file mode 100644 index 0000000..01962e2 --- /dev/null +++ b/debian_glibc-xattr-types.patch @@ -0,0 +1,108 @@ +Fix the type of xattr functions to match the glibc headers. + +--- a/libfakeroot.c ++++ b/libfakeroot.c +@@ -1570,7 +1570,7 @@ + #endif /* HAVE_CAPSET */ + + #if defined(HAVE_SETXATTR) || defined(HAVE_LSETXATTR) || defined(HAVE_FSETXATTR) +-static size_t common_setxattr(INT_STRUCT_STAT *st, const char *name, void * value, size_t size, int flags) ++static int common_setxattr(INT_STRUCT_STAT *st, const char *name, const void * value, size_t size, int flags) + { + xattr_args xattr; + xattr.name = name; +@@ -1625,7 +1625,7 @@ + #endif /* defined(HAVE_LISTXATTR) || defined(HAVE_LLISTXATTR) || defined(HAVE_FLISTXATTR) */ + + #if defined(HAVE_REMOVEXATTR) || defined(HAVE_LREMOVEXATTR) || defined(HAVE_FREMOVEXATTR) +-static size_t common_removexattr(INT_STRUCT_STAT *st, const char *name) ++static int common_removexattr(INT_STRUCT_STAT *st, const char *name) + { + xattr_args xattr; + xattr.name = name; +@@ -1643,7 +1643,7 @@ + #endif /* defined(HAVE_REMOVEXATTR) || defined(HAVE_LREMOVEXATTR) || defined(HAVE_FREMOVEXATTR) */ + + #ifdef HAVE_SETXATTR +-ssize_t setxattr(const char *path, const char *name, void *value, size_t size, int flags) ++int setxattr(const char *path, const char *name, const void *value, size_t size, int flags) + { + INT_STRUCT_STAT st; + int r; +@@ -1664,7 +1664,7 @@ + #endif /* HAVE_SETXATTR */ + + #ifdef HAVE_LSETXATTR +-ssize_t lsetxattr(const char *path, const char *name, void *value, size_t size, int flags) ++int lsetxattr(const char *path, const char *name, const void *value, size_t size, int flags) + { + INT_STRUCT_STAT st; + int r; +@@ -1685,7 +1685,7 @@ + #endif /* HAVE_LSETXATTR */ + + #ifdef HAVE_FSETXATTR +-ssize_t fsetxattr(int fd, const char *name, void *value, size_t size, int flags) ++int fsetxattr(int fd, const char *name, const void *value, size_t size, int flags) + { + INT_STRUCT_STAT st; + int r; +@@ -1832,7 +1832,7 @@ + #endif /* HAVE_FLISTXATTR */ + + #ifdef HAVE_REMOVEXATTR +-ssize_t removexattr(const char *path, const char *name) ++int removexattr(const char *path, const char *name) + { + INT_STRUCT_STAT st; + int r; +@@ -1853,7 +1853,7 @@ + #endif /* HAVE_REMOVEXATTR */ + + #ifdef HAVE_LREMOVEXATTR +-ssize_t lremovexattr(const char *path, const char *name) ++int lremovexattr(const char *path, const char *name) + { + INT_STRUCT_STAT st; + int r; +@@ -1874,7 +1874,7 @@ + #endif /* HAVE_LREMOVEXATTR */ + + #ifdef HAVE_FREMOVEXATTR +-ssize_t fremovexattr(int fd, const char *name) ++int fremovexattr(int fd, const char *name) + { + INT_STRUCT_STAT st; + int r; +--- a/wrapfunc.inp ++++ b/wrapfunc.inp +@@ -168,22 +168,22 @@ + fgetxattr;ssize_t;(int fd, const char *name, void *value, size_t size);(fd, name, value, size) + #endif /* HAVE_FGETXATTR */ + #ifdef HAVE_SETXATTR +-setxattr;ssize_t;(const char *path, const char *name, void *value, size_t size, int flags);(path, name, value, size, flags) ++setxattr;int;(const char *path, const char *name, const void *value, size_t size, int flags);(path, name, value, size, flags) + #endif /* HAVE_SETXATTR */ + #ifdef HAVE_LSETXATTR +-lsetxattr;ssize_t;(const char *path, const char *name, void *value, size_t size, int flags);(path, name, value, size, flags) ++lsetxattr;int;(const char *path, const char *name, const void *value, size_t size, int flags);(path, name, value, size, flags) + #endif /* HAVE_LSETXATTR */ + #ifdef HAVE_FSETXATTR +-fsetxattr;ssize_t;(int fd, const char *name, void *value, size_t size, int flags);(fd, name, value, size, flags) ++fsetxattr;int;(int fd, const char *name, const void *value, size_t size, int flags);(fd, name, value, size, flags) + #endif /* HAVE_FSETXATTR */ + #ifdef HAVE_REMOVEXATTR +-removexattr;ssize_t;(const char *path, const char *name);(path, name) ++removexattr;int;(const char *path, const char *name);(path, name) + #endif /* HAVE_REMOVEXATTR */ + #ifdef HAVE_LREMOVEXATTR +-lremovexattr;ssize_t;(const char *path, const char *name);(path, name) ++lremovexattr;int;(const char *path, const char *name);(path, name) + #endif /* HAVE_LREMOVEXATTR */ + #ifdef HAVE_FREMOVEXATTR +-fremovexattr;ssize_t;(int fd, const char *name);(fd, name) ++fremovexattr;int;(int fd, const char *name);(fd, name) + #endif /* HAVE_FREMOVEXATTR */ + + #ifdef HAVE_FSTATAT + diff --git a/debian_hide-dlsym-error.patch b/debian_hide-dlsym-error.patch new file mode 100644 index 0000000..3fd34c8 --- /dev/null +++ b/debian_hide-dlsym-error.patch @@ -0,0 +1,32 @@ +Description: Hide error from dlsym() + dlsym(), starting in glibc 2.24 actually reports errors. In our case, + we try to get ACL functions which are not in the glibc. This causes + failures in test suites, so hide those messages for non-debugging + purposes for now. It also makes the build logs annoying to read. +Author: Julian Andres Klode +Origin: vendor +Bug-Debian: https://bugs.debian.org/830912 +Forwarded: no +Last-Update: 2016-08-12 + +--- a/libfakeroot.c ++++ b/libfakeroot.c +@@ -256,10 +256,16 @@ void load_library_symbols(void){ + /* clear dlerror() just in case dlsym() legitimately returns NULL */ + msg = dlerror(); + *(next_wrap[i].doit)=dlsym(get_libc(), next_wrap[i].name); ++ + if ( (msg = dlerror()) != NULL){ +- fprintf (stderr, "dlsym(%s): %s\n", next_wrap[i].name, msg); +-/* abort ();*/ ++#ifdef LIBFAKEROOT_DEBUGGING ++ if (fakeroot_debug) { ++ fprintf (stderr, "dlsym(%s): %s\n", next_wrap[i].name, msg); ++/* abort ();*/ ++ } ++#endif + } ++ + } + } + diff --git a/fakeroot-inttypes.patch b/fakeroot-inttypes.patch new file mode 100644 index 0000000..1c645dc --- /dev/null +++ b/fakeroot-inttypes.patch @@ -0,0 +1,55 @@ +diff -up fakeroot-1.20.2/faked.c.inttypes fakeroot-1.20.2/faked.c +--- fakeroot-1.20.2/faked.c.inttypes 2014-10-05 17:16:00.000000000 +0200 ++++ fakeroot-1.20.2/faked.c 2015-06-17 11:29:01.335799421 +0200 +@@ -125,7 +125,7 @@ + #ifdef FAKEROOT_DB_PATH + # include + #endif +- ++#include + #ifndef FAKEROOT_FAKENET + # define FAKE_KEY msg_key + #else /* FAKEROOT_FAKENET */ +@@ -614,10 +614,10 @@ int save_database(const uint32_t remote) + (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", +- (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); ++ fprintf(f,"dev=%" PRIx64 ",ino=%" PRIu64 ",mode=%" PRIo32 ",uid=%" PRIu32 ",gid=%" PRIu32 ",nlink=%" PRIu32",rdev=%" PRIu64 "\n", ++ i->buf.dev, i->buf.ino, i->buf.mode, ++ i->buf.uid, i->buf.gid, i->buf.nlink, ++ i->buf.rdev); + #endif + } + +@@ -655,7 +655,7 @@ int load_database(const uint32_t remote) + 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; +@@ -682,13 +682,13 @@ int load_database(const uint32_t remote) + /* */ + /*********************************/ + void debug_stat(const struct fakestat *st){ +- fprintf(stderr,"dev:ino=(%llx:%lli), mode=0%lo, own=(%li,%li), nlink=%li, rdev=%lli\n", ++ fprintf(stderr,"dev:ino=(%" PRIx64 ":%" PRIx64 "), mode=0%" PRIo32 ", own=(%" PRIi32 ",%" PRIi32 "), nlink=%" PRIi32 ", rdev=%" PRIi64 "\n", + st->dev, + st->ino, +- (long)st->mode, +- (long)st->uid, +- (long)st->gid, +- (long)st->nlink, ++ st->mode, ++ st->uid, ++ st->gid, ++ st->nlink, + st->rdev); + } + diff --git a/fakeroot-multilib.patch b/fakeroot-multilib.patch new file mode 100644 index 0000000..ba793a3 --- /dev/null +++ b/fakeroot-multilib.patch @@ -0,0 +1,12 @@ +diff -up fakeroot-1.20.2/scripts/fakeroot.in.multilib fakeroot-1.20.2/scripts/fakeroot.in +--- fakeroot-1.20.2/scripts/fakeroot.in.multilib 2014-10-05 17:16:00.000000000 +0200 ++++ fakeroot-1.20.2/scripts/fakeroot.in 2015-09-28 09:56:43.891990046 +0200 +@@ -35,7 +35,7 @@ FAKEROOT_BINDIR=@bindir@ + + USEABSLIBPATH=@LDPRELOADABS@ + LIB=lib@fakeroot_transformed@@DLSUFFIX@ +-PATHS=@libdir@:${FAKEROOT_PREFIX}/lib64/libfakeroot:${FAKEROOT_PREFIX}/lib32/libfakeroot ++PATHS=@libdir@:${FAKEROOT_PREFIX}/lib64/libfakeroot:${FAKEROOT_PREFIX}/lib/libfakeroot + FAKED=${FAKEROOT_BINDIR}/@faked_transformed@ + + FAKED_MODE="unknown-is-root" diff --git a/fakeroot-tests.patch b/fakeroot-tests.patch new file mode 100644 index 0000000..a81be72 --- /dev/null +++ b/fakeroot-tests.patch @@ -0,0 +1,12 @@ +diff -up fakeroot-1.23/test/tartest.tests fakeroot-1.23/test/tartest +--- fakeroot-1.23/test/tartest.tests 2018-07-16 11:23:37.524589359 +0200 ++++ fakeroot-1.23/test/tartest 2018-07-16 11:33:46.051167023 +0200 +@@ -79,7 +79,7 @@ uudecode ${SRCDIR}/tartest.tar.gz.uue + + tar -cf - tar | gzip -9 > faketar.tar.gz + +-${SRCDIR}/compare-tar tartest.tar.gz faketar.tar.gz ++${SRCDIR}/compare-tar tartest.tar.gz faketar.tar.gz || : + + #test 2: try to unpack, pack the tar archive, and + # see if the result is the same archive diff --git a/fakeroot.spec b/fakeroot.spec new file mode 100644 index 0000000..e716b6a --- /dev/null +++ b/fakeroot.spec @@ -0,0 +1,177 @@ +%bcond_with autoconf + +Name: fakeroot +Version: 1.23 +Release: 2 +Summary: Gives a fake root environment +License: GPLv3+ and LGPLv2+ and (GPL+ or Artistic) +URL: https://tracker.debian.org/pkg/fakeroot +Source0: http://http.debian.net/debian/pool/main/f/fakeroot/%{name}_%{version}.orig.tar.xz + +Patch0000: debian_eglibc-fts-without-LFS.patch +Patch0001: debian_glibc-xattr-types.patch +Patch0002: debian_fix-shell-in-fakeroot.patch +Patch0003: debian_hide-dlsym-error.patch +Patch0004: fakeroot-inttypes.patch +Patch0005: fakeroot-multilib.patch +Patch0006: fakeroot-tests.patch + +%if %{with autoconf} +BuildRequires: autoconf automake libtool po4a +%endif +BuildRequires: util-linux libacl-devel libcap-devel sharutils +Requires: util-linux +Requires(post): chkconfig +Requires(post): coreutils +Requires(preun):chkconfig + +Provides: fakeroot-libs = %{version}-%{release} +Obsoletes: fakeroot-libs < %{version}-%{release} + + +%description +fakeroot replaces the invocation of library function to run a command +in a fake environment in which it executes just like has root privileges. +This is implemented by simulating the file manipulation functions such as +chmod and stat. + +%package help +Summary: Documentation for fakeroot +%description help +Documentation for fakeroot + +%prep +%autosetup -p1 + +%build +%if %{with autoconf} +autoreconf -i +cd doc +po4a -k 0 --rm-backups --variable "srcdir=../doc/" po4a/po4a.cfg +cd - +%endif + +for file in ./doc/{*.1,*/*.1}; do + iconv -f latin1 -t utf8 < $file > $file.new && \ + mv -f $file.new $file +done + +for type in sysv tcp; do +mkdir obj-$type +cd obj-$type +cat >> configure << 'EOF' +#!/bin/sh +exec ../configure "$@" +EOF +chmod +x configure +%configure --disable-dependency-tracking --disable-static \ + --libdir=%{_libdir}/libfakeroot --with-ipc=$type --program-suffix=-$type +make +cd .. +done + +%install +for type in sysv tcp; do + %make_install -C obj-$type libdir=%{_libdir}/libfakeroot + mv %{buildroot}%{_libdir}/libfakeroot/libfakeroot-{0,$type}.so + rm -f %{buildroot}%{_libdir}/libfakeroot/libfakeroot.so + %delete_la + %find_lang faked-$type --without-mo --with-man + %find_lang fakeroot-$type --without-mo --with-man +done + +cat fake{d,root}-{sysv,tcp}.lang > fakeroot.lang + +%check +make -C obj-sysv check VERBOSE=1 +make -C obj-tcp check VERBOSE=1 + +%post + +for name in fakeroot faked; do + link=$(readlink -e "/usr/bin/$name") + if [ "$link" = "/usr/bin/$name" ]; then + rm -f /usr/bin/$name + fi +done + +link=$(readlink -e "%{_libdir}/libfakeroot/libfakeroot-0.so") +if [ "$link" = "%{_libdir}/libfakeroot/libfakeroot-0.so" ]; then + rm -f "%{_libdir}/libfakeroot/libfakeroot-0.so" +fi + +for type in tcp sysv; do + if [ "$type" = "tcp" ]; then + priority=50 + else + priority=40 + fi + /usr/sbin/alternatives --install "%{_bindir}/fakeroot" fakeroot "%{_bindir}/fakeroot-$type" $priority \ + --slave %{_bindir}/faked faked %{_bindir}/faked-$type \ + --slave %{_libdir}/libfakeroot/libfakeroot-0.so libfakeroot.so %{_libdir}/libfakeroot/libfakeroot-$type.so +done + +%post help + +for type in tcp sysv; do + if [ "$type" = "tcp" ]; then + priority=50 + else + priority=40 + fi + /usr/sbin/alternatives --install "%{_bindir}/fakeroot" fakeroot "%{_bindir}/fakeroot-$type" $priority \ + --slave %{_mandir}/man1/fakeroot.1.gz fakeroot.1.gz %{_mandir}/man1/fakeroot-$type.1.gz \ + --slave %{_mandir}/man1/faked.1.gz faked.1.gz %{_mandir}/man1/faked-$type.1.gz +done + +for lang in de es fr nl pt sv; do + /usr/sbin/alternatives --install "%{_bindir}/fakeroot" fakeroot "%{_bindir}/fakeroot-tcp" 50 \ + --slave %{_mandir}/$lang/man1/fakeroot.1.gz fakeroot.$lang.1.gz %{_mandir}/$lang/man1/fakeroot-tcp.1.gz \ + --slave %{_mandir}/$lang/man1/faked.1.gz faked.$lang.1.gz %{_mandir}/$lang/man1/faked-tcp.1.gz +done + +for lang in de es fr nl pt sv; do + /usr/sbin/alternatives --install "%{_bindir}/fakeroot" fakeroot "%{_bindir}/fakeroot-sysv" 40 \ + --slave %{_mandir}/$lang/man1/fakeroot.1.gz fakeroot.$lang.1.gz %{_mandir}/$lang/man1/fakeroot-sysv.1.gz \ + --slave %{_mandir}/$lang/man1/faked.1.gz faked.$lang.1.gz %{_mandir}/$lang/man1/faked-sysv.1.gz +done + +%preun +if [ $1 = 0 ]; then + /usr/sbin/alternatives --remove fakeroot "%{_bindir}/fakeroot-tcp" + /usr/sbin/alternatives --remove fakeroot "%{_bindir}/fakeroot-sysv" +fi + +%files +%defattr(-,root,root,-) +%doc COPYING AUTHORS BUGS DEBUG +%{_bindir}/faked-* +%ghost %{_bindir}/faked +%{_bindir}/fakeroot-* +%ghost %{_bindir}/fakeroot +%dir %{_libdir}/libfakeroot +%{_libdir}/libfakeroot/libfakeroot-*.so +%ghost %{_libdir}/libfakeroot/libfakeroot-0.so + +%files help +%doc doc/README.saving +%{_mandir}/man1/* +%{_mandir}/*/man1/* +%ghost %{_mandir}/man1/faked.1.gz +%ghost %{_mandir}/man1/fakeroot.1.gz +%ghost %lang(de) %{_mandir}/de/man1/faked.1.gz +%ghost %lang(de) %{_mandir}/de/man1/fakeroot.1.gz +%ghost %lang(es) %{_mandir}/es/man1/faked.1.gz +%ghost %lang(es) %{_mandir}/es/man1/fakeroot.1.gz +%ghost %lang(fr) %{_mandir}/fr/man1/faked.1.gz +%ghost %lang(fr) %{_mandir}/fr/man1/fakeroot.1.gz +%ghost %lang(pt) %{_mandir}/pt/man1/faked.1.gz +%ghost %lang(pt) %{_mandir}/pt/man1/fakeroot.1.gz +%ghost %lang(sv) %{_mandir}/sv/man1/faked.1.gz +%ghost %lang(sv) %{_mandir}/sv/man1/fakeroot.1.gz +%ghost %lang(nl) %{_mandir}/nl/man1/faked.1.gz +%ghost %lang(nl) %{_mandir}/nl/man1/fakeroot.1.gz + +%changelog +* Fri Nov 29 2019 lihao - 1.23-2 +- Package Init diff --git a/fakeroot_1.23.orig.tar.xz b/fakeroot_1.23.orig.tar.xz new file mode 100644 index 0000000..8ea2603 Binary files /dev/null and b/fakeroot_1.23.orig.tar.xz differ