1 # This spec supports two methods of RPM creation:
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
7 # $ ./configure --with-cyrus-sasl --with-tls && make rpm
9 # Another example, starting from the source code repository:
10 # $ git clone git://git.savannah.nongnu.org/nmh.git
13 # $ ./configure --with-cyrus-sasl --with-tls && make rpm
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 [...]'.
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
24 # If configure has previously been run successfully in the workspace,
25 # it will not be invoked again, even if configure_opts is defined.
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
33 # Note that Version cannot contain any dashes.
35 # The description, summary, and a few other tags were taken from the
36 # nmh.spec used to build the Fedora 15 nmh rpm.
39 Version: %
(sed "s
/-/_
/g" VERSION
)
40 %define rawversion %
(cat VERSION
)
42 Summary: A capable MIME
-email
-handling system with a
command-line interface
43 Group: Applications
/Internet
45 URL: http
://savannah.nongnu.org
/projects
/nmh
46 BuildRequires
: flex ncurses
-devel
47 %define tarfile nmh
-%rawversion.tar.gz
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.
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
69 [ -f $RPM_SOURCE_DIR
/VERSION
] || cp
-p
%srcdir/VERSION $RPM_SOURCE_DIR
70 %setup -q
-n
%name-%rawversion
74 if [ -f
%srcdir/config.status
]; then
75 echo reusing existing configuration
76 cp
-pf
%srcdir/config.status .
79 %if %{undefined configure_opts}
80 %define configure_opts
--with
-cyrus
-sasl
82 %configure %configure_opts
88 rm -rf $RPM_BUILD_ROOT
89 make install DESTDIR
=$RPM_BUILD_ROOT
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#'
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
105 rm -rf $RPM_BUILD_ROOT $RPM_BUILD_DIR
/%buildsubdir
109 %defattr(-,root
,root
,-)
110 %config(noreplace
) %_sysconfdir/*