]> diplodocus.org Git - nmh/blob - SPECS/nmh.spec
Fixed mhshow part markers when displaying multiple messages.
[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 'configure_opts --with-cyrus-sasl --with-tls' \
22 # --bb ~/lib/rpmbuild/SPECS/nmh.spec
23 #
24 # If configure has previously been run successfully in the workspace,
25 # it will not be invoked again, even if configure_opts is defined.
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 MIME-email-handling system with a command-line interface
43 Group: Applications/Internet
44 License: BSD
45 URL: http://savannah.nongnu.org/projects/nmh
46 BuildRequires: flex 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 a collection of single-purpose programs that send, receive,
55 show, search, and otherwise manipulate emails, including MIME.
56 They combine well with other Unix programs, easing the development
57 of custom shorthand commands as shell scripts.
58 Optional GUI interfaces are provided by the external xmh and exmh
59 projects. nmh is a descendant of the RAND MH, Mail Handler, project.
60
61
62 %prep
63 if [ ! -f $RPM_SOURCE_DIR/%tarfile ]; then
64 #### The tarfile wasn't already installed and we started with a
65 #### workspace (using make rpm), so get it from there.
66 [ -f %srcdir/%tarfile ] || (cd %srcdir && make dist)
67 cp -p %srcdir/%tarfile $RPM_SOURCE_DIR/%tarfile
68 fi
69 [ -f $RPM_SOURCE_DIR/VERSION ] || cp -p %srcdir/VERSION $RPM_SOURCE_DIR
70 %setup -q -n %name-%rawversion
71
72
73 %build
74 if [ -f %srcdir/config.status ]; then
75 echo reusing existing configuration
76 cp -pf %srcdir/config.status .
77 ./config.status
78 else
79 %if %{undefined configure_opts}
80 %define configure_opts --with-cyrus-sasl
81 %endif
82 %configure %configure_opts
83 fi
84 make all dist
85
86
87 %install
88 rm -rf $RPM_BUILD_ROOT
89 make install DESTDIR=$RPM_BUILD_ROOT
90
91 gz_manpages='-e '
92
93 if find $RPM_BUILD_ROOT -name 'inc.1*' | \
94 egrep -q '/usr(/lib|/share)?/man/([^/]+/)?man'; then
95 #### brp-compress will gzip the man pages, so account for that.
96 gz_manpages='-e s#\(/man/man./.*\)#\1.gz#'
97 fi
98
99 #### etc is brought into files using %config{noreplace}
100 find $RPM_BUILD_ROOT -name etc -prune -o ! -type d -print | \
101 sed -e "s#^$RPM_BUILD_ROOT##" "$gz_manpages" > nmh_files
102
103
104 %clean
105 rm -rf $RPM_BUILD_ROOT $RPM_BUILD_DIR/%buildsubdir
106
107
108 %files -f nmh_files
109 %defattr(-,root,root,-)
110 %config(noreplace) %_sysconfdir/*