include php-imap in FC2 (bug #115535)

Joe Orton jorton at redhat.com
Tue Mar 2 17:15:03 UTC 2004


On Tue, Feb 24, 2004 at 08:02:18PM +0200, Kaj J. Niemi wrote:
> > I'm also able to package the c-client library based on the previous imap
> > rpm if that is the conclusion of this discussion.
> 
> Attached is a suggestion for libc-client.spec. It is based on the imap-2002d
> package. A shared library is built in addition to the static library. The
> build code was borrowed from FreeBSD's ports collection mail/cclient where
> it has been working well. In the base package we install just the shared
> library while the header files and the static library gets saved for -devel.
> The .spec and the .src.rpm can be found at <http://www.a51.org/sw/fedora/>.
> 
> Comments are welcome.

Thanks for doing this Kaj... I had a quick look, it was missing a 
%post/%postun, and there were a few too many RFCs in %doc for my taste.

$RPM_OPT_FLAGS doesn't seem to be actually used during the build AFAICT. 
Can that be fixed?

Attached an updated spec file.

joe
-------------- next part --------------

%define soname		c-client
%define somajver	0
%define shlibname	lib%{soname}.so.%{somajver}

Summary: C-client mail access routines for IMAP and POP protocols
Name: libc-client
Version: 2002e
Release: 1
Epoch: 0
License: University of Washington Free-Fork License
Group: System Environment/Daemons
URL: http://www.washington.edu/imap/

Source0: imap-%{version}.tar.Z
Source1: flock.c

Patch0: imap-2002e-redhat-ssl.patch
Patch1: imap-2000-linux.patch
Patch2: imap-2001a-mbox-disable.patch
Patch3: imap-2002b-krbpath.patch
Patch4: imap-2000c-redhat-flock.patch
Patch5: imap-2001a-overflow.patch
Patch6: imap-2002e-redhat-version.patch
Patch7: imap-2002d-ssltype.patch
Patch8: imap-2002e-cclient-only.patch
Patch9: imap-2002e-shared.patch

Buildroot: %{_tmppath}/%{name}-%{version}-root

BuildPrereq: krb5-devel, openssl-devel
# DO NOT REMOVE THIS PAM HEADER DEPENDANCY OR FACE THE WRATH
BuildPreReq: /usr/include/security/pam_modules.h
Requires: pam >= 0.59

%description
C-client is a common API for accessing mailboxes. It is used internally by
the popular PINE mail reader, the University of Washington's IMAP server
and PHP.

%package devel
Summary: Development tools for programs which will use the IMAP library.
Group: Development/Libraries

%description devel
The c-client-devel package contains the header files and static libraries
for developing programs which will use the C-client common API.

%prep
%setup -q -n imap-%{version}
chmod -R u+w .

%patch0 -p1 -b .redhat-ssl-patch
%patch1 -p1 -b .linux-patch
%patch2 -p0 -b .mbox-disable-patch

%patch3 -p1 -b .gssapi-patch

%patch4 -p1 -b .redhat-flock
%patch5 -p1 -b .overflow
%patch6 -p1 -b .redhat-version

%patch7 -p1 -b .ssltype
%patch8 -p1 -b .cclient-only
%patch9 -p1 -b .shared

cp %{SOURCE1} src/osdep/unix/

%build
# Set EXTRACFLAGS here instead of in imap-2000-redhat.patch (#20760)
EXTRACFLAGS="$EXTRACFLAGS -DDISABLE_POP_PROXY=1 -DIGNORE_LOCK_EACCES_ERRORS=1"
EXTRACFLAGS="$EXTRACFLAGS -I/usr/include/openssl"

make RPM_OPT_FLAGS="$RPM_OPT_FLAGS -fPIC" lnp \
EXTRACFLAGS="$EXTRACFLAGS" \
EXTRALDFLAGS="$EXTRALDFLAGS" \
EXTRAAUTHENTICATORS=gss \
SSLTYPE=unix \
SHLIBBASE=%{soname} \
SHLIBNAME=%{shlibname}
# This line needs to be here.

%install
rm -rf $RPM_BUILD_ROOT

mkdir -p $RPM_BUILD_ROOT%{_libdir}
install -m 644 ./c-client/c-client.a $RPM_BUILD_ROOT%{_libdir}/
ln -s c-client.a  $RPM_BUILD_ROOT%{_libdir}/libc-client.a

install -m 644 ./c-client/%{shlibname} $RPM_BUILD_ROOT%{_libdir}/
ln -s %{shlibname} $RPM_BUILD_ROOT%{_libdir}/lib%{soname}.so

mkdir -p $RPM_BUILD_ROOT%{_includedir}/imap
install -m 644 ./c-client/*.h $RPM_BUILD_ROOT%{_includedir}/imap
# Added linkage.c to fix (#34658) <mharris>
install -m 644 ./c-client/linkage.c $RPM_BUILD_ROOT%{_includedir}/imap
install -m 644 ./src/osdep/tops-20/shortsym.h $RPM_BUILD_ROOT%{_includedir}/imap

#mkdir -p $RPM_BUILD_ROOT/%{_datadir}/ssl/certs

# don't ship quite so many docs
rm -rf docs/rfc docs/FAQ.txt

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root)
%doc CPYRIGHT README WARNING docs/RELNOTES docs/*.txt
%doc docs/CONFIG docs/SSLBUILD
%{_libdir}/lib%{soname}.so.*

%files devel
%defattr(-,root,root)
%doc docs/*
%{_includedir}/imap
%{_libdir}/c-client.a
%{_libdir}/libc-client.a
%{_libdir}/lib%{soname}.so

%changelog
* Tue Mar  2 2004 Joe Orton <jorton at redhat.com> 0:2002e-1
- add post/postun, always use -fPIC

* Tue Feb 24 2004 Kaj J. Niemi <kajtzu at fi.basen.net>
- Name change from c-client to libc-client

* Sat Feb 14 2004 Kaj J. Niemi <kajtzu at fi.basen.net> 0:2002e-0.1
- c-client 2002e is based on imap-2002d
- Build shared version, build logic is copied from FreeBSD net/cclient



More information about the fedora-devel-list mailing list