makeconfig, Makefile: extend to support variable INCLUDES..
[s-mailx.git] / mailx.spec
blob26f1eff4a3d9515927e68394de392c1eb03bda75
1 # Sccsid @(#)mailx.spec 1.35 (gritter) 12/25/06
3 %define use_nss 0
4 %define mozilla_version 1.0.5
6 Summary: An enhanced implementation of the mailx command
7 Name: mailx
8 Version: 11.5
9 Release: 1
10 License: BSD
11 Group: Applications/Internet
12 Source: %{name}-%{version}.tar.bz2
13 URL: <http://heirloom.sourceforge.net/mailx.html>
14 Vendor: Gunnar Ritter <gunnarr@acm.org>
15 Packager: Didar Hussain <dhs@rediffmail.com>
16 BuildRoot: %{_tmppath}/%{name}-root
18 %if %{use_nss}
19 Requires: seamonkey-nss
20 Requires: seamonkey-nspr
21 BuildRequires: seamonkey-nss-devel
22 BuildRequires: seamonkey-nspr-devel
23 BuildRequires: /usr/include/mozilla-seamonkey-%{mozilla_version}/nss/cms.h
24 %endif
26 %description
27 Heirloom mailx is derived from Berkeley Mail and is intended provide
28 the functionality of the POSIX mailx command with additional support
29 for MIME messages, IMAP, POP3, and SMTP. It provides enhanced
30 features for interactive use, such as caching and disconnected
31 operation for IMAP, message threading, scoring, and filtering.
32 It is also usable as a mail batch language, both for sending
33 and receiving mail.
35 %define prefix /usr
36 %define bindir %{prefix}/bin
37 %define mandir %{prefix}/share/man
38 %define sysconfdir /etc
39 %define mailrc %{sysconfdir}/nail.rc
40 %define mailspool /var/mail
41 %define sendmail /usr/lib/sendmail
42 %define ucbinstall install
43 %define cflags -O2 -fomit-frame-pointer
44 %define cppflags -D_GNU_SOURCE
46 %define makeflags PREFIX=%{prefix} BINDIR=%{bindir} MANDIR=%{mandir} SYSCONFDIR=%{sysconfdir} MAILRC=%{mailrc} MAILSPOOL=%{mailspool} SENDMAIL=%{sendmail} UCBINSTALL=%{ucbinstall} CFLAGS="%{cflags}" CPPFLAGS="%{cppflags}"
48 %prep
49 %setup
51 %build
52 rm -rf %{buildroot}
54 # Some RedHat releases refuse to compile with OpenSSL unless
55 # -I/usr/kerberos/include is given. To compile with GSSAPI authentication
56 # included, they also need -L/usr/kerberos/lib.
57 test -d /usr/kerberos/include &&
58 INCLUDES="$INCLUDES -I/usr/kerberos/include" export INCLUDES
59 test -d /usr/kerberos/lib &&
60 LDFLAGS="$LDFLAGS -L/usr/kerberos/lib" export LDFLAGS
62 %if %{use_nss}
63 INCLUDES="$INCLUDES -I/usr/include/mozilla-seamonkey-%{mozilla_version}/nspr"
64 INCLUDES="$INCLUDES -I/usr/include/mozilla-seamonkey-%{mozilla_version}/nss"
65 export INCLUDES
66 %endif
68 make %{makeflags}
70 %install
71 make DESTDIR=%{buildroot} %{makeflags} install
72 gzip -9 %{buildroot}/%{mandir}/man1/mailx.1
74 %clean
75 cd ..; rm -rf %{_builddir}/%{name}-%{version}
76 rm -rf %{buildroot}
78 %files
79 %defattr(-,root,root)
80 %doc COPYING AUTHORS INSTALL README TODO ChangeLog
81 %config(noreplace) /etc/nail.rc
82 %{bindir}/mailx
83 %{mandir}/man1/mailx*