# http://ftp.rpm.org/max-rpm/s1-rpm-inside-scripts.html # https://rpm-software-management.github.io/rpm/manual/macros.html # https://rpm-packaging-guide.github.io/ %global _owner pgnd %global _lib_legacy %( echo %{_lib} | sed 's|64$||g' ) %global _build_timestamp %( date +%%Y%%m%%d_%%H%%M%%S --utc ) %global _dist .%{_build_timestamp}.%{_owner}.fc%{fedora} # https://stackoverflow.com/questions/47838041/rpmbuild-how-to-disable-check-buildroot # https://rpm-software-management.github.io/rpm/manual/dependency_generators.html # %%global __spec_install_pre /bin/true # %%global __arch_install_post %%{nil} # %%global __os_install_post %%{nil} %global _disable_source_fetch 0 %global debug_package %{nil} # %%undefine _auto_set_build_flags %global _hardened_build 1 # %%global __brp_mangle_shebangs %%{nil} # %%global __brp_strip %%{nil} # %%global __requires_exclude ^.*/xxx/bin/python.*$ # %%global __requires_exclude_from ^.*/xxx/bin/python.*$ # %%global _build_id_links none # %%bcond_with XXX : opt build with XXX; default, without # %%bcond_without XXX : opt build without XXX; default, with # %%bcond_without _pfx_frontend_svr # POSTFIX # https://github.com/vdukhovni/postfix # https://www.postfix.org/INSTALL.html # https://www.postfix.org/PACKAGE_README.html # https://cgit.freebsd.org/ports/tree/mail/postfix-current/Makefile %global _pfx_name postfix %global _pfx_pkgnm postfix-current %global _pfx_unitnm postfix-current %global _pfx_comment Postfix MTA (Current Upstream Release) %global _pfx_descrip %{expand: %{_pfx_comment}.} # https://spdx.org/licenses/EPL-2.0.html and https://spdx.org/licenses/IPL-1.0.html %global _license EPL-2.0 and IPL-1.0 %global _pfx_usr postfix %global _pfx_grp postfix %global _pfx_grp_milter postfix-milter %global _pfx_grp_setgid postdrop %global _pfx_bin_dir_r bin %global _pfx_conf_dir /usr/local/etc/postfix %global _pfx_conf_dir_orig_r etc %global _pfx_default_db_type lmdb %global _pfx_data_dir /var/lib/postfix %global _pfx_doc_dir_r share/doc %global _pfx_install_dir /usr/local/postfix-pgnd/postfix-current %global _pfx_libexec_dir_r libexec %global _pfx_log_dir /var/log/postfix %global _pfx_mailq_path_r %{_pfx_bin_dir_r}/mailq.postfix %global _pfx_man_dir_r share/man %global _pfx_meta_dir_r %{_pfx_conf_dir_orig_r} %global _pfx_newaliases_path_r %{_pfx_bin_dir_r}/newaliases.postfix %global _pfx_pid_file master.pid %global _pfx_run_dir /var/spool/postfix %global _pfx_sample_dir %{_pfx_doc_dir_r}/samples #!!! https://fedoraproject.org/wiki/Changes/Unify_bin_and_sbin %global _pfx_sbin_dir_r sbin %global _pfx_sendmail_path_r %{_pfx_sbin_dir_r}/sendmail.postfix %global _pfx_shlib_dir_r lib64 %global _pfx_unit_dir /etc/systemd/system %global _pfx_exec_dir_r %{_pfx_sbin_dir_r} %global _pfx_exec %{_pfx_install_dir}/%{_pfx_exec_dir_r}/postfix %global _msmtp_log_dir /var/log/msmtp %global _msmtp_log_file msmtp.log # https://docs.fedoraproject.org/en-US/packaging-guidelines/SourceURL/ # POSTFIX # https://github.com/vdukhovni/postfix %global _pfx0_scm_repo vdukhovni/postfix # %%global _pfx0_scm_branch postfix-3.9 %global _pfx0_scm_branch v3.9.0 %global _pfx0_scm_repo_esc %( echo %{_pfx0_scm_repo} | sed 's|_|-|g' | sed 's|/|%2F|g') %global _pfx0_scm_repo_norm %( echo %{_pfx0_scm_repo} | sed 's|_|-|g' | sed 's|/|-|g' ) %global _pfx0_scm_branch_norm %( echo %{_pfx0_scm_branch} | sed 's|_|-|g' | sed 's|/|-|g' ) %global _pfx0_scm_host https://github.com %global _pfx0_scm_host_api https://api.github.com/repos %global _pfx0_scm_url %{_pfx0_scm_host}/%{_pfx0_scm_repo} %global _pfx0_commit %( git ls-remote %{_pfx0_scm_url} | grep /%{_pfx0_scm_branch}$ | cut -f1 ) %global _pfx0_shortcommit %( c=%{_pfx0_commit}; echo ${c} | head -c 7 ) # https://docs.github.com/en/rest/repos/contents %global _pfx0_scm_tarball %{_pfx0_scm_host_api}/%{_pfx0_scm_repo}/tarball/%{_pfx0_commit} # !!NOTE!! GH API tarball extracts to: %global _pfx0_scm_extract_dir %{_pfx0_scm_repo_norm}-%{shortcommit0} %global forgeurl0 %{_pfx0_scm_url} %global commit0 %{_pfx0_commit} %global shortcommit0 %{_pfx0_shortcommit} %global forgesource0 %{_pfx0_scm_tarball} %global extractdir0 %{_pfx0_scm_extract_dir} %global forgesetupargs0 -T -D -b 0 -n %{extractdir0} # PFLOGSUMM # https://jimsun.linxnet.com/postfix_contrib.html # https://packages.debian.org/source/sid/pflogsumm # https://src.fedoraproject.org/rpms/postfix/tree/rawhide %global _pfx_pflogsumm_url_src https://deb.debian.org/debian/pool/main/p/pflogsumm %global _pfx_pflogsumm_ver 1.1.5 %forgemeta -i -a %global dist %{_dist} # Vendor Pinning Vendor: %{_owner} # NEVRA (n-e:v-r.a) Name: %{_pfx_pkgnm} Epoch: 3 # https://docs.fedoraproject.org/en-US/packaging-guidelines/Versioning/ Version: %{scm0}_%( echo %{_pfx0_scm_branch} | sed 's|-|_|g' ) Release: 0%{?dist} # https://blog.jasonantman.com/2014/07/how-yum-and-rpm-compare-versions/ %global _same_evr %{epoch}:%{version}-%{release} Summary: %{_pfx_comment} License: %{_license} URL: %{forgeurl0} Source0: %{forgesource0} Source100: %{_pfx_unitnm}.service Source101: postfix-pam.conf Source102: %{_pfx_pkgnm}.logrotate Source103: %{_pfx_pkgnm}.rsyslog Source104: wait_qmgr.sh Patch100: 100-fedora-alternatives.patch Source400: %{_pfx_pflogsumm_url_src}/pflogsumm_%{_pfx_pflogsumm_ver}.orig.tar.gz Source401: pflogsumm.service Source402: pflogsumm.timer Source403: pflogsumm-report.sh Patch401: pflogsumm-%{_pfx_pflogsumm_ver}-datecalc.patch Patch402: pflogsumm-%{_pfx_pflogsumm_ver}-ipv6-warnings-fix.patch Patch403: pflogsumm-%{_pfx_pflogsumm_ver}-syslog-name-underscore-fix.patch BuildRequires: findutils BuildRequires: gcc BuildRequires: libdb BuildRequires: libdb-devel BuildRequires: libdb-utils BuildRequires: make BuildRequires: m4 BuildRequires: pcre2-devel BuildRequires: perl-generators BuildRequires: pkgconf BuildRequires: pkgconfig(icu-uc) BuildRequires: pkgconfig(lmdb) BuildRequires: pkgconfig(openssl) BuildRequires: pkgconfig(sqlite3) BuildRequires: pkgconfig(zlib) BuildRequires: systemd BuildRequires: systemd-rpm-macros BuildRequires: systemd-units %{?systemd_requires} Requires: diffutils Requires: findutils Requires: libdb Requires: libdb-devel Requires: libdb-utils Requires: lmdb Requires: logrotate Requires: policycoreutils Requires: rsyslog # qshape, pflogsumm Requires: msmtp Requires: perl(Date::Calc) Requires: perl(File::Find) Requires: perl(Getopt::Std) Requires: perl(IO::File) Requires(pre): user(postfix) Requires(pre): group(postfix) Requires(pre): group(postfix-milter) Requires(post): hostname Requires(post): %{_sbindir}/alternatives Requires(post): %{_bindir}/openssl Requires(preun): %{_sbindir}/alternatives Provides: postfix-current = %{_same_evr} Provides: postfix = %{_same_evr} Provides: postfix-pflogsumm = %{_same_evr} Provides: MTA = %{_same_evr} Provides: sendmail = %{_same_evr} Provides: server(smtp) = %{_same_evr} Provides: smtpd = %{_same_evr} Provides: smtpdaemon = %{_same_evr} Obsoletes: postfix-current < %{_same_evr} Obsoletes: postfix-pflogsumm < %{_same_evr} # FRONTEND SERVER APPS #Requires: clamav-milter #Requires: dkimpy-milter #Requires: fangfrisch #Requires: fm-auth-milter #Requires: milter-regex #Requires: spamassassin-milter Recommends: ( clamav-milter and dkimpy-milter and fangfrisch and fm-auth-milter and milter-regex and spamassassin-milter ) Provides: postfix-milter = %{_same_evr} Obsoletes: postfix-milter < %{_same_evr} Obsoletes: postfix < %{_same_evr} Obsoletes: postfix-lmdb < %{_same_evr} Obsoletes: postfix-pcre < %{_same_evr} Obsoletes: postfix-perl-scripts < %{_same_evr} Obsoletes: postfix-sqlite < %{_same_evr} Conflicts: exim Conflicts: sendmail %description %{_pfx_descrip} %prep echo '##### STARTING PREP #####' %forgesetup -a # postfix patches cd %{_builddir}/%{extractdir0}/postfix patch -p1 < %{PATCH100} # pflogsumm patches cd %{_builddir} tar xzvf %{SOURCE400} patch -p0 < %{PATCH401} patch -p0 < %{PATCH402} patch -p1 < %{PATCH403} %build echo '##### STARTING BUILD #####' cd %{_builddir}/%{extractdir0}/postfix echo '##### CLEAN BUILD #####' make tidy > /dev/null 2>&1 echo '##### PFX SOURCE FLAGS PREP #####' unset AUXLIBS AUXLIBS_LDAP AUXLIBS_LMDB AUXLIBS_PCRE AUXLIBS_MYSQL AUXLIBS_PGSQL AUXLIBS_SQLITE AUXLIBS_CDB _this_CFLAGS="${CFLAGS}" _this_CPPFLAGS="${CPPFLAGS}" _this_CXXFLAGS="${CXXFLAGS}" _this_LDFLAGS="${LDFLAGS}" _this_CFLAGS+=" -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE" CCARGS="" CCARGS+=" -fPIC -fcommon" CCARGS+=" -DNO_NIS" CCARGS+=" -DNO_NISPLUS" CCARGS+=" -DHAS_DB" CCARGS+=" -DHAS_LMDB $( pkg-config --cflags lmdb)" CCARGS+=" -DHAS_PCRE=2 $( pcre2-config --cflags)" CCARGS+=" -DHAS_SQLITE $( pkg-config --cflags sqlite3)" CCARGS+=" -DUSE_TLS $( pkg-config --cflags openssl)" CCARGS+=" $(getconf LFS_CFLAGS)" # quiet noise ... CCARGS+=" -Wno-missing-braces" CCARGS+=" -Wno-maybe-uninitialized" CCARGS+=" -Wno-unused-but-set-variable" CCARGS+=" -Wno-unused-function" AUXLIBS="" AUXLIBS+=" -ldb" AUXLIBS+=" $( pkg-config --libs openssl)" AUXLIBS_LMDB="$( pkg-config --libs lmdb)" AUXLIBS_PCRE=" $( pcre2-config --libs8)" AUXLIBS_SQLITE=" $( pkg-config --libs sqlite3)" chmod +x $( find . | grep annotate.sh) # SHLIB_RPATH is needed to find private libraries # LDFLAGS are added to SHLIB_RPATH because the postfix build system # ignores them. Adding LDFLAGS to SHLIB_RPATH is currently the only # way how to get them in # check: # readelf -d ./postfix | grep RUNPATH # 0x000000000000001d (RUNPATH) Library runpath: [/usr/local/postfix-pgnd/postfix-current/lib64] make -f Makefile.init makefiles \ config_directory="%{_pfx_install_dir}/%{_pfx_conf_dir_orig_r}" \ queue_directory="%{_pfx_run_dir}" \ shlib_directory="%{_pfx_install_dir}/%{_pfx_shlib_dir_r}" \ shared=yes \ SHLIB_CFLAGS="${_this_CFLAGS} -fno-strict-aliasing -Wno-comment" \ SHLIB_RPATH="-Wl,-rpath,%{_pfx_install_dir}/%{_pfx_shlib_dir_r} ${_this_LDFLAGS}" \ SHLIB_SUFFIX=".so" \ dynamicmaps=yes \ pie=yes \ CCARGS="${CCARGS}" \ AUXLIBS="${AUXLIBS}" \ AUXLIBS_LMDB="${AUXLIBS_LMDB}" \ AUXLIBS_PCRE="${AUXLIBS_PCRE}" \ AUXLIBS_SQLITE="${AUXLIBS_SQLITE}" \ DEBUG="" \ OPT="-O3" \ POSTFIX_INSTALL_OPTS=" -keep-build-mtime" make V=1 -j${RPM_BUILD_NCPUS} # pre-clean rm -rf %{_pfx_install_dir} %install echo '##### STARTING INSTALL #####' cd %{_builddir}/%{extractdir0}/postfix # Move stuff around so we don't conflict with sendmail #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|') # mv man/$i man/$dest # sed -i "s|^\.so $i|\.so $dest|" man/man?/*.[1-9] #done # Where can I install a user-created man page in fedora? # https://discussion.fedoraproject.org/t/where-can-i-install-a-user-created-man-page-in-fedora/75700/5 ## modify rpmbuild rpath check criteria # cref: /usr/lib/rpm/check-rpaths-worker # _this_QA_RPATHS=$(( 0x0001|0x0002|0x0004|0x0008|0x0010|0x0020 )) # allow 'invalid' RPATHs _this_QA_RPATHS=$(( 0x0002 )) export _this_QA_RPATHS export QA_RPATHS=${_this_QA_RPATHS} # paths are relative to install_root make non-interactive-package \ install_root="${RPM_BUILD_ROOT}" \ mail_owner="%{_pfx_usr}" \ setgid_group="%{_pfx_grp_setgid}" \ shlib_directory="%{_pfx_install_dir}/%{_pfx_shlib_dir_r}" \ SHLIB_RPATH="-Wl,-rpath,%{_pfx_install_dir}/%{_pfx_shlib_dir_r} ${_this_LDFLAGS}" \ command_directory="%{_pfx_install_dir}/%{_pfx_exec_dir_r}" \ config_directory="%{_pfx_install_dir}/%{_pfx_conf_dir_orig_r}" \ daemon_directory="%{_pfx_install_dir}/%{_pfx_libexec_dir_r}" \ data_directory="%{_pfx_data_dir}" \ default_database_type="%{_pfx_default_db_type}" \ html_directory=no \ manpage_directory="%{_pfx_install_dir}/%{_pfx_man_dir_r}" \ meta_directory="%{_pfx_install_dir}/%{_pfx_meta_dir_r}" \ queue_directory="%{_pfx_run_dir}" \ readme_directory=no \ mailq_path="%{_pfx_install_dir}/%{_pfx_mailq_path_r}" \ newaliases_path="%{_pfx_install_dir}/%{_pfx_newaliases_path_r}" \ sendmail_path="%{_pfx_install_dir}/%{_pfx_sendmail_path_r}" \ || exit 1 # GENERATE .service FILES, scripts sed -i \ -e 's|__PFX_CONFDIR__|%{_pfx_conf_dir}|g' \ -e 's|__PFX_EXEC__|%{_pfx_exec}|g' \ -e 's|__PFX_GRP__|%{_pfx_grp}|g' \ -e 's|__PFX_GRP_MILTER__|%{_pfx_grp_milter}|g' \ -e 's|__PFX_GRP_SETGID__|%{_pfx_grp_setgid}|g' \ -e 's|__PFX_LOGDIR__|%{_pfx_log_dir}|g' \ -e 's|__PFX_PIDFILE__|%{_pfx_pid_file}|g' \ -e 's|__PFX_RUNDIR__|%{_pfx_run_dir}|g' \ -e 's|__PFX_SBINDIR__|%{_pfx_install_dir}/%{_pfx_exec_dir_r}|g' \ -e 's|__PFX_UNITNM__|%{_pfx_unitnm}|g' \ -e 's|__PFX_USR__|%{_pfx_usr}|g' \ -e 's|__MSMTP_LOGDIR__|%{_msmtp_log_dir}|g' \ -e 's|__MSMTP_LOGFILE__|%{_msmtp_log_file}|g' \ %{SOURCE100} %{SOURCE101} %{SOURCE102} %{SOURCE103} %{SOURCE104} %{SOURCE401} %{SOURCE402} %{SOURCE403} # DIRS mkdir -p ${RPM_BUILD_ROOT}/%{_pfx_conf_dir}/dynamicmaps.cf.d mkdir -p ${RPM_BUILD_ROOT}/%{_pfx_conf_dir}/postfix-files.d mkdir -p ${RPM_BUILD_ROOT}/%{_pfx_conf_dir}/scripts mkdir -p ${RPM_BUILD_ROOT}/%{_pfx_data_dir} mkdir -p ${RPM_BUILD_ROOT}/%{_pfx_run_dir} mkdir -p ${RPM_BUILD_ROOT}/%{_pfx_unit_dir} mkdir -p ${RPM_BUILD_ROOT}/%{_sysconfdir}/logrotate.d mkdir -p ${RPM_BUILD_ROOT}/%{_sysconfdir}/pam.d mkdir -p ${RPM_BUILD_ROOT}/%{_sysconfdir}/rsyslog.d # SERVICEs install -D -p -m 644 \ %{SOURCE100} \ ${RPM_BUILD_ROOT}/%{_pfx_unit_dir}/%{_pfx_unitnm}.service install -D -p -m 644 \ %{SOURCE401} \ ${RPM_BUILD_ROOT}/%{_pfx_unit_dir}/pflogsumm.service install -D -p -m 644 \ %{SOURCE402} \ ${RPM_BUILD_ROOT}/%{_pfx_unit_dir}/pflogsumm.timer # FILES install -D -p -m 644 \ ${RPM_BUILD_ROOT}/%{_pfx_install_dir}/%{_pfx_conf_dir_orig_r}/postfix-files \ ${RPM_BUILD_ROOT}/%{_pfx_conf_dir}/postfix-files install -D -p -m 644 \ ${RPM_BUILD_ROOT}/%{_pfx_install_dir}/%{_pfx_conf_dir_orig_r}/dynamicmaps.cf \ ${RPM_BUILD_ROOT}/%{_pfx_conf_dir}/dynamicmaps.cf install -D -p -m 644 \ auxiliary/rmail/rmail \ ${RPM_BUILD_ROOT}/%{_pfx_install_dir}/%{_pfx_bin_dir_r}/rmail.postfix install -D -p -m 644 \ %{_builddir}/pflogsumm-%{_pfx_pflogsumm_ver}/pflogsumm.1 \ ${RPM_BUILD_ROOT}/%{_pfx_install_dir}/%{_pfx_man_dir_r}/man1/pflogsumm.1 install -D -p -m 644 \ %{SOURCE102} \ ${RPM_BUILD_ROOT}/%{_sysconfdir}/logrotate.d/%{_pfx_pkgnm} install -D -p -m 644 \ %{SOURCE101} \ ${RPM_BUILD_ROOT}/%{_sysconfdir}/pam.d/smtp.postfix install -D -p -m 644 \ %{SOURCE103} \ ${RPM_BUILD_ROOT}/%{_sysconfdir}/rsyslog.d/%{_pfx_pkgnm}.conf # SCRIPTS install -D -p -m 755 \ %{SOURCE403} \ ${RPM_BUILD_ROOT}/%{_pfx_conf_dir}/scripts/pflogsumm-report.sh install -D -p -m 755 \ %{SOURCE104} \ ${RPM_BUILD_ROOT}/%{_pfx_conf_dir}/scripts/wait_qmgr.sh install -D -p -m 755 \ %{_builddir}/pflogsumm-%{_pfx_pflogsumm_ver}/pflogsumm.pl \ ${RPM_BUILD_ROOT}/%{_pfx_install_dir}/%{_pfx_exec_dir_r}/pflogsumm install -D -p -m 755 \ auxiliary/qshape/qshape.pl \ ${RPM_BUILD_ROOT}/%{_pfx_install_dir}/%{_pfx_exec_dir_r}/qshape # symlink /usr/lib/sendmail mkdir -p ${RPM_BUILD_ROOT}/%{_prefix}/%{_lib_legacy} pushd ${RPM_BUILD_ROOT}/%{_prefix}/%{_lib_legacy} ln -sf %{_pfx_install_dir}/sbin/sendmail.postfix . popd # prepare alternatives ghosts for g in \ {%{_sbindir},%{_prefix}/%{_lib_legacy}}/sendmail \ %{_bindir}/{mailq,newaliases,rmail} \ %{_mandir}/{man1/{mailq.1,newaliases.1},man5/aliases.5,man8/{sendmail.8,smtpd.8}} \ %{_sysconfdir}/pam.d/smtp do mkdir -p $(dirname ${RPM_BUILD_ROOT}${g}) touch ${RPM_BUILD_ROOT}${g} done # adjust for RPM-auto-compressed man pages sed -i -E \ 's|(/man[158]/.*.[158]):f|\1.gz:f|g' \ ${RPM_BUILD_ROOT}/%{_pfx_install_dir}/%{_pfx_conf_dir_orig_r}/postfix-files # rpm auto-compresses man-pages to *.gz only in _standard_locations; for non-standard, exec manually ... # cref: /usr/lib/rpm/brp-compress find ${RPM_BUILD_ROOT}/%{_pfx_install_dir}/%{_pfx_man_dir_r} -type f -name "*\.[158]" \ -exec gzip -9 -n {} \; # REMOVE git artifacts from pkging find ${RPM_BUILD_ROOT} -name '.gitignore' -type f -exec rm -f {} + %pre %post -e %systemd_post %{_pfx_unitnm}.service # fix permissions, as in 'postfix-files' sh -x %{_pfx_install_dir}/%{_pfx_libexec_dir_r}/post-install set-permissions \ mail_owner=%{_pfx_usr} \ setgid_group=%{_pfx_grp_setgid} \ command_directory=%{_pfx_install_dir}/%{_pfx_exec_dir_r} \ daemon_directory=%{_pfx_install_dir}/%{_pfx_libexec_dir_r} \ manpage_directory=%{_pfx_install_dir}/%{_pfx_man_dir_r} \ meta_directory=%{_pfx_install_dir}/%{_pfx_conf_dir_orig_r} \ shlib_directory=%{_pfx_install_dir}/%{_pfx_shlib_dir_r} \ sendmail_path=%{_pfx_install_dir}/%{_pfx_exec_dir_r} \ &> /dev/null # SYSTEM 'ALTERNATIVES' # alternatives --display mta _alt_prio=120 %{_sbindir}/alternatives \ --install %{_sbindir}/sendmail mta %{_pfx_install_dir}/%{_pfx_exec_dir_r}/sendmail.postfix ${_alt_prio} \ --follower %{_bindir}/mailq mta-mailq %{_pfx_install_dir}/%{_pfx_bin_dir_r}/mailq.postfix \ --follower %{_bindir}/newaliases mta-newaliases %{_pfx_install_dir}/%{_pfx_bin_dir_r}/newaliases.postfix \ --follower %{_sysconfdir}/pam.d/smtp mta-pam %{_sysconfdir}/pam.d/smtp.postfix \ --follower %{_bindir}/rmail mta-rmail %{_pfx_install_dir}/%{_pfx_bin_dir_r}/rmail.postfix \ --follower %{_prefix}/%{_lib_legacy}/sendmail mta-sendmail %{_prefix}/%{_lib_legacy}/sendmail.postfix \ --follower %{_mandir}/man1/mailq.1.gz mta-mailqman %{_mandir}/man1/mailq.postfix.1.gz \ --follower %{_mandir}/man1/newaliases.1.gz mta-newaliasesman %{_mandir}/man1/newaliases.postfix.1.gz \ --follower %{_mandir}/man5/aliases.5.gz mta-aliasesman %{_mandir}/man5/aliases.postfix.5.gz \ --follower %{_mandir}/man8/sendmail.8.gz mta-sendmailman %{_mandir}/man1/sendmail.postfix.1.gz \ --follower %{_mandir}/man8/smtpd.8.gz mta-smtpdman %{_mandir}/man8/smtpd.postfix.8.gz \ --initscript postfix-current /bin/systemctl try-restart rsyslog.service >/dev/null 2>&1 || : exit 0 %preun %systemd_preun %{_pfx_unitnm}.service # alternatives if [ "$1" = 0 ]; then %{_sbindir}/alternatives --remove mta %{_pfx_install_dir}/%{_pfx_exec_dir_r}/sendmail.postfix fi exit 0 %postun %systemd_postun_with_restart %{_pfx_unitnm}.service %check %files # http://ftp.rpm.org/max-rpm/s1-rpm-inside-files-list-directives.html %{_pfx_install_dir} %doc %license %{_pfx_unit_dir}/%{_pfx_pkgnm}.service %{_pfx_unit_dir}/pflogsumm.service %{_pfx_unit_dir}/pflogsumm.timer %config(noreplace) %{_sysconfdir}/pam.d/smtp.postfix %{_prefix}/%{_lib_legacy}/sendmail.postfix %{_sysconfdir}/logrotate.d/%{_pfx_pkgnm} %{_sysconfdir}/rsyslog.d/%{_pfx_pkgnm}.conf %attr(0750,root,%{_pfx_grp}) %{_pfx_conf_dir}/scripts/wait_qmgr.sh %attr(0750,root,%{_pfx_grp}) %{_pfx_conf_dir}/scripts/pflogsumm-report.sh %dir %attr(0750,root,%{_pfx_grp}) %{_pfx_conf_dir}/dynamicmaps.cf.d %dir %attr(0750,root,%{_pfx_grp}) %{_pfx_conf_dir}/postfix-files.d %attr(0640,root,%{_pfx_grp}) %{_pfx_conf_dir}/dynamicmaps.cf %attr(0640,root,%{_pfx_grp}) %{_pfx_conf_dir}/postfix-files # track; delete on uninstall if exists; no error if !exists %ghost %attr(0755, root, root) %{_sbindir}/sendmail %ghost %attr(0755, root, root) %{_prefix}/%{_lib_legacy}/sendmail %ghost %attr(0755, root, root) %{_bindir}/{mailq,newaliases,rmail} %ghost %{_sysconfdir}/pam.d/smtp %ghost %{_mandir}/{man1/{mailq.1,newaliases.1},man5/aliases.5,man8/{sendmail.8,smtpd.8}}.gz # track; do not delete on uninstall %ghost %dir %attr(0700, %{_pfx_usr}, root) %{_pfx_data_dir} %ghost %{_pfx_data_dir}/* %ghost %dir %attr(0755,root,root) %{_pfx_run_dir} %ghost %{_pfx_run_dir}/* %changelog * Wed Sep 18 2024 pgnd _ - bump 1726675239