Sun, 02 Sep 2012 18:18:43 +0200
Introduce new version of tcpdump, reorder taglib and cryptbreaker to
the end because they fail to build on Linux, and correct flawed URLs
probably copied from the doxygen build entry.
michael@146 | 1 | ## |
michael@146 | 2 | ## postfix.spec -- OpenPKG RPM Package Specification |
michael@178 | 3 | ## Copyright (c) 2000-2009 OpenPKG Foundation e.V. <http://openpkg.net/> |
michael@146 | 4 | ## |
michael@146 | 5 | ## Permission to use, copy, modify, and distribute this software for |
michael@146 | 6 | ## any purpose with or without fee is hereby granted, provided that |
michael@146 | 7 | ## the above copyright notice and this permission notice appear in all |
michael@146 | 8 | ## copies. |
michael@146 | 9 | ## |
michael@146 | 10 | ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED |
michael@146 | 11 | ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
michael@146 | 12 | ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
michael@146 | 13 | ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR |
michael@146 | 14 | ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
michael@146 | 15 | ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
michael@146 | 16 | ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF |
michael@146 | 17 | ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
michael@146 | 18 | ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
michael@146 | 19 | ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT |
michael@146 | 20 | ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
michael@146 | 21 | ## SUCH DAMAGE. |
michael@146 | 22 | ## |
michael@146 | 23 | |
michael@146 | 24 | # package versions |
michael@495 | 25 | %define V_postfix 2.9.4 |
michael@495 | 26 | %define V_pflogsumm 1.1.5 |
michael@146 | 27 | %define V_whoson 2.4.0 |
michael@146 | 28 | |
michael@146 | 29 | # package information |
michael@146 | 30 | Name: postfix |
michael@146 | 31 | Summary: Mail Transfer Agent (MTA) |
michael@146 | 32 | URL: http://www.postfix.org/ |
michael@146 | 33 | Vendor: Wietse Venema |
michael@146 | 34 | Packager: OpenPKG Foundation e.V. |
michael@146 | 35 | Distribution: OpenPKG Community |
michael@146 | 36 | Class: BASE |
michael@146 | 37 | Group: Mail |
michael@146 | 38 | License: IPL |
michael@146 | 39 | Version: %{V_postfix} |
michael@495 | 40 | Release: 20120800 |
michael@146 | 41 | |
michael@146 | 42 | # package options |
michael@146 | 43 | %option with_fsl yes |
michael@146 | 44 | %option with_ssl no |
michael@146 | 45 | %option with_sasl no |
michael@495 | 46 | %option with_sqlite no |
michael@146 | 47 | %option with_mysql no |
michael@146 | 48 | %option with_pgsql no |
michael@146 | 49 | %option with_ldap no |
michael@146 | 50 | %option with_whoson no |
michael@146 | 51 | %option with_fdsetsize no |
michael@146 | 52 | |
michael@146 | 53 | # list of sources |
michael@146 | 54 | Source0: ftp://ftp.porcupine.org/mirrors/postfix-release/official/postfix-%{V_postfix}.tar.gz |
michael@146 | 55 | Source1: http://jimsun.linxnet.com/downloads/pflogsumm-%{V_pflogsumm}.tar.gz |
michael@146 | 56 | Source2: postfix.txt |
michael@146 | 57 | Source3: fsl.postfix |
michael@146 | 58 | Source4: rc.postfix |
michael@146 | 59 | Patch0: postfix.patch |
michael@146 | 60 | Patch1: postfix.patch.pfls |
michael@495 | 61 | Patch2: http://download.openpkg.org/components/versioned/postfix/postfix-%{V_whoson}-whoson.patch |
michael@146 | 62 | |
michael@146 | 63 | # build information |
michael@495 | 64 | BuildPreReq: OpenPKG, openpkg >= 20120101, perl, gcc |
michael@495 | 65 | PreReq: OpenPKG, openpkg >= 20120101, perl, procmail, perl-time |
michael@146 | 66 | BuildPreReq: make, pcre, db |
michael@146 | 67 | PreReq: make, pcre, db |
michael@146 | 68 | %if "%{with_fsl}" == "yes" |
michael@146 | 69 | BuildPreReq: fsl |
michael@146 | 70 | PreReq: fsl |
michael@146 | 71 | %endif |
michael@146 | 72 | %if "%{with_ssl}" == "yes" |
michael@146 | 73 | BuildPreReq: openssl |
michael@146 | 74 | PreReq: openssl |
michael@146 | 75 | %endif |
michael@146 | 76 | %if "%{with_sasl}" == "yes" |
michael@146 | 77 | BuildPreReq: sasl |
michael@146 | 78 | PreReq: sasl |
michael@146 | 79 | %endif |
michael@495 | 80 | %if "%{with_sqlite}" == "yes" |
michael@495 | 81 | BuildPreReq: sqlite |
michael@495 | 82 | PreReq: sqlite |
michael@495 | 83 | %endif |
michael@146 | 84 | %if "%{with_mysql}" == "yes" |
michael@146 | 85 | BuildPreReq: mysql |
michael@146 | 86 | PreReq: mysql |
michael@146 | 87 | %endif |
michael@146 | 88 | %if "%{with_pgsql}" == "yes" |
michael@146 | 89 | BuildPreReq: postgresql, openssl |
michael@146 | 90 | PreReq: postgresql, openssl |
michael@146 | 91 | %endif |
michael@146 | 92 | %if "%{with_ldap}" == "yes" |
michael@146 | 93 | BuildPreReq: openldap, openssl |
michael@146 | 94 | PreReq: openldap, openssl |
michael@146 | 95 | %endif |
michael@146 | 96 | %if "%{with_whoson}" == "yes" |
michael@146 | 97 | BuildPreReq: whoson |
michael@146 | 98 | PreReq: whoson |
michael@146 | 99 | %endif |
michael@146 | 100 | Provides: MTA |
michael@146 | 101 | Conflicts: exim, sendmail, ssmtp |
michael@146 | 102 | |
michael@146 | 103 | %description |
michael@146 | 104 | Postfix is a new-generation Mail Transfer Agent (MTA) able to fully |
michael@146 | 105 | replace the Sendmail MTA. It is fully standards compliant and |
michael@146 | 106 | supports SMTP, ESMTP, LMTP over IPv4/IPv6 with optional TLS/SASL. |
michael@146 | 107 | |
michael@146 | 108 | Local specifics in this OpenPKG version: |
michael@146 | 109 | o Postfix delivers locally via Procmail |
michael@146 | 110 | o Postfix logs directly to the filesystem via OSSP fsl |
michael@146 | 111 | o Berkeley-DB dictionary support |
michael@146 | 112 | o PCRE matching support |
michael@146 | 113 | o Optional STARTTLS encryption support (see package options) |
michael@146 | 114 | o Optional SASL2 authentication support (see package options) |
michael@495 | 115 | o Optional SQLite dictionary support (see package options) |
michael@146 | 116 | o Optional MySQL dictionary support (see package options) |
michael@146 | 117 | o Optional PostgreSQL dictionary support (see package options) |
michael@146 | 118 | o Optional OpenLDAP dictionary support (see package options) |
michael@146 | 119 | o Optional WHOSON dictionary support (see package options) |
michael@146 | 120 | |
michael@146 | 121 | %track |
michael@146 | 122 | prog postfix = { |
michael@146 | 123 | version = %{V_postfix} |
michael@146 | 124 | url = ftp://ftp.porcupine.org/mirrors/postfix-release/official/ |
michael@146 | 125 | regex = postfix-(\d+\.\d+\.\d+)\.tar\.gz |
michael@146 | 126 | } |
michael@146 | 127 | prog postfix:pflogsumm = { |
michael@146 | 128 | version = %{V_pflogsumm} |
michael@146 | 129 | url = http://jimsun.linxnet.com/postfix_contrib.html |
michael@146 | 130 | regex = pflogsumm-(__VER__)\.tar\.gz |
michael@146 | 131 | } |
michael@146 | 132 | prog postfix:whoson = { |
michael@146 | 133 | version = %{V_whoson} |
michael@495 | 134 | url = http://download.openpkg.org/components/versioned/postfix/ |
michael@146 | 135 | regex = postfix-(__VER__)-whoson.patch |
michael@146 | 136 | } |
michael@146 | 137 | |
michael@146 | 138 | %prep |
michael@146 | 139 | # unpack distribution files |
michael@146 | 140 | %setup -q |
michael@146 | 141 | %setup -q -T -D -a 1 |
michael@146 | 142 | |
michael@146 | 143 | # apply OpenPKG patches |
michael@146 | 144 | %patch -p0 |
michael@146 | 145 | ( cd pflogsumm-%{V_pflogsumm} && %{l_patch} -p0 -b <%{PATCH1} ) || exit $? |
michael@146 | 146 | |
michael@495 | 147 | # apply vendor WHOSON patch |
michael@495 | 148 | %if "%{with_whoson}" == "yes" |
michael@495 | 149 | %patch -p0 -P 2 |
michael@495 | 150 | %endif |
michael@495 | 151 | |
michael@178 | 152 | # remove OpenPKG privelege model incompatible exit conditions |
michael@178 | 153 | %{l_shtool} subst \ |
michael@178 | 154 | -e 's;msg_fatal\(.*attribute specifies mail system\);msg_info\1;g' \ |
michael@178 | 155 | src/pipe/pipe.c |
michael@178 | 156 | |
michael@495 | 157 | # platform specific corrections |
michael@495 | 158 | case "%{l_platform -t}" in |
michael@495 | 159 | *-sunos5.11 ) |
michael@495 | 160 | %{l_shtool} subst \ |
michael@495 | 161 | -e 's;#define HAS_NISPLUS;#undef HAS_NISPLUS;' \ |
michael@495 | 162 | src/util/sys_defs.h |
michael@495 | 163 | ;; |
michael@495 | 164 | esac |
michael@146 | 165 | |
michael@146 | 166 | %build |
michael@146 | 167 | # configure Postfix (hard-core part I) |
michael@146 | 168 | %{l_shtool} subst \ |
michael@146 | 169 | -e 's/var_config_dir, /var_command_dir, /' \ |
michael@146 | 170 | src/postfix/postfix.c |
michael@146 | 171 | %{l_shtool} subst \ |
michael@146 | 172 | -e 's;config_directory/postfix-script;command_directory/postfix-script;' \ |
michael@146 | 173 | -e 's;config_directory/post-install;command_directory/postfix-install;' \ |
michael@146 | 174 | conf/postfix-script |
michael@146 | 175 | %{l_shtool} subst \ |
michael@146 | 176 | -e 's;/usr/include;%{l_prefix}/include;g' \ |
michael@146 | 177 | makedefs |
michael@146 | 178 | |
michael@146 | 179 | # configure Postfix (regular part) |
michael@146 | 180 | unset LD_LIBRARY_PATH || true |
michael@146 | 181 | CCARGS="" |
michael@146 | 182 | CCARGS="$CCARGS %{l_cflags -O}" |
michael@146 | 183 | CCARGS="$CCARGS %{l_cppflags}" |
michael@146 | 184 | CCARGS="$CCARGS -DDEF_COMMAND_DIR=\\\"%{l_prefix}/sbin\\\"" |
michael@146 | 185 | CCARGS="$CCARGS -DDEF_SENDMAIL_PATH=\\\"%{l_prefix}/sbin/sendmail\\\"" |
michael@146 | 186 | CCARGS="$CCARGS -DDEF_CONFIG_DIR=\\\"%{l_prefix}/etc/postfix\\\"" |
michael@146 | 187 | CCARGS="$CCARGS -DDEF_DAEMON_DIR=\\\"%{l_prefix}/libexec/postfix\\\"" |
michael@146 | 188 | CCARGS="$CCARGS -DDEF_QUEUE_DIR=\\\"%{l_prefix}/var/postfix\\\"" |
michael@146 | 189 | CCARGS="$CCARGS -DDEF_DATA_DIR=\\\"%{l_prefix}/var/postfix/data\\\"" |
michael@146 | 190 | AUXLIBS="" |
michael@146 | 191 | AUXLIBS="$AUXLIBS %{l_ldflags}" |
michael@146 | 192 | CCARGS="$CCARGS -DHAS_DB" |
michael@146 | 193 | AUXLIBS="$AUXLIBS -ldb" |
michael@146 | 194 | CCARGS="$CCARGS -DHAS_PCRE" |
michael@146 | 195 | AUXLIBS="$AUXLIBS -lpcre" |
michael@495 | 196 | %if "%{with_sqlite}" == "yes" |
michael@495 | 197 | CCARGS="$CCARGS -DHAS_SQLITE" |
michael@495 | 198 | AUXLIBS="$AUXLIBS -lsqlite3" |
michael@495 | 199 | %endif |
michael@146 | 200 | %if "%{with_mysql}" == "yes" |
michael@146 | 201 | CCARGS="$CCARGS -DHAS_MYSQL %{l_cppflags mysql .}" |
michael@146 | 202 | AUXLIBS="$AUXLIBS %{l_ldflags mysql .} -lmysqlclient -lz -lm" |
michael@146 | 203 | %endif |
michael@146 | 204 | %if "%{with_pgsql}" == "yes" |
michael@146 | 205 | CCARGS="$CCARGS -DHAS_PGSQL %{l_cppflags postgresql .}" |
michael@146 | 206 | AUXLIBS="$AUXLIBS -lpq -lssl -lcrypto -lcrypt" |
michael@146 | 207 | %endif |
michael@146 | 208 | %if "%{with_sasl}" == "yes" |
michael@146 | 209 | CCARGS="$CCARGS -DUSE_SASL_AUTH -DUSE_CYRUS_SASL %{l_cppflags sasl .}" |
michael@146 | 210 | AUXLIBS="$AUXLIBS -lsasl2 -lcrypt" |
michael@146 | 211 | if [ -f /usr/lib/libdl.so -o -f /usr/lib/libdl.a ]; then |
michael@146 | 212 | AUXLIBS="$AUXLIBS -ldl" |
michael@146 | 213 | fi |
michael@146 | 214 | if [ -f /usr/lib64/libdl.so -o -f /usr/lib64/libdl.a ]; then |
michael@146 | 215 | AUXLIBS="$AUXLIBS -ldl" |
michael@146 | 216 | fi |
michael@146 | 217 | %endif |
michael@146 | 218 | %if "%{with_ssl}" == "yes" |
michael@146 | 219 | CCARGS="$CCARGS -DUSE_TLS" |
michael@146 | 220 | AUXLIBS="$AUXLIBS -lssl -lcrypto" |
michael@146 | 221 | %endif |
michael@146 | 222 | %if "%{with_ldap}" == "yes" |
michael@146 | 223 | CCARGS="$CCARGS -DHAS_LDAP" |
michael@146 | 224 | AUXLIBS="$AUXLIBS -lldap -llber -lssl -lcrypto" |
michael@146 | 225 | %endif |
michael@146 | 226 | %if "%{with_fsl}" == "yes" |
michael@146 | 227 | AUXLIBS="$AUXLIBS %{l_fsl_ldflags} %{l_fsl_libs}" |
michael@146 | 228 | CCARGS="$CCARGS -DUSE_SOFTLIMITONLY" |
michael@146 | 229 | %endif |
michael@146 | 230 | %if "%{with_fdsetsize}" != "no" |
michael@146 | 231 | %if "%{with_fdsetsize}" == "yes" |
michael@146 | 232 | CCARGS="$CCARGS -DFD_SETSIZE=1024" |
michael@146 | 233 | %else |
michael@146 | 234 | CCARGS="$CCARGS -DFD_SETSIZE=%{with_fdsetsize}" |
michael@146 | 235 | %endif |
michael@146 | 236 | %endif |
michael@146 | 237 | case "%{l_platform -t}" in |
michael@146 | 238 | *-sunos* ) AUXLIBS="$AUXLIBS -lrt" ;; |
michael@146 | 239 | esac |
michael@146 | 240 | %{l_make} %{l_mflags} -f Makefile.init makefiles \ |
michael@146 | 241 | CC="%{l_cc}" CCARGS="$CCARGS" AUXLIBS="$AUXLIBS" |
michael@146 | 242 | |
michael@146 | 243 | # configure Postfix (hard-core part II) |
michael@146 | 244 | %{l_shtool} subst \ |
michael@146 | 245 | -e 's;#define HAS_DBM;#define HAS_DBM_DISABLED;' \ |
michael@146 | 246 | -e 's;#define HAS_DB;#define HAS_DB_DISABLED;' \ |
michael@146 | 247 | src/util/sys_defs.h |
michael@146 | 248 | |
michael@146 | 249 | # build Postfix |
michael@495 | 250 | %{l_make} %{l_mflags -O} |
michael@146 | 251 | |
michael@146 | 252 | %install |
michael@146 | 253 | |
michael@146 | 254 | # perform standard installation procedure |
michael@146 | 255 | %{l_shtool} subst -e "s;chown;true;" postfix-install |
michael@146 | 256 | sh postfix-install -non-interactive \ |
michael@146 | 257 | install_root=$RPM_BUILD_ROOT \ |
michael@146 | 258 | config_directory=%{l_prefix}/etc/postfix \ |
michael@146 | 259 | daemon_directory=%{l_prefix}/libexec/postfix \ |
michael@146 | 260 | command_directory=%{l_prefix}/sbin \ |
michael@146 | 261 | queue_directory=%{l_prefix}/var/postfix \ |
michael@146 | 262 | data_directory=%{l_prefix}/var/postfix/data \ |
michael@146 | 263 | sendmail_path=%{l_prefix}/sbin/sendmail \ |
michael@146 | 264 | newaliases_path=%{l_prefix}/sbin/newaliases \ |
michael@146 | 265 | mailq_path=%{l_prefix}/sbin/mailq \ |
michael@146 | 266 | manpage_directory=%{l_prefix}/man \ |
michael@146 | 267 | mail_user=%{l_musr} \ |
michael@146 | 268 | setgid_group=%{l_rgrp} |
michael@146 | 269 | |
michael@146 | 270 | # post-adjust binaries |
michael@146 | 271 | rm -f $RPM_BUILD_ROOT%{l_prefix}/sbin/mailq |
michael@146 | 272 | ln $RPM_BUILD_ROOT%{l_prefix}/sbin/sendmail \ |
michael@146 | 273 | $RPM_BUILD_ROOT%{l_prefix}/sbin/mailq |
michael@146 | 274 | rm -f $RPM_BUILD_ROOT%{l_prefix}/sbin/newaliases |
michael@146 | 275 | ln $RPM_BUILD_ROOT%{l_prefix}/sbin/sendmail \ |
michael@146 | 276 | $RPM_BUILD_ROOT%{l_prefix}/sbin/newaliases |
michael@146 | 277 | strip $RPM_BUILD_ROOT%{l_prefix}/sbin/* >/dev/null 2>&1 || true |
michael@146 | 278 | strip $RPM_BUILD_ROOT%{l_prefix}/libexec/postfix/* >/dev/null 2>&1 || true |
michael@146 | 279 | |
michael@146 | 280 | # post-adjust configuration |
michael@146 | 281 | for cfg in \ |
michael@146 | 282 | *LICENSE makedefs.out bounce.cf.default access aliases \ |
michael@146 | 283 | canonical header_checks relocated transport virtual \ |
michael@146 | 284 | main.cf master.cf main.cf.default; do |
michael@146 | 285 | rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/postfix/$cfg |
michael@146 | 286 | done |
michael@146 | 287 | |
michael@146 | 288 | # install default configuration |
michael@146 | 289 | for name in `grep "^<file" %{SOURCE postfix.txt} | sed -e 's;^.*name=";;' -e 's;".*$;;'`; do |
michael@146 | 290 | (echo ""; cat %{SOURCE postfix.txt}; echo "") |\ |
michael@146 | 291 | sed -e "1,/^<file name=\"$name\">/d" -e "/<\/file>/,\$d" >$name |
michael@146 | 292 | %{l_shtool} install -c -m 644 %{l_value -s -a} \ |
michael@146 | 293 | $name $RPM_BUILD_ROOT%{l_prefix}/etc/postfix/ |
michael@146 | 294 | done |
michael@146 | 295 | |
michael@146 | 296 | # pre-create variable stuff |
michael@146 | 297 | ( cd $RPM_BUILD_ROOT%{l_prefix}/var/postfix |
michael@146 | 298 | %{l_shtool} mkdir -f -p -m 700 data |
michael@146 | 299 | %{l_shtool} mkdir -f -p -m 755 log |
michael@146 | 300 | ) || exit $? |
michael@146 | 301 | |
michael@146 | 302 | # install addons |
michael@146 | 303 | %{l_shtool} install -c -m 755 \ |
michael@146 | 304 | -e 's;/usr/sbin/sendmail;%{l_prefix}/sbin/sendmail;g' \ |
michael@146 | 305 | auxiliary/rmail/rmail $RPM_BUILD_ROOT%{l_prefix}/sbin/rmail |
michael@146 | 306 | %{l_shtool} install -c -m 755 \ |
michael@146 | 307 | -e 's;/usr/bin/perl;%{l_prefix}/bin/perl;g' \ |
michael@146 | 308 | -e 's;postconf -h;%{l_prefix}/sbin/postconf -h;' \ |
michael@146 | 309 | auxiliary/qshape/qshape.pl $RPM_BUILD_ROOT%{l_prefix}/sbin/qshape |
michael@146 | 310 | %{l_shtool} install -c -m 644 \ |
michael@146 | 311 | man/man1/qshape.1 $RPM_BUILD_ROOT%{l_prefix}/man/man8/qshape.8 |
michael@146 | 312 | ( cd pflogsumm-%{V_pflogsumm} |
michael@146 | 313 | %{l_shtool} install -c -m 755 \ |
michael@146 | 314 | -e 's;/usr/bin/perl;%{l_prefix}/bin/perl;g' \ |
michael@146 | 315 | pflogsumm.pl $RPM_BUILD_ROOT%{l_prefix}/sbin/pflogsumm |
michael@146 | 316 | %{l_shtool} install -c -m 644 \ |
michael@146 | 317 | pflogsumm.1 $RPM_BUILD_ROOT%{l_prefix}/man/man1/ |
michael@146 | 318 | ) || exit $? |
michael@146 | 319 | |
michael@146 | 320 | # install run-command script |
michael@146 | 321 | %{l_shtool} mkdir -f -p -m 755 \ |
michael@146 | 322 | $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d |
michael@146 | 323 | %{l_shtool} install -c -m 755 %{l_value -s -a} \ |
michael@146 | 324 | %{SOURCE rc.postfix} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/ |
michael@146 | 325 | |
michael@146 | 326 | # adjust installation to avoid file name conflicts |
michael@146 | 327 | ( cd $RPM_BUILD_ROOT%{l_prefix}/man/man8 |
michael@146 | 328 | mv master.8 postfix_master.8 |
michael@146 | 329 | ) || exit $? |
michael@146 | 330 | |
michael@146 | 331 | # install OSSP fsl configuration |
michael@146 | 332 | %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/fsl |
michael@146 | 333 | %{l_shtool} install -c -m 644 %{l_value -s -a} \ |
michael@146 | 334 | %{SOURCE fsl.postfix} \ |
michael@146 | 335 | $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/ |
michael@146 | 336 | |
michael@146 | 337 | # generate file list |
michael@146 | 338 | %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \ |
michael@146 | 339 | %{l_files_std} \ |
michael@146 | 340 | '%config %{l_prefix}/etc/fsl/fsl.postfix' \ |
michael@146 | 341 | '%attr(-,%{l_susr},%{l_mgrp}) %{l_prefix}/etc/postfix' \ |
michael@146 | 342 | '%config %attr(-,%{l_susr},%{l_mgrp}) %{l_prefix}/etc/postfix/*' \ |
michael@146 | 343 | '%attr(-,%{l_susr},%{l_mgrp}) %{l_prefix}/libexec/postfix/*' \ |
michael@146 | 344 | '%attr(2755,%{l_musr},%{l_rgrp}) %{l_prefix}/sbin/{postdrop,postqueue}' \ |
michael@146 | 345 | '%dir %attr(-,%{l_susr},%{l_mgrp}) %{l_prefix}/libexec/postfix' \ |
michael@146 | 346 | '%dir %attr(-,%{l_susr},%{l_mgrp}) %{l_prefix}/var/postfix' \ |
michael@495 | 347 | '%dir %attr(-,%{l_susr},%{l_mgrp}) %{l_prefix}/var/postfix/pid' \ |
michael@146 | 348 | '%dir %attr(-,%{l_musr},%{l_rgrp}) %{l_prefix}/var/postfix/{maildrop,public}' |
michael@146 | 349 | |
michael@146 | 350 | %files -f files |
michael@146 | 351 | |
michael@146 | 352 | %clean |
michael@146 | 353 | |
michael@146 | 354 | %pre |
michael@146 | 355 | # before upgrade, save status and stop service |
michael@146 | 356 | [ $1 -eq 2 ] || exit 0 |
michael@146 | 357 | eval `%{l_rc} postfix status 2>/dev/null | tee %{l_tmpfile}` |
michael@146 | 358 | %{l_rc} postfix stop 2>/dev/null |
michael@146 | 359 | exit 0 |
michael@146 | 360 | |
michael@146 | 361 | %post |
michael@146 | 362 | if [ $1 -eq 1 ]; then |
michael@146 | 363 | # after install, generate configuration |
michael@146 | 364 | ( cd $RPM_INSTALL_PREFIX/etc/postfix && %{l_make} all; true ) >/dev/null 2>&1 |
michael@146 | 365 | fi |
michael@146 | 366 | if [ $1 -eq 2 ]; then |
michael@146 | 367 | # after upgrade, regenerate configuration |
michael@146 | 368 | ( cd $RPM_INSTALL_PREFIX/etc/postfix && %{l_make} clean all; true ) >/dev/null 2>&1 |
michael@146 | 369 | # after upgrade, restore status |
michael@146 | 370 | eval `cat %{l_tmpfile}`; rm -f %{l_tmpfile} >/dev/null 2>&1 || true |
michael@146 | 371 | [ ".$postfix_active" = .yes ] && %{l_rc} postfix start |
michael@146 | 372 | fi |
michael@146 | 373 | exit 0 |
michael@146 | 374 | |
michael@146 | 375 | %preun |
michael@146 | 376 | # before erase, stop service and remove log files |
michael@146 | 377 | [ $1 -eq 0 ] || exit 0 |
michael@146 | 378 | %{l_rc} postfix stop 2>/dev/null |
michael@146 | 379 | rm -f $RPM_INSTALL_PREFIX/var/postfix/log/postfix.log* >/dev/null 2>&1 || true |
michael@146 | 380 | rm -f $RPM_INSTALL_PREFIX/var/postfix/log/postfix.sum* >/dev/null 2>&1 || true |
michael@146 | 381 | # remove generated configuration files |
michael@146 | 382 | ( cd $RPM_INSTALL_PREFIX/etc/postfix && %{l_make} clean >/dev/null 2>&1; true ) || true |
michael@495 | 383 | # remove generated runtime files and directories |
michael@495 | 384 | rm -rf $RPM_INSTALL_PREFIX/var/postfix/data/* |
michael@146 | 385 | rm -rf $RPM_INSTALL_PREFIX/var/postfix/pid/* |
michael@146 | 386 | rm -rf $RPM_INSTALL_PREFIX/var/postfix/private/* |
michael@146 | 387 | rm -rf $RPM_INSTALL_PREFIX/var/postfix/public/* |
michael@146 | 388 | find $RPM_INSTALL_PREFIX/var/postfix/active/ -type d -print |\ |
michael@146 | 389 | xargs rmdir >/dev/null 2>&1 || true |
michael@146 | 390 | find $RPM_INSTALL_PREFIX/var/postfix/incoming/ -type d -print |\ |
michael@146 | 391 | xargs rmdir >/dev/null 2>&1 || true |
michael@146 | 392 | exit 0 |
michael@146 | 393 |