Ticket #1446: postfix.2.diff

File postfix.2.diff, 5.8 KB (added by pguyot (Paul Guyot), 20 years ago)

New diff for portfile & patch that includes addition of .turd files and use of xinstall and ui_msg about configuration files.

  • Portfile

    ? postfix.diff
    ? files/patch-src-dns-dns.h
    RCS file: /Volumes/src/cvs/od/proj/darwinports/dports/mail/postfix/Portfile,v
    retrieving revision 1.16
    diff -u -r1.16 Portfile
     
    22
    33PortSystem      1.0
    44name            postfix
    5 version         2.0.14
     5version         2.0.17
    66categories      mail
    77maintainers     charlie@rubberduck.com 
    88description     Fast and robust mail transfer agent
     
    1313                        Postfix act as delivery daemon for ezmlm-idx.
    1414homepage        http://www.postfix.org/
    1515platforms       darwin
    16 checksums       md5 d0f1d1382958f3ce918d4d690be22229
     16checksums       md5 482e3912e4e910bd62f1a2d74bfa3b77
    1717master_sites    ftp://ftp.tau.ac.il/pub/unix/mail/postfix/official/ \
    1818                http://postfix.problemlos.ch/release/official/ \
    1919                ftp://ftp.matrix.com.br/pub/postfix/official/ \
     
    2121                ftp://ftp.club-internet.fr/pub/mirrors/ftp.porcupine.org/postfix-release/official/ \
    2222                ftp://ftp.doc.cs.univ-paris8.fr/mirrors/ftp.porcupine.org/postfix-release/official/
    2323patchfiles      patch-access.5 patch-flush.8 patch-master.8 \
    24                 patch-regexp_table.5 patch-sys_defs.h patch-canonical.5 \
     24                                patch-regexp_table.5 patch-sys_defs.h patch-canonical.5 \
    2525                patch-mail_params.h patch-pcre_table.5 patch-postdrop.1 \
    2626                patch-postqueue.1 patch-relocated.5 patch-transport.5 \
    2727                patch-cleanup.8 patch-main.cf patch-postfix-install \
     
    3535        build.env-delete        CCARGS=-DNO_PCRE
    3636}
    3737
     38platform darwin 7 {
     39        patchfiles-append patch-src-dns-dns.h
     40}
     41
    3842configure {
    3943        cd ${worksrcpath}
    4044        reinplace "s|__PREFIX|${prefix}|g" src/util/sys_defs.h
     
    7276        file mkdir ${destroot}${prefix}/sbin
    7377        file mkdir ${destroot}${prefix}/man
    7478        file mkdir ${destroot}${prefix}/share/postfix
    75         system "install -d -g postdrop ${destroot}${prefix}/var/spool/postfix/public"
    76         system "install -d -g postdrop ${destroot}${prefix}/var/spool/postfix/maildrop"
     79        xinstall -d -o postfix -g postdrop ${destroot}${prefix}/var/spool/postfix/public
     80        xinstall -d -o postfix -g postdrop ${destroot}${prefix}/var/spool/postfix/maildrop
     81        # Add turd files to avoid these directories to be deleted.
     82        system "touch ${destroot}${prefix}/var/spool/postfix/public/.turd"
     83        system "chown postfix:postdrop ${destroot}${prefix}/var/spool/postfix/public/.turd"
     84        system "touch ${destroot}${prefix}/var/spool/postfix/maildrop/.turd"
     85        system "chown postfix:postdrop ${destroot}${prefix}/var/spool/postfix/maildrop/.turd"
    7786        system "/bin/sh postfix-install -non-interactive \
    7887                install_root=${destroot} \
    7988                config_directory=${prefix}/etc/postfix \
     
    8695                mailq_path=${prefix}/bin/mailq \
    8796                sample_directory=${prefix}/share/postfix/sample \
    8897                readme_directory=${prefix}/share/postfix/readme"
    89         system "install -o root -m 755 -d ${destroot}${prefix}/etc/rc.d"
    90         system "install -o root -m 755 -c \
    91                 ${portpath}/files/postfix.sh ${destroot}${prefix}/etc/rc.d"
     98        xinstall -m 755 -d ${destroot}${prefix}/etc/rc.d
     99        xinstall -m 755 -c ${portpath}/files/postfix.sh ${destroot}${prefix}/etc/rc.d
    92100        reinplace "s|__PREFIX|${prefix}|g" \
    93101                ${destroot}${prefix}/etc/rc.d/postfix.sh
    94102}
     
    102110                ${destroot}${prefix}/etc/postfix/master.cf.sample
    103111        file rename ${destroot}${prefix}/etc/postfix/aliases \
    104112                ${destroot}${prefix}/etc/postfix/aliases.sample
     113}
     114
     115post-install {
     116        # Tell the user about the renaming of the configuration files.
     117        ui_msg "To get postfix working, you need to copy sample configuration "
     118        ui_msg "files and to edit them (${prefix}/etc/postfix/*.sample)."
     119        ui_msg "You may also want to turn your system's MTA off."
    105120}
  • files/patch-sys_defs.h

    RCS file: /Volumes/src/cvs/od/proj/darwinports/dports/mail/postfix/files/patch-sys_defs.h,v
    retrieving revision 1.2
    diff -u -r1.2 patch-sys_defs.h
     
    1 --- src/util/sys_defs.h Tue Jun 10 02:11:56 2003
    2 +++ src/util/sys_defs.h.new     Sat Jun 21 13:16:27 2003
    3 @@ -88,10 +88,10 @@
    4  #define HAS_FSYNC
    5  #define HAS_DB
    6  #define HAS_SA_LEN
    7 -#define DEF_DB_TYPE    "hash"
    8 -#define ALIAS_DB_MAP   "hash:/etc/aliases"
    9 +#define DEF_DB_TYPE    "netinfo"
    10 +#define ALIAS_DB_MAP   "netinfo:/aliases"
    11  #define GETTIMEOFDAY(t) gettimeofday(t,(struct timezone *) 0)
    12 -#define ROOT_PATH      "/bin:/usr/bin:/sbin:/usr/sbin"
    13 +#define ROOT_PATH      "/bin:/usr/bin:/sbin:/usr/sbin:__PREFIX/bin:__PREFIX/sbin"
    14  #define USE_STATFS
     1--- src/util/sys_defs.h.orig    Wed Nov  5 21:17:37 2003
     2+++ src/util/sys_defs.h Wed Jan 21 20:31:50 2004
     3@@ -52,11 +52,11 @@
    154 #define STATFS_IN_SYS_MOUNT_H
    165 #define HAS_POSIX_REGEXP
    17 @@ -99,11 +99,11 @@
    18  #define PRINTFLIKE(x,y)
    19  #define SCANFLIKE(x,y)
    20  #define HAS_NETINFO
     6 #define HAS_ST_GEN     /* struct stat contains inode generation number */
    217-#define NATIVE_SENDMAIL_PATH "/usr/sbin/sendmail"
    228-#define NATIVE_MAILQ_PATH "/usr/bin/mailq"
    239-#define NATIVE_NEWALIAS_PATH "/usr/bin/newaliases"
     
    3016+#define NATIVE_DAEMON_DIR "__PREFIX/libexec/postfix"
    3117 #endif
    3218 
    33   /*
     19 #if defined(FREEBSD2) || defined(FREEBSD3) || defined(FREEBSD4)
     20@@ -88,10 +88,10 @@
     21 #define HAS_FSYNC
     22 #define HAS_DB
     23 #define HAS_SA_LEN
     24-#define DEF_DB_TYPE    "hash"
     25-#define ALIAS_DB_MAP   "hash:/etc/aliases"
     26+#define DEF_DB_TYPE    "netinfo"
     27+#define ALIAS_DB_MAP   "netinfo:/aliases"
     28 #define GETTIMEOFDAY(t) gettimeofday(t,(struct timezone *) 0)
     29-#define ROOT_PATH      "/bin:/usr/bin:/sbin:/usr/sbin"
     30+#define ROOT_PATH      "/bin:/usr/bin:/sbin:/usr/sbin:__PREFIX/bin:__PREFIX/sbin"
     31 #define USE_STATFS
     32 #define STATFS_IN_SYS_MOUNT_H
     33 #define HAS_POSIX_REGEXP