added my Recipes

This commit is contained in:
2024-07-11 14:16:35 +02:00
parent 38bc4f53ac
commit 09b621d929
7118 changed files with 525762 additions and 3 deletions

View File

@@ -0,0 +1,117 @@
From 9000ee4d8bb5c5e0bcc588e9bec86eb56f4285e1 Mon Sep 17 00:00:00 2001
From: Li xin <lixin.fnst@cn.fujitsu.com>
Date: Fri, 19 Jun 2015 16:45:54 +0900
Subject: [PATCH] Fix makedefs
1)remove RANLIB, SYSLIBS, AR and get them from env.
2)reference sysroot when searching header files
3)include sysroot path instead of absolute include path
for Linux2 and Linux3 systems.
4)for non-native build, search STAGING_BASELIBDIR/LIBDIR
native build, search host library path for nsl and resolv library
which comes from libc
Upstreamstatus: Inappropriate [embedded specific]
Signed-off-by: Yao Zhao <yao.zhao@windriver.com>
---
makedefs | 27 +++++++++++----------------
1 file changed, 11 insertions(+), 16 deletions(-)
diff --git a/makedefs b/makedefs
index 3448c1e..78e0717 100644
--- a/makedefs
+++ b/makedefs
@@ -197,9 +197,6 @@ echo "# pie=$pie"
# Defaults for most sane systems
-RANLIB=ranlib
-SYSLIBS=
-AR=ar
ARFL=rv
# Ugly function to make our error message more visible among the
@@ -492,12 +489,12 @@ case "$SYSTEM.$RELEASE" in
case "$CCARGS" in
*-DNO_DB*) ;;
*-DHAS_DB*) ;;
- *) if [ -f /usr/include/db.h ]
+ *) if [ -f "$BUILD_SYSROOT"/usr/include/db.h ]
then
: we are all set
- elif [ -f /usr/include/db/db.h ]
+ elif [ -f "$BUILD_SYSROOT"/usr/include/db/db.h ]
then
- CCARGS="$CCARGS -I/usr/include/db"
+ CCARGS="$CCARGS -I"$BUILD_SYSROOT"/usr/include/db"
else
# No, we're not going to try db1 db2 db3 etc.
# On a properly installed system, Postfix builds
@@ -506,12 +503,12 @@ case "$SYSTEM.$RELEASE" in
echo "Install the appropriate db*-devel package first." 1>&2
exit 1
fi
- SYSLIBS="-ldb"
+ SYSLIBS="$SYSLIBS -ldb"
;;
esac
for name in nsl resolv $GDBM_LIBS
do
- for lib in /usr/lib64 /lib64 /usr/lib /lib
+ for lib in $BUILD_SYSROOT_NSL_PATH
do
test -e $lib/lib$name.a -o -e $lib/lib$name.so && {
SYSLIBS="$SYSLIBS -l$name"
@@ -531,7 +528,7 @@ case "$SYSTEM.$RELEASE" in
if [ `expr "X$CCARGS" : "X.*-DNO_EPOLL"` -gt 0 ]
then
:
- elif [ ! -e /usr/include/sys/epoll.h ]
+ elif [ ! -e "$BUILD_SYSROOT"/usr/include/sys/epoll.h ]
then
echo CCARGS="$CCARGS -DNO_EPOLL"
else
@@ -555,8 +552,6 @@ int main(int argc, char **argv)
}
EOF
${CC-gcc} -o makedefs.test makedefs.test.c || exit 1
- ./makedefs.test 2>/dev/null ||
- CCARGS="$CCARGS -DNO_EPOLL"
rm -f makedefs.test makedefs.test.[co]
fi;;
esac
@@ -572,12 +567,12 @@ EOF
case "$CCARGS" in
*-DNO_DB*) ;;
*-DHAS_DB*) ;;
- *) if [ -f /usr/include/db.h ]
+ *) if [ -f "$BUILD_SYSROOT"/usr/include/db.h ]
then
: we are all set
- elif [ -f /usr/include/db/db.h ]
+ elif [ -f "$BUILD_SYSROOT"/usr/include/db/db.h ]
then
- CCARGS="$CCARGS -I/usr/include/db"
+ CCARGS="$CCARGS -I"$BUILD_SYSROOT"/usr/include/db"
else
# On a properly installed system, Postfix builds
# by including <db.h> and by linking with -ldb
@@ -585,12 +580,12 @@ EOF
echo "Install the appropriate db*-devel package first." 1>&2
exit 1
fi
- SYSLIBS="-ldb"
+ SYSLIBS="$SYSLIBS -ldb"
;;
esac
for name in nsl resolv
do
- for lib in /usr/lib64 /lib64 /usr/lib /usr/lib/* /lib /lib/*
+ for lib in $BUILD_SYSROOT_NSL_PATH
do
test -e $lib/lib$name.a -o -e $lib/lib$name.so && {
SYSLIBS="$SYSLIBS -l$name"
--
2.17.1

View File

@@ -0,0 +1,107 @@
From cb69ffda0c2cbde6acdc8b01c8d5ff78d81a84fc Mon Sep 17 00:00:00 2001
From: Li xin <lixin.fnst@cn.fujitsu.com>
Date: Fri, 19 Jun 2015 17:14:58 +0900
Subject: [PATCH] Change fixed postconf to a variable for cross-compiling
Upstreamstatus: Inappropriate [embedded specific]
Signed-off-by: Yao Zhao <yao.zhao@windriver.com>
---
Makefile.in | 2 +-
postfix-install | 18 ++++++++++--------
2 files changed, 11 insertions(+), 9 deletions(-)
diff --git a/Makefile.in b/Makefile.in
index 65e7911..40295be 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -22,7 +22,7 @@ META = meta/main.cf.proto meta/master.cf.proto meta/postfix-files \
EXPAND = sed -e "s;\$${LIB_PREFIX};$(LIB_PREFIX);" \
-e "s;\$${LIB_SUFFIX};$(LIB_SUFFIX);"
SHLIB_DIR_OVERRIDE = \
- $${shlib_directory:-`$(SHLIB_ENV) bin/postconf -dhx shlib_directory`}
+ $${shlib_directory:-`$(SHLIB_ENV) $(POSTCONF) -dhx shlib_directory`}
default: update
diff --git a/postfix-install b/postfix-install
index e498cd3..8049f43 100644
--- a/postfix-install
+++ b/postfix-install
@@ -244,8 +244,8 @@ test -z "$non_interactive" -a ! -t 0 && {
exit 1
}
-test -x bin/postconf || {
- echo $0: Error: no bin/postconf file. Did you forget to run \"make\"? 1>&2
+test -x "$POSTCONF" || {
+ echo $0: Error: no $POSTCONF file. Did you forget to run \"make\"? 1>&2
exit 1
}
@@ -266,7 +266,7 @@ do
case "$junk" in
*MAIL_VERSION*)
case "$mail_version" in
- "") mail_version="`bin/postconf -dhx mail_version`" || exit 1
+ "") mail_version="`$POSTCONF -dhx mail_version`" || exit 1
esac
val=`echo "$junk" | sed 's/MAIL_VERSION$/'"$mail_version/g"` || exit 1
case "$val" in
@@ -454,7 +454,7 @@ template files main.cf.proto and master.cf.proto."
: ${install_root=/}
: ${tempdir=`pwd`}
-: ${config_directory=`bin/postconf -c conf -h -d config_directory`}
+: ${config_directory=`$POSTCONF -c conf -h -d config_directory`}
# Find out the location of installed configuration files.
@@ -520,7 +520,7 @@ test -f $CONFIG_DIRECTORY/main.cf && {
case "$junk" in
"") eval unset $name;;
esac
- eval : \${$name=\`bin/postconf -c $CONFIG_DIRECTORY -hx $name\`} ||
+ eval : \${$name=\`$POSTCONF -c $CONFIG_DIRECTORY -hx $name\`} ||
exit 1
done
}
@@ -533,7 +533,7 @@ do
case "$junk" in
"") eval unset $name;;
esac
- eval : \${$name=\`bin/postconf -c conf -d -hx $name\`} || exit 1
+ eval : \${$name=\`$POSTCONF -c conf -d -hx $name\`} || exit 1
done
# Override settings manually.
@@ -670,6 +670,8 @@ README_DIRECTORY=$install_root$readme_directory
SHLIB_DIRECTORY=$install_root$shlib_directory
META_DIRECTORY=$install_root$meta_directory
+test "x$POSTCONF" != "x" || POSTCONF="bin/postconf"
+
# Avoid repeated tests for existence of these; default permissions suffice.
test -d $DAEMON_DIRECTORY || mkdir -p $DAEMON_DIRECTORY || exit 1
@@ -841,7 +843,7 @@ IFS="$BACKUP_IFS"
# the wrong place when Postfix is being upgraded.
case "$mail_version" in
-"") mail_version="`bin/postconf -dhx mail_version`" || exit 1
+"") mail_version="`$POSTCONF -c $CONFIG_DIRECTORY -dhx mail_version`" || exit 1
esac
# Undo MAIL_VERSION expansion at the end of a parameter value. If
@@ -861,7 +863,7 @@ do
esac
done
-bin/postconf -c $CONFIG_DIRECTORY -e \
+"$POSTCONF" -c $CONFIG_DIRECTORY -e \
"daemon_directory = $daemon_directory" \
"data_directory = $data_directory" \
"command_directory = $command_directory" \
--
2.17.1

View File

@@ -0,0 +1,64 @@
From 995bddd9563b1aecca2369f2f9c675f88bdc0053 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Sat, 26 Aug 2017 10:29:37 -0700
Subject: [PATCH] makedefs: Use native compiler to build makedefs.test
Its a binary used during build
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
makedefs | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/makedefs b/makedefs
index 78e0717..3299eba 100644
--- a/makedefs
+++ b/makedefs
@@ -551,7 +551,7 @@ int main(int argc, char **argv)
exit(0);
}
EOF
- ${CC-gcc} -o makedefs.test makedefs.test.c || exit 1
+ ${BUILD_CC-gcc} -o makedefs.test makedefs.test.c || exit 1
rm -f makedefs.test makedefs.test.[co]
fi;;
esac
@@ -787,7 +787,7 @@ int main(int argc, char **argv)
exit(0);
}
EOF
- ${CC-gcc} -o makedefs.test makedefs.test.c || exit 1
+ ${BUILD_CC-gcc} -o makedefs.test makedefs.test.c || exit 1
./makedefs.test 2>/dev/null ||
CCARGS="$CCARGS -DNO_SIGSETJMP"
rm -f makedefs.test makedefs.test.[co]
@@ -823,7 +823,7 @@ int main(int argc, char **argv)
&error) != 14);
}
EOF
- ${CC-gcc} -o makedefs.test makedefs.test.c $icu_cppflags \
+ ${BUILD_CC-gcc} -o makedefs.test makedefs.test.c $icu_cppflags \
$icu_ldflags >/dev/null 2>&1
if ./makedefs.test 2>/dev/null ; then
CCARGS="$CCARGS $icu_cppflags"
@@ -938,7 +938,7 @@ int main(void)
exit(ferror(stdout) ? 1 : 0);
}
EOF
- eval ${CC-gcc} ${CCARGS} -o makedefs.test makedefs.test.c || exit 1
+ eval ${BUILD_CC-gcc} ${CCARGS} -o makedefs.test makedefs.test.c || exit 1
./makedefs.test || exit 1
rm -f makedefs.test makedefs.test.[co]
}
@@ -1094,7 +1094,7 @@ int main(void)
exit(ferror(stdout) ? 1 : 0);
}
EOF
- eval ${CC-gcc} ${CCARGS} -o makedefs.test makedefs.test.c || exit 1
+ eval ${BUILD_CC-gcc} ${CCARGS} -o makedefs.test makedefs.test.c || exit 1
parm_val=`./makedefs.test` || exit 1
rm -f makedefs.test makedefs.test.[co]
eval ${parm_name}=\""\$parm_val"\"
--
2.17.1

View File

@@ -0,0 +1,32 @@
From afef4a9391e6bb1a6c3e73d370f240577ed8b0dd Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Sun, 16 Jan 2022 11:21:54 +0800
Subject: [PATCH] Fix icu config
do not entertain cppflags from icu, this is because
icu-config feeds the -I path without sysroot which
caused native headers to be included and build is
corrupted in any case its just adding -I/usr/include
to the CCARGS which we loose nothing if its not
entertained.
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
makedefs | 1 -
1 file changed, 1 deletion(-)
diff --git a/makedefs b/makedefs
index 3299eba..2a76f20 100644
--- a/makedefs
+++ b/makedefs
@@ -826,7 +826,6 @@ EOF
${BUILD_CC-gcc} -o makedefs.test makedefs.test.c $icu_cppflags \
$icu_ldflags >/dev/null 2>&1
if ./makedefs.test 2>/dev/null ; then
- CCARGS="$CCARGS $icu_cppflags"
SYSLIBS="$SYSLIBS $icu_ldflags"
else
CCARGS="$CCARGS -DNO_EAI"
--
2.17.1

View File

@@ -0,0 +1,58 @@
From 545d4a79b50caa5698622c0c1905ae154197a16f Mon Sep 17 00:00:00 2001
From: Yi Zhao <yi.zhao@windriver.com>
Date: Fri, 12 Oct 2018 12:38:02 +0800
Subject: [PATCH] makedefs: add -lnsl and -lresolv to SYSLIBS by default
We don't need to check libnsl.so and libresolv.so since the libnsl2 is
specified in DEPENDS and libresolv.so is from c libarary.
Upstream-Status: Inappropriate [embedded specific]
Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
---
makedefs | 22 ++--------------------
1 file changed, 2 insertions(+), 20 deletions(-)
diff --git a/makedefs b/makedefs
index 2a76f20..9d5db9f 100644
--- a/makedefs
+++ b/makedefs
@@ -506,16 +506,7 @@ case "$SYSTEM.$RELEASE" in
SYSLIBS="$SYSLIBS -ldb"
;;
esac
- for name in nsl resolv $GDBM_LIBS
- do
- for lib in $BUILD_SYSROOT_NSL_PATH
- do
- test -e $lib/lib$name.a -o -e $lib/lib$name.so && {
- SYSLIBS="$SYSLIBS -l$name"
- break
- }
- done
- done
+ SYSLIBS="$SYSLIBS -lnsl -lresolv"
# Kernel 2.4 added IPv6
case "$RELEASE" in
2.[0-3].*) CCARGS="$CCARGS -DNO_IPV6";;
@@ -583,16 +574,7 @@ EOF
SYSLIBS="$SYSLIBS -ldb"
;;
esac
- for name in nsl resolv
- do
- for lib in $BUILD_SYSROOT_NSL_PATH
- do
- test -e $lib/lib$name.a -o -e $lib/lib$name.so && {
- SYSLIBS="$SYSLIBS -l$name"
- break
- }
- done
- done
+ SYSLIBS="$SYSLIBS -lnsl -lresolv"
SYSLIBS="$SYSLIBS -ldl"
: ${SHLIB_SUFFIX=.so}
: ${SHLIB_CFLAGS=-fPIC}
--
2.17.1

View File

@@ -0,0 +1,35 @@
From e5ddcf9575437bacd64c2b68501b413014186a6a Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Wed, 19 Oct 2022 10:15:01 -0700
Subject: [PATCH] makedefs: Account for linux 6.x version
Major version has bumped to 6 and script needs to know that
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
makedefs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/makedefs
+++ b/makedefs
@@ -613,7 +613,7 @@ EOF
: ${SHLIB_ENV="LD_LIBRARY_PATH=`pwd`/lib"}
: ${PLUGIN_LD="${CC-gcc} -shared"}
;;
- Linux.[345].*) SYSTYPE=LINUX$RELEASE_MAJOR
+ Linux.[3-6]*) SYSTYPE=LINUX$RELEASE_MAJOR
case "$CCARGS" in
*-DNO_DB*) ;;
*-DHAS_DB*) ;;
--- a/src/util/sys_defs.h
+++ b/src/util/sys_defs.h
@@ -751,7 +751,7 @@ extern int initgroups(const char *, int)
/*
* LINUX.
*/
-#if defined(LINUX2) || defined(LINUX3) || defined(LINUX4) || defined(LINUX5)
+#if defined(LINUX2) || defined(LINUX3) || defined(LINUX4) || defined(LINUX5) || defined(LINUX6)
#define SUPPORTED
#define UINT32_TYPE unsigned int
#define UINT16_TYPE unsigned short

View File

@@ -0,0 +1,20 @@
#!/bin/sh
ALIASESDB_STAMP=/var/lib/misc/postfix.aliasesdb-stamp
make_aliasesdb() {
if [ "$(/usr/sbin/postconf -h alias_database)" = "hash:/etc/aliases" ]
then
# /etc/aliases.db may be used by other MTA, make sure nothing
# has touched it since our last newaliases call
[ /etc/aliases -nt /etc/aliases.db ] ||
[ "$ALIASESDB_STAMP" -nt /etc/aliases.db ] ||
[ "$ALIASESDB_STAMP" -ot /etc/aliases.db ] || return 0
/usr/bin/newaliases
touch -r /etc/aliases.db "$ALIASESDB_STAMP"
else
/usr/bin/newaliases
fi
}
make_aliasesdb

View File

@@ -0,0 +1,13 @@
#! /bin/sh
HOSTNAME=$(/bin/hostname)
if [ -z "$HOSTNAME" -o "$HOSTNAME" = "(none)" -o ! -z "`echo $HOSTNAME | sed -n '/^[0-9]*\.[0-9].*/p'`" ]; then
# If hostname is invalid, and myhostname not existed in main.cf
/usr/sbin/postconf -h "myhostname" 2>/dev/null
if [ $? -ne 0 ]; then
# Set "localhost" to main.cf
/usr/sbin/postconf -e "myhostname=localhost"
fi
fi

View File

@@ -0,0 +1 @@
root@ permit_mynetworks,reject

View File

@@ -0,0 +1,105 @@
compatibility_level = 3.6
smtputf8_enable = no
# Configure your domain and accounts
#mydomain=sample.com
#FQDN from gethostname
#myhostname =
mydomain=localdomain
mydestination = $myhostname, localhost.localdomain localhost
mynetworks = 127.0.0.1/8
inet_interfaces = 127.0.0.1
virtual_mailbox_domains = sample.com, other.net
virtual_mailbox_maps = hash:/etc/postfix/virtual
virtual_alias_maps = hash:/etc/postfix/virtual_alias
alias_maps = hash:/etc/aliases
# You'll start with the following lines for maildir storage
virtual_mailbox_base = /var/spool/vmail
virtual_uid_maps = static:`grep vmail /etc/passwd | cut -d ":" -f 3`
virtual_gid_maps = static:`grep vmail /etc/passwd | cut -d ":" -f 4`
# You'll start with the following lines for IMAP storage
#virtual_transport = lmtp:unix:/var/lib/cyrus/socket/lmtp
# General stuff here again
#config_directory = /etc/postfix
sample_directory = /etc/postfix
queue_directory = /var/spool/postfix
mail_spool_directory = /var/spool/mail
readme_directory = no
command_directory = /usr/sbin
daemon_directory = @LIBEXECDIR@/postfix
mail_owner = postfix
setgid_group = postdrop
unknown_local_recipient_reject_code = 450
mynetworks_style = host
debug_peer_level = 2
sendmail_path = /usr/sbin/sendmail
newaliases_path = /usr/bin/newaliases
mailq_path = /usr/bin/mailq
smtpd_data_restrictions =
permit_mynetworks,
reject_unauth_pipelining,
permit
smtpd_client_restrictions =
permit_mynetworks,
# reject_unknown_client, # This can cause a lot of false rejects.
reject_invalid_hostname,
reject_rbl_client list.dsbl.org,
reject_rbl_client sbl.spamhaus.org,
reject_rbl_client cbl.abuseat.org,
reject_rbl_client dul.dnsbl.sorbs.net,
permit
smtpd_helo_required = yes
smtpd_helo_restrictions =
permit_mynetworks,
reject_unauth_pipelining,
# reject_non_fqdn_hostname, # This can cause a lot of false rejects.
# reject_unknown_hostname, # This can cause a lot of false rejects.
reject_invalid_hostname,
permit
smtpd_sender_restrictions =
permit_mynetworks,
reject_non_fqdn_sender,
# check_sender_access hash:/etc/postfix/access_domains,
reject_unknown_sender_domain,
permit
smtpd_recipient_restrictions =
permit_mynetworks,
permit_sasl_authenticated,
reject_unauth_destination,
# check_recipient_access pcre:/etc/postfix/recipient_checks.pcre,
# check_helo_access pcre:/etc/postfix/helo_checks.pcre,
# check_client_access hash:/etc/postfix/maps/access_client,
# check_client_access hash:/etc/postfix/maps/exceptions_client,
# check_helo_access hash:/etc/postfix/maps/access_helo,
# check_helo_access hash:/etc/postfix/maps/verify_helo,
# check_sender_access hash:/etc/postfix/maps/access_sender,
# check_sender_access hash:/etc/postfix/maps/verify_sender,
# check_recipient_access hash:/etc/postfix/maps/access_recipient,
# reject_multi_recipient_bounce,
reject_non_fqdn_recipient,
reject_unknown_recipient_domain,
# reject_unlisted_recipient,
#check_policy_service unix:private/policy,
# check_sender_access hash:/etc/postfix/maps/no_verify_sender,
# check_sender_access hash:/etc/postfix/access_domains,
# reject_unverified_sender,
# reject_unverified_recipient
check_recipient_access hash:/etc/postfix/internal_recipient
disable_vrfy_command = yes

View File

@@ -0,0 +1,94 @@
#!/bin/sh
### BEGIN INIT INFO
# Provides: postfix MTA
# Default-Start: 2345
# Default-Stop: 016
# Short-Description: start and stop postfix
# Description: Postfix is a Mail Transport Agent, which is the program
# that moves mail from one machine to another.
### END INIT INFO
success() {
echo " Successful"
exit 0
}
fail() {
echo " Failed"
exit 1
}
check_return () {
local ret="$1"
if [ "$ret" = "0" ]; then
success
else
fail
fi
}
PIDFile=/var/spool/postfix/pid/master.pid
case "$1" in
start)
echo -n "Starting Postfix..."
if [ ! -e /etc/aliases.db ]; then
# The alias database is necessary for postfix to work correctly.
echo "Creating aliases database ..."
newaliases
fi
if ! postfix status >/dev/null 2>&1; then
/usr/sbin/check_hostname.sh
postfix start
check_return $?
else
success
fi
;;
stop)
echo -n "Stopping Postfix..."
if postfix status >/dev/null 2>&1; then
postfix stop
check_return $?
else
success
fi
;;
reload)
echo -n "Reloading Postfix..."
if postfix status >/dev/null 2>&1; then
postfix reload
check_return $?
else
postfix start
check_return $?
fi
;;
restart)
$0 stop
sleep 1
$0 start
;;
status)
if postfix status >/dev/null 2>&1; then
pid=`sed -e 's/\s//g' $PIDFile`
echo "The Postfix mail system is running (PID: $pid)"
exit 0
else
echo "The Postfix mail system is not running"
exit 1
fi
;;
*)
echo "Usage: $0 {start|stop|status|reload|restart}"
exit 1
;;
esac

View File

@@ -0,0 +1,16 @@
[Unit]
Description=Postfix Mail Transport Agent
After=syslog.target network.target
Conflicts=sendmail.service exim.service
[Service]
Type=forking
PIDFile=@LOCALSTATEDIR@/spool/postfix/pid/master.pid
ExecStartPre=-@SBINDIR@/check_hostname.sh
ExecStartPre=-@LIBEXECDIR@/postfix/aliasesdb
ExecStart=@SBINDIR@/postfix start
ExecReload=@SBINDIR@/postfix reload
ExecStop=@SBINDIR@/postfix stop
[Install]
WantedBy=multi-user.target