File up-imapproxy.spec of Package up-imapproxy
#This is imapproxy rpm spec file
%define prefix /usr
%define withkrb5 0
# Check for option at command line, ie:
# rpmbuild -bb imapproxy.spec --define 'with_krb5 1'
# with_krb5 indicates the Kerberos includes are needed (ie: Red Hat Linux 9)
%{?with_krb5:%define withkrb5 1}
Summary: Imapproxy Daemon
BuildRequires: openssl-devel ncurses-devel zlib
PreReq: %insserv_prereq
Name: up-imapproxy
Version: 1.2.7
Release: 0
License: GPL-3.0+
Group: Productivity/Networking/Email/Servers
Source0: http://prdownloads.sourceforge.net/squirrelmail/squirrelmail-imap_proxy-%{version}.tar.bz2
Source1: up-imapproxy.init
Patch1: imapproxy.Makefile.patch
Url: http://www.imapproxy.org
BuildRoot: %{_tmppath}/%{name}-%{version}-root
%description
This is a connection caching imapproxy daemon for proxied imap connections.
It is now adopted by the squirrelmail project
Authors:
--------
Dave McMurtrie <davemcmurtrie@gmail.com>
%prep
%setup -n squirrelmail-imap_proxy-%{version}
%patch1
%build
chmod 755 ./configure
%if %{withkrb5}
./configure --with-prefix=%{prefix} --with-krb5=/usr/kerberos
%else
./configure --with-prefix=%{prefix}
%endif
make OPT_FLAGS="$RPM_OPT_FLAGS"
chmod 644 README ChangeLog
%install
# the binaries
install -d %{buildroot}/etc/init.d
install -d %{buildroot}/%{_sbindir}
make prefix=$RPM_BUILD_ROOT%{prefix} rpm_prefix=$RPM_BUILD_ROOT rpm-install
# init file and configuration
install -D %{SOURCE1} $RPM_BUILD_ROOT/etc/init.d/up-imapproxy
ln -sf /etc/init.d/up-imapproxy $RPM_BUILD_ROOT/usr/sbin/rcup-imapproxy
%{__rm} $RPM_BUILD_ROOT/etc/init.d/imapproxy
%preun
%stop_on_removal up-imapproxy
%post
%{fillup_and_insserv up-imapproxy}
%postun
%restart_on_update up-imapproxy
%{insserv_cleanup}
%files
%defattr(-, root, root)
%config /etc/imapproxy.conf
%doc README ChangeLog
%attr(750,root,root) %{prefix}/sbin/in.imapproxyd
%attr(750,root,root) %{prefix}/sbin/pimpstat
%config %attr(0755,root,root) /etc/init.d/up-imapproxy
%{_sbindir}/rcup-imapproxy
%changelog