Initial commit

This commit is contained in:
Your Name
2026-04-23 17:07:55 +08:00
commit b7e39e063b
16725 changed files with 1625565 additions and 0 deletions
@@ -0,0 +1,51 @@
SUMMARY = "ACPICA tools for the development and debug of ACPI tables"
DESCRIPTION = "The ACPI Component Architecture (ACPICA) project provides an \
OS-independent reference implementation of the Advanced Configuration and \
Power Interface Specification (ACPI). ACPICA code contains those portions of \
ACPI meant to be directly integrated into the host OS as a kernel-resident \
subsystem, and a small set of tools to assist in developing and debugging \
ACPI tables."
HOMEPAGE = "http://www.acpica.org/"
SECTION = "console/tools"
LICENSE = "Intel | BSD-3-Clause | GPL-2.0-only"
LIC_FILES_CHKSUM = "file://source/compiler/aslcompile.c;beginline=7;endline=150;md5=79a69059b499bccc70a484459549758f"
COMPATIBLE_HOST = "(i.86|x86_64|arm|aarch64).*-linux"
DEPENDS = "m4-native flex-native bison-native"
SRC_URI = "https://acpica.org/sites/acpica/files/acpica-unix-${PV}.tar.gz"
SRC_URI[sha256sum] = "86876a745e3d224dcfd222ed3de465b47559e85811df2db9820ef09a9dff5cce"
UPSTREAM_CHECK_URI = "https://acpica.org/downloads"
S = "${WORKDIR}/acpica-unix-${PV}"
inherit update-alternatives
ALTERNATIVE_PRIORITY = "100"
ALTERNATIVE:${PN} = "acpixtract acpidump"
EXTRA_OEMAKE = "CC='${CC}' \
OPT_CFLAGS=-Wall \
DESTDIR=${D} \
PREFIX=${prefix} \
INSTALLDIR=${bindir} \
INSTALLFLAGS= \
YACC=bison \
YFLAGS='-y --file-prefix-map=${WORKDIR}=/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR}' \
"
do_install() {
oe_runmake install
}
# iasl*.bb is a subset of this recipe, so RREPLACE it
PROVIDES = "iasl"
RPROVIDES:${PN} += "iasl"
RREPLACES:${PN} += "iasl"
RCONFLICTS:${PN} += "iasl"
BBCLASSEXTEND = "native"
@@ -0,0 +1,28 @@
SUMMARY = "Tool for creating HTML, PDF, EPUB, man pages"
DESCRIPTION = "AsciiDoc is a text document format for writing short documents, \
articles, books and UNIX man pages."
HOMEPAGE = "http://asciidoc.org/"
LICENSE = "GPL-2.0-only"
LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=aaee33adce0fc7cc40fee23f82f7f101 \
file://LICENSE;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
"
SRC_URI = "git://github.com/asciidoc/asciidoc-py;protocol=https;branch=main"
SRCREV = "545b79b8d7dae70d12bf0657359bdd36de0c5c26"
DEPENDS = "libxml2-native libxslt-native docbook-xml-dtd4-native docbook-xsl-stylesheets-native"
S = "${WORKDIR}/git"
# Tell xmllint where to find the DocBook XML catalogue, because right now it
# opens /etc/xml/catalog on the host. Depends on auto-catalogs.patch
export SGML_CATALOG_FILES="file://${STAGING_ETCDIR_NATIVE}/xml/catalog"
inherit setuptools3
CLEANBROKEN = "1"
BBCLASSEXTEND = "native nativesdk"
UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>(\d+(\.\d+)+))$"
@@ -0,0 +1,56 @@
From f446686916e503dfb9fb928252d1b72a07573b29 Mon Sep 17 00:00:00 2001
From: Dengke Du <dengke.du@windriver.com>
Date: Tue, 18 Jul 2017 03:42:56 -0400
Subject: [PATCH] remove glibc assumption
glibc time.h header has an undocumented __isleap macro
that we are using anf musl is missing it.
Since it is undocumented & does not appear
on any other libc, stop using it and just define the macro in
locally instead.
Upstream-Status: Submitted [ https://lists.debian.org/debian-accessibility/2017/07/msg00044.html ]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Dengke Du <dengke.du@windriver.com>
---
parsetime.y | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
Index: at-3.2.1/parsetime.y
===================================================================
--- at-3.2.1.orig/parsetime.y
+++ at-3.2.1/parsetime.y
@@ -14,6 +14,9 @@
((y) % 4 == 0 && ((y) % 100 != 0 || (y) % 400 == 0))
#endif
+#define is_leap_year(y) \
+ ((y) % 4 == 0 && ((y) % 100 != 0 || (y) % 400 == 0))
+
struct tm exectm;
static int isgmt;
static char *tz = NULL;
@@ -230,8 +233,8 @@ date : month_name day_number
mnum == 12) && dnum > 31)
|| ((mnum == 4 || mnum == 6 || mnum == 9 ||
mnum == 11) && dnum > 30)
- || (mnum == 2 && dnum > 29 && __isleap(ynum+1900))
- || (mnum == 2 && dnum > 28 && !__isleap(ynum+1900))
+ || (mnum == 2 && dnum > 29 && is_leap_year(ynum+1900))
+ || (mnum == 2 && dnum > 28 && !is_leap_year(ynum+1900))
)
{
yyerror("Error in day of month");
@@ -274,8 +277,8 @@ date : month_name day_number
mnum == 12) && dnum > 31)
|| ((mnum == 4 || mnum == 6 || mnum == 9 ||
mnum == 11) && dnum > 30)
- || (mnum == 2 && dnum > 29 && __isleap(ynum+1900))
- || (mnum == 2 && dnum > 28 && !__isleap(ynum+1900))
+ || (mnum == 2 && dnum > 29 && is_leap_year(ynum+1900))
+ || (mnum == 2 && dnum > 28 && !is_leap_year(ynum+1900))
)
{
yyerror("Error in day of month");
+45
View File
@@ -0,0 +1,45 @@
#!/bin/sh
#
# Starts at daemon
#
umask 077
# Source function library.
. /etc/init.d/functions
start() {
echo -n "Starting atd: "
start-stop-daemon --start --quiet --pidfile /var/run/atd.pid --background --exec /usr/sbin/atd -- -f
echo "OK"
}
stop() {
echo -n "Stopping atd: "
start-stop-daemon --stop --quiet --pidfile /var/run/atd.pid
echo "OK"
}
restart() {
stop
start
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart|reload)
restart
;;
status)
status /usr/sbin/atd
;;
*)
echo $"Usage: $0 {start|stop|restart|status}"
exit 1
esac
exit $?
@@ -0,0 +1,9 @@
[Unit]
Description=Job spooling tools
After=syslog.target
[Service]
ExecStart=@SBINDIR@/atd -f
[Install]
WantedBy=multi-user.target
@@ -0,0 +1,25 @@
Upstream-Status: Pending
--- at-3.1.12/configure.ac 2011-06-23 14:51:03.653572945 +0800
+++ at-3.1.12/configure.ac.new 2011-06-27 16:12:14.903572945 +0800
@@ -81,10 +81,18 @@
AC_FUNC_VPRINTF
AC_FUNC_GETLOADAVG
AC_CHECK_FUNCS(getcwd mktime strftime setreuid setresuid sigaction waitpid)
+
+AC_ARG_WITH([pam],
+ [AS_HELP_STRING([--without-pam], [without PAM support])])
+
+if test "x$with_pam" != xno; then
AC_CHECK_HEADERS(security/pam_appl.h, [
PAMLIB="-lpam"
- AC_DEFINE(HAVE_PAM, 1, [Define to 1 for PAM support])
-])
+ AC_DEFINE(HAVE_PAM, 1, [Define to 1 for PAM support])],
+ [if test "x$with_pam" = xyes; then
+ AC_MSG_ERROR([PAM selected but security/pam_misc.h not found])
+ fi])
+fi
dnl Checking for programs
@@ -0,0 +1,30 @@
Upstream-Status: Inappropriate [licensing]
posixtm.[ch] files are replaced with gplv2 version from these locations:
http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=blob;f=lib/posixtm.c;hb=5661ab9d49512b4cf3c19caa11bb581d8ce561ba
http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=blob;f=lib/posixtm.h;hb=5661ab9d49512b4cf3c19caa11bb581d8ce561ba
update the Copyright file information to reflect the replaced files.
Date: 2010/08/31
Nitin A Kamble nitin.a.kamble@intel.com
Index: at-3.2.1/Copyright
===================================================================
--- at-3.2.1.orig/Copyright
+++ at-3.2.1/Copyright
@@ -34,10 +34,10 @@ The files posixtm.c and posixtm.h have t
Copyright (C) 1989, 1990, 1991, 1998, 2000, 2001, 2002, 2003, 2004,
2005, 2006, 2007 Free Software Foundation Inc.
- This program is free software: you can redistribute it and/or modify
+ This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 of the License, or
- (at your option) any later version.
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -0,0 +1,32 @@
From 150b63a936af71b992a3a7b0fc2d2497e51fc800 Mon Sep 17 00:00:00 2001
From: Robert Yang <liezhi.yang@windriver.com>
Date: Wed, 28 Jan 2015 23:52:00 -0800
Subject: [PATCH] Makefile: fix for parallel build
Fixed:
y.tab.c:1001:0: error: unterminated #if
Let "$(YACC) -d parsetime.y" only run once will fix the problem.
Upstream-Status: Pending
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
---
Makefile | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
Index: at-3.2.1/Makefile.in
===================================================================
--- at-3.2.1.orig/Makefile.in
+++ at-3.2.1/Makefile.in
@@ -77,7 +77,9 @@ at: $(ATOBJECTS)
atd: $(RUNOBJECTS)
$(CC) $(LDFLAGS) -o atd $(RUNOBJECTS) $(LIBS) $(PAMLIB) $(SELINUXLIB)
-y.tab.c y.tab.h: parsetime.y
+y.tab.h: y.tab.c
+
+y.tab.c: parsetime.y
$(YACC) -d parsetime.y
lex.yy.c: parsetime.l
@@ -0,0 +1,35 @@
From 8c8a0b6ba199327d2eafefd6611353e1c483a854 Mon Sep 17 00:00:00 2001
From: Chen Qi <Qi.Chen@windriver.com>
Date: Wed, 5 Dec 2018 10:00:36 +0800
Subject: [PATCH] fix pam.conf
oe doesn't support "@include", use the concrete directive instead.
Upstream-Status: Pending
Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
pam.conf | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/pam.conf b/pam.conf
index 3674c0a..2f8d586 100644
--- a/pam.conf
+++ b/pam.conf
@@ -2,9 +2,9 @@
# The PAM configuration file for the at daemon
#
-@include common-auth
-@include common-account
+auth include common-auth
+account include common-account
session required pam_loginuid.so
-@include common-session-noninteractive
+session include common-session-noninteractive
session required pam_limits.so
auth required pam_env.so user_readenv=1
--
2.7.4
+328
View File
@@ -0,0 +1,328 @@
/* Parse dates for touch and date.
Copyright (C) 1989, 1990, 1991, 1998, 2000, 2001, 2002, 2003, 2004,
2005, 2006, 2007 Free Software Foundation Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
/* Yacc-based version written by Jim Kingdon and David MacKenzie.
Rewritten by Jim Meyering. */
#include <config.h>
#include "posixtm.h"
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <string.h>
#if USE_UNLOCKED_IO
# include "unlocked-io.h"
#endif
/* ISDIGIT differs from isdigit, as follows:
- Its arg may be any int or unsigned int; it need not be an unsigned char
or EOF.
- It's typically faster.
POSIX says that only '0' through '9' are digits. Prefer ISDIGIT to
isdigit unless it's important to use the locale's definition
of `digit' even when the host does not conform to POSIX. */
#define ISDIGIT(c) ((unsigned int) (c) - '0' <= 9)
time_t mktime ();
/*
POSIX requires:
touch -t [[CC]YY]mmddhhmm[.ss] FILE...
8, 10, or 12 digits, followed by optional .ss
(PDS_LEADING_YEAR | PDS_CENTURY | PDS_SECONDS)
touch mmddhhmm[YY] FILE... (obsoleted by POSIX 1003.1-2001)
8 or 10 digits, YY (if present) must be in the range 69-99
(PDS_TRAILING_YEAR | PDS_PRE_2000)
date mmddhhmm[[CC]YY]
8, 10, or 12 digits
(PDS_TRAILING_YEAR | PDS_CENTURY)
*/
static int
year (struct tm *tm, const int *digit_pair, size_t n, unsigned int syntax_bits)
{
switch (n)
{
case 1:
tm->tm_year = *digit_pair;
/* Deduce the century based on the year.
POSIX requires that 00-68 be interpreted as 2000-2068,
and that 69-99 be interpreted as 1969-1999. */
if (digit_pair[0] <= 68)
{
if (syntax_bits & PDS_PRE_2000)
return 1;
tm->tm_year += 100;
}
break;
case 2:
if (! (syntax_bits & PDS_CENTURY))
return 1;
tm->tm_year = digit_pair[0] * 100 + digit_pair[1] - 1900;
break;
case 0:
{
time_t now;
struct tm *tmp;
/* Use current year. */
time (&now);
tmp = localtime (&now);
if (! tmp)
return 1;
tm->tm_year = tmp->tm_year;
}
break;
default:
abort ();
}
return 0;
}
static int
posix_time_parse (struct tm *tm, const char *s, unsigned int syntax_bits)
{
const char *dot = NULL;
int pair[6];
int *p;
size_t i;
size_t s_len = strlen (s);
size_t len = (((syntax_bits & PDS_SECONDS) && (dot = strchr (s, '.')))
? (size_t) (dot - s)
: s_len);
if (len != 8 && len != 10 && len != 12)
return 1;
if (dot)
{
if (!(syntax_bits & PDS_SECONDS))
return 1;
if (s_len - len != 3)
return 1;
}
for (i = 0; i < len; i++)
if (!ISDIGIT (s[i]))
return 1;
len /= 2;
for (i = 0; i < len; i++)
pair[i] = 10 * (s[2*i] - '0') + s[2*i + 1] - '0';
p = pair;
if (syntax_bits & PDS_LEADING_YEAR)
{
if (year (tm, p, len - 4, syntax_bits))
return 1;
p += len - 4;
len = 4;
}
/* Handle 8 digits worth of `MMDDhhmm'. */
tm->tm_mon = *p++ - 1;
tm->tm_mday = *p++;
tm->tm_hour = *p++;
tm->tm_min = *p++;
len -= 4;
/* Handle any trailing year. */
if (syntax_bits & PDS_TRAILING_YEAR)
{
if (year (tm, p, len, syntax_bits))
return 1;
}
/* Handle seconds. */
if (!dot)
{
tm->tm_sec = 0;
}
else
{
int seconds;
++dot;
if (!ISDIGIT (dot[0]) || !ISDIGIT (dot[1]))
return 1;
seconds = 10 * (dot[0] - '0') + dot[1] - '0';
tm->tm_sec = seconds;
}
return 0;
}
/* Parse a POSIX-style date, returning true if successful. */
bool
posixtime (time_t *p, const char *s, unsigned int syntax_bits)
{
struct tm tm0
#ifdef lint
/* Placate gcc-4's -Wuninitialized.
posix_time_parse fails to set all of tm0 only when it returns
nonzero (due to year() returning nonzero), and in that case,
this code doesn't use the tm0 at all. */
= { 0, }
#endif
;
struct tm tm1;
struct tm const *tm;
time_t t;
if (posix_time_parse (&tm0, s, syntax_bits))
return false;
tm1 = tm0;
tm1.tm_isdst = -1;
t = mktime (&tm1);
if (t != (time_t) -1)
tm = &tm1;
else
{
/* mktime returns -1 for errors, but -1 is also a valid time_t
value. Check whether an error really occurred. */
tm = localtime (&t);
if (! tm)
return false;
}
/* Reject dates like "September 31" and times like "25:61". */
if ((tm0.tm_year ^ tm->tm_year)
| (tm0.tm_mon ^ tm->tm_mon)
| (tm0.tm_mday ^ tm->tm_mday)
| (tm0.tm_hour ^ tm->tm_hour)
| (tm0.tm_min ^ tm->tm_min)
| (tm0.tm_sec ^ tm->tm_sec))
return false;
*p = t;
return true;
}
#ifdef TEST_POSIXTIME
/*
Test mainly with syntax_bits == 13
(aka: (PDS_LEADING_YEAR | PDS_CENTURY | PDS_SECONDS))
This test data assumes Universal Time, e.g., TZ="UTC0".
This test data also assumes that time_t is signed and is at least
39 bits wide, so that it can represent all years from 0000 through
9999. A host with 32-bit signed time_t can represent only time
stamps in the range 1901-12-13 20:45:52 through 2038-01-18
03:14:07 UTC, assuming POSIX time_t with no leap seconds, so test
cases outside this range will not work on such a host.
Also, the first two lines of test data assume that the current
year is 2002.
BEGIN-DATA
12131415.16 13 1039788916 Fri Dec 13 14:15:16 2002
12131415.16 13 1039788916 Fri Dec 13 14:15:16 2002
000001010000.00 13 -62167132800 Sun Jan 1 00:00:00 0000
190112132045.52 13 -2147483648 Fri Dec 13 20:45:52 1901
190112132045.53 13 -2147483647 Fri Dec 13 20:45:53 1901
190112132046.52 13 -2147483588 Fri Dec 13 20:46:52 1901
190112132145.52 13 -2147480048 Fri Dec 13 21:45:52 1901
190112142045.52 13 -2147397248 Sat Dec 14 20:45:52 1901
190201132045.52 13 -2144805248 Mon Jan 13 20:45:52 1902
196912312359.59 13 -1 Wed Dec 31 23:59:59 1969
197001010000.00 13 0 Thu Jan 1 00:00:00 1970
197001010000.01 13 1 Thu Jan 1 00:00:01 1970
197001010001.00 13 60 Thu Jan 1 00:01:00 1970
197001010100.00 13 3600 Thu Jan 1 01:00:00 1970
197001020000.00 13 86400 Fri Jan 2 00:00:00 1970
197002010000.00 13 2678400 Sun Feb 1 00:00:00 1970
197101010000.00 13 31536000 Fri Jan 1 00:00:00 1971
197001000000.00 13 * *
197000010000.00 13 * *
197001010000.60 13 * *
197001010060.00 13 * *
197001012400.00 13 * *
197001320000.00 13 * *
197013010000.00 13 * *
203801190314.06 13 2147483646 Tue Jan 19 03:14:06 2038
203801190314.07 13 2147483647 Tue Jan 19 03:14:07 2038
203801190314.08 13 2147483648 Tue Jan 19 03:14:08 2038
999912312359.59 13 253402300799 Fri Dec 31 23:59:59 9999
1112131415 13 1323785700 Tue Dec 13 14:15:00 2011
1112131415.16 13 1323785716 Tue Dec 13 14:15:16 2011
201112131415.16 13 1323785716 Tue Dec 13 14:15:16 2011
191112131415.16 13 -1831974284 Wed Dec 13 14:15:16 1911
203712131415.16 13 2144326516 Sun Dec 13 14:15:16 2037
3712131415.16 13 2144326516 Sun Dec 13 14:15:16 2037
6812131415.16 13 3122633716 Thu Dec 13 14:15:16 2068
6912131415.16 13 -1590284 Sat Dec 13 14:15:16 1969
7012131415.16 13 29945716 Sun Dec 13 14:15:16 1970
1213141599 2 945094500 Mon Dec 13 14:15:00 1999
1213141500 2 976716900 Wed Dec 13 14:15:00 2000
END-DATA
*/
# define MAX_BUFF_LEN 1024
int
main (void)
{
char buff[MAX_BUFF_LEN + 1];
buff[MAX_BUFF_LEN] = 0;
while (fgets (buff, MAX_BUFF_LEN, stdin) && buff[0])
{
char time_str[MAX_BUFF_LEN];
unsigned int syntax_bits;
time_t t;
if (sscanf (buff, "%s %u", time_str, &syntax_bits) != 2)
printf ("*\n");
else
{
printf ("%-15s %2u ", time_str, syntax_bits);
if (posixtime (&t, time_str, syntax_bits))
printf ("%12ld %s", (long int) t, ctime (&t));
else
printf ("%12s %s", "*", "*\n");
}
}
exit (0);
}
#endif
/*
Local Variables:
compile-command: "gcc -DTEST_POSIXTIME -g -O -Wall -W posixtm.c"
End:
*/
@@ -0,0 +1,37 @@
/* Parse dates for touch and date.
Copyright (C) 1998, 2003, 2005, 2007 Free Software Foundation Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
/* Yacc-based version written by Jim Kingdon and David MacKenzie.
Rewritten by Jim Meyering. */
#ifndef POSIXTM_H_
# define POSIXTM_H_
# include <stdbool.h>
# include <time.h>
/* POSIX Date Syntax flags. */
# define PDS_LEADING_YEAR 1
# define PDS_TRAILING_YEAR 2
# define PDS_CENTURY 4
# define PDS_SECONDS 8
# define PDS_PRE_2000 16
bool posixtime (time_t *p, const char *s, unsigned int syntax_bits);
#endif
+76
View File
@@ -0,0 +1,76 @@
SUMMARY = "Delayed job execution and batch processing"
HOMEPAGE = "http://blog.calhariz.com/"
DESCRIPTION = "At allows for commands to be run at a particular time. Batch will execute commands when \
the system load levels drop to a particular level."
SECTION = "base"
LICENSE = "GPL-2.0-or-later"
LIC_FILES_CHKSUM = "file://COPYING;md5=4325afd396febcb659c36b49533135d4"
DEPENDS = "flex flex-native bison-native \
${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}"
PACKAGECONFIG ?= "\
${@bb.utils.contains('DISTRO_FEATURES', 'selinux', 'selinux', '', d)} \
"
PACKAGECONFIG[selinux] = "--with-selinux,--without-selinux,libselinux,"
RDEPENDS:${PN} = "${@bb.utils.contains('DISTRO_FEATURES', 'pam', '${PAM_DEPS}', '', d)} \
"
PAM_DEPS = "libpam libpam-runtime pam-plugin-env pam-plugin-limits"
RCONFLICTS:${PN} = "atd"
RREPLACES:${PN} = "atd"
SRC_URI = "${DEBIAN_MIRROR}/main/a/at/${BPN}_${PV}.orig.tar.gz \
file://posixtm.c \
file://posixtm.h \
file://file_replacement_with_gplv2.patch \
file://atd.init \
file://atd.service \
${@bb.utils.contains('DISTRO_FEATURES', 'pam', '${PAM_SRC_URI}', '', d)} \
file://makefile-fix-parallel.patch \
file://0001-remove-glibc-assumption.patch \
"
PAM_SRC_URI = "file://pam.conf.patch \
file://configure-add-enable-pam.patch"
SRC_URI[sha256sum] = "bb066b389d7c9bb9d84a35738032b85c30cba7d949f758192adc72c9477fd3b8"
EXTRA_OECONF += "ac_cv_path_SENDMAIL=/bin/true \
--with-daemon_username=root \
--with-daemon_groupname=root \
--with-jobdir=/var/spool/at/jobs \
--with-atspool=/var/spool/at/spool \
ac_cv_header_security_pam_appl_h=${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'yes', 'no', d)} "
inherit autotools-brokensep systemd update-rc.d
INITSCRIPT_NAME = "atd"
INITSCRIPT_PARAMS = "defaults"
SYSTEMD_SERVICE:${PN} = "atd.service"
do_patch[postfuncs] += "copy_posix_files"
copy_posix_files() {
cp -f ${WORKDIR}/posixtm.[ch] ${S}
}
do_install () {
oe_runmake -e "IROOT=${D}" install
install -d ${D}${sysconfdir}/init.d
install -m 0755 ${WORKDIR}/atd.init ${D}${sysconfdir}/init.d/atd
# install systemd unit files
install -d ${D}${systemd_system_unitdir}
install -m 0644 ${WORKDIR}/atd.service ${D}${systemd_system_unitdir}
sed -i -e 's,@SBINDIR@,${sbindir},g' ${D}${systemd_system_unitdir}/atd.service
if [ "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}" ]; then
install -D -m 0644 ${WORKDIR}/${BP}/pam.conf ${D}${sysconfdir}/pam.d/atd
fi
rm -f ${D}${datadir}/at/batch-job
}
@@ -0,0 +1,72 @@
SUMMARY = "Baremetal examples to work with the several QEMU architectures supported on OpenEmbedded"
HOMEPAGE = "https://github.com/aehs29/baremetal-helloqemu"
DESCRIPTION = "These are introductory examples to showcase the use of QEMU to run baremetal applications."
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://LICENSE;md5=39346640a23c701e4f459e05f56f4449"
SRCREV = "fc7c43d138185028b6ac14c83f6492fce26eca95"
PV = "0.1+git${SRCPV}"
SRC_URI = "git://github.com/ahcbb6/baremetal-helloqemu.git;protocol=https;branch=master"
UPSTREAM_VERSION_UNKNOWN="1"
S = "${WORKDIR}/git"
# The following variables should be set to accomodate each application
BAREMETAL_BINNAME ?= "hello_baremetal_${MACHINE}"
IMAGE_LINK_NAME ?= "baremetal-helloworld-image-${MACHINE}"
IMAGE_NAME_SUFFIX ?= ""
# Baremetal-Image creates the proper wiring, assumes the output is provided in
# binary and ELF format, installed on ${base_libdir}/firmware/ , we want a
# package to be created since we might have some way of updating the baremetal
# firmware from Linux
inherit baremetal-image
# startup code for x86 uses NASM syntax
DEPENDS:qemux86:append = " nasm-native"
# These parameters are app specific for this example
# This will be translated automatically to the architecture and
# machine that QEMU uses on OE, e.g. -machine virt -cpu cortex-a57
# but the examples can also be run on other architectures/machines
# such as vexpress-a15 by overriding the setting on the machine.conf
COMPATIBLE_MACHINE = "qemuarmv5|qemuarm|qemuarm64|qemuriscv64|qemuriscv32|qemux86|qemux86-64"
BAREMETAL_QEMUARCH ?= ""
BAREMETAL_QEMUARCH:qemuarmv5 = "versatile"
BAREMETAL_QEMUARCH:qemuarm = "arm"
BAREMETAL_QEMUARCH:qemuarm64 = "aarch64"
BAREMETAL_QEMUARCH:qemuriscv64 = "riscv64"
BAREMETAL_QEMUARCH:qemuriscv32 = "riscv32"
BAREMETAL_QEMUARCH:qemux86 = "x86"
BAREMETAL_QEMUARCH:qemux86-64 = "x86-64"
EXTRA_OEMAKE:append = " QEMUARCH=${BAREMETAL_QEMUARCH} V=1"
# qemux86-64 uses a different Makefile
do_compile:prepend:qemux86-64(){
cd x86-64
}
# Install binaries on the proper location for baremetal-image to fetch and deploy
do_install(){
install -d ${D}/${base_libdir}/firmware
install -m 755 ${B}/build/hello_baremetal_${BAREMETAL_QEMUARCH}.bin ${D}/${base_libdir}/firmware/${BAREMETAL_BINNAME}.bin
install -m 755 ${B}/build/hello_baremetal_${BAREMETAL_QEMUARCH}.elf ${D}/${base_libdir}/firmware/${BAREMETAL_BINNAME}.elf
}
FILES:${PN} += " \
${base_libdir}/firmware/${BAREMETAL_BINNAME}.bin \
${base_libdir}/firmware/${BAREMETAL_BINNAME}.elf \
"
# qemux86-64 boots from iso rather than -kernel, create image to boot from
do_image:append:qemux86-64(){
dd if=/dev/zero of=${B}/build/img.iso bs=1M count=10 status=none
dd if=${B}/build/stage1.bin of=${B}/build/img.iso bs=512 count=1 conv=notrunc
dd if=${B}/build/stage2.bin of=${B}/build/img.iso bs=512 seek=1 count=64 conv=notrunc
dd if=${B}/build/hello_baremetal_x86-64.bin of=${B}/build/img.iso bs=512 seek=65 conv=notrunc
install ${B}/build/img.iso ${IMGDEPLOYDIR}/${IMAGE_LINK_NAME}.iso
}
+131
View File
@@ -0,0 +1,131 @@
SUMMARY = "An sh-compatible command language interpreter"
HOMEPAGE = "http://tiswww.case.edu/php/chet/bash/bashtop.html"
DESCRIPTION = "Bash is the GNU Project's Bourne Again SHell, a complete implementation of the IEEE POSIX and Open Group shell specification with interactive command line editing, job control on architectures that support it, csh-like features such as history substitution and brace expansion, and a slew of other features."
SECTION = "base/shell"
DEPENDS = "ncurses bison-native virtual/libiconv"
inherit autotools gettext texinfo update-alternatives ptest
EXTRA_AUTORECONF += "--exclude=autoheader"
EXTRA_OECONF = "--enable-job-control --without-bash-malloc bash_cv_wexitstatus_offset=8"
# If NON_INTERACTIVE_LOGIN_SHELLS is defined, all login shells read the
# startup files, even if they are not interactive.
# This is what other major distros do. And this is what we wanted. See bug#5359 and bug#7137.
CFLAGS += "-DNON_INTERACTIVE_LOGIN_SHELLS"
# This can vary depending upon the host
CFLAGS += "-DHEREDOC_PIPESIZE=65536"
# Disable bracketed paste mode by default (enabled by default in bash 5.1). It
# causes a lot of garbage in non-interactive shells
CFLAGS += "-DBRACKETED_PASTE_DEFAULT=0"
ALTERNATIVE:${PN} = "bash sh"
ALTERNATIVE_LINK_NAME[bash] = "${base_bindir}/bash"
ALTERNATIVE_TARGET[bash] = "${base_bindir}/bash"
ALTERNATIVE_LINK_NAME[sh] = "${base_bindir}/sh"
ALTERNATIVE_TARGET[sh] = "${base_bindir}/bash.${BPN}"
ALTERNATIVE_PRIORITY = "100"
RDEPENDS:${PN} += "base-files"
RDEPENDS:${PN}:class-nativesdk = ""
RDEPENDS:${PN}-ptest += "make coreutils perl sed shadow util-linux-setpriv"
RDEPENDS:${PN}-ptest:append:libc-glibc = " \
glibc-gconv-big5hkscs \
glibc-gconv-iso8859-1 \
glibc-utils \
locale-base-de-de \
locale-base-en-us \
locale-base-fr-fr \
locale-base-fr-fr.iso-8859-1 \
locale-base-zh-hk.big5-hkscs \
"
CACHED_CONFIGUREVARS += "headersdir=${includedir}/${PN}"
do_configure:prepend () {
if [ ! -e ${S}/acinclude.m4 ]; then
cat ${S}/aclocal.m4 > ${S}/acinclude.m4
fi
}
do_compile:prepend() {
# Remove any leftover .build files. This ensures that bash always has the
# same version number and keeps builds reproducible
rm -f ${B}/.build
}
do_compile_ptest () {
oe_runmake buildtest
}
do_install:prepend () {
# Ensure determinism as this counter increases for each make call
rm -f ${B}/.build
}
do_install:append () {
# Move /usr/bin/bash to /bin/bash, if need
if [ "${base_bindir}" != "${bindir}" ]; then
mkdir -p ${D}${base_bindir}
mv ${D}${bindir}/bash ${D}${base_bindir}
fi
}
do_install:append:class-target () {
# Clean buildhost references in bashbug
sed -i -e "s,--sysroot=${STAGING_DIR_TARGET},,g" \
-e "s,-I${WORKDIR}/\S* ,,g" \
-e 's|${DEBUG_PREFIX_MAP}||g' \
${D}${bindir}/bashbug
# Clean buildhost references in bash.pc
sed -i -e "s,--sysroot=${STAGING_DIR_TARGET},,g" \
${D}${libdir}/pkgconfig/bash.pc
# Clean buildhost references in Makefile.inc
sed -i -e "s,--sysroot=${STAGING_DIR_TARGET},,g" \
-e 's|${DEBUG_PREFIX_MAP}||g' \
-e 's:${HOSTTOOLS_DIR}/::g' \
-e 's:${BASE_WORKDIR}/${MULTIMACH_TARGET_SYS}::g' \
${D}${libdir}/bash/Makefile.inc
}
do_install_ptest () {
make INSTALL_TEST_DIR=${D}${PTEST_PATH}/tests install-test
cp ${B}/Makefile ${D}${PTEST_PATH}
cp ${B}/config.h ${D}${PTEST_PATH}
cp ${B}/version.h ${D}${PTEST_PATH}
cp ${S}/y.tab.[ch] ${D}${PTEST_PATH}
install -D ${WORKDIR}/run-bash-ptests ${D}${PTEST_PATH}/run-bash-ptests
sed -i -e 's/^Makefile/_Makefile/' -e "s,--sysroot=${STAGING_DIR_TARGET},,g" \
-e 's|${DEBUG_PREFIX_MAP}||g' \
-e "s,${S},,g" -e "s,${B},,g" -e "s,${STAGING_DIR_NATIVE},,g" \
-e 's:${HOSTTOOLS_DIR}/::g' \
-e 's:${UNINATIVE_LOADER}:${base_bindir}/false:g' \
${D}${PTEST_PATH}/Makefile
}
# The uninative loader is different on i386 & x86_64 hosts. Since it is only
# being replaced with /bin/false anyway, it doesn't need to be part of the task
# hash
do_install_ptest[vardepsexclude] += "UNINATIVE_LOADER"
pkg_postinst:${PN} () {
grep -q "^${base_bindir}/bash$" $D${sysconfdir}/shells || echo ${base_bindir}/bash >> $D${sysconfdir}/shells
}
pkg_postrm:${PN} () {
printf "$(grep -v "^${base_bindir}/bash$" $D${sysconfdir}/shells)\n" > $D${sysconfdir}/shells
}
PACKAGES += "${PN}-bashbug"
FILES:${PN} = "${bindir}/bash ${base_bindir}/bash.bash"
FILES:${PN}-bashbug = "${bindir}/bashbug"
PACKAGE_BEFORE_PN += "${PN}-loadable"
RDEPENDS:${PN}-loadable += "${PN}"
FILES:${PN}-loadable += "${libdir}/bash/*"
RPROVIDES:${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', '/bin/sh /bin/bash', '', d)}"
@@ -0,0 +1,60 @@
From 318b762837c2ad25319caeaf0320eff613b64daf Mon Sep 17 00:00:00 2001
From: Anders Roxell <anders.roxell@enea.com>
Date: Wed, 19 Dec 2012 17:18:31 +0100
Subject: [PATCH] Add 'ptest' target to Makefile, to run tests without checking
dependencies.
Upstream-Status: Pending
Signed-off-by: Anders Roxell <anders.roxell@enea.com>
Rebase to 5.0
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
Makefile.in | 24 +++++++++++++++++++-----
1 file changed, 19 insertions(+), 5 deletions(-)
diff --git a/Makefile.in b/Makefile.in
index bc97049..937ce39 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -943,20 +943,34 @@ maybe-clean:
fi
recho$(EXEEXT): $(SUPPORT_SRC)recho.c
- @$(CC_FOR_BUILD) $(CCFLAGS_FOR_BUILD) ${LDFLAGS_FOR_BUILD} -o $@ $(SUPPORT_SRC)recho.c ${LIBS_FOR_BUILD}
+ @$(CC) $(CCFLAGS) ${LDFLAGS} -o $@ $<
zecho$(EXEEXT): $(SUPPORT_SRC)zecho.c
- @$(CC_FOR_BUILD) $(CCFLAGS_FOR_BUILD) ${LDFLAGS_FOR_BUILD} -o $@ $(SUPPORT_SRC)zecho.c ${LIBS_FOR_BUILD}
+ @$(CC) $(CCFLAGS) ${LDFLAGS} -o $@ $<
printenv$(EXEEXT): $(SUPPORT_SRC)printenv.c
- @$(CC_FOR_BUILD) $(CCFLAGS_FOR_BUILD) ${LDFLAGS_FOR_BUILD} -o $@ $(SUPPORT_SRC)printenv.c ${LIBS_FOR_BUILD}
+ @$(CC) $(CCFLAGS) ${LDFLAGS} -o $@ $<
xcase$(EXEEXT): $(SUPPORT_SRC)xcase.c
- @$(CC_FOR_BUILD) $(CCFLAGS_FOR_BUILD) ${LDFLAGS_FOR_BUILD} -o $@ $(SUPPORT_SRC)xcase.c ${LIBS_FOR_BUILD}
+ @$(CC) $(CCFLAGS) ${LDFLAGS} -o $@ $<
-test tests check: force $(Program) $(TESTS_SUPPORT)
+test tests check:
+ @$(MAKE) install-test
+ @$(MAKE) runtest
+
+install-test: buildtest
+ifeq ($(origin INSTALL_TEST_DIR), undefined)
@-test -d tests || mkdir tests
@cp $(TESTS_SUPPORT) tests
+else
+ @-test -d $(INSTALL_TEST_DIR) || mkdir -p $(INSTALL_TEST_DIR)
+ @cp -r $(srcdir)/tests/* $(INSTALL_TEST_DIR)/
+ @cp $(TESTS_SUPPORT) $(INSTALL_TEST_DIR)
+endif
+
+buildtest: force $(Program) $(TESTS_SUPPORT)
+
+runtest:
@( cd $(srcdir)/tests && \
BUILD_DIR=$(BUILD_DIR) PATH=$(BUILD_DIR)/tests:$$PATH THIS_SH=$(THIS_SH) $(SHELL) ${TESTSCRIPT} )
@@ -0,0 +1,33 @@
From 0c4cab9594c96c2dc435a8d9724605824bcbf917 Mon Sep 17 00:00:00 2001
From: Dengke Du <dengke.du@windriver.com>
Date: Tue, 19 Apr 2016 02:57:45 -0400
Subject: [PATCH] fix run-builtins failed
FAIL: run-builtins
1. redirect the stderr output of command exec with -l option in
builtins.tests to /dev/null
2. ensure the system contain the locales "en_US.UTF-8"
Upstream-Status: Pending
Signed-off-by: Dengke Du <dengke.du@windriver.com>
---
tests/builtins.tests | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/builtins.tests b/tests/builtins.tests
index 9d77520..63f3af8 100644
--- a/tests/builtins.tests
+++ b/tests/builtins.tests
@@ -109,7 +109,7 @@ esac
# test options to exec
(exec -a specialname ${THIS_SH} -c 'echo $0' )
-(exec -l -a specialname ${THIS_SH} -c 'echo $0' )
+(exec -l -a specialname ${THIS_SH} -c 'echo $0' ) 2> /dev/null
# test `clean' environment. if /bin/sh is bash, and the script version of
# printenv is run, there will be variables in the environment that bash
# sets on startup. Also test code that prefixes argv[0] with a dash.
--
2.8.1
@@ -0,0 +1,26 @@
On hosts with FORTIFY_SOURCES, stringize support is required, as it's used by
the macros to wrap functions (e.g. read and open in unistd.h). Those wrappers
use the STRING() macro from unistd.h. A header in the bash sources overrides
the unistd.h macro to 'x' when HAVE_STRINGIZE is not defined, causing the
wrappers to generate calls to 'xread' and 'xopen', which do not exist,
resulting in a failure to link.
Assume we have stringize support when cross-compiling, which works around the
issue.
It may be best for upstream to either give up on supporting compilers without
stringize support, or to not define STRING() at all when FORTIFY_SOURCES is
defined, letting the unistd.h one be used, instead.
Upstream-Status: Pending
--- bash-4.2.orig/builtins/mkbuiltins.c
+++ bash-4.2/builtins/mkbuiltins.c
@@ -28,6 +28,7 @@
# define HAVE_STDLIB_H
# define HAVE_RENAME
+# define HAVE_STRINGIZE
#endif /* CROSS_COMPILING */
#if defined (HAVE_UNISTD_H)
@@ -0,0 +1,4 @@
#!/bin/sh
cd "$(dirname "$0")"
make -k THIS_SH=/bin/bash BUILD_DIR=`pwd` srcdir=`pwd` runtest
@@ -0,0 +1,26 @@
#!/bin/sh
en_US=`locale -a | grep en_US*`
fr_FR=`locale -a | grep fr_FR*`
de_DE=`locale -a | grep de_DE*`
if [ -z "$en_US" ]
then
echo "Warning: The en_US* locales is needed to run the intl.tests, please add it."
fi
if [ -z "$fr_FR" ]
then
echo "Warning: The fr_FR* locales is needed to run the intl.tests, please add it."
fi
if [ -z "$de_DE" ]
then
echo "Warning: The de_DE* locales is needed to run the intl.tests, please add it."
fi
useradd bashtest
chown -R bashtest:bashtest tests
setpriv --reuid bashtest --rgid bashtest --clear-groups --reset-env $(dirname "$0")/run-bash-ptests
chown -R root:root tests
userdel -r bashtest
@@ -0,0 +1,42 @@
From 28eb06047ebd2deaa8c7cd2bf6655ef6a469dc14 Mon Sep 17 00:00:00 2001
From: Hongxu Jia <hongxu.jia@windriver.com>
Date: Tue, 15 Aug 2017 10:01:56 +0800
Subject: [PATCH 1/2] Add FAIL/PASS output to test output.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Björn Stenberg <bjst@enea.com>
Upstream-Status: Pending
Rebase to 4.4
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
tests/run-all | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/tests/run-all b/tests/run-all
index 2882fe0..e21d026 100644
--- a/tests/run-all
+++ b/tests/run-all
@@ -33,7 +33,16 @@ do
case $x in
$0|run-minimal|run-gprof) ;;
*.orig|*~) ;;
- *) echo $x ; sh $x ; rm -f ${BASH_TSTOUT} ;;
+ *) echo $x
+ output=`sh $x`
+ if [ -n "$output" ]; then
+ echo "$output"
+ echo "FAIL: $x"
+ else
+ echo "PASS: $x"
+ fi
+ rm -f ${BASH_TSTOUT}
+ ;;
esac
done
--
1.8.3.1
@@ -0,0 +1,70 @@
From d1bf23817afffd5917b74da6946e0c3b7e63e336 Mon Sep 17 00:00:00 2001
From: Alexander Kanavin <alex.kanavin@gmail.com>
Date: Mon, 28 Dec 2020 21:04:27 +0100
Subject: [PATCH] bash: update 5.0 -> 5.1
Including m4 files directly like this confuses autotools.bbclass, remove
the references and rely upon aclocal to collect the m4 files together
as needed instead making it work like other autotools based projects.
Upstream-Status: Inappropriate [OE configuration specific]
RP 2021/1/20
---
configure.ac | 43 -------------------------------------------
1 file changed, 43 deletions(-)
diff --git a/configure.ac b/configure.ac
index 50a6e20..a3b5bd7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -710,49 +710,6 @@ if test x$SIZE = x; then
fi
AC_SUBST(SIZE)
-m4_include([m4/stat-time.m4])
-m4_include([m4/timespec.m4])
-
-m4_include([m4/strtoimax.m4])
-
-dnl include files for gettext
-
-m4_include([m4/codeset.m4])
-m4_include([m4/extern-inline.m4])
-m4_include([m4/fcntl-o.m4])
-m4_include([m4/gettext.m4])
-m4_include([m4/glibc2.m4])
-m4_include([m4/glibc21.m4])
-m4_include([m4/host-cpu-c-abi.m4])
-m4_include([m4/iconv.m4])
-m4_include([m4/intdiv0.m4])
-m4_include([m4/intl.m4])
-m4_include([m4/intlmacosx.m4])
-m4_include([m4/intl-thread-locale.m4])
-m4_include([m4/intmax.m4])
-m4_include([m4/inttypes-pri.m4])
-m4_include([m4/inttypes.m4])
-m4_include([m4/inttypes_h.m4])
-m4_include([m4/lcmessage.m4])
-m4_include([m4/lib-ld.m4])
-m4_include([m4/lib-link.m4])
-m4_include([m4/lib-prefix.m4])
-m4_include([m4/lock.m4])
-m4_include([m4/nls.m4])
-m4_include([m4/po.m4])
-m4_include([m4/printf-posix.m4])
-m4_include([m4/progtest.m4])
-m4_include([m4/pthread_rwlock_rdlock.m4])
-m4_include([m4/size_max.m4])
-m4_include([m4/stdint_h.m4])
-m4_include([m4/threadlib.m4])
-m4_include([m4/uintmax_t.m4])
-m4_include([m4/ulonglong.m4])
-m4_include([m4/visibility.m4])
-m4_include([m4/wchar_t.m4])
-m4_include([m4/wint_t.m4])
-m4_include([m4/xsize.m4])
-
dnl C compiler characteristics
AC_C_CONST
AC_C_INLINE
@@ -0,0 +1,22 @@
require bash.inc
# GPL-2.0-or-later (< 4.0), GPL-3.0-or-later (>= 4.0)
LICENSE = "GPL-3.0-or-later"
LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
SRC_URI = "${GNU_MIRROR}/bash/${BP}.tar.gz;name=tarball \
file://mkbuiltins_have_stringize.patch \
file://build-tests.patch \
file://test-output.patch \
file://run-ptest \
file://run-bash-ptests \
file://fix-run-builtins.patch \
file://use_aclocal.patch \
"
SRC_URI[tarball.sha256sum] = "13720965b5f4fc3a0d4b61dd37e7565c741da9a5be24edc2ae00182fc1b3588c"
DEBUG_OPTIMIZATION:append:armv4 = " ${@bb.utils.contains('TUNE_CCARGS', '-mthumb', '-fomit-frame-pointer', '', d)}"
DEBUG_OPTIMIZATION:append:armv5 = " ${@bb.utils.contains('TUNE_CCARGS', '-mthumb', '-fomit-frame-pointer', '', d)}"
BBCLASSEXTEND = "nativesdk"
@@ -0,0 +1,44 @@
From e174b6e7d195d5a7465575641b7f68581f162574 Mon Sep 17 00:00:00 2001
From: Li Zhou <li.zhou@windriver.com>
Date: Thu, 27 Jun 2019 13:10:47 +0800
Subject: [PATCH] dc: fix exit code of q command
The exit code for "echo q | dc" is 1 for dc-1.4.1;
while the exit code for "echo q | dc" is 0 for dc-1.4.
Here is the answer from ken@gnu.org:
dc-1.4 was right. There was a rewrite of a chunk of code for 1.4.1 to
fix a corner case in the Q command, and somehow the placement of the
clean-up label for the 'q' command got misplaced on the error-handling
branch instead of the clean-exit branch. The patch below fixes this
(it is committed for whenever the next bc/dc release gets made).
Thanks for the report,
--Ken Pizzini
Upstream-Status: Backport [Got the solution from maintainer]
Signed-off-by: Li Zhou <li.zhou@windriver.com>
---
dc/eval.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dc/eval.c b/dc/eval.c
index 05a3d9e..bcab8db 100644
--- a/dc/eval.c
+++ b/dc/eval.c
@@ -814,10 +814,10 @@ error_fail:
fprintf(stderr, "%s: ", progname);
perror("error reading input");
return DC_FAIL;
-reset_and_exit_quit:
reset_and_exit_fail:
signal(SIGINT, sigint_default);
return DC_FAIL;
+reset_and_exit_quit:
reset_and_exit_success:
signal(SIGINT, sigint_default);
return DC_SUCCESS;
--
1.9.1
@@ -0,0 +1,46 @@
{"@iK20:s2:p@r",
"@iF1,5.6,7,8,9,10,11,12,13,14,15[l0:KA:#Z1:l0:s7:pKA:s0:pl5:C1,0:",
"s14:pl7:s0:pl14:RN1:l5:0<Z2:1s12:pl5:ns5:pN2:l2:s15:pK6:l15:+",
"K.44:l5:*+s13:pl5:cS1+s2:pN3:l5:1>Z4:l10:1+s10:pl5:K2:/s5:pl2:",
"1+s2:pJ3:N4:l13:s2:p1l5:+s14:pl5:s6:p1s8:pK2:s11:pN6:1B7:J5:N8:",
"l11:i11:pJ6:N7:l6:l5:*s6:l8:l11:*s8:/s9:pl9:0=Z9:l10:0>Z10:N11:",
"l10:d10:Z12:l14:l14:*s14:pJ11:N12:N10:l15:s2:pl12:Z13:1l14:/R",
"N13:l14:1/RN9:l14:l9:+s14:pJ8:N5:0R]@r",
"@iF2,5.7,9,10,11,12,13,14,15[l0:KA:#Z1:l0:s7:pKA:s0:pl5:C2,0:",
"s14:pl7:s0:pl14:RN1:l5:0{Z2:1K10:l2:^-1/RN2:l2:s15:pK6:l2:+s2:",
"pK2:s10:p0s11:pN3:l5:K2:}Z4:l10:K2:*s10:pl5:cRs5:pJ3:N4:N5:l5:",
"K.5:{Z6:l10:K2:*s10:pl5:cRs5:pJ5:N6:l5:1-l5:1+/s13:s14:pl13:l13:",
"*s12:pK3:s11:pN8:1B9:J7:N10:l11:K2:+s11:pJ8:N9:l13:l12:*s13:l11:",
"/s9:pl9:0=Z11:l10:l14:*s14:pl15:s2:pl14:1/RN11:l14:l9:+s14:pJ10:N7:",
"0R]@r",
"@iF3,5.7,9,11,12,13,16,14,15[l0:KA:#Z1:l0:s7:pKA:s0:pl5:C3,0:",
"s14:pl7:s0:pl14:RN1:l2:s15:pK1.1:l15:*K2:+s2:p1C4,0:s14:pl5:0",
"<Z2:1s12:pl5:ns5:pN2:0s2:pl5:l14:/K2:+K4:/s13:pl5:K4:l13:*l14:",
"*-s5:pl13:K2:%Z3:l5:ns5:pN3:l15:K2:+s2:pl5:s9:s14:pl5:nl5:*s16:",
"pK3:s11:pN5:1B6:J4:N7:l11:K2:+s11:pJ5:N6:l9:l16:l11:l11:1-*/*",
"s9:pl9:0=Z8:l15:s2:pl12:Z9:l14:n1/RN9:l14:1/RN8:l14:l9:+s14:p",
"J7:N4:0R]@r",
"@iF5,5.7,14,15[l0:KA:#Z1:l0:s7:pKA:s0:pl5:C5,0:s14:pl7:s0:pl14:",
"RN1:l2:s15:pl2:K1.2:*s2:pl5:1C4,0:K2:*+C3,0:s14:pl15:s2:pl14:",
"1/R0R]@r",
"@iF4,5.6,7,9,10,11,12,13,16,14,15[l0:KA:#Z1:l0:s7:pKA:s0:pl5:",
"C4,0:s14:pl7:s0:pl14:RN1:1s12:pl5:0<Z2:1ns12:pl5:ns5:pN2:l5:1",
"=Z3:l2:K25:{Z4:K.7853981633974483096156608:l12:/RN4:l2:K40:{Z5:",
"K.7853981633974483096156608458198757210492:l12:/RN5:l2:K60:{Z6:",
"K.785398163397448309615660845819875721049292349843776455243736",
":l12:/RN6:N3:l5:K.2:=Z7:l2:K25:{Z8:K.1973955598498807583700497",
":l12:/RN8:l2:K40:{Z9:K.1973955598498807583700497651947902934475",
":l12:/RN9:l2:K60:{Z10:K.197395559849880758370049765194790293447585103787852101517688",
":l12:/RN10:N7:l2:s15:pl5:K.2:>Z11:l15:K5:+s2:pK.2:C4,0:s6:pN11:",
"l15:K3:+s2:pN12:l5:K.2:>Z13:l10:1+s10:pl5:K.2:-1l5:K.2:*+/s5:",
"pJ12:N13:l5:s13:s14:pl5:nl5:*s16:pK3:s11:pN15:1B16:J14:N17:l11:",
"K2:+s11:pJ15:N16:l13:l16:*s13:l11:/s9:pl9:0=Z18:l15:s2:pl10:l6:",
"*l14:+l12:/RN18:l14:l9:+s14:pJ17:N14:0R]@r",
"@iF6,13,5.6,7,8,9,10,11,12,16,14,15[l0:KA:#Z1:l0:s7:pKA:s0:pl13:",
"l5:C6,00:s14:pl7:s0:pl14:RN1:l2:s15:p0s2:pl13:1/s13:pl13:0<Z2:",
"l13:ns13:pl13:K2:%1=Z3:1s12:pN3:N2:1s10:pK2:s11:pN5:l11:l13:{",
"B6:J4:N7:l11:i11:pJ5:N6:l10:l11:*s10:pJ7:N4:K1.5:l15:*s2:pl5:",
"l13:^K2:l13:^/l10:/s10:p1s9:s14:pl5:nl5:*K4:/s16:pK1.5:l15:*l10:",
"cL+l10:cS-s2:p1s11:pN9:1B10:J8:N11:l11:i11:pJ9:N10:l9:l16:*l11:",
"/l13:l11:+/s9:pl9:0=Z12:l15:s2:pl12:Z13:l10:nl14:*1/RN13:l10:",
"l14:*1/RN12:l14:l9:+s14:pJ11:N8:0R]@r",0}
@@ -0,0 +1,24 @@
These rules are not cross-friendly so delete them and we'll generate the file offline.
Upstream-Status: Inappropriate
Signed-off-by: Ross Burton <ross.burton@intel.com>
diff --git a/bc/Makefile.am b/bc/Makefile.am
index d9d412e..f244241 100644
--- a/bc/Makefile.am
+++ b/bc/Makefile.am
@@ -31,14 +31,6 @@ global.o: libmath.h
fbcOBJ = main.o bc.o scan.o execute.o load.o storage.o util.o warranty.o
-libmath.h: libmath.b $(fbcOBJ) $(LIBBC)
- echo '{0}' > libmath.h
- $(MAKE) global.o
- $(LINK) -o fbc $(fbcOBJ) global.o $(LIBBC) $(LIBL) $(READLINELIB) $(LIBS)
- ./fbc -c $(srcdir)/libmath.b </dev/null >libmath.h
- $(srcdir)/fix-libmath_h
- rm -f ./fbc ./global.o
-
sbcOBJ = main.o sbc.o scan.o execute.o global.o load.o storage.o util.o \
warranty.o
sbc.o: sbc.c
@@ -0,0 +1,9 @@
#! /bin/sh
for TEST in *.b; do
if bc -l $TEST </dev/null; then
echo "PASS: bc/$TEST"
else
echo "FAIL: bc/$TEST"
fi
done
@@ -0,0 +1,40 @@
SUMMARY = "Arbitrary precision calculator language"
HOMEPAGE = "http://www.gnu.org/software/bc/bc.html"
DESCRIPTION = "bc is an arbitrary precision numeric processing language. Syntax is similar to C, but differs in many substantial areas. It supports interactive execution of statements."
LICENSE = "GPL-3.0-or-later"
LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \
file://COPYING.LIB;md5=6a6a8e020838b23406c81b19c1d46df6 \
file://bc/bcdefs.h;endline=17;md5=4295c06df9e833519a342f7b5d43db06 \
file://dc/dc.h;endline=18;md5=36b8c600b63ee8c3aeade2764f6b2a4b \
file://lib/number.c;endline=20;md5=cf43068cc88f837731dc53240456cfaf"
SECTION = "base"
DEPENDS = "flex-native"
SRC_URI = "${GNU_MIRROR}/${BPN}/${BP}.tar.gz \
file://no-gen-libmath.patch \
file://libmath.h \
file://0001-dc-fix-exit-code-of-q-command.patch \
file://run-ptest"
SRC_URI[md5sum] = "cda93857418655ea43590736fc3ca9fc"
SRC_URI[sha256sum] = "62adfca89b0a1c0164c2cdca59ca210c1d44c3ffc46daf9931cf4942664cb02a"
inherit autotools texinfo update-alternatives ptest
PACKAGECONFIG ??= "readline"
PACKAGECONFIG[readline] = "--with-readline,--without-readline,readline"
PACKAGECONFIG[libedit] = "--with-libedit,--without-libedit,libedit"
do_compile:prepend() {
cp -f ${WORKDIR}/libmath.h ${B}/bc/libmath.h
}
do_install_ptest() {
install ${S}/Test/*.b ${D}${PTEST_PATH}
}
ALTERNATIVE:${PN} = "bc dc"
ALTERNATIVE_PRIORITY = "100"
BBCLASSEXTEND = "native nativesdk"
@@ -0,0 +1,40 @@
From 9cb1667f9d3a9bcfc3b83466cd8d3b79f0554ff0 Mon Sep 17 00:00:00 2001
From: Azat Khuzhin <a3at.mail@gmail.com>
Date: Wed, 8 Jul 2015 01:37:09 +0300
Subject: [PATCH 1/3] fix typos in manpage
This patch is taken from
ftp://ftp.debian.org/debian/pool/main/b/blktool/blktool_4-7.debian.tar.xz
Upstream-Status: Inappropriate [upstream is dead]
Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
---
blktool.8 | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/blktool.8 b/blktool.8
index a1f5c96..45b7724 100644
--- a/blktool.8
+++ b/blktool.8
@@ -191,7 +191,7 @@ Query or set device bus state (0 off, 1 on, 2 tristate)
Query the detected (or overridden, via -t) device class.
Typically this will result in 'ATA' or 'SCSI' for most devices.
Detection is based on device major; thus your SATA device may appear as
-'SCSI'.
+\&'SCSI'.
.TP
.B cd-speed
@@ -237,7 +237,7 @@ Omitting the on/off argument will print the current state.
.TP
.B media
-Lock in (or unlock) a removeable device.
+Lock in (or unlock) a removable device.
.TP
.B multiple-count
--
2.1.4
@@ -0,0 +1,31 @@
From ddb1071da2c78d8155aab62e9f0d46f69500200f Mon Sep 17 00:00:00 2001
From: Azat Khuzhin <a3at.mail@gmail.com>
Date: Wed, 8 Jul 2015 01:42:24 +0300
Subject: [PATCH 2/3] fix string error
This patch is taken from
ftp://ftp.debian.org/debian/pool/main/b/blktool/blktool_4-7.debian.tar.xz
Upstream-Status: Inappropriate [upstream is dead]
Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
---
util.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/util.c b/util.c
index 1f3a9ca..2ccf56a 100644
--- a/util.c
+++ b/util.c
@@ -28,7 +28,7 @@ void pdie(const char *msg, int perr)
if (perr)
perror(msg);
else
- fprintf(stderr, msg);
+ fprintf(stderr, "%s", msg);
if (blkdev >= 0)
close(blkdev);
exit(1);
--
2.1.4
@@ -0,0 +1,78 @@
From 68faa63aaad81f4a289e4a03173ab4cf798deb53 Mon Sep 17 00:00:00 2001
From: Azat Khuzhin <a3at.mail@gmail.com>
Date: Sat, 1 Nov 2014 22:24:32 +0300
Subject: [PATCH 3/3] Fix 3-d argument for BLKROSET it must be 'const int *'
Most of *SET ioctls have int type for 3-d argument, except BLKROSET.
So add bc_arg_type enum, build it into bool_comand and install arg_type
to bc_arg_int_ptr for BLKROSET only.
Debian-bug-id: 641164
Link: https://bugs.debian.org/641164
This patch is taken from
ftp://ftp.debian.org/debian/pool/main/b/blktool/blktool_4-7.debian.tar.xz
Upstream-Status: Inappropriate [upstream is dead]
Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
---
blktool.c | 11 +++++++++--
blktool.h | 7 +++++++
2 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/blktool.c b/blktool.c
index fbefecd..221a195 100644
--- a/blktool.c
+++ b/blktool.c
@@ -85,7 +85,7 @@ static struct bool_command bool_cmd_tbl[] = {
{ { DEF_BOOL("pio-data"), dc_ata, DEF_HDIO(32BIT) },
"16-bit", "32-bit" },
{ { DEF_BOOL("readonly"), dc_any, IOCNAME(BLKROGET), IOCNAME(BLKROSET) },
- DEF_BOOLSTR },
+ DEF_BOOLSTR, bc_arg_int_ptr },
{ { DEF_BOOL("unmask-irq"), dc_ata, DEF_HDIO(UNMASKINTR) },
DEF_BOOLSTR },
{ { "wcache", ct_bool, handle_wcache, dc_any,
@@ -171,7 +171,14 @@ static void handle_bool(int argc, char **argv, struct command *cmd)
} else if ((argc == 4) && (cmd->write_ioctl_name != NULL)) {
do_32 = parse_bool(argc, argv, bcm);
- if (ioctl(blkdev, cmd->write_ioctl, do_32))
+
+ int ret;
+ if (bcm->arg_type == bc_arg_int_ptr) {
+ ret = ioctl(blkdev, cmd->write_ioctl, &do_32);
+ } else {
+ ret = ioctl(blkdev, cmd->write_ioctl, do_32);
+ }
+ if (ret)
pdie(cmd->write_ioctl_name, 1);
}
else {
diff --git a/blktool.h b/blktool.h
index fce4387..85add83 100644
--- a/blktool.h
+++ b/blktool.h
@@ -85,11 +85,18 @@ struct command {
const char *write_ioctl_name;
};
+enum bc_arg_type {
+ bc_arg_int,
+ bc_arg_int_ptr,
+};
+
struct bool_command {
struct command cmd;
const char *str_false;
const char *str_true;
+
+ enum bc_arg_type arg_type;
};
struct class_operations {
--
2.1.4
@@ -0,0 +1,19 @@
Description: Fix FTBFS with glibc 2.28
Author: Adrian Bunk <bunk@debian.org>
Bug-Debian: https://bugs.debian.org/917055
This patch is taken from
http://ftp.debian.org/debian/pool/main/b/blktool/blktool_4-7.1.debian.tar.xz
Upstream-Status: Inappropriate [upstream is dead]
Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
--- blktool-4.orig/blktool.c
+++ blktool-4/blktool.c
@@ -18,6 +18,7 @@
#include <unistd.h>
#include <sys/stat.h>
#include <sys/ioctl.h>
+#include <sys/sysmacros.h>
#include <fcntl.h>
#include <errno.h>
#include <getopt.h>
@@ -0,0 +1,29 @@
SUMMARY = "Tune low-level block device parameters"
DESCRIPTION = "blktool is used for querying and/or changing settings \
of a block device. It is like hdparm but a more general tool, as it \
works on SCSI, IDE and SATA devices."
HOMEPAGE = "http://packages.debian.org/unstable/admin/blktool"
LICENSE = "GPL-2.0-or-later"
LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
file://blktool.c;beginline=7;endline=8;md5=a5e798ea98fd50972088968a15e5f373"
DEPENDS = "glib-2.0"
SRC_URI = "http://snapshot.debian.org/archive/debian/20160728T043443Z/pool/main/b/${BPN}/${BPN}_4.orig.tar.gz;name=tarball \
file://0001-fix-typos-in-manpage.patch \
file://0002-fix-string-error.patch \
file://0003-Fix-3-d-argument-for-BLKROSET-it-must-be-const-int.patch \
file://0004-fix-ftbfs-glibc-2.28.patch \
"
SRC_URI[tarball.md5sum] = "62edc09c9908107e69391c87f4f3fd40"
SRC_URI[tarball.sha256sum] = "b1e6d5912546d2a4b704ec65c2b9664aa3b4663e7d800e06803330335a2cb764"
# for this package we're mostly interested in tracking debian patches,
# and not in the upstream version where all development has effectively stopped
UPSTREAM_CHECK_URI = "${DEBIAN_MIRROR}/main/b/blktool/"
UPSTREAM_CHECK_REGEX = "(?P<pver>((\d+\.*)+)-((\d+\.*)+))\.(diff|debian\.tar)\.(gz|xz)"
S = "${WORKDIR}/${BPN}-4.orig"
inherit autotools pkgconfig
@@ -0,0 +1,74 @@
lib_LTLIBRARIES = libbz2.la
libbz2_la_LDFLAGS = -version-info 1:8:0
libbz2_la_SOURCES = blocksort.c \
huffman.c \
crctable.c \
randtable.c \
compress.c \
decompress.c \
bzlib.c
bin_PROGRAMS = bzip2 bzip2recover
bzip2_SOURCES = bzip2.c
bzip2_LDADD = libbz2.la
bzip2_DEPENDENCIES = libbz2.la
include_HEADERS = bzlib.h
bzip2recover_SOURCES = bzip2recover.c
bzip2recover_LDADD = libbz2.la
bzip2recover_DEPENDENCIES = libbz2.la
bin_SCRIPTS = bzgrep bzmore bzdiff
man_MANS = bzip2.1 bzgrep.1 bzmore.1 bzdiff.1
EXTRA_DIST = $(man_MANS)
runtest:
./bzip2 -1 < sample1.ref > sample1.rb2
./bzip2 -2 < sample2.ref > sample2.rb2
./bzip2 -3 < sample3.ref > sample3.rb2
./bzip2 -d < sample1.bz2 > sample1.tst
./bzip2 -d < sample2.bz2 > sample2.tst
./bzip2 -ds < sample3.bz2 > sample3.tst
@if cmp sample1.bz2 sample1.rb2; then echo "PASS: sample1 compress";\
else echo "FAIL: sample1 compress"; fi
@if cmp sample2.bz2 sample2.rb2; then echo "PASS: sample2 compress";\
else echo "FAIL: sample2 compress"; fi
@if cmp sample3.bz2 sample3.rb2; then echo "PASS: sample3 compress";\
else echo "FAIL: sample3 compress"; fi
@if cmp sample1.tst sample1.ref; then echo "PASS: sample1 decompress";\
else echo "FAIL: sample1 decompress"; fi
@if cmp sample2.tst sample2.ref; then echo "PASS: sample2 decompress";\
else echo "FAIL: sample2 decompress"; fi
@if cmp sample3.tst sample3.ref; then echo "PASS: sample3 decompress";\
else echo "FAIL: sample3 decompress"; fi
./bzip2-tests/run-tests.sh --without-valgrind --tests-dir="$(PWD)/bzip2-tests"
install-ptest:
sed -n '/^runtest:/,/^install-ptest:/{/^install-ptest:/!p}' \
$(srcdir)/Makefile.am > $(DESTDIR)/Makefile
cp $(srcdir)/sample1.ref $(DESTDIR)/
cp $(srcdir)/sample2.ref $(DESTDIR)/
cp $(srcdir)/sample3.ref $(DESTDIR)/
cp $(srcdir)/sample1.bz2 $(DESTDIR)/
cp $(srcdir)/sample2.bz2 $(DESTDIR)/
cp $(srcdir)/sample3.bz2 $(DESTDIR)/
ln -s $(bindir)/bzip2 $(DESTDIR)/bzip2
install-exec-hook:
ln -s $(bindir)/bzip2$(EXEEXT) $(DESTDIR)$(bindir)/bunzip2$(EXEEXT)
ln -s $(bindir)/bzip2$(EXEEXT) $(DESTDIR)$(bindir)/bzcat$(EXEEXT)
ln -s $(bindir)/bzgrep$(EXEEXT) $(DESTDIR)$(bindir)/bzegrep$(EXEEXT)
ln -s $(bindir)/bzgrep$(EXEEXT) $(DESTDIR)$(bindir)/bzfgrep$(EXEEXT)
ln -s $(bindir)/bzmore$(EXEEXT) $(DESTDIR)$(bindir)/bzless$(EXEEXT)
ln -s $(bindir)/bzdiff$(EXEEXT) $(DESTDIR)$(bindir)/bzcmp$(EXEEXT)
install-data-hook:
echo ".so man1/bzgrep.1" > $(DESTDIR)$(mandir)/man1/bzegrep.1
echo ".so man1/bzgrep.1" > $(DESTDIR)$(mandir)/man1/bzfgrep.1
echo ".so man1/bzmore.1" > $(DESTDIR)$(mandir)/man1/bzless.1
echo ".so man1/bzdiff.1" > $(DESTDIR)$(mandir)/man1/bzcmp.1
@@ -0,0 +1,11 @@
AC_PREREQ([2.57])
AC_INIT(bzip2, %BZIP2_VERSION%)
AM_INIT_AUTOMAKE(foreign)
AM_MAINTAINER_MODE
AC_PROG_CC
AC_PROG_LIBTOOL
AC_OUTPUT([Makefile])
@@ -0,0 +1,2 @@
#!/bin/sh
make -k runtest
@@ -0,0 +1,70 @@
SUMMARY = "Very high-quality data compression program"
DESCRIPTION = "bzip2 compresses files using the Burrows-Wheeler block-sorting text compression algorithm, and \
Huffman coding. Compression is generally considerably better than that achieved by more conventional \
LZ77/LZ78-based compressors, and approaches the performance of the PPM family of statistical compressors."
HOMEPAGE = "https://sourceware.org/bzip2/"
SECTION = "console/utils"
LICENSE = "bzip2-1.0.6 & GPL-3.0-or-later & Apache-2.0 & MS-PL & BSD-3-Clause & Zlib"
LICENSE:${PN} = "bzip2-1.0.6"
LICENSE:${PN}-dev = "bzip2-1.0.6"
LICENSE:${PN}-dbg = "bzip2-1.0.6"
LICENSE:${PN}-doc = "bzip2-1.0.6"
LICENSE:${PN}-src = "bzip2-1.0.6"
LICENSE:libbz2 = "bzip2-1.0.6"
LICENSE:${PN}-ptest = "bzip2-1.0.6 & GPL-3.0-or-later & Apache-2.0 & MS-PL & BSD-3-Clause & Zlib"
LIC_FILES_CHKSUM = "file://LICENSE;beginline=4;endline=37;md5=600af43c50f1fcb82e32f19b32df4664 \
file://${WORKDIR}/git/commons-compress/LICENSE.txt;md5=86d3f3a95c324c9479bd8986968f4327 \
file://${WORKDIR}/git/dotnetzip/License.txt;md5=9cb56871eed4e748c3bc7e8ff352a54f \
file://${WORKDIR}/git/dotnetzip/License.zlib.txt;md5=cc421ccd22eeb2e5db6b79e6de0a029f \
file://${WORKDIR}/git/go/LICENSE;md5=5d4950ecb7b26d2c5e4e7b4e0dd74707 \
file://${WORKDIR}/git/lbzip2/COPYING;md5=d32239bcb673463ab874e80d47fae504 \
"
SRC_URI = "https://sourceware.org/pub/${BPN}/${BPN}-${PV}.tar.gz \
git://sourceware.org/git/bzip2-tests.git;name=bzip2-tests;branch=master;protocol=https \
file://configure.ac;subdir=${BP} \
file://Makefile.am;subdir=${BP} \
file://run-ptest \
"
SRC_URI[md5sum] = "67e051268d0c475ea773822f7500d0e5"
SRC_URI[sha256sum] = "ab5a03176ee106d3f0fa90e381da478ddae405918153cca248e682cd0c4a2269"
SRCREV_bzip2-tests = "f9061c030a25de5b6829e1abf373057309c734c0"
UPSTREAM_CHECK_URI = "https://www.sourceware.org/pub/bzip2/"
PACKAGES =+ "libbz2"
CFLAGS:append = " -fPIC -fpic -Winline -fno-strength-reduce -D_FILE_OFFSET_BITS=64"
inherit autotools update-alternatives ptest relative_symlinks
ALTERNATIVE_PRIORITY = "100"
ALTERNATIVE:${PN} = "bunzip2 bzcat bzip2"
#install binaries to bzip2-native under sysroot for replacement-native
EXTRA_OECONF:append:class-native = " --bindir=${STAGING_BINDIR_NATIVE}/${PN}"
do_configure:prepend () {
sed -i -e "s|%BZIP2_VERSION%|${PV}|" ${S}/configure.ac
}
do_install_ptest () {
install -d ${D}${PTEST_PATH}/bzip2-tests
cp -r ${WORKDIR}/git/commons-compress ${D}${PTEST_PATH}/bzip2-tests/commons-compress
cp -r ${WORKDIR}/git/dotnetzip ${D}${PTEST_PATH}/bzip2-tests/dotnetzip
cp -r ${WORKDIR}/git/go ${D}${PTEST_PATH}/bzip2-tests/go
cp -r ${WORKDIR}/git/lbzip2 ${D}${PTEST_PATH}/bzip2-tests/lbzip2
cp -r ${WORKDIR}/git/pyflate ${D}${PTEST_PATH}/bzip2-tests/pyflate
cp ${WORKDIR}/git/README ${D}${PTEST_PATH}/bzip2-tests/
cp ${WORKDIR}/git/run-tests.sh ${D}${PTEST_PATH}/bzip2-tests/
sed -i -e "s|^Makefile:|_Makefile:|" ${D}${PTEST_PATH}/Makefile
}
FILES:libbz2 = "${libdir}/lib*${SOLIBS}"
RDEPENDS:${PN}-ptest += "make bash"
PROVIDES:append:class-native = " bzip2-replacement-native"
BBCLASSEXTEND = "native nativesdk"
@@ -0,0 +1,88 @@
SUMMARY = "GNU cpio is a program to manage archives of files"
DESCRIPTION = "GNU cpio is a tool for creating and extracting archives, or copying files from one place to \
another. It handles a number of cpio formats as well as reading and writing tar files."
HOMEPAGE = "http://www.gnu.org/software/cpio/"
SECTION = "base"
LICENSE = "GPL-3.0-only"
LIC_FILES_CHKSUM = "file://COPYING;md5=f27defe1e96c2e1ecd4e0c9be8967949"
SRC_URI = "${GNU_MIRROR}/cpio/cpio-${PV}.tar.gz \
file://0001-configure-Include-needed-header-for-major-minor-macr.patch \
file://run-ptest \
file://test.sh \
"
SRC_URI[sha256sum] = "145a340fd9d55f0b84779a44a12d5f79d77c99663967f8cfa168d7905ca52454"
inherit autotools gettext texinfo ptest
CVE_STATUS[CVE-2010-4226] = "not-applicable-platform: Issue applies to use of cpio in SUSE/OBS"
EXTRA_OECONF += "DEFAULT_RMT_DIR=${sbindir}"
do_install () {
autotools_do_install
if [ "${base_bindir}" != "${bindir}" ]; then
install -d ${D}${base_bindir}/
mv "${D}${bindir}/cpio" "${D}${base_bindir}/cpio"
if [ "${sbindir}" != "${bindir}" ]; then
rmdir ${D}${bindir}/
fi
fi
# Avoid conflicts with the version from tar
mv "${D}${mandir}/man8/rmt.8" "${D}${mandir}/man8/rmt-cpio.8"
}
do_compile_ptest() {
oe_runmake -C ${B}/gnu/ check
oe_runmake -C ${B}/lib/ check
oe_runmake -C ${B}/rmt/ check
oe_runmake -C ${B}/src/ check
oe_runmake -C ${B}/tests/ genfile
}
do_install_ptest() {
install -d ${D}${PTEST_PATH}/tests/
sed -i "/abs_/d" ${B}/tests/atconfig
install --mode=755 ${B}/tests/atconfig ${D}${PTEST_PATH}/tests/
sed -i "s%${B}/tests:%%g" ${B}/tests/atlocal
sed -i "s%${B}/src:%%g" ${B}/tests/atlocal
install --mode=755 ${B}/tests/atlocal ${D}${PTEST_PATH}/tests/
install --mode=755 ${B}/tests/genfile ${D}${PTEST_PATH}/tests/
install --mode=755 ${S}/tests/testsuite ${D}${PTEST_PATH}/tests/
install --mode=755 ${WORKDIR}/test.sh ${D}${PTEST_PATH}/test.sh
sed -i "s#@PTEST_PATH@#${PTEST_PATH}#g" ${D}${PTEST_PATH}/test.sh
}
# ptest.bbclass currently chowns the ptest directory explicitly, so we need to
# change permission after that has happened so the ptest user can write a
# temporary directory.
do_install_ptest_base:append() {
chgrp -R ptest ${D}${PTEST_PATH}/
chmod -R g+w ${D}${PTEST_PATH}/
}
# The tests need to run as a non-root user, so pull in the ptest user
DEPENDS:append:class-target = "${@bb.utils.contains('PTEST_ENABLED', '1', ' ptest-runner', '', d)}"
PACKAGE_WRITE_DEPS:append:class-target = " ${MLPREFIX}ptest-runner"
RDEPENDS:${PN}-ptest += "ptest-runner"
PACKAGES =+ "${PN}-rmt"
FILES:${PN}-rmt = "${sbindir}/rmt*"
inherit update-alternatives
ALTERNATIVE_PRIORITY = "100"
ALTERNATIVE:${PN} = "cpio"
ALTERNATIVE:${PN}-rmt = "rmt"
ALTERNATIVE_LINK_NAME[cpio] = "${base_bindir}/cpio"
ALTERNATIVE_PRIORITY[rmt] = "50"
ALTERNATIVE_LINK_NAME[rmt] = "${sbindir}/rmt"
BBCLASSEXTEND = "native nativesdk"
@@ -0,0 +1,48 @@
From 8179be21e664cedb2e9d238cc2f6d04965e97275 Mon Sep 17 00:00:00 2001
From: Sergey Poznyakoff <gray@gnu.org>
Date: Thu, 11 May 2023 10:18:44 +0300
Subject: [PATCH] configure: Include needed header for major/minor macros
This helps in avoiding the warning about implicit function declaration
which is elevated as error with newer compilers e.g. clang 16
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Upstream-Status: Backport
Signed-off-by: Ross Burton <ross.burton@arm.com>
---
configure.ac | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)
diff --git a/configure.ac b/configure.ac
index de479e7..c601029 100644
--- a/configure.ac
+++ b/configure.ac
@@ -43,8 +43,22 @@ AC_TYPE_UID_T
AC_CHECK_TYPE(gid_t, int)
AC_HEADER_DIRENT
-AX_COMPILE_CHECK_RETTYPE([major], [0])
-AX_COMPILE_CHECK_RETTYPE([minor], [0])
+AX_COMPILE_CHECK_RETTYPE([major], [0], [
+#include <sys/types.h>
+#ifdef MAJOR_IN_MKDEV
+# include <sys/mkdev.h>
+#endif
+#ifdef MAJOR_IN_SYSMACROS
+# include <sys/sysmacros.h>
+#endif])
+AX_COMPILE_CHECK_RETTYPE([minor], [0], [
+#include <sys/types.h>
+#ifdef MAJOR_IN_MKDEV
+# include <sys/mkdev.h>
+#endif
+#ifdef MAJOR_IN_SYSMACROS
+# include <sys/sysmacros.h>
+#endif])
AC_CHECK_FUNCS([fchmod fchown])
# This is needed for mingw build
--
2.34.1
+3
View File
@@ -0,0 +1,3 @@
#!/bin/sh
su -c ./test.sh ptest
@@ -0,0 +1,10 @@
#!/bin/sh
# Define cpio test work dir
WORKDIR=@PTEST_PATH@/tests/
# Run test
cd ${WORKDIR}
./atconfig ./atlocal ./testsuite
./testsuite 2>&1 | grep -E '[0-9]{1,3}: ' | sed -e 's/^.....//' -e '/[ok]$/s/^/PASS: /;/FAILED (.*)/s/^/FAIL: /;/skipped (.*)/s/^/SKIP: /;/expected failure/ s/^/PASS: /;/UNEXPECTED PASS/s/^/FAIL: /' -e 's/ok$//g' -e 's/FAILED.*//g' -e 's/skipped.*//g' -e 's/expected failure.*//g' -e 's/UNEXPECTED PASS.*//g'
@@ -0,0 +1,339 @@
From aae03b7e626d5f62ab929d51d11352a5a2ff6b2d Mon Sep 17 00:00:00 2001
From: Lei Maohui <leimaohui@cn.fujitsu.com>
Date: Tue, 9 Jun 2015 11:11:48 +0900
Subject: [PATCH 1/2] packlib.c: support dictionary byte order dependent
The previous dict files are NOT byte-order independent, in fact they are
probably ARCHITECTURE SPECIFIC.
Create the dict files in big endian, and convert to host endian while
load them. This could fix the endian issue on multiple platform.
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Upstream-Status: Submitted [https://github.com/cracklib/cracklib/pull/41]
We can't use the endian.h, htobe* and be*toh functions because they are
not available on older versions of glibc, such as that found in RHEL
5.9.
Change to checking endian and directly calling bswap_* as defined in
byteswap.h.
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Lei Maohui <leimaohui@cn.fujitsu.com>
---
lib/packlib.c | 214 +++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 210 insertions(+), 4 deletions(-)
diff --git a/lib/packlib.c b/lib/packlib.c
index 9396e1d..d0bb181 100644
--- a/lib/packlib.c
+++ b/lib/packlib.c
@@ -16,6 +16,12 @@
#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif
+
+#ifndef _BSD_SOURCE
+#define _BSD_SOURCE /* See feature_test_macros(7) */
+#endif
+#include <endian.h>
+#include <byteswap.h>
#include "packer.h"
#define DEBUG 0
@@ -43,6 +49,185 @@ typedef struct
char data_get[NUMWORDS][MAXWORDLEN];
} PWDICT64;
+enum{
+ en_is32,
+ en_is64
+};
+
+static int
+IheaderHostToBigEndian(char *pHeader, int nBitType)
+{
+ if (nBitType == en_is64 && __BYTE_ORDER == __LITTLE_ENDIAN)
+ {
+ struct pi_header64 *pHeader64 = (struct pi_header64*)pHeader;
+
+ pHeader64->pih_magic = bswap_64(pHeader64->pih_magic);
+ pHeader64->pih_numwords = bswap_64(pHeader64->pih_numwords);
+ pHeader64->pih_blocklen = bswap_16(pHeader64->pih_blocklen);
+ pHeader64->pih_pad = bswap_16(pHeader64->pih_pad);
+
+#if DEBUG
+ printf("Header64: magic %x, numwords %x, blocklen %x, pad %x\n",
+ pHeader64->pih_magic, pHeader64->pih_numwords,
+ pHeader64->pih_blocklen, pHeader64->pih_pad);
+#endif
+ }
+ else if (nBitType == en_is32 && __BYTE_ORDER == __LITTLE_ENDIAN)
+ {
+ struct pi_header *pHeader32 = (struct pi_header*)pHeader;
+
+ pHeader32->pih_magic = bswap_32(pHeader32->pih_magic);
+ pHeader32->pih_numwords = bswap_32(pHeader32->pih_numwords);
+ pHeader32->pih_blocklen = bswap_16(pHeader32->pih_blocklen);
+ pHeader32->pih_pad = bswap_16(pHeader32->pih_pad);
+
+#if DEBUG
+ printf("Header32: magic %x, numwords %x, blocklen %x, pad %x\n",
+ pHeader32->pih_magic, pHeader32->pih_numwords,
+ pHeader32->pih_blocklen, pHeader32->pih_pad);
+#endif
+ }
+ else if (__BYTE_ORDER == __LITTLE_ENDIAN)
+ {
+ fprintf(stderr, "Neither 32 or 64: %d\n", nBitType);
+ return (-1);
+ }
+
+ return 0;
+}
+
+static int
+IheaderBigEndianToHost(char *pHeader, int nBitType)
+{
+ if (nBitType == en_is64 && __BYTE_ORDER == __LITTLE_ENDIAN)
+ {
+ struct pi_header64 *pHeader64 = (struct pi_header64*)pHeader;
+
+ pHeader64->pih_magic = bswap_64(pHeader64->pih_magic);
+ pHeader64->pih_numwords = bswap_64(pHeader64->pih_numwords);
+ pHeader64->pih_blocklen = bswap_16(pHeader64->pih_blocklen);
+ pHeader64->pih_pad = bswap_16(pHeader64->pih_pad);
+
+#if DEBUG
+ printf("Header64: magic %x, numwords %x, blocklen %x, pad %x\n",
+ pHeader64->pih_magic, pHeader64->pih_numwords,
+ pHeader64->pih_blocklen, pHeader64->pih_pad);
+#endif
+ }
+ else if (nBitType == en_is32 && __BYTE_ORDER == __LITTLE_ENDIAN)
+ {
+ struct pi_header *pHeader32 = (struct pi_header*)pHeader;
+
+ pHeader32->pih_magic = bswap_32(pHeader32->pih_magic);
+ pHeader32->pih_numwords = bswap_32(pHeader32->pih_numwords);
+ pHeader32->pih_blocklen = bswap_16(pHeader32->pih_blocklen);
+ pHeader32->pih_pad = bswap_16(pHeader32->pih_pad);
+
+#if DEBUG
+ printf("Header32: magic %x, numwords %x, blocklen %x, pad %x\n",
+ pHeader32->pih_magic, pHeader32->pih_numwords,
+ pHeader32->pih_blocklen, pHeader32->pih_pad);
+#endif
+ }
+ else if (__BYTE_ORDER == __LITTLE_ENDIAN)
+ {
+ fprintf(stderr, "Neither 32 or 64: %d\n", nBitType);
+ return (-1);
+ }
+
+ return 0;
+}
+
+static int
+HwmsHostToBigEndian(char *pHwms, int nLen,int nBitType)
+{
+ int i = 0;
+
+ if (nBitType == en_is64 && __BYTE_ORDER == __LITTLE_ENDIAN)
+ {
+ uint64_t *pHwms64 = (uint64_t*)pHwms;
+
+ for (i = 0; i < nLen / sizeof(uint64_t); i++)
+ {
+ *pHwms64 = bswap_64(*pHwms64);
+ *pHwms64++;
+ }
+
+ }
+ else if (nBitType == en_is32 && __BYTE_ORDER == __LITTLE_ENDIAN)
+ {
+ uint32_t *pHwms32 = (uint32_t*)pHwms;
+
+ for (i = 0; i < nLen / sizeof(uint32_t); i++)
+ {
+ *pHwms32 = bswap_32(*pHwms32);
+ *pHwms32++;
+ }
+
+ }
+ else if (__BYTE_ORDER == __LITTLE_ENDIAN)
+ {
+ fprintf(stderr, "Neither 32 or 64: %d\n", nBitType);
+ return (-1);
+ }
+
+#if DEBUG
+ for (i = 0; i < nLen; i+=8)
+ {
+ printf("hwms%s: %02X %02X %02X %02X %02X %02X %02X %02X\n",
+ nBitType==en_is64?"64":"32", pHwms[i+0]&0xFF, pHwms[i+1]&0xFF,
+ pHwms[i+2]&0xFF, pHwms[i+3]&0xFF, pHwms[i+4]&0xFF,
+ pHwms[i+5]&0xFF, pHwms[i+6]&0xFF, pHwms[i+7]&0xFF);
+ }
+#endif
+
+ return 0;
+}
+
+static int
+HwmsBigEndianToHost(char *pHwms, int nLen, int nBitType)
+{
+ int i = 0;
+
+ if (nBitType == en_is64 && __BYTE_ORDER == __LITTLE_ENDIAN)
+ {
+ uint64_t *pHwms64 = (uint64_t*)pHwms;
+
+ for (i = 0; i < nLen / sizeof(uint64_t); i++)
+ {
+ *pHwms64++ = bswap_64(*pHwms64);
+ }
+
+ }
+ else if (nBitType == en_is32 && __BYTE_ORDER == __LITTLE_ENDIAN)
+ {
+ uint32_t *pHwms32 = (uint32_t*)pHwms;
+
+ for (i = 0; i < nLen / sizeof(uint32_t); i++)
+ {
+ *pHwms32 = bswap_32(*pHwms32);
+ *pHwms32++;
+ }
+
+ }
+ else if (__BYTE_ORDER == __LITTLE_ENDIAN)
+ {
+ fprintf(stderr, "Neither 32 or 64: %d\n", nBitType);
+ return (-1);
+ }
+
+#if DEBUG
+ for (i = 0; i < nLen; i+=8)
+ {
+ printf("hwms%s: %02X %02X %02X %02X %02X %02X %02X %02X\n",
+ nBitType==en_is64?"64":"32", pHwms[i+0]&0xFF, pHwms[i+1]&0xFF,
+ pHwms[i+2]&0xFF, pHwms[i+3]&0xFF, pHwms[i+4]&0xFF,
+ pHwms[i+5]&0xFF, pHwms[i+6]&0xFF, pHwms[i+7]&0xFF);
+ }
+#endif
+
+ return 0;
+}
static int
_PWIsBroken64(FILE *ifp)
@@ -55,6 +240,7 @@ _PWIsBroken64(FILE *ifp)
return 0;
}
+ IheaderBigEndianToHost((char *) &pdesc64.header, en_is64);
return (pdesc64.header.pih_magic == PIH_MAGIC);
}
@@ -147,7 +333,11 @@ PWOpen(prefix, mode)
pdesc.header.pih_blocklen = NUMWORDS;
pdesc.header.pih_numwords = 0;
- fwrite((char *) &pdesc.header, sizeof(pdesc.header), 1, ifp);
+ struct pi_header tmpheader32;
+
+ memcpy(&tmpheader32, &pdesc.header, sizeof(pdesc.header));
+ IheaderHostToBigEndian((char *) &tmpheader32, en_is32);
+ fwrite((char *) &tmpheader32, sizeof(tmpheader32), 1, ifp);
} else
{
pdesc.flags &= ~PFOR_WRITE;
@@ -171,6 +361,7 @@ PWOpen(prefix, mode)
return NULL;
}
+ IheaderBigEndianToHost((char *) &pdesc.header, en_is32);
if ((pdesc.header.pih_magic == 0) || (pdesc.header.pih_numwords == 0))
{
/* uh-oh. either a broken "64-bit" file or a garbage file. */
@@ -193,6 +384,7 @@ PWOpen(prefix, mode)
}
return NULL;
}
+ IheaderBigEndianToHost((char *) &pdesc64.header, en_is64);
if (pdesc64.header.pih_magic != PIH_MAGIC)
{
/* nope, not "64-bit" after all */
@@ -288,6 +480,7 @@ PWOpen(prefix, mode)
{
pdesc.flags &= ~PFOR_USEHWMS;
}
+ HwmsBigEndianToHost((char*)pdesc64.hwms, sizeof(pdesc64.hwms), en_is64);
for (i = 0; i < sizeof(pdesc.hwms) / sizeof(pdesc.hwms[0]); i++)
{
pdesc.hwms[i] = pdesc64.hwms[i];
@@ -297,6 +490,7 @@ PWOpen(prefix, mode)
{
pdesc.flags &= ~PFOR_USEHWMS;
}
+ HwmsBigEndianToHost((char*)pdesc.hwms, sizeof(pdesc.hwms), en_is32);
#if DEBUG
for (i=1; i<=0xff; i++)
{
@@ -330,7 +524,11 @@ PWClose(pwp)
return (-1);
}
- if (!fwrite((char *) &pwp->header, sizeof(pwp->header), 1, pwp->ifp))
+ struct pi_header tmpheader32;
+
+ memcpy(&tmpheader32, &pwp->header, sizeof(pwp->header));
+ IheaderHostToBigEndian((char *) &tmpheader32, en_is32);
+ if (!fwrite((char *) &tmpheader32, sizeof(tmpheader32), 1, pwp->ifp))
{
fprintf(stderr, "index magic fwrite failed\n");
return (-1);
@@ -349,7 +547,12 @@ PWClose(pwp)
printf("hwm[%02x] = %d\n", i, pwp->hwms[i]);
#endif
}
- fwrite(pwp->hwms, 1, sizeof(pwp->hwms), pwp->wfp);
+
+ PWDICT tmp_pwp;
+
+ memcpy(&tmp_pwp, pwp, sizeof(PWDICT));
+ HwmsHostToBigEndian(tmp_pwp.hwms, sizeof(tmp_pwp.hwms), en_is32);
+ fwrite(tmp_pwp.hwms, 1, sizeof(tmp_pwp.hwms), pwp->wfp);
}
}
@@ -403,7 +606,8 @@ PutPW(pwp, string)
datum = (uint32_t) ftell(pwp->dfp);
- fwrite((char *) &datum, sizeof(datum), 1, pwp->ifp);
+ uint32_t tmpdatum = (__BYTE_ORDER == __LITTLE_ENDIAN) ? bswap_32(datum) : datum;
+ fwrite((char *) &tmpdatum, sizeof(tmpdatum), 1, pwp->ifp);
fputs(pwp->data_put[0], pwp->dfp);
putc(0, (FILE*) pwp->dfp);
@@ -462,6 +666,7 @@ GetPW(pwp, number)
perror("(index fread failed)");
return NULL;
}
+ datum64 = (__BYTE_ORDER == __LITTLE_ENDIAN) ? bswap_64(datum64) : datum64;
datum = datum64;
} else {
if (fseek(pwp->ifp, sizeof(struct pi_header) + (thisblock * sizeof(uint32_t)), 0))
@@ -475,6 +680,7 @@ GetPW(pwp, number)
perror("(index fread failed)");
return NULL;
}
+ datum = (__BYTE_ORDER == __LITTLE_ENDIAN) ? bswap_32(datum) : datum;
}
int r = 1;
--
2.20.1
@@ -0,0 +1,33 @@
SUMMARY = "Password strength checker library"
HOMEPAGE = "https://github.com/cracklib/cracklib"
DESCRIPTION = "${SUMMARY}"
LICENSE = "LGPL-2.1-or-later"
LIC_FILES_CHKSUM = "file://COPYING.LIB;md5=e3eda01d9815f8d24aae2dbd89b68b06"
DEPENDS = "cracklib-native zlib"
EXTRA_OECONF = "--without-python --libdir=${base_libdir}"
SRC_URI = "git://github.com/cracklib/cracklib;protocol=https;branch=main \
file://0001-packlib.c-support-dictionary-byte-order-dependent.patch \
"
SRCREV = "4cf5125250c6325ef0a2dc085eabff875227edc3"
S = "${WORKDIR}/git/src"
inherit autotools gettext
# This is custom stuff from upstream's autogen.sh
do_configure:prepend() {
mkdir -p ${S}/m4
echo EXTRA_DIST = *.m4 > ${S}/m4/Makefile.am
touch ${S}/ABOUT-NLS
}
do_install:append:class-target() {
create-cracklib-dict -o ${D}${datadir}/cracklib/pw_dict ${D}${datadir}/cracklib/cracklib-small
}
BBCLASSEXTEND = "native nativesdk"
+58
View File
@@ -0,0 +1,58 @@
#!/bin/sh
### BEGIN INIT INFO
# Provides: crond crontab
# Default-Start: 2345
# Default-Stop: 016
# Short-Description: run cron daemon
# Description: cron is a standard UNIX program that runs user-specified
# programs at periodic scheduled times. vixie cron adds a
# number of features to the basic UNIX cron, including better
# security and more powerful configuration options.
### END INIT INFO
CROND=/usr/sbin/crond
CONFIG=/etc/sysconfig/crond
[ -f $CONFIG ] || exit 1
[ -x $CROND ] || exit 1
. $CONFIG
# Source function library.
. /etc/init.d/functions
case "$1" in
start)
echo -n "Starting crond: "
start-stop-daemon --start --quiet --exec $CROND -- $CRONDARGS
RETVAL=$?
if [ $RETVAL -eq 0 ] ; then
echo "OK"
else
echo "FAIL"
fi
;;
stop)
echo -n "Stopping crond: "
start-stop-daemon --stop --quiet --pidfile /var/run/crond.pid
RETVAL=$?
if [ $RETVAL -eq 0 ] ; then
echo "OK"
else
echo "FAIL"
fi
;;
status)
status crond
exit $?
;;
restart)
$0 stop && sleep 1 && $0 start
;;
*)
echo "Usage: /etc/init.d/crond {start|stop|status|restart}"
exit 1
esac
exit 0
@@ -0,0 +1,11 @@
[Unit]
Description=Periodic Command Scheduler
[Service]
EnvironmentFile=/etc/sysconfig/crond
ExecStart=@SBINDIR@/crond -n $CRONDARGS
ExecReload=@BASE_BINDIR@/kill -HUP $MAINPID
Restart=always
[Install]
WantedBy=multi-user.target
@@ -0,0 +1,22 @@
password-auth is the Fedora's common pam configure file, use oe common pam
configure files instead.
Upstream-Status: Pending
Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
diff --git a/pam/crond b/pam/crond
index 560529d..95a6457 100644
--- a/pam/crond
+++ b/pam/crond
@@ -4,8 +4,8 @@
#
# Although no PAM authentication is called, auth modules
# are used for credential setting
-auth include system-auth
+auth include common-auth
account required pam_access.so
-account include system-auth
+account include common-auth
session required pam_loginuid.so
-session include system-auth
+session include common-session-noninteractive
@@ -0,0 +1,14 @@
# /etc/crontab: system-wide crontab
# Unlike any other crontab you don't have to run the `crontab'
# command to install the new version when you edit this file
# and files in /etc/cron.d. These files also have username fields,
# that none of the other crontabs do.
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
# m h dom mon dow user command
# 1 * * * * root cd / && run-parts /etc/cron.hourly
# 30 7 * * * root cd / && run-parts /etc/cron.daily
# 42 7 * * 7 root cd / && run-parts /etc/cron.weekly
# 55 7 1 * * root cd / && run-parts /etc/cron.monthly
@@ -0,0 +1,85 @@
SUMMARY = "Cron daemon for executing programs at set times"
DESCRIPTION = "Cronie contains the standard UNIX daemon crond that runs \
specified programs at scheduled times and related tools. It is based on the \
original cron and has security and configuration enhancements like the \
ability to use pam and SELinux."
HOMEPAGE = "https://github.com/cronie-crond/cronie/"
BUGTRACKER = "https://bugzilla.redhat.com"
# Internet Systems Consortium License
LICENSE = "ISC & BSD-3-Clause & BSD-2-Clause & GPL-2.0-or-later"
LIC_FILES_CHKSUM = "file://COPYING;md5=dd2a592170760e1386c769e1043b3722 \
file://src/cron.c;endline=20;md5=b425c334265026177128353a142633b4 \
file://src/popen.c;beginline=3;endline=31;md5=edd50742d8def712e9472dba353668a9"
SECTION = "utils"
GITHUB_BASE_URI = "https://github.com/cronie-crond/${BPN}/releases/"
SRC_URI = "${GITHUB_BASE_URI}/download/cronie-${PV}/cronie-${PV}.tar.gz \
file://crond.init \
file://crontab \
file://crond.service \
${@bb.utils.contains('DISTRO_FEATURES', 'pam', '${PAM_SRC_URI}', '', d)}"
PAM_SRC_URI = "file://crond_pam_config.patch"
PAM_DEPS = "libpam libpam-runtime pam-plugin-access pam-plugin-loginuid"
SRC_URI[sha256sum] = "2cd0f0dd1680e6b9c39bf1e3a5e7ad6df76aa940de1ee90a453633aa59984e62"
inherit autotools update-rc.d useradd systemd github-releases
UPSTREAM_CHECK_REGEX = "releases/tag/cronie-(?P<pver>\d+(\.\d+)+)"
PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}"
PACKAGECONFIG[audit] = "--with-audit,--without-audit,audit,"
PACKAGECONFIG[pam] = "--with-pam,--without-pam,libpam,${PAM_DEPS}"
PACKAGECONFIG[anacron] = "--enable-anacron,--disable-anacron,anacron"
PACKAGECONFIG[selinux] = "--with-selinux,--without-selinux,libselinux"
INITSCRIPT_NAME = "crond"
INITSCRIPT_PARAMS = "start 90 2 3 4 5 . stop 60 0 1 6 ."
USERADD_PACKAGES = "${PN}"
GROUPADD_PARAM:${PN} = "--system crontab"
SYSTEMD_SERVICE:${PN} = "crond.service"
do_install:append () {
install -d ${D}${sysconfdir}/sysconfig/
install -d ${D}${sysconfdir}/init.d/
install -m 0644 ${S}/crond.sysconfig ${D}${sysconfdir}/sysconfig/crond
install -m 0755 ${WORKDIR}/crond.init ${D}${sysconfdir}/init.d/crond
# install systemd unit files
install -d ${D}${systemd_system_unitdir}
install -m 0644 ${WORKDIR}/crond.service ${D}${systemd_system_unitdir}
sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \
-e 's,@SBINDIR@,${sbindir},g' \
${D}${systemd_system_unitdir}/crond.service
# below are necessary for a complete cron environment
install -d ${D}${localstatedir}/spool/cron
install -m 0755 ${WORKDIR}/crontab ${D}${sysconfdir}/
mkdir -p ${D}${sysconfdir}/cron.d
mkdir -p ${D}${sysconfdir}/cron.hourly
mkdir -p ${D}${sysconfdir}/cron.daily
mkdir -p ${D}${sysconfdir}/cron.weekly
mkdir -p ${D}${sysconfdir}/cron.monthly
touch ${D}${sysconfdir}/cron.deny
# below setting is necessary to allow normal user using crontab
# setgid for crontab binary
chown root:crontab ${D}${bindir}/crontab
chmod 2755 ${D}${bindir}/crontab
# allow 'crontab' group write to /var/spool/cron
chown root:crontab ${D}${localstatedir}/spool/cron
chmod 770 ${D}${localstatedir}/spool/cron
chmod 600 ${D}${sysconfdir}/crontab
}
FILES:${PN} += "${sysconfdir}/cron*"
CONFFILES:${PN} += "${sysconfdir}/crontab"
+113
View File
@@ -0,0 +1,113 @@
SUMMARY = "An Internet printing system for Unix"
DESCRIPTION = "The Common UNIX Printing System is a printing system and \
general replacement for lpd and the like. It supports the Internet Printing \
Protocol (IPP), and has its own filtering driver model for handling various \
document types."
HOMEPAGE = "https://www.cups.org/"
SECTION = "console/utils"
LICENSE = "Apache-2.0"
DEPENDS = "libpng jpeg dbus zlib libusb1"
SRC_URI = "${GITHUB_BASE_URI}/download/v${PV}/cups-${PV}-source.tar.gz \
file://0001-use-echo-only-in-init.patch \
file://0002-don-t-try-to-run-generated-binaries.patch \
file://libexecdir.patch \
file://0004-cups-fix-multilib-install-file-conflicts.patch \
file://volatiles.99_cups \
file://cups-volatiles.conf \
"
GITHUB_BASE_URI = "https://github.com/OpenPrinting/cups/releases"
CVE_STATUS[CVE-2008-1033] = "not-applicable-platform: Issue only applies to MacOS"
CVE_STATUS[CVE-2009-0032] = "cpe-incorrect: Issue affects pdfdistiller plugin used with but not part of cups"
CVE_STATUS[CVE-2018-6553] = "not-applicable-platform: This is an Ubuntu only issue"
CVE_STATUS[CVE-2022-26691] = "fixed-version: This is fixed in 2.4.2 but the cve-check class still reports it"
CVE_STATUS[CVE-2021-25317] = "not-applicable-config: This concerns /var/log/cups having lp ownership, our /var/log/cups is root:root, so this doesn't apply."
LEAD_SONAME = "libcupsdriver.so"
CLEANBROKEN = "1"
inherit autotools-brokensep binconfig useradd systemd pkgconfig multilib_script github-releases
USERADD_PACKAGES = "${PN}"
GROUPADD_PARAM:${PN} = "--system lpadmin"
SYSTEMD_SERVICE:${PN} = "cups.socket cups.path cups.service cups-lpd.socket"
PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'zeroconf', 'avahi', '', d)} \
${@bb.utils.filter('DISTRO_FEATURES', 'pam systemd', d)}"
PACKAGECONFIG[avahi] = "--with-dnssd=avahi,--with-dnssd=no,avahi"
PACKAGECONFIG[acl] = "--enable-acl,--disable-acl,acl"
PACKAGECONFIG[gnutls] = "--with-tls=gnutls,--with-tls=no,gnutls"
PACKAGECONFIG[pam] = "--enable-pam --with-pam-module=unix, --disable-pam, libpam"
PACKAGECONFIG[systemd] = "--with-systemd=${systemd_system_unitdir},--without-systemd,systemd"
PACKAGECONFIG[xinetd] = "--with-xinetd=${sysconfdir}/xinetd.d,--without-xinetd,xinetd"
PACKAGECONFIG[webif] = "--enable-webif,--disable-webif"
EXTRA_OECONF = " \
--enable-dbus \
--with-dbusdir=${sysconfdir}/dbus-1 \
--enable-browsing \
--disable-gssapi \
--enable-debug \
--disable-relro \
--enable-libusb \
--with-system-groups=lpadmin \
--with-cups-group=lp \
--with-domainsocket=/run/cups/cups.sock \
--with-pkgconfpath=${libdir}/pkgconfig \
DSOFLAGS='${LDFLAGS}' \
"
EXTRA_AUTORECONF += "--exclude=autoheader"
do_install () {
oe_runmake "BUILDROOT=${D}" install
# Remove /var/run from package as cupsd will populate it on startup
rm -fr ${D}/${localstatedir}/run
rm -fr ${D}/${localstatedir}/log
rmdir ${D}/${libexecdir}/${BPN}/driver
# Fix the pam configuration file permissions
if ${@bb.utils.contains('PACKAGECONFIG', 'pam', 'true', 'false', d)}; then
chmod 0644 ${D}${sysconfdir}/pam.d/cups
fi
# Remove sysinit script and symlinks if sysvinit is not in DISTRO_FEATURES
if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','false','true',d)}; then
rm -rf ${D}${sysconfdir}/init.d/
rm -rf ${D}${sysconfdir}/rc*
install -d ${D}${sysconfdir}/tmpfiles.d
install -m 0644 ${WORKDIR}/cups-volatiles.conf \
${D}${sysconfdir}/tmpfiles.d/cups.conf
else
install -d ${D}${sysconfdir}/default/volatiles
install -m 0644 ${WORKDIR}/volatiles.99_cups \
${D}${sysconfdir}/default/volatiles/99_cups
fi
}
PACKAGES =+ "${PN}-lib ${PN}-libimage ${PN}-webif"
RDEPENDS:${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'procps', '', d)}"
FILES:${PN} += "${libexecdir}/cups/"
FILES:${PN}-lib = "${libdir}/libcups.so.*"
FILES:${PN}-libimage = "${libdir}/libcupsimage.so.*"
# put the html for the web interface into its own PACKAGE
FILES:${PN}-webif += "${datadir}/doc/cups/ ${datadir}/icons/"
RRECOMMENDS:${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'webif', '${PN}-webif', '', d)}"
CONFFILES:${PN} += "${sysconfdir}/cups/cupsd.conf"
MULTILIB_SCRIPTS = "${PN}-dev:${bindir}/cups-config"
SYSROOT_PREPROCESS_FUNCS += "cups_sysroot_preprocess"
cups_sysroot_preprocess () {
sed -i ${SYSROOT_DESTDIR}${bindir_crossscripts}/cups-config -e 's:cups_datadir=.*:cups_datadir=${datadir}/cups:' -e 's:cups_serverbin=.*:cups_serverbin=${libexecdir}/cups:'
}
@@ -0,0 +1,27 @@
From a3f4d8ba97f4669a95943a7e65eb61aa44ce7999 Mon Sep 17 00:00:00 2001
From: Saul Wold <sgw@linux.intel.com>
Date: Thu, 13 Dec 2012 19:03:52 -0800
Subject: [PATCH 1/4] use echo only in init
Upstream-Status: Inappropriate [embedded specific]
Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
---
scheduler/cups.sh.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scheduler/cups.sh.in b/scheduler/cups.sh.in
index 89ac36d..6618a0f 100644
--- a/scheduler/cups.sh.in
+++ b/scheduler/cups.sh.in
@@ -50,7 +50,7 @@ case "`uname`" in
ECHO_ERROR=:
;;
- Linux*)
+ DisableLinux*)
IS_ON=/bin/true
if test -f /etc/init.d/functions; then
. /etc/init.d/functions
--
2.17.1
@@ -0,0 +1,31 @@
From 3e9a965dcd65ab2d40b753b6f792a1a4559182aa Mon Sep 17 00:00:00 2001
From: Koen Kooi <koen@dominion.thruhere.net>
Date: Sun, 30 Jan 2011 16:37:27 +0100
Subject: [PATCH 2/4] don't try to run generated binaries
Upstream-Status: Inappropriate [embedded specific]
Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
---
ppdc/Makefile | 32 ++++++++++++++++----------------
1 file changed, 16 insertions(+), 16 deletions(-)
diff --git a/ppdc/Makefile b/ppdc/Makefile
index 32e2e0b..f1478d4 100644
--- a/ppdc/Makefile
+++ b/ppdc/Makefile
@@ -186,8 +186,8 @@ genstrings: genstrings.o libcupsppdc.a ../cups/$(LIBCUPSSTATIC) \
$(LD_CXX) $(ARCHFLAGS) $(ALL_LDFLAGS) -o genstrings genstrings.o \
libcupsppdc.a $(LINKCUPSSTATIC)
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
- echo Generating localization strings...
- ./genstrings >sample.c
+# echo Generating localization strings...
+# ./genstrings >sample.c
#
--
2.17.1
@@ -0,0 +1,33 @@
From 7dbda1887aa19ab720aff22312f4caff2d575f62 Mon Sep 17 00:00:00 2001
From: Kai Kang <kai.kang@windriver.com>
Date: Wed, 3 Oct 2018 00:27:11 +0800
Subject: [PATCH 4/4] cups: fix multilib install file conflicts
@CUPS_SERVERBIN@ is ${libdir} related that causes multilib install file
conflict. Remove @CUPS_SERVERBIN@ from the comment line of cups-files.conf to
avoid the conflict.
Upstream-Status: Inappropriate [OE specific]
Signed-off-by: Kai Kang <kai.kang@windriver.com>
---
conf/cups-files.conf.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/conf/cups-files.conf.in b/conf/cups-files.conf.in
index 4a78ba6..03c6582 100644
--- a/conf/cups-files.conf.in
+++ b/conf/cups-files.conf.in
@@ -73,7 +73,7 @@ PageLog @CUPS_LOGDIR@/page_log
#RequestRoot @CUPS_REQUESTS@
# Location of helper programs...
-#ServerBin @CUPS_SERVERBIN@
+#ServerBin
# SSL/TLS keychain for the scheduler...
#ServerKeychain @CUPS_SERVERKEYCHAIN@
--
2.17.1
@@ -0,0 +1 @@
d /var/log/cups 0755 root root -
@@ -0,0 +1,35 @@
From 1724f7bcdbcfdb445778f8a2e530c5c094c18c10 Mon Sep 17 00:00:00 2001
From: Ross Burton <ross.burton@arm.com>
Date: Tue, 13 Jul 2021 12:56:30 +0100
Subject: [PATCH] Use $libexecdir instead of hardcoding $prefix/lib as this
breaks multilib builds.
Upstream-Status: Pending
Signed-off-by: Ross Burton <ross.burton@arm.com>
---
config-scripts/cups-directories.m4 | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/config-scripts/cups-directories.m4 b/config-scripts/cups-directories.m4
index 2033d47..230166e 100644
--- a/config-scripts/cups-directories.m4
+++ b/config-scripts/cups-directories.m4
@@ -239,7 +239,7 @@ AC_SUBST([CUPS_REQUESTS])
AS_CASE(["$host_os_name"], [*-gnu], [
# GNUs
INSTALL_SYSV="install-sysv"
- CUPS_SERVERBIN="$exec_prefix/lib/cups"
+ CUPS_SERVERBIN="$libexecdir/cups"
], [*bsd* | darwin*], [
# *BSD and Darwin (macOS)
INSTALL_SYSV=""
@@ -247,7 +247,7 @@ AS_CASE(["$host_os_name"], [*-gnu], [
], [*], [
# All others
INSTALL_SYSV="install-sysv"
- CUPS_SERVERBIN="$exec_prefix/lib/cups"
+ CUPS_SERVERBIN="$libexecdir/cups"
])
AC_DEFINE_UNQUOTED([CUPS_SERVERBIN], ["$CUPS_SERVERBIN"], [Location of server programs.])
@@ -0,0 +1,2 @@
# <type> <owner> <group> <mode> <path> <linksource>
d root root 0755 /var/log/cups none
@@ -0,0 +1,5 @@
require cups.inc
LIC_FILES_CHKSUM = "file://LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57"
SRC_URI[sha256sum] = "58e970cf1955e1cc87d0847c32526d9c2ccee335e5f0e3882b283138ba0e7262"
@@ -0,0 +1,23 @@
SUMMARY = "Collection of autoconf m4 macros"
SECTION = "base"
HOMEPAGE = "http://sourceforge.net/projects/cwautomacros.berlios/"
DESCRIPTION = "A collection of autoconf macros, plus an autogen.sh script that can be used with them."
LICENSE = "GPL-2.0-only"
LIC_FILES_CHKSUM = "file://LICENSE;md5=eb723b61539feef013de476e68b5c50a"
SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}.berlios/${BP}.tar.bz2"
SRC_URI[md5sum] = "074afcb50d0a8bff10786a2954b2b02d"
SRC_URI[sha256sum] = "3115603b891f3a163c0bbb5fea2f3742113a183fa6745ee5e89e5f6d0e9f6121"
do_configure() {
:
}
do_install() {
oe_runmake LABEL=`date -d @${SOURCE_DATE_EPOCH} +%Y%m%d` CWAUTOMACROSPREFIX=${D}${prefix} install
# cleanup buildpaths in autogen.sh
sed -i -e 's,${D},,g' ${D}${prefix}/share/cwautomacros/scripts/autogen.sh
}
BBCLASSEXTEND = "native"
@@ -0,0 +1,13 @@
SUMMARY = "Diffutils contains tools used for finding differences between files"
HOMEPAGE = "https://www.gnu.org/software/diffutils/diffutils.html"
DESCRIPTION = "Diffutils contains the GNU diff, diff3, \
sdiff, and cmp utilities. These programs are usually \
used for creating patch files."
SECTION = "base"
inherit autotools texinfo update-alternatives gettext
ALTERNATIVE:${PN} = "diff cmp"
ALTERNATIVE_PRIORITY = "100"
BBCLASSEXTEND = "native nativesdk"
@@ -0,0 +1,29 @@
From f31395c931bc633206eccfcfaaaa5d15021a3e86 Mon Sep 17 00:00:00 2001
From: Peiran Hong <peiran.hong@windriver.com>
Date: Thu, 5 Sep 2019 15:42:22 -0400
Subject: [PATCH] Skip strip-trailing-cr test case
Skip the test "strip-trailing-cr" since it requires valgrind to
work, but valgrind is considered too heavy-weight for diffutils
package.
Upstream-Status: Inappropriate [embedded specific]
Signed-off-by: Peiran Hong <peiran.hong@windriver.com>
---
tests/Makefile.am | 1 -
1 file changed, 1 deletion(-)
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 79bacfb..4adb4d7 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -22,7 +22,6 @@ TESTS = \
stdin \
strcoll-0-names \
filename-quoting \
- strip-trailing-cr \
timezone \
colors \
y2038-vs-32bit
@@ -0,0 +1,4 @@
#!/bin/sh
abs_ptestdir=`echo "$(cd "$(dirname "$0")"; pwd)"`
make -C $abs_ptestdir/tests check-TESTS abs_top_srcdir="$abs_ptestdir"
@@ -0,0 +1,43 @@
LICENSE = "GPL-3.0-or-later"
LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
require diffutils.inc
SRC_URI = "${GNU_MIRROR}/diffutils/diffutils-${PV}.tar.xz \
file://run-ptest \
file://0001-Skip-strip-trailing-cr-test-case.patch \
"
SRC_URI[sha256sum] = "90e5e93cc724e4ebe12ede80df1634063c7a855692685919bfe60b556c9bd09e"
EXTRA_OECONF += "ac_cv_path_PR_PROGRAM=${bindir}/pr --without-libsigsegv-prefix"
# latest gnulib is no longer able to handle this - I dare not try to fix that maze of abstractions and generators
CFLAGS:mingw32 = " -DSA_RESTART=0"
# Fix "Argument list too long" error when len(TMPDIR) = 410
acpaths = "-I ./m4"
EXTRA_OEMAKE:append:mingw32 = " LIBS='-lbcrypt'"
inherit ptest
RDEPENDS:${PN}-ptest += "make perl"
do_install_ptest() {
t=${D}${PTEST_PATH}
install -D ${S}/build-aux/test-driver $t/build-aux/test-driver
cp -r ${S}/tests $t/
install ${B}/tests/Makefile $t/tests/
sed -e 's,--sysroot=${STAGING_DIR_TARGET},,g' \
-e 's|${DEBUG_PREFIX_MAP}||g' \
-e 's:${HOSTTOOLS_DIR}/::g' \
-e 's:${RECIPE_SYSROOT_NATIVE}::g' \
-e 's:${BASE_WORKDIR}/${MULTIMACH_TARGET_SYS}::g' \
-e 's|^Makefile:|_Makefile:|' \
-e 's|bash|sh|' \
-e 's|^top_srcdir = \(.*\)|top_srcdir = ..\/|' \
-e 's|^srcdir = \(.*\)|srcdir = .|' \
-e 's|"`$(built_programs)`"|diff|' \
-e 's|gawk|awk|g' \
-i $t/tests/Makefile
}
+38
View File
@@ -0,0 +1,38 @@
SUMMARY = "Line-oriented text editor"
HOMEPAGE = "http://www.gnu.org/software/ed/"
DESCRIPTION = "GNU ed is a line-oriented text editor. It is used to create, display, modify and otherwise manipulate text files, both interactively and via shell scripts. A restricted version of ed, red, can only edit files in the current directory and cannot execute shell commands."
LICENSE = "GPL-2.0-only"
LIC_FILES_CHKSUM = "file://COPYING;md5=76d6e300ffd8fb9d18bd9b136a9bba13 \
file://ed.h;endline=20;md5=504a90a78b045972e2fd2f3fc418c195 \
file://main.c;endline=17;md5=cf9d322b0ac4445ca2299c61ee175365 \
"
SECTION = "base"
CVE_PRODUCT = "gnu:ed"
# LSB states that ed should be in /bin/
bindir = "${base_bindir}"
# Upstream regularly removes previous releases from https://ftp.gnu.org/gnu/ed/
SRC_URI = "${GNU_MIRROR}/ed/${BP}.tar.lz"
UPSTREAM_CHECK_URI = "${GNU_MIRROR}/ed/"
SRC_URI[sha256sum] = "ce2f2e5c424790aa96d09dacb93d9bbfdc0b7eb6249c9cb7538452e8ec77cd48"
EXTRA_OEMAKE = "-e MAKEFLAGS="
inherit texinfo
do_configure() {
${S}/configure
}
do_install() {
oe_runmake 'DESTDIR=${D}' install
# Info dir listing isn't interesting at this point so remove it if it exists.
if [ -e "${D}${infodir}/dir" ]; then
rm -f ${D}${infodir}/dir
fi
}
@@ -0,0 +1,29 @@
From 08f887f4bc65684397bf8ec30cc61d91d894deac Mon Sep 17 00:00:00 2001
From: Tudor Florea <tudor.florea@enea.com>
Date: Wed, 28 May 2014 18:59:54 +0200
Subject: [PATCH] ethtool: use serial-tests config needed by ptest.
ptest needs buildtest-TESTS and runtest-TESTS targets.
serial-tests is required to generate those targets.
Signed-off-by: Tudor Florea <tudor.florea@enea.com>
Upstream-Status: Inappropriate
(default automake behavior incompatible with ptest)
---
configure.ac | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index c1e0012..c460398 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2,7 +2,7 @@ dnl Process this file with autoconf to produce a configure script.
AC_INIT(ethtool, 6.3, netdev@vger.kernel.org)
AC_PREREQ(2.52)
AC_CONFIG_SRCDIR([ethtool.c])
-AM_INIT_AUTOMAKE([gnu subdir-objects])
+AM_INIT_AUTOMAKE([gnu subdir-objects serial-tests])
AC_CONFIG_HEADERS([ethtool-config.h])
AM_MAINTAINER_MODE
@@ -0,0 +1,2 @@
#!/bin/sh
make -k runtest-TESTS
@@ -0,0 +1,37 @@
SUMMARY = "Display or change ethernet card settings"
DESCRIPTION = "A small utility for examining and tuning the settings of your ethernet-based network interfaces."
HOMEPAGE = "http://www.kernel.org/pub/software/network/ethtool/"
SECTION = "console/network"
LICENSE = "GPL-2.0-or-later"
LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
file://ethtool.c;beginline=4;endline=17;md5=c19b30548c582577fc6b443626fc1216"
SRC_URI = "${KERNELORG_MIRROR}/software/network/ethtool/ethtool-${PV}.tar.gz \
file://run-ptest \
file://avoid_parallel_tests.patch \
"
SRC_URI[sha256sum] = "342d37d3fe19da79d0276c4c69c34c61f1ad8f87b06514d664bf1eeb29bfd525"
UPSTREAM_CHECK_URI = "https://www.kernel.org/pub/software/network/ethtool/"
inherit autotools ptest bash-completion pkgconfig
RDEPENDS:${PN}-ptest += "make bash"
PACKAGECONFIG ?= "netlink"
PACKAGECONFIG[netlink] = "--enable-netlink,--disable-netlink,libmnl,"
do_compile_ptest() {
oe_runmake buildtest-TESTS
}
do_install_ptest () {
cp ${B}/Makefile ${D}${PTEST_PATH}
install ${B}/test-cmdline ${D}${PTEST_PATH}
if ${@bb.utils.contains('PACKAGECONFIG', 'netlink', 'false', 'true', d)}; then
install ${B}/test-features ${D}${PTEST_PATH}
fi
install ${B}/ethtool ${D}${PTEST_PATH}/ethtool
sed -i 's/^Makefile/_Makefile/' ${D}${PTEST_PATH}/Makefile
}
@@ -0,0 +1,18 @@
SUMMARY = "find, locate, and xargs binaries"
DESCRIPTION = "The GNU Find Utilities are the basic directory searching utilities of the GNU operating system. \
These programs are typically used in conjunction with other programs to provide modular and powerful directory \
search and file locating capabilities to other commands."
HOMEPAGE = "http://www.gnu.org/software/findutils/"
BUGTRACKER = "http://savannah.gnu.org/bugs/?group=findutils"
SECTION = "console/utils"
SRC_URI = "${GNU_MIRROR}/${BPN}/${BP}.tar.xz \
file://run-ptest \
"
inherit autotools gettext texinfo update-alternatives ptest
ALTERNATIVE:${PN} = "find xargs"
ALTERNATIVE_PRIORITY = "100"
BBCLASSEXTEND = "native nativesdk"
@@ -0,0 +1,57 @@
#!/bin/bash
# create temporary symlink to workaround missing oldfind
ln -s /usr/bin/find /tmp/oldfind
# make oldfind visible
export PATH="/tmp:${PATH}"
export built_programs="find xargs locate updatedb"
# this gets substituted by sed during build
export VERSION="__run_ptest_version__"
# define missing functions for tests/init.sh
fu_path_prepend_ () {
path_prepend_ $@
}
print_ver_ () {
:
}
skip_if_root_ () {
[ $(id -u) = 0 ] && exit 77;
}
require_root_ () {
[ $(id -u) = 0 ] || exit 77;
}
expensive_ () {
:
}
export -f fu_path_prepend_
export -f print_ver_
export -f skip_if_root_
export -f require_root_
export -f expensive_
for f in tests/*/*.sh; do
bash $f ;
case $? in
0 )
echo -n "PASS";;
77 )
echo -n "SKIP";;
* )
echo -n "FAIL";;
esac
echo ": $f"
done
#remove symlink
rm -f /tmp/oldfind
echo
@@ -0,0 +1,27 @@
require findutils.inc
# GPL-2.0-or-later (<< 4.2.32), GPL-3.0-or-later (>= 4.2.32)
LICENSE = "GPL-3.0-or-later"
LIC_FILES_CHKSUM = "file://COPYING;md5=1ebbd3e34237af26da5dc08a4e440464"
DEPENDS = "bison-native"
SRC_URI[sha256sum] = "a2bfb8c09d436770edc59f50fa483e785b161a3b7b9d547573cb08065fd462fe"
PACKAGECONFIG[selinux] = "--with-selinux,--without-selinux,libselinux"
# http://savannah.gnu.org/bugs/?27299
CACHED_CONFIGUREVARS += "gl_cv_func_wcwidth_works=yes"
EXTRA_OECONF += "ac_cv_path_SORT=${bindir}/sort"
# need od from coreutils for -t option
RDEPENDS:${PN}-ptest += "bash sed grep coreutils"
do_install_ptest:class-target() {
mkdir -p ${D}${PTEST_PATH}/tests/
cp -r ${S}/tests/* ${D}${PTEST_PATH}/tests/
# substitute value in run-ptest with actual version
sed -i -e 's/__run_ptest_version__/${PV}/' ${D}${PTEST_PATH}/run-ptest
}
@@ -0,0 +1,27 @@
#!/bin/sh
cd test
for i in `grep -E "^[a-z0-9_-]*:$" Maketests |awk -F: '{print $1}'`; do
unset LANG
grep -q "^$i$" skipped.txt
if [ $? -eq 0 ]; then
echo "SKIP: $i"
continue
fi
srcdir=`pwd` AWKPROG=gawk AWK=gawk CMP=cmp make -f Maketests $i >$i.tmp 2>&1
if [ -e _$i ]; then
cat _$i
grep -q "support not compiled in" _$i
if [ $? -eq 0 ]; then
echo "SKIP: $i"
continue
fi
fi
grep -q "Error" $i.tmp
if [ $? -eq 0 ]; then
echo "FAIL: $i"
else
echo "PASS: $i"
rm -f $i.tmp
fi
done
@@ -0,0 +1,87 @@
SUMMARY = "GNU awk text processing utility"
DESCRIPTION = "The GNU version of awk, a text processing utility. \
Awk interprets a special-purpose programming language to do \
quick and easy text pattern matching and reformatting jobs."
HOMEPAGE = "https://www.gnu.org/software/gawk/"
BUGTRACKER = "bug-gawk@gnu.org"
SECTION = "console/utils"
# gawk <= 3.1.5: GPL-2.0-only
# gawk >= 3.1.6: GPL-3.0-only
LICENSE = "GPL-3.0-only"
LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
PACKAGECONFIG ??= "readline"
PACKAGECONFIG[readline] = "--with-readline,--without-readline,readline"
PACKAGECONFIG[mpfr] = "--with-mpfr,--without-mpfr, mpfr"
SRC_URI = "${GNU_MIRROR}/gawk/gawk-${PV}.tar.gz \
file://run-ptest \
"
SRC_URI[sha256sum] = "945aef7ccff101f20b22a10802bc005e994ab2b8ea3e724cc1a197c62f41f650"
inherit autotools gettext texinfo update-alternatives
FILES:${PN} += "${datadir}/awk"
FILES:${PN}-dev += "${libdir}/${BPN}/*.la"
PACKAGES =+ "${PN}-gawkbug"
FILES:${PN}-gawkbug += "${bindir}/gawkbug"
ALTERNATIVE:${PN} = "awk"
ALTERNATIVE_TARGET[awk] = "${bindir}/gawk"
ALTERNATIVE_PRIORITY = "100"
do_install:append() {
# remove the link since we don't package it
rm ${D}${bindir}/awk
# Strip non-reproducible build flags (containing build paths)
sed -i -e 's|^CC.*|CC=""|g' -e 's|^CFLAGS.*|CFLAGS=""|g' ${D}${bindir}/gawkbug
}
inherit ptest
do_install_ptest() {
mkdir ${D}${PTEST_PATH}/test
ln -s ${bindir}/gawk ${D}${PTEST_PATH}/gawk
# The list of tests is all targets in Maketests, apart from the dummy Gt-dummy
TESTS=$(awk -F: '$1 == "Gt-dummy" { next } /[[:alnum:]]+:$/ { print $1 }' ${S}/test/Maketests)
for i in $TESTS Maketests inclib.awk; do
cp ${S}/test/$i* ${D}${PTEST_PATH}/test
done
sed -i \
-e 's|#!${base_bindir}/awk|#!${bindir}/awk|g' ${D}${PTEST_PATH}/test/*.awk
sed -i -e "s|GAWKLOCALE|LANG|g" ${D}${PTEST_PATH}/test/Maketests
# These tests require an unloaded host as otherwise timing sensitive tests can fail
# https://bugzilla.yoctoproject.org/show_bug.cgi?id=14371
rm -f ${D}${PTEST_PATH}/test/time.*
rm -f ${D}${PTEST_PATH}/test/timeout.*
for t in time timeout; do
echo $t >> ${D}${PTEST_PATH}/test/skipped.txt
done
}
do_install_ptest:append:libc-musl() {
# Reported https://lists.gnu.org/archive/html/bug-gawk/2021-02/msg00005.html
rm -f ${D}${PTEST_PATH}/test/clos1way6.*
# Needs en_US.UTF-8 but then does not work with musl
rm -f ${D}${PTEST_PATH}/test/backsmalls1.*
# Needs en_US.UTF-8 but then does not work with musl
rm -f ${D}${PTEST_PATH}/test/commas.*
# The below two need LANG=C inside the make rule for musl
rm -f ${D}${PTEST_PATH}/test/rebt8b1.*
rm -f ${D}${PTEST_PATH}/test/regx8bit.*
for t in clos1way6 backsmalls1 commas rebt8b1 regx8bit; do
echo $t >> ${D}${PTEST_PATH}/test/skipped.txt
done
}
RDEPENDS:${PN}-ptest += "make locale-base-en-us"
RDEPENDS:${PN}-ptest:append:libc-glibc = " locale-base-en-us.iso-8859-1"
RDEPENDS:${PN}-ptest:append:libc-musl = " musl-locales"
BBCLASSEXTEND = "native nativesdk"
@@ -0,0 +1,32 @@
From 0ccbaa134093bf6afc79f2d20d061bca5a8754ed Mon Sep 17 00:00:00 2001
From: Kai Kang <kai.kang@windriver.com>
Date: Thu, 29 Mar 2018 16:02:05 +0800
Subject: [PATCH 04/10] avoid host contamination
Remove hardcode path refer to host to avoid host contamination.
Upstream-Status: Pending
Signed-off-by: Kai Kang <kai.kang@windriver.com>
Rebase to 9.23
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
devices/devs.mak | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/devices/devs.mak b/devices/devs.mak
index 846aa50..9570182 100644
--- a/devices/devs.mak
+++ b/devices/devs.mak
@@ -393,7 +393,7 @@ $(DEVOBJ)gdevxalt.$(OBJ) : $(DEVSRC)gdevxalt.c $(GDEVX) $(math__h) $(memory__h)\
### NON PORTABLE, ONLY UNIX WITH GCC SUPPORT
$(DEVOBJ)X11.so : $(x11alt_) $(x11_) $(DEVS_MAK) $(MAKEDIRS)
- $(CCLD) $(LDFLAGS) -shared -o $(DEVOBJ)X11.so $(x11alt_) $(x11_) -L/usr/X11R6/lib -lXt -lSM -lICE -lXext -lX11 $(XLIBDIRS)
+ $(CCLD) $(LDFLAGS) -shared -o $(DEVOBJ)X11.so $(x11alt_) $(x11_) -lXt -lSM -lICE -lXext -lX11 $(XLIBDIRS)
###### --------------- Memory-buffered printer devices --------------- ######
--
1.8.3.1
@@ -0,0 +1,30 @@
From c481b055cd464734a3c2d80719ead4c1c92a40c9 Mon Sep 17 00:00:00 2001
From: Robert Yang <liezhi.yang@windriver.com>
Date: Mon, 4 May 2015 22:31:48 -0700
Subject: [PATCH 02/10] base/gendev.c: fix for -Werror=return-type
Fixed:
base/gendev.c:80:1: error: return type defaults to 'int' [-Werror=return-type]
Upstream-Status: Pending
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
---
base/gendev.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/base/gendev.c b/base/gendev.c
index 59d5999..7766b08 100644
--- a/base/gendev.c
+++ b/base/gendev.c
@@ -77,6 +77,7 @@ static const char *indent_item = "";
/* Forward definitions */
void add_entry(config *, const char *, const char *, bool);
+int
main(int argc, char *argv[])
{
config conf;
--
1.8.3.1
@@ -0,0 +1,68 @@
SUMMARY = "The GPL Ghostscript PostScript/PDF interpreter"
DESCRIPTION = "Ghostscript is used for PostScript/PDF preview and printing. Usually as \
a back-end to a program such as ghostview, it can display PostScript and PDF \
documents in an X11 environment. \
\
Furthermore, it can render PostScript and PDF files as graphics to be printed \
on non-PostScript printers. Supported printers include common \
dot-matrix, inkjet and laser models. \
"
HOMEPAGE = "http://www.ghostscript.com"
SECTION = "console/utils"
LICENSE = "GPL-3.0-only"
LIC_FILES_CHKSUM = "file://LICENSE;md5=f98ffa763e50cded76f49bce73aade16"
DEPENDS = "tiff jpeg fontconfig cups libpng freetype zlib"
UPSTREAM_CHECK_URI = "https://github.com/ArtifexSoftware/ghostpdl-downloads/releases"
UPSTREAM_CHECK_REGEX = "(?P<pver>\d+(\.\d+)+)\.tar"
def gs_verdir(v):
return "".join(v.split("."))
SRC_URI = "https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs${@gs_verdir("${PV}")}/${BPN}-${PV}.tar.gz \
file://ghostscript-9.16-Werror-return-type.patch \
file://avoid-host-contamination.patch \
"
SRC_URI[sha256sum] = "a4cd61a07fec161bee35da0211a5e5cde8ff8a0aaf942fc0176715e499d21661"
PACKAGECONFIG ??= ""
PACKAGECONFIG[gtk] = "--enable-gtk,--disable-gtk,gtk+3"
PACKAGECONFIG[libidn] = "--with-libidn,--without-libidn,libidn"
PACKAGECONFIG[libpaper] = "--with-libpaper,--without-libpaper,libpaper"
PACKAGECONFIG[x11] = "--with-x --x-includes=${STAGING_INCDIR} --x-libraries=${STAGING_LIBDIR}, \
--without-x, virtual/libx11 libxext libxt"
EXTRA_OECONF = "--with-jbig2dec \
--with-fontpath=${datadir}/fonts \
CUPSCONFIG="${STAGING_BINDIR_CROSS}/cups-config" \
PKGCONFIG=pkg-config \
"
EXTRA_OECONF:append:mipsarcho32 = " --with-large_color_index=0"
# Uses autoconf but not automake, can't do out-of-tree
inherit autotools-brokensep pkgconfig
# Prune the source tree of libraries that we're using our packaging of, so that
# ghostscript can't link to them. Can't prune zlib as that's needed for the
# native tools.
prune_sources() {
rm -rf ${S}/jpeg/ ${S}/libpng/ ${S}/tiff/ ${S}/expat/ ${S}/freetype/ ${S}/cups/lib
}
do_unpack[postfuncs] += "prune_sources"
do_install:append () {
mkdir -p ${D}${datadir}/ghostscript/${PV}/
cp -r ${S}/Resource ${D}${datadir}/ghostscript/${PV}/
cp -r ${S}/iccprofiles ${D}${datadir}/ghostscript/${PV}/
}
# ghostscript does not supports "arc"
COMPATIBLE_HOST = "^(?!arc).*"
# some entries in NVD uses gpl_ghostscript
CVE_PRODUCT = "ghostscript gpl_ghostscript"
@@ -0,0 +1,22 @@
SUMMARY = "This is a simple example recipe that cross-compiles a Go program."
SECTION = "examples"
HOMEPAGE = "https://golang.org/"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
SRC_URI = "git://go.googlesource.com/example;branch=master;protocol=https"
SRCREV = "5bec756976671f30903223ec46ff8a70dced4954"
UPSTREAM_CHECK_COMMITS = "1"
GO_IMPORT = "golang.org/x/example"
GO_INSTALL = "${GO_IMPORT}/hello"
export GO111MODULE="off"
inherit go
# This is just to make clear where this example is
do_install:append() {
mv ${D}${bindir}/hello ${D}${bindir}/${BPN}
}
@@ -0,0 +1,29 @@
From 6194f0027045433598a61965758b4531a3d06d1f Mon Sep 17 00:00:00 2001
From: Bruno Haible <bruno@clisp.org>
Date: Sun, 30 Aug 2020 12:36:15 +0200
Subject: [PATCH] Make the code C++17 compliant.
* lib/getline.cc (getstr): Don't use the 'register' keyword.
Upstream-Status: Backport [https://git.savannah.gnu.org/gitweb/?p=gperf.git;a=commit;h=a63b830554920476881837eeacd4a6b507632b19]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
lib/getline.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/getline.cc b/lib/getline.cc
index c57c633..0984a7c 100644
--- a/lib/getline.cc
+++ b/lib/getline.cc
@@ -55,7 +55,7 @@ getstr (char **lineptr, size_t *n, FILE *stream, char terminator, size_t offset)
for (;;)
{
- register int c = getc (stream);
+ int c = getc (stream);
/* We always want at least one char left in the buffer, since we
always (unless we get an error while reading the first char)
--
2.39.0
@@ -0,0 +1,181 @@
From 1862c6e57a308a05889c80c048dbc58bdc378dcb Mon Sep 17 00:00:00 2001
From: Bruno Haible <bruno@clisp.org>
Date: Tue, 5 Jul 2022 07:51:46 +0200
Subject: [PATCH] Add support for reproducible builds.
Suggested by Richard Purdie <richard.purdie@linuxfoundation.org> in
<https://lists.gnu.org/archive/html/bug-gperf/2022-07/msg00000.html>.
* autogen.sh: Import also lib/filename.h.
* Makefile.in (IMPORTED_FILES): Add lib/filename.h.
* src/options.cc: Include filename.h.
(Options::print_options): Print only the base name of the program name.
* tests/*.exp: Update.
Upstream-Status: Backport
Index: gperf-3.1/ChangeLog
===================================================================
--- gperf-3.1.orig/ChangeLog
+++ gperf-3.1/ChangeLog
@@ -1,3 +1,14 @@
+2022-07-05 Bruno Haible <bruno@clisp.org>
+
+ Add support for reproducible builds.
+ Suggested by Richard Purdie <richard.purdie@linuxfoundation.org> in
+ <https://lists.gnu.org/archive/html/bug-gperf/2022-07/msg00000.html>.
+ * autogen.sh: Import also lib/filename.h.
+ * Makefile.in (IMPORTED_FILES): Add lib/filename.h.
+ * src/options.cc: Include filename.h.
+ (Options::print_options): Print only the base name of the program name.
+ * tests/*.exp: Update.
+
2017-01-02 Marcel Schaible <marcel.schaible@studium.fernuni-hagen.de>
* gperf-3.1 released.
Index: gperf-3.1/src/options.cc
===================================================================
--- gperf-3.1.orig/src/options.cc
+++ gperf-3.1/src/options.cc
@@ -26,6 +26,7 @@
#include <string.h> /* declares strcmp() */
#include <ctype.h> /* declares isdigit() */
#include <limits.h> /* defines CHAR_MAX */
+#include "filename.h"
#include "getopt.h"
#include "version.h"
@@ -280,6 +281,16 @@ Options::print_options () const
{
const char *arg = _argument_vector[i];
+ if (i == 0)
+ {
+ /* _argument_vector[0] is the program name. Print only its base name.
+ This is useful for reproducible builds. */
+ const char *p = arg + strlen (arg);
+ while (p > arg && ! ISSLASH (p[-1]))
+ p--;
+ arg = p;
+ }
+
/* Escape arg if it contains shell metacharacters. */
if (*arg == '-')
{
Index: gperf-3.1/lib/filename.h
===================================================================
--- /dev/null
+++ gperf-3.1/lib/filename.h
@@ -0,0 +1,112 @@
+/* Basic filename support macros.
+ Copyright (C) 2001-2022 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <https://www.gnu.org/licenses/>. */
+
+/* From Paul Eggert and Jim Meyering. */
+
+#ifndef _FILENAME_H
+#define _FILENAME_H
+
+#include <string.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* Filename support.
+ ISSLASH(C) tests whether C is a directory separator
+ character.
+ HAS_DEVICE(Filename) tests whether Filename contains a device
+ specification.
+ FILE_SYSTEM_PREFIX_LEN(Filename) length of the device specification
+ at the beginning of Filename,
+ index of the part consisting of
+ alternating components and slashes.
+ FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE
+ 1 when a non-empty device specification
+ can be followed by an empty or relative
+ part,
+ 0 when a non-empty device specification
+ must be followed by a slash,
+ 0 when device specification don't exist.
+ IS_ABSOLUTE_FILE_NAME(Filename)
+ tests whether Filename is independent of
+ any notion of "current directory".
+ IS_RELATIVE_FILE_NAME(Filename)
+ tests whether Filename may be concatenated
+ to a directory filename.
+ Note: On native Windows, OS/2, DOS, "c:" is neither an absolute nor a
+ relative file name!
+ IS_FILE_NAME_WITH_DIR(Filename) tests whether Filename contains a device
+ or directory specification.
+ */
+#if defined _WIN32 || defined __CYGWIN__ \
+ || defined __EMX__ || defined __MSDOS__ || defined __DJGPP__
+ /* Native Windows, Cygwin, OS/2, DOS */
+# define ISSLASH(C) ((C) == '/' || (C) == '\\')
+ /* Internal macro: Tests whether a character is a drive letter. */
+# define _IS_DRIVE_LETTER(C) \
+ (((C) >= 'A' && (C) <= 'Z') || ((C) >= 'a' && (C) <= 'z'))
+ /* Help the compiler optimizing it. This assumes ASCII. */
+# undef _IS_DRIVE_LETTER
+# define _IS_DRIVE_LETTER(C) \
+ (((unsigned int) (C) | ('a' - 'A')) - 'a' <= 'z' - 'a')
+# define HAS_DEVICE(Filename) \
+ (_IS_DRIVE_LETTER ((Filename)[0]) && (Filename)[1] == ':')
+# define FILE_SYSTEM_PREFIX_LEN(Filename) (HAS_DEVICE (Filename) ? 2 : 0)
+# ifdef __CYGWIN__
+# define FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE 0
+# else
+ /* On native Windows, OS/2, DOS, the system has the notion of a
+ "current directory" on each drive. */
+# define FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE 1
+# endif
+# if FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE
+# define IS_ABSOLUTE_FILE_NAME(Filename) \
+ ISSLASH ((Filename)[FILE_SYSTEM_PREFIX_LEN (Filename)])
+# else
+# define IS_ABSOLUTE_FILE_NAME(Filename) \
+ (ISSLASH ((Filename)[0]) || HAS_DEVICE (Filename))
+# endif
+# define IS_RELATIVE_FILE_NAME(Filename) \
+ (! (ISSLASH ((Filename)[0]) || HAS_DEVICE (Filename)))
+# define IS_FILE_NAME_WITH_DIR(Filename) \
+ (strchr ((Filename), '/') != NULL || strchr ((Filename), '\\') != NULL \
+ || HAS_DEVICE (Filename))
+#else
+ /* Unix */
+# define ISSLASH(C) ((C) == '/')
+# define HAS_DEVICE(Filename) ((void) (Filename), 0)
+# define FILE_SYSTEM_PREFIX_LEN(Filename) ((void) (Filename), 0)
+# define FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE 0
+# define IS_ABSOLUTE_FILE_NAME(Filename) ISSLASH ((Filename)[0])
+# define IS_RELATIVE_FILE_NAME(Filename) (! ISSLASH ((Filename)[0]))
+# define IS_FILE_NAME_WITH_DIR(Filename) (strchr ((Filename), '/') != NULL)
+#endif
+
+/* Deprecated macros. For backward compatibility with old users of the
+ 'filename' module. */
+#define IS_ABSOLUTE_PATH IS_ABSOLUTE_FILE_NAME
+#define IS_PATH_WITH_DIR IS_FILE_NAME_WITH_DIR
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _FILENAME_H */
@@ -0,0 +1,21 @@
DESCRIPTION = "GNU gperf is a perfect hash function generator"
HOMEPAGE = "http://www.gnu.org/software/gperf"
SUMMARY = "Generate a perfect hash function from a set of keywords"
LICENSE = "GPL-3.0-or-later"
LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \
file://src/main.cc;beginline=8;endline=19;md5=dec8f611845d047387ed56b5b85fa99b"
SRC_URI = "${GNU_MIRROR}/${BPN}/${BP}.tar.gz \
file://0001-Make-the-code-C-17-compliant.patch"
SRC_URI[md5sum] = "9e251c0a618ad0824b51117d5d9db87e"
SRC_URI[sha256sum] = "588546b945bba4b70b6a3a616e80b4ab466e3f33024a352fc2198112cdbb3ae2"
SRC_URI += "file://1862c6e57a308a05889c80c048dbc58bdc378dcb.patch"
inherit autotools
# The nested configures don't find the parent aclocal.m4 out of the box, so tell
# it where to look explicitly (mirroring the behaviour of upstream's Makefile.devel).
EXTRA_AUTORECONF += " -I ${S} --exclude=aclocal"
BBCLASSEXTEND = "native nativesdk"
@@ -0,0 +1,46 @@
SUMMARY = "GNU grep utility"
HOMEPAGE = "http://savannah.gnu.org/projects/grep/"
DESCRIPTION = "Grep searches one or more input files for lines containing a match to a specified pattern. By default, grep prints the matching lines."
BUGTRACKER = "http://savannah.gnu.org/bugs/?group=grep"
SECTION = "console/utils"
LICENSE = "GPL-3.0-only"
LIC_FILES_CHKSUM = "file://COPYING;md5=1ebbd3e34237af26da5dc08a4e440464"
SRC_URI = "${GNU_MIRROR}/grep/grep-${PV}.tar.xz"
SRC_URI[sha256sum] = "1db2aedde89d0dea42b16d9528f894c8d15dae4e190b59aecc78f5a951276eab"
inherit autotools gettext texinfo pkgconfig
# Fix "Argument list too long" error when len(TMPDIR) = 410
acpaths = "-I ./m4"
do_configure:prepend () {
sed -i -e '1s,#!@SHELL@,#!/bin/sh,' ${S}/src/egrep.sh
rm -f ${S}/m4/init.m4
}
do_install () {
autotools_do_install
if [ "${base_bindir}" != "${bindir}" ]; then
install -d ${D}${base_bindir}
mv ${D}${bindir}/grep ${D}${base_bindir}/grep
mv ${D}${bindir}/egrep ${D}${base_bindir}/egrep
mv ${D}${bindir}/fgrep ${D}${base_bindir}/fgrep
rmdir ${D}${bindir}/
fi
}
inherit update-alternatives
PACKAGECONFIG ??= "pcre"
PACKAGECONFIG[pcre] = "--enable-perl-regexp,--disable-perl-regexp,libpcre2"
ALTERNATIVE_PRIORITY = "100"
ALTERNATIVE:${PN} = "grep egrep fgrep"
ALTERNATIVE_LINK_NAME[grep] = "${base_bindir}/grep"
ALTERNATIVE_LINK_NAME[egrep] = "${base_bindir}/egrep"
ALTERNATIVE_LINK_NAME[fgrep] = "${base_bindir}/fgrep"
BBCLASSEXTEND = "nativesdk"
@@ -0,0 +1,536 @@
From 99313d5c0ff35da6627e7dc985612f990ca64637 Mon Sep 17 00:00:00 2001
From: "G. Branden Robinson" <g.branden.robinson@gmail.com>
Date: Mon, 16 Aug 2021 12:37:22 +1000
Subject: [PATCH] Fix code style issues.
* src/preproc/grn/hgraph.cpp:
* src/preproc/grn/hpoint.cpp:
* src/preproc/grn/main.cpp:
* src/preproc/grn/hdb.cpp: Drop use of `register` storage class.
* src/preproc/grn/hgraph.cpp (len, HGPrintElt, picurve):
* src/preproc/grn/hdb.cpp (DBRead): Wrap long lines.
* src/preproc/grn/hgraph.cpp: Rename function from `Paramaterize` to
`Parameterize`.
(HGCurve): Update call site.
* src/preproc/grn/main.cpp (add_file): Drop redundant cast in
`realloc()` call.
(conv, interpret): Use standard English in diagnostic messages.
Upstream-Status: Backport [https://git.savannah.gnu.org/cgit/groff.git/commit/?id=eead5f5cf1dedc6d180bdb34914d7157d39e270c]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
src/preproc/grn/hdb.cpp | 20 +++---
src/preproc/grn/hgraph.cpp | 131 +++++++++++++++++++------------------
src/preproc/grn/hpoint.cpp | 2 +-
src/preproc/grn/main.cpp | 38 +++++------
4 files changed, 100 insertions(+), 91 deletions(-)
diff --git a/src/preproc/grn/hdb.cpp b/src/preproc/grn/hdb.cpp
index c61e099..2b4011b 100644
--- a/src/preproc/grn/hdb.cpp
+++ b/src/preproc/grn/hdb.cpp
@@ -35,7 +35,7 @@ extern POINT *PTInit();
extern POINT *PTMakePoint(double x, double y, POINT ** pplist);
-int DBGetType(register char *s);
+int DBGetType(char *s);
/*
@@ -61,7 +61,7 @@ DBCreateElt(int type,
char *text,
ELT **db)
{
- register ELT *temp;
+ ELT *temp = 0;
temp = (ELT *) malloc(sizeof(ELT));
temp->nextelt = *db;
@@ -80,11 +80,11 @@ DBCreateElt(int type,
* pointer to that database.
*/
ELT *
-DBRead(register FILE *file)
+DBRead(FILE *file)
{
- register int i;
- register int done; /* flag for input exhausted */
- register double nx; /* x holder so x is not set before orienting */
+ int i;
+ int done; /* flag for input exhausted */
+ double nx; /* x holder so x is not set before orienting */
int type; /* element type */
ELT *elist; /* pointer to the file's elements */
POINT *plist; /* pointer for reading in points */
@@ -112,7 +112,9 @@ DBRead(register FILE *file)
/* if (fscanf(file,"%" MAXSTRING_S "s\n", string) == EOF) */
/* I changed the scanf format because the element */
/* can have two words (e.g. CURVE SPLINE) */
- if (fscanf(file, "\n%" MAXSTRING_S "[^\n]%*[^\n]\n", string) == EOF) {
+ if (fscanf(file, "\n%"
+ MAXSTRING_S
+ "[^\n]%*[^\n]\n", string) == EOF) {
error("'%1', error in file format", gremlinfile);
return (elist);
}
@@ -209,7 +211,7 @@ DBRead(register FILE *file)
* New file format has literal names for element types.
*/
int
-DBGetType(register char *s)
+DBGetType(char *s)
{
if (isdigit(s[0]) || (s[0] == '-')) /* old element format or EOF */
return (atoi(s));
@@ -298,7 +300,7 @@ xscanf(FILE *f,
double *xp,
double *yp)
{
- register int c, i, j, m, frac;
+ int c, i, j, m, frac;
int iscale = 1, jscale = 1; /* x = i/scale, y=j/jscale */
while ((c = getc(f)) == ' ');
diff --git a/src/preproc/grn/hgraph.cpp b/src/preproc/grn/hgraph.cpp
index dbc0086..ad051ea 100644
--- a/src/preproc/grn/hgraph.cpp
+++ b/src/preproc/grn/hgraph.cpp
@@ -14,7 +14,8 @@
#define PointsPerInterval 64
#define pi 3.14159265358979324
#define twopi (2.0 * pi)
-#define len(a, b) groff_hypot((double)(b.x-a.x), (double)(b.y-a.y))
+#define len(a, b) groff_hypot((double)(b.x-a.x), \
+ (double)(b.y-a.y))
extern int dotshifter; /* for the length of dotted curves */
@@ -48,7 +49,7 @@ extern double adj4;
extern int res;
void HGSetFont(int font, int size);
-void HGPutText(int justify, POINT pnt, register char *string);
+void HGPutText(int justify, POINT pnt, char *string);
void HGSetBrush(int mode);
void tmove2(int px, int py);
void doarc(POINT cp, POINT sp, int angle);
@@ -58,10 +59,10 @@ void drawwig(POINT * ptr, int type);
void HGtline(int x1, int y1);
void deltax(double x);
void deltay(double y);
-void HGArc(register int cx, register int cy, int px, int py, int angle);
-void picurve(register int *x, register int *y, int npts);
+void HGArc(int cx, int cy, int px, int py, int angle);
+void picurve(int *x, int *y, int npts);
void HGCurve(int *x, int *y, int numpoints);
-void Paramaterize(int x[], int y[], double h[], int n);
+void Parameterize(int x[], int y[], double h[], int n);
void PeriodicSpline(double h[], int z[],
double dz[], double d2z[], double d3z[],
int npoints);
@@ -83,10 +84,10 @@ void
HGPrintElt(ELT *element,
int /* baseline */)
{
- register POINT *p1;
- register POINT *p2;
- register int length;
- register int graylevel;
+ POINT *p1;
+ POINT *p2;
+ int length;
+ int graylevel;
if (!DBNullelt(element) && !Nullpoint((p1 = element->ptlist))) {
/* p1 always has first point */
@@ -168,7 +169,8 @@ HGPrintElt(ELT *element,
if (polyfill == FILL || polyfill == BOTH) {
/* do the interior */
- char command = (polyfill == BOTH && element->brushf) ? 'p' : 'P';
+ char command = (polyfill == BOTH && element->brushf)
+ ? 'p' : 'P';
/* include outline, if there is one and */
/* the -p flag was set */
@@ -278,7 +280,7 @@ HGPrintElt(ELT *element,
void
HGPutText(int justify,
POINT pnt,
- register char *string)
+ char *string)
{
int savelasty = lasty; /* vertical motion for text is to be */
/* ignored. Save current y here */
@@ -387,7 +389,7 @@ HGSetFont(int font,
void
HGSetBrush(int mode)
{
- register int printed = 0;
+ int printed = 0;
if (linmod != style[--mode]) {
/* Groff doesn't understand \Ds, so we take it out */
@@ -417,7 +419,7 @@ HGSetBrush(int mode)
void
deltax(double x)
{
- register int ix = (int) (x * troffscale);
+ int ix = (int) (x * troffscale);
printf(" %du", ix - lastx);
lastx = ix;
@@ -437,7 +439,7 @@ deltax(double x)
void
deltay(double y)
{
- register int iy = (int) (y * troffscale);
+ int iy = (int) (y * troffscale);
printf(" %du", iy - lastyline);
lastyline = iy;
@@ -457,8 +459,8 @@ void
tmove2(int px,
int py)
{
- register int dx;
- register int dy;
+ int dx;
+ int dy;
if ((dy = py - lasty)) {
printf("\\v'%du'", dy);
@@ -483,10 +485,10 @@ tmove2(int px,
void
tmove(POINT * ptr)
{
- register int ix = (int) (ptr->x * troffscale);
- register int iy = (int) (ptr->y * troffscale);
- register int dx;
- register int dy;
+ int ix = (int) (ptr->x * troffscale);
+ int iy = (int) (ptr->y * troffscale);
+ int dx;
+ int dy;
if ((dy = iy - lasty)) {
printf(".sp %du\n", dy);
@@ -547,7 +549,7 @@ void
drawwig(POINT * ptr,
int type)
{
- register int npts; /* point list index */
+ int npts; /* point list index */
int x[MAXPOINTS], y[MAXPOINTS]; /* point list */
for (npts = 1; !Nullpoint(ptr); ptr = PTNextPoint(ptr), npts++) {
@@ -574,20 +576,20 @@ drawwig(POINT * ptr,
*----------------------------------------------------------------------------*/
void
-HGArc(register int cx,
- register int cy,
+HGArc(int cx,
+ int cy,
int px,
int py,
int angle)
{
double xs, ys, resolution, fullcircle;
int m;
- register int mask;
- register int extent;
- register int nx;
- register int ny;
- register int length;
- register double epsilon;
+ int mask;
+ int extent;
+ int nx;
+ int ny;
+ int length;
+ double epsilon;
xs = px - cx;
ys = py - cy;
@@ -633,15 +635,15 @@ HGArc(register int cx,
*----------------------------------------------------------------------------*/
void
-picurve(register int *x,
- register int *y,
+picurve(int *x,
+ int *y,
int npts)
{
- register int nseg; /* effective resolution for each curve */
- register int xp; /* current point (and temporary) */
- register int yp;
- int pxp, pyp; /* previous point (to make lines from) */
- int i; /* inner curve segment traverser */
+ int nseg; /* effective resolution for each curve */
+ int xp; /* current point (and temporary) */
+ int yp;
+ int pxp, pyp; /* previous point (to make lines from) */
+ int i; /* inner curve segment traverser */
int length = 0;
double w; /* position factor */
double t1, t2, t3; /* calculation temps */
@@ -671,7 +673,8 @@ picurve(register int *x,
/* 'nseg' is the number of line */
/* segments that will be drawn for */
/* each curve segment. */
- nseg = (int) ((double) (nseg + (int) groff_hypot((double) xp, (double) yp)) /
+ nseg = (int) ((double) (nseg + (int) groff_hypot((double) xp,
+ (double) yp)) /
res * PointsPerInterval);
for (i = 1; i < nseg; i++) {
@@ -710,10 +713,10 @@ HGCurve(int *x,
double h[MAXPOINTS], dx[MAXPOINTS], dy[MAXPOINTS];
double d2x[MAXPOINTS], d2y[MAXPOINTS], d3x[MAXPOINTS], d3y[MAXPOINTS];
double t, t2, t3;
- register int j;
- register int k;
- register int nx;
- register int ny;
+ int j;
+ int k;
+ int nx;
+ int ny;
int lx, ly;
int length = 0;
@@ -725,7 +728,7 @@ HGCurve(int *x,
* Solve for derivatives of the curve at each point separately for x and y
* (parametric).
*/
- Paramaterize(x, y, h, numpoints);
+ Parameterize(x, y, h, numpoints);
/* closed curve */
if ((x[1] == x[numpoints]) && (y[1] == y[numpoints])) {
@@ -771,15 +774,15 @@ HGCurve(int *x,
*----------------------------------------------------------------------------*/
void
-Paramaterize(int x[],
+Parameterize(int x[],
int y[],
double h[],
int n)
{
- register int dx;
- register int dy;
- register int i;
- register int j;
+ int dx;
+ int dy;
+ int i;
+ int j;
double u[MAXPOINTS];
for (i = 1; i <= n; ++i) {
@@ -937,9 +940,9 @@ NaturalEndSpline(double h[], /* parameterization */
*----------------------------------------------------------------------------*/
void
-change(register int x,
- register int y,
- register int vis)
+change(int x,
+ int y,
+ int vis)
{
static int length = 0;
@@ -967,17 +970,17 @@ void
HGtline(int x_1,
int y_1)
{
- register int x_0 = lastx;
- register int y_0 = lasty;
- register int dx;
- register int dy;
- register int oldcoord;
- register int res1;
- register int visible;
- register int res2;
- register int xinc;
- register int yinc;
- register int dotcounter;
+ int x_0 = lastx;
+ int y_0 = lasty;
+ int dx;
+ int dy;
+ int oldcoord;
+ int res1;
+ int visible;
+ int res2;
+ int xinc;
+ int yinc;
+ int dotcounter;
if (linmod == SOLID) {
line(x_1, y_1);
@@ -1045,4 +1048,8 @@ HGtline(int x_1,
change(x_1, y_1, 0);
}
-/* EOF */
+// Local Variables:
+// fill-column: 72
+// mode: C++
+// End:
+// vim: set cindent noexpandtab shiftwidth=2 textwidth=72:
diff --git a/src/preproc/grn/hpoint.cpp b/src/preproc/grn/hpoint.cpp
index b581cb0..77bfc9d 100644
--- a/src/preproc/grn/hpoint.cpp
+++ b/src/preproc/grn/hpoint.cpp
@@ -32,7 +32,7 @@ PTMakePoint(double x,
double y,
POINT **pplist)
{
- register POINT *pt;
+ POINT *pt;
if (Nullpoint(pt = *pplist)) { /* empty list */
*pplist = (POINT *) malloc(sizeof(POINT));
diff --git a/src/preproc/grn/main.cpp b/src/preproc/grn/main.cpp
index 833fd60..d1887b6 100644
--- a/src/preproc/grn/main.cpp
+++ b/src/preproc/grn/main.cpp
@@ -88,7 +88,7 @@ extern "C" const char *Version_string;
extern void HGPrintElt(ELT *element, int baseline);
extern ELT *DBInit();
-extern ELT *DBRead(register FILE *file);
+extern ELT *DBRead(FILE *file);
extern POINT *PTInit();
extern POINT *PTMakePoint(double x, double y, POINT **pplist);
@@ -231,9 +231,9 @@ int compatibility_flag = FALSE; /* TRUE if in compatibility mode */
void getres();
int doinput(FILE *fp);
-void conv(register FILE *fp, int baseline);
+void conv(FILE *fp, int baseline);
void savestate();
-int has_polygon(register ELT *elist);
+int has_polygon(ELT *elist);
void interpret(char *line);
@@ -256,7 +256,7 @@ add_file(char **file,
{
if (*count >= *cur_size) {
*cur_size += FILE_SIZE_INCR;
- file = (char **) realloc((char **) file, *cur_size * sizeof(char *));
+ file = (char **) realloc(file, *cur_size * sizeof(char *));
if (file == NULL) {
fatal("unable to extend file array");
}
@@ -283,9 +283,9 @@ main(int argc,
{
setlocale(LC_NUMERIC, "C");
program_name = argv[0];
- register FILE *fp;
- register int k;
- register char c;
+ FILE *fp;
+ int k;
+ char c;
int gfil = 0;
char **file = NULL;
int file_cur_size = INIT_FILE_SIZE;
@@ -466,7 +466,7 @@ doinput(FILE *fp)
void
initpic()
{
- register int i;
+ int i;
for (i = 0; i < STYLES; i++) { /* line thickness defaults */
thick[i] = defthick[i];
@@ -511,12 +511,12 @@ initpic()
*----------------------------------------------------------------------------*/
void
-conv(register FILE *fp,
+conv(FILE *fp,
int baseline)
{
- register FILE *gfp = NULL; /* input file pointer */
- register int done = 0; /* flag to remember if finished */
- register ELT *e; /* current element pointer */
+ FILE *gfp = NULL; /* input file pointer */
+ int done = 0; /* flag to remember if finished */
+ ELT *e; /* current element pointer */
ELT *PICTURE; /* whole picture data base pointer */
double temp; /* temporary calculating area */
/* POINT ptr; */ /* coordinates of a point to pass to 'mov' */
@@ -543,7 +543,7 @@ conv(register FILE *fp,
if (!gremlinfile[0]) {
if (!setdefault)
- error("at line %1: no picture filename.\n", baseline);
+ error("no picture file name at line %1", baseline);
return;
}
char *path;
@@ -577,7 +577,7 @@ conv(register FILE *fp,
} /* here, troffscale is the */
/* picture's scaling factor */
if (pointscale) {
- register int i; /* do pointscaling here, when */
+ int i; /* do pointscaling here, when */
/* scale is known, before output */
for (i = 0; i < SIZES; i++)
tsize[i] = (int) (troffscale * (double) tsize[i] + 0.5);
@@ -700,7 +700,7 @@ conv(register FILE *fp,
void
savestate()
{
- register int i;
+ int i;
for (i = 0; i < STYLES; i++) /* line thickness defaults */
defthick[i] = thick[i];
@@ -761,8 +761,8 @@ interpret(char *line)
{
char str1[MAXINLINE];
char str2[MAXINLINE];
- register char *chr;
- register int i;
+ char *chr;
+ int i;
double par;
str2[0] = '\0';
@@ -811,7 +811,7 @@ interpret(char *line)
if (str2[0] < '0') {
nofont:
- error("no fontname specified in line %1", linenum);
+ error("no font name specified in line %1", linenum);
break;
}
if (str1[1] == 't')
@@ -935,7 +935,7 @@ interpret(char *line)
*/
int
-has_polygon(register ELT *elist)
+has_polygon(ELT *elist)
{
while (!DBNullelt(elist)) {
if (elist->type == POLYGON)
--
2.39.0
@@ -0,0 +1,212 @@
From 6cfa9f8126c1d6ec26f120d273e714fb19108873 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Sun, 4 Aug 2019 16:32:41 -0700
Subject: [PATCH] Include config.h
This helps avoid the include conflicts where <stdlib.h> is including
<math.h> and since -I./lib is used and a local math.h wrapper is
residing in there, the build breaks since stdlib.h really wants the
standard system math.h to be included, this ensures that right macros
are predefined and included before stdlib.h is included
fixes
In file included from src/libs/libgroff/assert.cpp:20:
In file included from TOPDIR/build/tmp/work/aarch64-yoe-linux-musl/groff/1.22.4-r0/recipe-sysroot/usr/include/c++/v1/stdlib.h:100:
./lib/math.h:38:3: error: "Please include config.h first."
#error "Please include config.h first."
^
./lib/math.h:40:1: error: unknown type name '_GL_INLINE_HEADER_BEGIN'
We delete eqn.cpp and qen.hpp in do_configure
to ensure they're regenerated and deterministic.
Issue is fixed upstream with similar patches:
https://git.savannah.gnu.org/cgit/groff.git/commit/?id=979f3f4266151c7681a68a40d2c4913842a7271d
https://git.savannah.gnu.org/cgit/groff.git/commit/?id=fe121eeacd53c96105f23209b2c205f436f97359
Upstream-Status: Backport [see links above]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
src/libs/libgroff/assert.cpp | 4 +
src/libs/libgroff/curtime.cpp | 4 +
src/libs/libgroff/device.cpp | 4 +
src/libs/libgroff/error.cpp | 4 +
src/libs/libgroff/fatal.cpp | 4 +
src/libs/libgroff/string.cpp | 4 +
src/libs/libgroff/strsave.cpp | 4 +
src/preproc/eqn/eqn.cpp | 450 ++++++++++++++++++----------------
src/preproc/eqn/eqn.hpp | 12 +-
src/preproc/eqn/eqn.ypp | 4 +
src/preproc/eqn/other.cpp | 4 +
src/preproc/eqn/text.cpp | 4 +
src/preproc/pic/object.cpp | 4 +
13 files changed, 285 insertions(+), 221 deletions(-)
diff --git a/src/libs/libgroff/assert.cpp b/src/libs/libgroff/assert.cpp
index aceed05..97780d6 100644
--- a/src/libs/libgroff/assert.cpp
+++ b/src/libs/libgroff/assert.cpp
@@ -16,6 +16,10 @@ for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+#if HAVE_CONFIG_H
+# include <config.h>
+#endif
+
#include <stdio.h>
#include <stdlib.h>
#include "assert.h"
diff --git a/src/libs/libgroff/curtime.cpp b/src/libs/libgroff/curtime.cpp
index 72fe067..9ddba08 100644
--- a/src/libs/libgroff/curtime.cpp
+++ b/src/libs/libgroff/curtime.cpp
@@ -15,6 +15,10 @@ for more details.
The GNU General Public License version 2 (GPL2) is available in the
internet at <http://www.gnu.org/licenses/gpl-2.0.txt>. */
+#if HAVE_CONFIG_H
+# include <config.h>
+#endif
+
#include <errno.h>
#include <limits.h>
#include <stdlib.h>
diff --git a/src/libs/libgroff/device.cpp b/src/libs/libgroff/device.cpp
index 0d28b85..c211f85 100644
--- a/src/libs/libgroff/device.cpp
+++ b/src/libs/libgroff/device.cpp
@@ -17,6 +17,10 @@ for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+#if HAVE_CONFIG_H
+# include <config.h>
+#endif
+
#include <stdlib.h>
#include "device.h"
#include "defs.h"
diff --git a/src/libs/libgroff/error.cpp b/src/libs/libgroff/error.cpp
index 9a18803..7b63d3d 100644
--- a/src/libs/libgroff/error.cpp
+++ b/src/libs/libgroff/error.cpp
@@ -17,6 +17,10 @@ for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+#if HAVE_CONFIG_H
+# include <config.h>
+#endif
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/src/libs/libgroff/fatal.cpp b/src/libs/libgroff/fatal.cpp
index c0dcb35..fd6003e 100644
--- a/src/libs/libgroff/fatal.cpp
+++ b/src/libs/libgroff/fatal.cpp
@@ -16,6 +16,10 @@ for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+#if HAVE_CONFIG_H
+# include <config.h>
+#endif
+
#include <stdlib.h>
#define FATAL_ERROR_EXIT_CODE 3
diff --git a/src/libs/libgroff/string.cpp b/src/libs/libgroff/string.cpp
index 46c015c..449f3a6 100644
--- a/src/libs/libgroff/string.cpp
+++ b/src/libs/libgroff/string.cpp
@@ -17,6 +17,10 @@ for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+#if HAVE_CONFIG_H
+# include <config.h>
+#endif
+
#include <stdlib.h>
#include "lib.h"
diff --git a/src/libs/libgroff/strsave.cpp b/src/libs/libgroff/strsave.cpp
index f95c05e..d875045 100644
--- a/src/libs/libgroff/strsave.cpp
+++ b/src/libs/libgroff/strsave.cpp
@@ -17,6 +17,10 @@ for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+#if HAVE_CONFIG_H
+# include <config.h>
+#endif
+
#include <string.h>
#include <stdlib.h>
diff --git a/src/preproc/eqn/eqn.ypp b/src/preproc/eqn/eqn.ypp
index fb318c3..b7b647e 100644
--- a/src/preproc/eqn/eqn.ypp
+++ b/src/preproc/eqn/eqn.ypp
@@ -16,6 +16,10 @@ for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
%{
+#if HAVE_CONFIG_H
+# include <config.h>
+#endif
+
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
diff --git a/src/preproc/eqn/other.cpp b/src/preproc/eqn/other.cpp
index 8db993f..38db396 100644
--- a/src/preproc/eqn/other.cpp
+++ b/src/preproc/eqn/other.cpp
@@ -17,6 +17,10 @@ for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+#if HAVE_CONFIG_H
+# include <config.h>
+#endif
+
#include <stdlib.h>
#include "eqn.h"
diff --git a/src/preproc/eqn/text.cpp b/src/preproc/eqn/text.cpp
index f3d06f9..3b244d5 100644
--- a/src/preproc/eqn/text.cpp
+++ b/src/preproc/eqn/text.cpp
@@ -17,6 +17,10 @@ for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+#if HAVE_CONFIG_H
+# include <config.h>
+#endif
+
#include <ctype.h>
#include <stdlib.h>
#include "eqn.h"
diff --git a/src/preproc/pic/object.cpp b/src/preproc/pic/object.cpp
index d8ba610..f26a831 100644
--- a/src/preproc/pic/object.cpp
+++ b/src/preproc/pic/object.cpp
@@ -17,6 +17,10 @@ for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+#if HAVE_CONFIG_H
+# include <config.h>
+#endif
+
#include <stdlib.h>
#include "pic.h"
--
2.22.0
@@ -0,0 +1,27 @@
From e738f9185ba90f2083c846ade3551234bb5a7cbc Mon Sep 17 00:00:00 2001
From: Jeremy Puhlman <jpuhlman@mvista.com>
Date: Sat, 7 Mar 2020 00:59:13 +0000
Subject: [PATCH] Make manpages mulitlib identical
Upstream-Status: Submitted [by email to g.branden.robinson@gmail.com]
Signed-off-by: Jeremy Puhlman <jpuhlman@mvista.com>
---
Makefile.am | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile.am b/Makefile.am
index d18c49b..6175fe9 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -917,7 +917,7 @@ SUFFIXES += .man
-e "s|[@]MDATE[@]|`$(PERL) $(top_srcdir)/mdate.pl $<`|g" \
-e "s|[@]OLDFONTDIR[@]|`echo $(oldfontdir) | sed -f $(makevarescape)`|g" \
-e "s|[@]PDFDOCDIR[@]|`echo $(pdfdocdir) | sed -f $(makevarescape)`|g" \
- -e "s|[@]SYSTEMMACRODIR[@]|`echo $(systemtmacdir) | sed -f $(makevarescape)`|g" \
+ -e "s|[@]SYSTEMMACRODIR[@]|`echo $(systemtmacdir) | sed -e 's,$(libdir),$(prefix)/lib*,' | sed -f $(makevarescape)`|g" \
-e "s|[@]TMAC_AN_PREFIX[@]|$(tmac_an_prefix)|g" \
-e "s|[@]TMAC_M_PREFIX[@]|$(tmac_m_prefix)|g" \
-e "s|[@]TMAC_MDIR[@]|$(tmacdir)/mm|g" \
--
2.23.0
@@ -0,0 +1,106 @@
From 6821a23e6cf34df37c351b45be413a8da9115f9f Mon Sep 17 00:00:00 2001
From: Robert Yang <liezhi.yang@windriver.com>
Date: Sat, 11 May 2019 17:03:03 +0800
Subject: [PATCH 1/2] replace "perl -w" with "use warnings"
The shebang's max length is usually 128 as defined in
/usr/include/linux/binfmts.h:
#define BINPRM_BUF_SIZE 128
There would be errors when @PERL@ is longer than 128, use
'/usr/bin/env perl' can fix the problem, but '/usr/bin/env perl -w'
doesn't work:
/usr/bin/env: perl -w: No such file or directory
So replace "perl -w" with "use warnings" to make it work.
Upstream-Status: Submitted [by email to g.branden.robinson@gmail.com]
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Rebase to 1.22.4.
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
font/devpdf/util/BuildFoundries.pl | 3 ++-
src/devices/gropdf/gropdf.pl | 3 ++-
src/devices/gropdf/pdfmom.pl | 3 ++-
src/utils/afmtodit/afmtodit.pl | 3 ++-
4 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/font/devpdf/util/BuildFoundries.pl b/font/devpdf/util/BuildFoundries.pl
index f8af826..9584e28 100644
--- a/font/devpdf/util/BuildFoundries.pl
+++ b/font/devpdf/util/BuildFoundries.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -w
+#!/usr/bin/perl
#
# BuildFoundries : Given a Foundry file generate groff and download files
# Deri James : Monday 07 Feb 2011
@@ -22,6 +22,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
use strict;
+use warnings;
(my $progname = $0) =~s @.*/@@;
my $where=shift||'';
diff --git a/src/devices/gropdf/gropdf.pl b/src/devices/gropdf/gropdf.pl
index 2ec52d0..ce5a06f 100644
--- a/src/devices/gropdf/gropdf.pl
+++ b/src/devices/gropdf/gropdf.pl
@@ -1,4 +1,4 @@
-#!@PERL@ -w
+#!@PERL@
#
# gropdf : PDF post processor for groff
#
@@ -21,6 +21,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
use strict;
+use warnings;
use Getopt::Long qw(:config bundling);
use constant
diff --git a/src/devices/gropdf/pdfmom.pl b/src/devices/gropdf/pdfmom.pl
index c9b08b2..61124f3 100644
--- a/src/devices/gropdf/pdfmom.pl
+++ b/src/devices/gropdf/pdfmom.pl
@@ -1,4 +1,4 @@
-#!@PERL@ -w
+#!@PERL@
#
# pdfmom : Frontend to run groff -mom to produce PDFs
# Deri James : Friday 16 Mar 2012
@@ -23,6 +23,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
use strict;
+use warnings;
use File::Temp qw/tempfile/;
my @cmd;
my $dev='pdf';
diff --git a/src/utils/afmtodit/afmtodit.pl b/src/utils/afmtodit/afmtodit.pl
index 954c58e..81a6c97 100644
--- a/src/utils/afmtodit/afmtodit.pl
+++ b/src/utils/afmtodit/afmtodit.pl
@@ -1,4 +1,4 @@
-#! /usr/bin/perl -w
+#! /usr/bin/perl
# -*- Perl -*-
# Copyright (C) 1989-2018 Free Software Foundation, Inc.
# Written by James Clark (jjc@jclark.com)
@@ -19,6 +19,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
use strict;
+use warnings;
@afmtodit.tables@
--
2.7.4
@@ -0,0 +1,41 @@
From 695965c27be74acb5968f19d51af86065c4b71a9 Mon Sep 17 00:00:00 2001
From: Hongxu Jia <hongxu.jia@windriver.com>
Date: Mon, 13 May 2019 09:48:14 +0800
Subject: [PATCH] support musl
...
|./lib/math.h:2877:1: error: 'int signbit(float)' conflicts with a previous declaration
| _GL_MATH_CXX_REAL_FLOATING_DECL_2 (signbit)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|In file included from recipe-sysroot/usr/include/c++/8.3.0/math.h:36,
| from ./lib/math.h:27,
| from ./src/include/driver.h:27,
| from src/devices/grodvi/dvi.cpp:20:
|recipe-sysroot/usr/include/c++/8.3.0/cmath:661:3: note: previous declaration 'constexpr bool std::signbit(float)'
| signbit(float __x)
| ^~~~~~~
...
Upstream-Status: Backport [http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=commit;h=453ff940449bbbde9ec00f0bbf82a359c5598fc7]
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
gnulib_m4/signbit.m4 | 2 ++
1 file changed, 2 insertions(+)
diff --git a/gnulib_m4/signbit.m4 b/gnulib_m4/signbit.m4
index 9e7884d..8b9c70c 100644
--- a/gnulib_m4/signbit.m4
+++ b/gnulib_m4/signbit.m4
@@ -31,6 +31,8 @@ AC_DEFUN([gl_SIGNBIT],
[case "$host_os" in
# Guess yes on glibc systems.
*-gnu* | gnu*) gl_cv_func_signbit="guessing yes" ;;
+ # Guess yes on musl systems.
+ *-musl*) gl_cv_func_signbit="guessing yes" ;;
# Guess yes on native Windows.
mingw*) gl_cv_func_signbit="guessing yes" ;;
# If we don't know, assume the worst.
--
2.7.4
@@ -0,0 +1,32 @@
From 75761ae7adc88412de4379d1cf5484b055cd5f18 Mon Sep 17 00:00:00 2001
From: Hongxu Jia <hongxu.jia@windriver.com>
Date: Sat, 11 May 2019 17:06:29 +0800
Subject: [PATCH 2/2] groff searchs fonts which are provided by ghostscript on
build host. It causes non-determinism issue. So not search font dirs on host.
Upstream-Status: Inappropriate [cross build specific]
Signed-off-by: Kai Kang <kai.kang@windriver.com>
Rebase to 1.22.4
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
font/devpdf/Foundry.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/font/devpdf/Foundry.in b/font/devpdf/Foundry.in
index 93e9b66..235b23b 100644
--- a/font/devpdf/Foundry.in
+++ b/font/devpdf/Foundry.in
@@ -65,7 +65,7 @@ ZD|Y||||Dingbats!d050000l.pfb
#======================================================================
#Foundry|Name|Searchpath
-foundry|U|(gs):@urwfontsdir@ :/usr/share/fonts/type1/gsfonts :/opt/local/share/fonts/urw-fonts # the URW fonts delivered with ghostscript (may be different)
+foundry|U|(gs) # the URW fonts delivered with ghostscript (may be different)
#Define Flags for afmtodit
r=-i 0 -m
--
2.7.4
@@ -0,0 +1,81 @@
SUMMARY = "GNU Troff software"
DESCRIPTION = "The groff (GNU troff) software is a typesetting package which reads plain text mixed with \
formatting commands and produces formatted output."
SECTION = "base"
HOMEPAGE = "http://www.gnu.org/software/groff/"
LICENSE = "GPL-3.0-only"
LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
SRC_URI = "${GNU_MIRROR}/groff/groff-${PV}.tar.gz \
file://0001-replace-perl-w-with-use-warnings.patch \
file://groff-not-search-fonts-on-build-host.patch \
file://0001-support-musl.patch \
file://0001-Include-config.h.patch \
file://0001-Make-manpages-mulitlib-identical.patch \
file://0001-Fix-code-style-issues.patch \
"
SRC_URI[md5sum] = "08fb04335e2f5e73f23ea4c3adbf0c5f"
SRC_URI[sha256sum] = "e78e7b4cb7dec310849004fa88847c44701e8d133b5d4c13057d876c1bad0293"
# Remove at the next upgrade
PR = "r1"
DEPENDS = "bison-native"
RDEPENDS:${PN} += "perl sed"
inherit autotools-brokensep texinfo multilib_script pkgconfig
MULTILIB_SCRIPTS = "${PN}:${bindir}/gpinyin ${PN}:${bindir}/groffer ${PN}:${bindir}/grog"
EXTRA_OECONF = "--without-x --without-doc"
PARALLEL_MAKE = ""
CACHED_CONFIGUREVARS += "ac_cv_path_PERL='/usr/bin/env perl' ac_cv_path_BASH_PROG='no' PAGE=A4"
# Delete these generated files since we depend on bison-native
# and regenerate them. Do it deterministically (always).
do_configure:prepend() {
rm -f ${S}/src/preproc/eqn/eqn.cpp
rm -f ${S}/src/preproc/eqn/eqn.hpp
}
do_install:append() {
# Some distros have both /bin/perl and /usr/bin/perl, but we set perl location
# for target as /usr/bin/perl, so fix it to /usr/bin/perl.
for i in afmtodit mmroff gropdf pdfmom grog; do
if [ -f ${D}${bindir}/$i ]; then
sed -i -e '1s,#!.*perl,#! ${USRBINPATH}/env perl,' ${D}${bindir}/$i
fi
done
if [ -e ${D}${libdir}/charset.alias ]; then
rm -rf ${D}${libdir}/charset.alias
fi
# awk is located at /usr/bin/, not /bin/
SPECIAL_AWK=`find ${D} -name special.awk`
if [ -f ${SPECIAL_AWK} ]; then
sed -i -e 's:#!.*awk:#! ${USRBINPATH}/awk:' ${SPECIAL_AWK}
fi
# not ship /usr/bin/glilypond and its releated files in embedded target system
rm -rf ${D}${bindir}/glilypond
rm -rf ${D}${libdir}/groff/glilypond
rm -rf ${D}${mandir}/man1/glilypond*
# not ship /usr/bin/grap2graph and its releated man files
rm -rf ${D}${bindir}/grap2graph
rm -rf ${D}${mandir}/man1/grap2graph*
}
do_install:append:class-native() {
create_cmdline_wrapper ${D}/${bindir}/groff \
-F${STAGING_DIR_NATIVE}${datadir_native}/groff/${PV}/font \
-M${STAGING_DIR_NATIVE}${datadir_native}/groff/${PV}/tmac
}
FILES:${PN} += "${libdir}/${BPN}/site-tmac \
${libdir}/${BPN}/groffer/"
BBCLASSEXTEND = "native"
@@ -0,0 +1,6 @@
#!/bin/sh
cd src/tests
make check
@@ -0,0 +1,36 @@
fix MakeMaker issues with using wrong SHELL/GREP
A set of substitution is being processed to all target scripts with sed by
replacing some key words with the detected values at configure time, this
is exactly not compliant with cross compling, and will cause missing path
errors at run time like:
"/usr/bin/zgrep: line 230: /usr/bin/grep: No such file or directory"
Fixed by removing unneeded substitution and using real runtime paths
instead.
Signed-off-by: Ming Liu <ming.liu@windriver.com>
Upstream-Status: Pending
---
Makefile.am | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index 4f51b61..80a5ddf 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -93,8 +93,7 @@ SUFFIXES = .in
.in:
$(AM_V_GEN)rm -f $@-t $@ \
&& sed \
- -e 's|/bin/sh|$(SHELL)|g' \
- -e 's|[@]GREP@|$(GREP)|g' \
+ -e 's|[@]GREP@|$(base_bindir)/grep|g' \
-e "s|'gzip'|$(GZIP_TRANSFORMED)|g" \
-e "s|'zdiff'|$(ZDIFF_TRANSFORMED)|g" \
-e "s|'zgrep'|$(ZGREP_TRANSFORMED)|g" \
--
2.7.4
+32
View File
@@ -0,0 +1,32 @@
SUMMARY = "Standard GNU compressor"
DESCRIPTION = "GNU Gzip is a popular data compression program originally written by Jean-loup Gailly for the GNU \
project. Mark Adler wrote the decompression part"
HOMEPAGE = "http://www.gnu.org/software/gzip/"
SECTION = "console/utils"
inherit autotools texinfo
export DEFS="NO_ASM"
EXTRA_OEMAKE:class-target = "GREP=${base_bindir}/grep"
EXTRA_OECONF:append:libc-musl = " gl_cv_func_fflush_stdin=yes "
do_install:append () {
if [ "${base_bindir}" != "${bindir}" ]; then
# Rename and move files into /bin (FHS), which is typical place for gzip
install -d ${D}${base_bindir}
mv ${D}${bindir}/gunzip ${D}${base_bindir}/gunzip
mv ${D}${bindir}/gzip ${D}${base_bindir}/gzip
mv ${D}${bindir}/zcat ${D}${base_bindir}/zcat
mv ${D}${bindir}/uncompress ${D}${base_bindir}/uncompress
fi
}
inherit update-alternatives
ALTERNATIVE_PRIORITY = "100"
ALTERNATIVE:${PN} = "gunzip gzip zcat"
ALTERNATIVE_LINK_NAME[gunzip] = "${base_bindir}/gunzip"
ALTERNATIVE_LINK_NAME[gzip] = "${base_bindir}/gzip"
ALTERNATIVE_LINK_NAME[zcat] = "${base_bindir}/zcat"
export CONFIG_SHELL="/bin/sh"
@@ -0,0 +1,41 @@
require gzip.inc
# change to GPL-3.0-or-later in 2007/07. Previous GPL-2.0-or-later version is
# 1.3.12
LICENSE = "GPL-3.0-or-later"
SRC_URI = "${GNU_MIRROR}/gzip/${BP}.tar.gz \
file://run-ptest \
"
SRC_URI:append:class-target = " file://wrong-path-fix.patch"
LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \
file://gzip.h;beginline=8;endline=20;md5=6e47caaa630e0c8bf9f1bc8d94a8ed0e"
PROVIDES:append:class-native = " gzip-replacement-native"
RDEPENDS:${PN}-ptest += "make perl grep diffutils"
BBCLASSEXTEND = "native nativesdk"
inherit ptest
do_install_ptest() {
mkdir -p ${D}${PTEST_PATH}/src/build-aux
cp ${S}/build-aux/test-driver ${D}${PTEST_PATH}/src/build-aux/
mkdir -p ${D}${PTEST_PATH}/src/tests
cp -r ${S}/tests/* ${D}${PTEST_PATH}/src/tests
sed -e 's/^abs_srcdir = ..*/abs_srcdir = \.\./' \
-e 's/^top_srcdir = ..*/top_srcdir = \.\./' \
-e 's/^GREP = ..*/GREP = grep/' \
-e 's/^AWK = ..*/AWK = awk/' \
-e 's/^srcdir = ..*/srcdir = \./' \
-e 's/^Makefile: ..*/Makefile: /' \
-e 's,--sysroot=${STAGING_DIR_TARGET},,g' \
-e 's|${DEBUG_PREFIX_MAP}||g' \
-e 's:${HOSTTOOLS_DIR}/::g' \
-e 's:${BASE_WORKDIR}/${MULTIMACH_TARGET_SYS}::g' \
${B}/tests/Makefile > ${D}${PTEST_PATH}/src/tests/Makefile
}
SRC_URI[sha256sum] = "5b4fb14d38314e09f2fc8a1c510e7cd540a3ea0e3eb9b0420046b82c3bf41085"
@@ -0,0 +1,38 @@
From e233006ee212109d2a1401dac37a9a851cc493d8 Mon Sep 17 00:00:00 2001
From: Yi Zhao <yi.zhao@windriver.com>
Date: Thu, 14 Dec 2017 15:23:47 +0800
Subject: [PATCH] wiper.sh: fix stat path
Fix the stat path for OE.
Upstream-Status: Inappropriate [OE specific]
Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
---
wiper/wiper.sh | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/wiper/wiper.sh b/wiper/wiper.sh
index 79eddc8..9ef2840 100755
--- a/wiper/wiper.sh
+++ b/wiper/wiper.sh
@@ -97,7 +97,6 @@ function find_prog(){
hash -r ## Refresh bash's cached PATH entries
HDPARM=`find_prog /sbin/hdparm` || exit 1
FIND=`find_prog /usr/bin/find` || exit 1
-STAT=`find_prog /usr/bin/stat` || exit 1
GAWK=`find_prog /usr/bin/gawk` || exit 1
BLKID=`find_prog /sbin/blkid` || exit 1
GREP=`find_prog /bin/grep` || exit 1
@@ -105,7 +104,7 @@ ID=`find_prog /usr/bin/id` || exit 1
LS=`find_prog /bin/ls` || exit 1
DF=`find_prog /bin/df` || exit 1
RM=`find_prog /bin/rm` || exit 1
-STAT=`find_prog /usr/bin/stat` || exit 1
+STAT=`find_prog /bin/stat` || exit 1
[ $verbose -gt 1 ] && HDPARM="$HDPARM --verbose"
--
2.7.4
@@ -0,0 +1,43 @@
SUMMARY = "Utility for viewing/manipulating IDE disk drive/driver parameters"
HOMEPAGE = "http://sourceforge.net/projects/hdparm/"
DESCRIPTION = "hdparm is a Linux shell utility for viewing \
and manipulating various IDE drive and driver parameters."
SECTION = "console/utils"
LICENSE = "BSD-2-Clause & GPL-2.0-only & hdparm"
LICENSE:${PN} = "BSD-2-Clause & hdparm"
LICENSE:${PN}-dbg = "BSD-2-Clause & hdparm"
LICENSE:wiper = "GPL-2.0-only"
NO_GENERIC_LICENSE[hdparm] = "LICENSE.TXT"
LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=495d03e50dc6c89d6a30107ab0df5b03 \
file://debian/copyright;md5=a82d7ba3ade9e8ec902749db98c592f3 \
file://wiper/GPLv2.txt;md5=fcb02dc552a041dee27e4b85c7396067 \
file://wiper/wiper.sh;beginline=7;endline=31;md5=b7bc642addc152ea307505bf1a296f09"
PACKAGES =+ "wiper"
FILES:wiper = "${bindir}/wiper.sh"
RDEPENDS:wiper = "bash gawk coreutils"
SRC_URI = "${SOURCEFORGE_MIRROR}/hdparm/${BP}.tar.gz \
file://wiper.sh-fix-stat-path.patch \
"
SRC_URI[sha256sum] = "d14929f910d060932e717e9382425d47c2e7144235a53713d55a94f7de535a4b"
EXTRA_OEMAKE = 'STRIP="echo" LDFLAGS="${LDFLAGS}"'
inherit update-alternatives
ALTERNATIVE:${PN} = "hdparm"
ALTERNATIVE_LINK_NAME[hdparm] = "${base_sbindir}/hdparm"
ALTERNATIVE_PRIORITY = "100"
do_install () {
install -d ${D}/${base_sbindir} ${D}/${mandir}/man8 ${D}/${bindir}
oe_runmake 'DESTDIR=${D}' 'sbindir=${base_sbindir}' install
cp ${S}/wiper/wiper.sh ${D}/${bindir}
}
@@ -0,0 +1,12 @@
DESCRIPTION = "A console-only image with more full-featured Linux system \
functionality installed."
IMAGE_FEATURES += "splash ssh-server-openssh"
IMAGE_INSTALL = "\
packagegroup-core-boot \
packagegroup-core-full-cmdline \
${CORE_IMAGE_EXTRA_INSTALL} \
"
inherit core-image
@@ -0,0 +1,23 @@
DESCRIPTION = "A development image that builds the kernel and packages that are \
sensitive to kernel updates and version changes"
# Could also be core-image-basic, but we'll keep this small for now
require recipes-core/images/core-image-minimal.bb
KERNEL_DEV_UTILS ?= "dropbear connman"
KERNEL_DEV_TOOLS ?= "packagegroup-core-tools-profile packagegroup-core-buildessential kernel-devsrc"
KERNEL_DEV_MODULE ?= "kernel-modules"
CORE_IMAGE_EXTRA_INSTALL += "${KERNEL_DEV_MODULE} \
${KERNEL_DEV_UTILS} \
${KERNEL_DEV_TOOLS} \
systemtap \
"
# We need extra space for things like kernel builds, etc.
IMAGE_ROOTFS_EXTRA_SPACE:append = " + 3000000"
# Let's define our own subset to test, we can later add a on-target kernel build even!
DEFAULT_TEST_SUITES = "ping ssh df connman syslog scp date parselogs"
IMAGE_FEATURES += "tools-profile"
@@ -0,0 +1,24 @@
DESCRIPTION = "Small image capable of booting a device with custom install scripts, \
adding a second rootfs, used for testing."
# use -testfs live-install scripts
PACKAGE_INSTALL = "initramfs-live-boot initramfs-live-install-testfs initramfs-live-install-efi-testfs busybox udev base-passwd ${ROOTFS_BOOTSTRAP_INSTALL}"
# Do not pollute the initrd image with rootfs features
IMAGE_FEATURES = ""
export IMAGE_BASENAME = "core-image-testcontroller-initramfs"
IMAGE_NAME_SUFFIX ?= ""
IMAGE_LINGUAS = ""
LICENSE = "MIT"
IMAGE_FSTYPES = "${INITRAMFS_FSTYPES}"
inherit core-image
IMAGE_ROOTFS_SIZE = "8192"
IMAGE_ROOTFS_EXTRA_SPACE = "0"
BAD_RECOMMENDATIONS += "busybox-syslog"
# Use the same restriction as initramfs-live-install-testfs
COMPATIBLE_HOST = "(i.86|x86_64).*-linux"
@@ -0,0 +1,18 @@
DESCRIPTION = "A test controller image to be deployed on a target useful for testing other images using the OEQA runtime tests"
IMAGE_FEATURES += "ssh-server-openssh package-management"
inherit core-image
# the deploy code requires bash and
# normal linux utilities not busybox ones
IMAGE_INSTALL += "\
bash coreutils util-linux tar gzip bzip2 kmod \
python3-modules python3-misc \
e2fsprogs e2fsprogs-mke2fs parted \
"
# we need a particular initramfs for live images
# that pulls custom install scripts which take
# care of partitioning for us
INITRD_IMAGE = "core-image-testcontroller-initramfs"
@@ -0,0 +1,47 @@
From 698ed332e2c592235d2b737c545ac25ad0970e15 Mon Sep 17 00:00:00 2001
From: "Maxin B. John" <maxin.john@intel.com>
Date: Tue, 21 Feb 2017 11:16:31 +0200
Subject: [PATCH 1/4] configure: Add option to enable/disable libnfnetlink
This changes the configure behaviour from autodetecting
for libnfnetlink to having an option to disable it explicitly
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Maxin B. John <maxin.john@intel.com>
---
configure.ac | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/configure.ac b/configure.ac
index bc2ed47b..e27745e5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -63,6 +63,9 @@ AC_ARG_WITH([pkgconfigdir], AS_HELP_STRING([--with-pkgconfigdir=PATH],
AC_ARG_ENABLE([nftables],
AS_HELP_STRING([--disable-nftables], [Do not build nftables compat]),
[enable_nftables="$enableval"], [enable_nftables="yes"])
+AC_ARG_ENABLE([libnfnetlink],
+ AS_HELP_STRING([--disable-libnfnetlink], [Do not use netfilter netlink library]),
+ [enable_libnfnetlink="$enableval"], [enable_libnfnetlink="yes"])
AC_ARG_ENABLE([connlabel],
AS_HELP_STRING([--disable-connlabel],
[Do not build libnetfilter_conntrack]),
@@ -117,9 +120,10 @@ if test "x$enable_bpfc" = "xyes" || test "x$enable_nfsynproxy" = "xyes"; then
AC_CHECK_LIB(pcap, pcap_compile,, AC_MSG_ERROR(missing libpcap library required by bpf compiler or nfsynproxy tool))
fi
-PKG_CHECK_MODULES([libnfnetlink], [libnfnetlink >= 1.0],
- [nfnetlink=1], [nfnetlink=0])
-AM_CONDITIONAL([HAVE_LIBNFNETLINK], [test "$nfnetlink" = 1])
+AS_IF([test "x$enable_libnfnetlink" = "xyes"], [
+ PKG_CHECK_MODULES([libnfnetlink], [libnfnetlink >= 1.0])
+ ])
+AM_CONDITIONAL([HAVE_LIBNFNETLINK], [test "x$enable_libnfnetlink" = "xyes"])
if test "x$enable_nftables" = "xyes"; then
PKG_CHECK_MODULES([libmnl], [libmnl >= 1.0], [mnl=1], [mnl=0])
--
2.30.2
@@ -0,0 +1,33 @@
From d4699d2169fe2d91d0f1f4369d40d2e5f42b8877 Mon Sep 17 00:00:00 2001
From: Alexander Kanavin <alex@linutronix.de>
Date: Tue, 17 May 2022 10:56:59 +0200
Subject: [PATCH 2/4] iptables/xshared.h: add missing sys.types.h include
This resolves the build error under musl:
| ../../../../../../../workspace/sources/iptables/iptables/xshared.h:83:56: error: unknown type name 'u_int16_t'; did you mean 'uint16_t'?
| 83 | set_option(unsigned int *options, unsigned int option, u_int16_t *invflg,
| | ^~~~~~~~~
| | uint16_t
Upstream-Status: Submitted [via email to phil@nwl.cc]
Signed-off-by: Alexander Kanavin <alex@linutronix.de>
---
iptables/xshared.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/iptables/xshared.h b/iptables/xshared.h
index 0ed9f3c2..b1413834 100644
--- a/iptables/xshared.h
+++ b/iptables/xshared.h
@@ -6,6 +6,7 @@
#include <stdint.h>
#include <netinet/in.h>
#include <net/if.h>
+#include <sys/types.h>
#include <linux/netfilter_arp/arp_tables.h>
#include <linux/netfilter_ipv4/ip_tables.h>
#include <linux/netfilter_ipv6/ip6_tables.h>
--
2.30.2
@@ -0,0 +1,41 @@
From 28291b41bc3717f51e8d9d465f0100f1ca99dc26 Mon Sep 17 00:00:00 2001
From: Trevor Gamblin <trevor.gamblin@windriver.com>
Date: Wed, 9 Mar 2022 12:50:39 -0500
Subject: [PATCH 3/4] Makefile.am: do not install /etc/ethertypes
The /etc/ethertypes is provided by netbase since 6.0[1].
Do not instal the file in ebtables, otherwise there would be a conflict:
Error: Transaction test error:
file /etc/ethertypes conflicts between attempted installs of
netbase-1:6.2-r0.corei7_64 and iptables-1.8.7-r0.corei7_64
[1]
https://salsa.debian.org/md/netbase/-/commit/316680c6a2c3641b6abc76b3eebf88781f609d35)
This patch is based off of the same change made for the ebtables recipe:
http://cgit.openembedded.org/meta-openembedded/tree/meta-networking/recipes-filter/ebtables/ebtables-2.0.11/0001-Makefile.am-do-not-install-etc-ethertypes.patch?h=master
Upstream-Status: Inappropriate [embedded specific]
Signed-off-by: Trevor Gamblin <trevor.gamblin@windriver.com>
---
Makefile.am | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile.am b/Makefile.am
index 451c3cb2..5125238c 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -20,7 +20,7 @@ EXTRA_DIST = autogen.sh iptables-test.py xlate-test.py
if ENABLE_NFTABLES
confdir = $(sysconfdir)
-dist_conf_DATA = etc/ethertypes etc/xtables.conf
+dist_conf_DATA = etc/xtables.conf
endif
.PHONY: tarball
--
2.30.2
@@ -0,0 +1,51 @@
From e7aa1dd2831f9bb5d0603c5e5027387ad7721b00 Mon Sep 17 00:00:00 2001
From: "Maxin B. John" <maxin.john@intel.com>
Date: Tue, 21 Feb 2017 11:49:07 +0200
Subject: [PATCH 4/4] configure.ac:
only-check-conntrack-when-libnfnetlink-enabled.patch
Package libnetfilter-conntrack depends on package libnfnetlink. iptables
checks package libnetfilter-conntrack whatever its package config
libnfnetlink is enabled or not. When libnfnetlink is disabled but
package libnetfilter-conntrack exists, it fails randomly with:
In file included from
.../iptables/1.4.21-r0/iptables-1.4.21/extensions/libxt_connlabel.c:8:0:
.../tmp/sysroots/qemumips/usr/include/libnetfilter_conntrack/libnetfilter_conntrack.h:14:42:
fatal error: libnfnetlink/linux_nfnetlink.h: No such file or directory
compilation terminated.
GNUmakefile:96: recipe for target 'libxt_connlabel.oo' failed
Only check libnetfilter-conntrack when libnfnetlink is enabled to fix it.
Upstream-Status: Pending
Signed-off-by: Kai Kang <kai.kang@windriver.com>
Signed-off-by: Maxin B. John <maxin.john@intel.com>
---
configure.ac | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/configure.ac b/configure.ac
index e27745e5..528f1bb5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -158,10 +158,12 @@ if test "$nftables" != 1; then
fi
if test "x$enable_connlabel" = "xyes"; then
- PKG_CHECK_MODULES([libnetfilter_conntrack],
+ nfconntrack=0
+ AS_IF([test "x$enable_libnfnetlink" = "xyes"], [
+ PKG_CHECK_MODULES([libnetfilter_conntrack],
[libnetfilter_conntrack >= 1.0.6],
[nfconntrack=1], [nfconntrack=0])
-
+ ])
if test "$nfconntrack" -ne 1; then
blacklist_modules="$blacklist_modules connlabel";
echo "WARNING: libnetfilter_conntrack not found, connlabel match will not be built";
--
2.30.2
@@ -0,0 +1,31 @@
From ed4082a7405a5838c205a34c1559e289949200cc Mon Sep 17 00:00:00 2001
From: Phil Sutter <phil@nwl.cc>
Date: Thu, 12 Jan 2023 14:38:44 +0100
Subject: extensions: NAT: Fix for -Werror=format-security
Have to pass either a string literal or format string to xt_xlate_add().
Fixes: f30c5edce0413 ("extensions: Merge SNAT, DNAT, REDIRECT and MASQUERADE")
Signed-off-by: Phil Sutter <phil@nwl.cc>
Upstream-Status: Backport [https://git.netfilter.org/iptables/commit/?id=ed4082a7405a5838c205a34c1559e289949200cc]
Signed-off-by: Alexander Kanavin <alex@linutronix.de>
---
extensions/libxt_NAT.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/extensions/libxt_NAT.c b/extensions/libxt_NAT.c
index da9f2201..2a634398 100644
--- a/extensions/libxt_NAT.c
+++ b/extensions/libxt_NAT.c
@@ -424,7 +424,7 @@ __NAT_xlate(struct xt_xlate *xl, const struct nf_nat_range2 *r,
if (r->flags & NF_NAT_RANGE_PROTO_OFFSET)
return 0;
- xt_xlate_add(xl, tgt);
+ xt_xlate_add(xl, "%s", tgt);
if (strlen(range_str))
xt_xlate_add(xl, " to %s", range_str);
if (r->flags & NF_NAT_RANGE_PROTO_RANDOM) {
--
cgit v1.2.3

Some files were not shown because too many files have changed in this diff Show More