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