Changed msg_style and msg_delim to be file static to m_getfld.c
[mmh] / SPECS / nmh.spec
1 # This spec supports two methods of RPM creation:
2 #
3 # 1) Start from an nmh workspace, run configure as desired and then "make rpm".
4 #    For example:
5 #      $ git clone git://git.savannah.nongnu.org/nmh.git
6 #      $ cd nmh
7 #      $ ./autogen.sh
8 #      $ ./configure --with-cyrus-sasl --with-locking=fcntl  &&  make rpm
9 #
10 # 2) Start with a source RPM and use rpmbuild.  Configure options are hard
11 #    coded below, but they can be overridden on the rpmbuild command line
12 #    with --define 'configure_opts --opt=value [...]'.
13 #    For example:
14 #      $ rpm -i nmh-1.4-0.fc16.src.rpm
15 #      $ rpmbuild --rmsource --rmspec \
16 #          --define '_sysconfdir /usr/local/nmh/etc' \
17 #          --define 'configure_opts --with-cyrus-sasl --with-locking=fcntl' \
18 #          --bb ~/lib/rpmbuild/SPECS/nmh.spec
19 #
20 # If configure has previously been run successfully in the workspace,
21 # it will not be invoked again, even if configure_opts is defined.
22 #
23 # Note that "make rpm" sets _sysconfdir.  If configuring to install
24 # anyplace other than the default _sysconfdir, typically /etc, and
25 # you're not using this through "make rpm", be sure to set _sysconfdir.
26 #
27 # With kernel (fcntl, flock, or lockf) locking, or with dot locking
28 # and a lockdir that's writable by the user, bin/inc does not need to
29 # be setgid.  This spec assumes that.  But if needed, add something
30 # like this to the %files section to make bin/inc setgid:
31 #   %attr(2755,-,mail) /usr/local/nmh/bin/inc
32 #
33 # Note that Version cannot contain any dashes.
34 #
35 # The description, summary, and a few other tags were taken from the
36 # nmh.spec used to build the Fedora 15 nmh rpm.
37
38 Name:          nmh
39 Version:       %(sed "s/-/_/g" VERSION)
40 %define        rawversion %(cat VERSION)
41 Release:       1%{?dist}
42 Summary:       A capable mail handling system with a command line interface
43 Group:         Applications/Internet
44 License:       BSD
45 URL:           http://savannah.nongnu.org/projects/nmh
46 BuildRequires: gdbm-devel ncurses-devel
47 %define        tarfile nmh-%rawversion.tar.gz
48 Source0:       %tarfile
49 Source1:       VERSION
50 %define        srcdir %(pwd)
51
52
53 %description
54 Nmh is an email system based on the MH email system and is intended to
55 be a (mostly) compatible drop-in replacement for MH.  Nmh isn't a
56 single comprehensive program.  Instead, it consists of a number of
57 fairly simple single-purpose programs for sending, receiving, saving,
58 retrieving and otherwise manipulating email messages.  You can freely
59 intersperse nmh commands with other shell commands or write custom
60 scripts which utilize nmh commands.  If you want to use nmh as a true
61 email user agent, you'll want to also install exmh to provide a user
62 interface for it--nmh only has a command line interface.
63
64
65 %prep
66 if [ ! -f $RPM_SOURCE_DIR/%tarfile ]; then
67   #### The tarfile wasn't already installed and we started with a
68   #### workspace (using make rpm), so get it from there.
69   [ -f %srcdir/%tarfile ]  ||  (cd %srcdir  &&  make dist)
70   cp -p %srcdir/%tarfile $RPM_SOURCE_DIR/%tarfile
71 fi
72 [ -f $RPM_SOURCE_DIR/VERSION ]  ||  cp -p %srcdir/VERSION $RPM_SOURCE_DIR
73 %setup -q -n %name-%rawversion
74
75
76 %build
77 if [ -f %srcdir/config.status ]; then
78   echo reusing existing configuration
79   cp -pf %srcdir/config.status .
80   ./config.status
81 else
82   %if %{undefined configure_opts}
83     %define configure_opts --with-cyrus-sasl --with-locking=fcntl
84   %endif
85   %configure %configure_opts
86 fi
87 make all dist
88
89
90 %install
91 rm -rf $RPM_BUILD_ROOT
92 make install DESTDIR=$RPM_BUILD_ROOT
93
94 gz_manpages='-e '
95
96 if find $RPM_BUILD_ROOT -name 'inc.1*' | \
97    egrep -q '/usr(/lib|/share)?/man/([^/]+/)?man'; then
98   #### brp-compress will gzip the man pages, so account for that.
99   gz_manpages='-e s#\(/man/man./.*\)#\1.gz#'
100 fi
101
102 #### etc is brought into files using %config{noreplace}
103 find $RPM_BUILD_ROOT -name etc -prune -o ! -type d -print | \
104   sed -e "s#^$RPM_BUILD_ROOT##" "$gz_manpages" > nmh_files
105
106
107 %clean
108 rm -rf $RPM_BUILD_ROOT $RPM_BUILD_DIR/%buildsubdir
109
110
111 %files -f nmh_files
112 %defattr(-,root,root,-)
113 %config(noreplace) %_sysconfdir/*