Package init

This commit is contained in:
dogsheng 2019-12-25 16:04:17 +08:00
parent fd0caa1f0b
commit b03c323e0c
2 changed files with 101 additions and 48 deletions

View File

@ -0,0 +1,38 @@
From 2df63f7b64035cf33c6c4a27ce11a496abd54d24 Mon Sep 17 00:00:00 2001
From: zhuchengliang4 <zhuchengliang4@huawei.com>
Date: Tue, 10 Dec 2019 22:15:50 +0800
Subject: [PATCH] fix postfix build faild
---
makedefs | 2 +-
src/util/sys_defs.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/makedefs b/makedefs
index 227fdd5..c575685 100644
--- a/makedefs
+++ b/makedefs
@@ -546,7 +546,7 @@ EOF
: ${SHLIB_ENV="LD_LIBRARY_PATH=`pwd`/lib"}
: ${PLUGIN_LD="${CC-gcc} -shared"}
;;
- Linux.[34].*) SYSTYPE=LINUX$RELEASE_MAJOR
+ Linux.[345].*) SYSTYPE=LINUX$RELEASE_MAJOR
case "$CCARGS" in
*-DNO_DB*) ;;
*-DHAS_DB*) ;;
diff --git a/src/util/sys_defs.h b/src/util/sys_defs.h
index b16763e..ad1bc04 100644
--- a/src/util/sys_defs.h
+++ b/src/util/sys_defs.h
@@ -748,7 +748,7 @@ extern int initgroups(const char *, int);
/*
* LINUX.
*/
-#if defined(LINUX2) || defined(LINUX3) || defined(LINUX4)
+#if defined(LINUX2) || defined(LINUX3) || defined(LINUX4) || defined(LINUX5)
#define SUPPORTED
#define UINT32_TYPE unsigned int
#define UINT16_TYPE unsigned short
--
2.19.1

View File

@ -23,7 +23,7 @@
Name: postfix
Summary: Postfix Mail Transport Agent
Version: 3.3.1
Release: 7
Release: 9
Epoch: 2
URL: http://www.postfix.org
License: (IBM and GPLv2+) or (EPL-2.0 and GPLv2+)
@ -54,6 +54,8 @@ Patch4: postfix-3.2.0-large-fs.patch
Patch9: pflogsumm-1.1.5-datecalc.patch
Patch10: pflogsumm-1.1.5-ipv6-warnings-fix.patch
Patch6000: fix-postfix-build-failed.patch
BuildRequires: libdb-devel perl-generators pkgconfig zlib-devel systemd-units libicu-devel libnsl2-devel gcc m4 openldap-devel
BuildRequires: cyrus-sasl-devel pcre-devel mariadb-connector-c-devel postgresql-devel sqlite-devel tinycdb-devel openssl-devel procps-ng
@ -111,6 +113,8 @@ maps with Postfix, you need this.
%patch3 -p1 -b .alternatives
%patch4 -p1 -b .large-fs
%patch6000 -p1
sed -i \
's|^\(\s*#define\s\+DEF_SHLIB_DIR\s\+\)"/usr/lib/postfix"|\1"%{_libdir}/postfix"|' \
src/global/mail_params.h
@ -172,7 +176,7 @@ make -f Makefile.init makefiles shared=yes dynamicmaps=yes \
%make_build
%install
mkdir -p $RPM_BUILD_ROOT
mkdir -p %{buildroot}
for i in man1/mailq.1 man1/newaliases.1 man1/sendmail.1 man5/aliases.5 man8/smtpd.8; do
dest=$(echo $i | sed 's|\.[1-9]$|.postfix\0|')
@ -181,7 +185,7 @@ for i in man1/mailq.1 man1/newaliases.1 man1/sendmail.1 man5/aliases.5 man8/smtp
done
make non-interactive-package \
install_root=$RPM_BUILD_ROOT \
install_root=%{buildroot} \
config_directory=%{postfix_config_dir} \
meta_directory=%{postfix_config_dir} \
shlib_directory=%{postfix_shlib_dir} \
@ -198,72 +202,72 @@ make non-interactive-package \
sample_directory=%{postfix_sample_dir} \
readme_directory=%{postfix_readme_dir} || exit 1
mkdir -p $RPM_BUILD_ROOT%{_initrddir}
install -c %{SOURCE1} $RPM_BUILD_ROOT%{_initrddir}/postfix
mkdir -p %{buildroot}%{_initrddir}
install -c %{SOURCE1} %{buildroot}%{_initrddir}/postfix
mkdir -p %{buildroot}%{_unitdir}
install -m 644 %{SOURCE2} %{buildroot}%{_unitdir}
install -m 755 %{SOURCE3} %{buildroot}%{postfix_daemon_dir}/aliasesdb
install -m 755 %{SOURCE4} %{buildroot}%{postfix_daemon_dir}/chroot-update
install -c auxiliary/rmail/rmail $RPM_BUILD_ROOT%{_bindir}/rmail.postfix
install -c auxiliary/rmail/rmail %{buildroot}%{_bindir}/rmail.postfix
for i in active bounce corrupt defer deferred flush incoming private saved maildrop public pid saved trace; do
mkdir -p $RPM_BUILD_ROOT%{postfix_queue_dir}/$i
mkdir -p %{buildroot}%{postfix_queue_dir}/$i
done
for i in smtp-sink smtp-source ; do
install -c -m 755 bin/$i $RPM_BUILD_ROOT%{postfix_command_dir}/
install -c -m 755 man/man1/$i.1 $RPM_BUILD_ROOT%{_mandir}/man1/
install -c -m 755 bin/$i %{buildroot}%{postfix_command_dir}/
install -c -m 755 man/man1/$i.1 %{buildroot}%{_mandir}/man1/
done
sed -i -r "s#(/man[158]/.*.[158]):f#\1.gz:f#" $RPM_BUILD_ROOT%{postfix_config_dir}/postfix-files
sed -i -r "s#(/man[158]/.*.[158]):f#\1.gz:f#" %{buildroot}%{postfix_config_dir}/postfix-files
cat $RPM_BUILD_ROOT%{postfix_config_dir}/postfix-files
cat %{buildroot}%{postfix_config_dir}/postfix-files
mkdir -p $RPM_BUILD_ROOT%{sasl_config_dir}
install -m 644 %{SOURCE100} $RPM_BUILD_ROOT%{sasl_config_dir}/smtpd.conf
mkdir -p %{buildroot}%{sasl_config_dir}
install -m 644 %{SOURCE100} %{buildroot}%{sasl_config_dir}/smtpd.conf
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/pam.d
install -m 644 %{SOURCE101} $RPM_BUILD_ROOT%{_sysconfdir}/pam.d/smtp.postfix
mkdir -p %{buildroot}%{_sysconfdir}/pam.d
install -m 644 %{SOURCE101} %{buildroot}%{_sysconfdir}/pam.d/smtp.postfix
mkdir -p $RPM_BUILD_ROOT%{postfix_doc_dir}
cp -p COMPATIBILITY LICENSE TLS_ACKNOWLEDGEMENTS TLS_LICENSE $RPM_BUILD_ROOT%{postfix_doc_dir}
mkdir -p %{buildroot}%{postfix_doc_dir}
cp -p COMPATIBILITY LICENSE TLS_ACKNOWLEDGEMENTS TLS_LICENSE %{buildroot}%{postfix_doc_dir}
mkdir -p $RPM_BUILD_ROOT%{postfix_doc_dir}/examples{,/chroot-setup}
cp -pr examples/{qmail-local,smtpd-policy} $RPM_BUILD_ROOT%{postfix_doc_dir}/examples
cp -p examples/chroot-setup/LINUX2 $RPM_BUILD_ROOT%{postfix_doc_dir}/examples/chroot-setup
mkdir -p %{buildroot}%{postfix_doc_dir}/examples{,/chroot-setup}
cp -pr examples/{qmail-local,smtpd-policy} %{buildroot}%{postfix_doc_dir}/examples
cp -p examples/chroot-setup/LINUX2 %{buildroot}%{postfix_doc_dir}/examples/chroot-setup
cp conf/{main,bounce}.cf.default $RPM_BUILD_ROOT%{postfix_doc_dir}
sed -i 's#%{postfix_config_dir}\(/bounce\.cf\.default\)#%{postfix_doc_dir}\1#' $RPM_BUILD_ROOT%{_mandir}/man5/bounce.5
rm -f $RPM_BUILD_ROOT%{postfix_config_dir}/{TLS_,}LICENSE
cp conf/{main,bounce}.cf.default %{buildroot}%{postfix_doc_dir}
sed -i 's#%{postfix_config_dir}\(/bounce\.cf\.default\)#%{postfix_doc_dir}\1#' %{buildroot}%{_mandir}/man5/bounce.5
rm -f %{buildroot}%{postfix_config_dir}/{TLS_,}LICENSE
find $RPM_BUILD_ROOT%{postfix_doc_dir} -type f | xargs chmod 644
find $RPM_BUILD_ROOT%{postfix_doc_dir} -type d | xargs chmod 755
find %{buildroot}%{postfix_doc_dir} -type f | xargs chmod 644
find %{buildroot}%{postfix_doc_dir} -type d | xargs chmod 755
install -c -m 644 pflogsumm-1.1.5/pflogsumm-faq.txt $RPM_BUILD_ROOT%{postfix_doc_dir}/pflogsumm-faq.txt
install -c -m 644 pflogsumm-1.1.5/pflogsumm.1 $RPM_BUILD_ROOT%{_mandir}/man1/pflogsumm.1
install -c pflogsumm-1.1.5/pflogsumm.pl $RPM_BUILD_ROOT%{postfix_command_dir}/pflogsumm
install -c -m 644 pflogsumm-1.1.5/pflogsumm-faq.txt %{buildroot}%{postfix_doc_dir}/pflogsumm-faq.txt
install -c -m 644 pflogsumm-1.1.5/pflogsumm.1 %{buildroot}%{_mandir}/man1/pflogsumm.1
install -c pflogsumm-1.1.5/pflogsumm.pl %{buildroot}%{postfix_command_dir}/pflogsumm
mantools/srctoman - auxiliary/qshape/qshape.pl > qshape.1
install -c qshape.1 $RPM_BUILD_ROOT%{_mandir}/man1/qshape.1
install -c auxiliary/qshape/qshape.pl $RPM_BUILD_ROOT%{postfix_command_dir}/qshape
install -c qshape.1 %{buildroot}%{_mandir}/man1/qshape.1
install -c auxiliary/qshape/qshape.pl %{buildroot}%{postfix_command_dir}/qshape
rm -f $RPM_BUILD_ROOT%{postfix_config_dir}/aliases
rm -f %{buildroot}%{postfix_config_dir}/aliases
mkdir -p $RPM_BUILD_ROOT/usr/lib
pushd $RPM_BUILD_ROOT/usr/lib
mkdir -p %{buildroot}/usr/lib
pushd %{buildroot}/usr/lib
ln -sf ../sbin/sendmail.postfix .
popd
mkdir -p $RPM_BUILD_ROOT%{_var}/lib/misc
touch $RPM_BUILD_ROOT%{_var}/lib/misc/postfix.aliasesdb-stamp
mkdir -p %{buildroot}%{_var}/lib/misc
touch %{buildroot}%{_var}/lib/misc/postfix.aliasesdb-stamp
for i in %{postfix_command_dir}/sendmail %{_bindir}/{mailq,newaliases,rmail} \
%{_sysconfdir}/pam.d/smtp /usr/lib/sendmail \
%{_mandir}/{man1/{mailq.1,newaliases.1},man5/aliases.5,man8/{sendmail.8,smtpd.8}}
do
touch $RPM_BUILD_ROOT$i
touch %{buildroot}$i
done
function split_file
@ -272,7 +276,7 @@ function split_file
sed -i "\|$1| d" "$3" || :
}
pushd $RPM_BUILD_ROOT%{postfix_config_dir}
pushd %{buildroot}%{postfix_config_dir}
for map in mysql pgsql sqlite cdb ldap pcre; do
rm -f dynamicmaps.cf.d/"$map" "postfix-files.d/$map"
split_file "^\s*$map\b" "$map" dynamicmaps.cf
@ -299,8 +303,8 @@ popd
ALTERNATIVES_DOCS=""
[ "%%{_excludedocs}" = 1 ] || ALTERNATIVES_DOCS='--slave %{_mandir}/man1/mailq.1.gz mta-mailqman %{_mandir}/man1/mailq.postfix.1.gz
--slave %{_mandir}/man1/newaliases.1.gz mta-newaliasesman %{_mandir}/man1/newaliases.postfix.1.gz
--slave %{_mandir}/man8/sendmail.8.gz mta-sendmailman %{_mandir}/man1/sendmail.postfix.1.gz
--slave %{_mandir}/man5/aliases.5.gz mta-aliasesman %{_mandir}/man5/aliases.postfix.5.gz
--slave %{_mandir}/man8/sendmail.8.gz mta-sendmailman %{_mandir}/man1/sendmail.postfix.1.gz
--slave %{_mandir}/man8/smtpd.8.gz mta-smtpdman %{_mandir}/man8/smtpd.postfix.8.gz'
%{_sbindir}/alternatives --install %{postfix_command_dir}/sendmail mta %{postfix_command_dir}/sendmail.postfix 60 \
@ -419,29 +423,28 @@ fi
%config(noreplace) %{postfix_config_dir}/canonical
%config(noreplace) %{postfix_config_dir}/generic
%config(noreplace) %{postfix_config_dir}/header_checks
%config(noreplace) %{postfix_config_dir}/main.cf
%config(noreplace) %{postfix_config_dir}/main.cf.proto
%config(noreplace) %{postfix_config_dir}/master.cf
%config(noreplace) %{postfix_config_dir}/master.cf.proto
%config(noreplace) %{postfix_config_dir}/relocated
%config(noreplace) %{postfix_config_dir}/transport
%config(noreplace) %{postfix_config_dir}/virtual
%{postfix_config_dir}/dynamicmaps.cf
%config(noreplace) %{postfix_config_dir}/main.cf
%config(noreplace) %{postfix_config_dir}/master.cf
%config(noreplace) %{postfix_config_dir}/main.cf.proto
%config(noreplace) %{postfix_config_dir}/master.cf.proto
%{postfix_config_dir}/postfix-files
%{postfix_config_dir}/dynamicmaps.cf
%{postfix_config_dir}/dynamicmaps.cf.d/sqlite
%{postfix_config_dir}/postfix-files.d/sqlite
%{postfix_shlib_dir}/postfix-sqlite.so
%{postfix_config_dir}/dynamicmaps.cf.d/ldap
%{postfix_config_dir}/postfix-files.d/ldap
%{postfix_shlib_dir}/postfix-ldap.so
%{postfix_config_dir}/dynamicmaps.cf.d/pcre
%{postfix_config_dir}/postfix-files.d/pcre
%{postfix_shlib_dir}/postfix-pcre.so
%{postfix_config_dir}/dynamicmaps.cf.d/mysql
%{postfix_config_dir}/postfix-files.d/mysql
%{postfix_shlib_dir}/postfix-mysql.so
%{postfix_shlib_dir}/postfix-pcre.so
%{postfix_shlib_dir}/postfix-ldap.so
%{postfix_shlib_dir}/postfix-mysql.so
%{postfix_shlib_dir}/postfix-sqlite.so
%{postfix_shlib_dir}/libpostfix-*.so
%{postfix_daemon_dir}/*
%{_bindir}/mailq.postfix
@ -504,6 +507,18 @@ fi
%{postfix_doc_dir}/README_FILES/*
%changelog
* Sat Dec 21 2019 openEuler Buildteam <buildteam@openeuler.org> - 2:3.3.1-9
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:fix postfix build failed
* Tue Dec 3 2019 openEuler Buildteam <buildteam@openeuler.org> - 2:3.3.1-8
- Type:NA
- ID:NA
- SUG:NA
- DESC:optimize the spec file
* Tue Oct 29 2019 openEuler Buildteam <buildteam@openeuler.org> - 2:3.3.1-7
- Type:NA
- ID:NA