From a78312294b75201e9a5f3e7730c3fc3a1845f2f2 Mon Sep 17 00:00:00 2001 From: Paul Eggleton Date: Wed, 31 Dec 2014 15:15:26 +0000 Subject: libc-client: rename to uw-imap, upgrade to 2007f * Upgrade to 2007f * Rename to uw-imap; this is the name used by Fedora and is much more sensible than libc-client * Fix errors when linking the library against code compiled with -fPIC such as mod-php (patch from Fedora). * Add a security patch from Fedora * Rename files directory to uw-imap Signed-off-by: Paul Eggleton --- .../libc-client/files/quote_cctype.patch | 12 ---- .../libc-client/libc-client_2007e.bb | 35 --------- .../uw-imap/uw-imap/imap-2007e-shared.patch | 82 ++++++++++++++++++++++ .../uw-imap/imap-2007f-format-security.patch | 20 ++++++ .../uw-imap/uw-imap/quote_cctype.patch | 12 ++++ meta-oe/recipes-devtools/uw-imap/uw-imap_2007f.bb | 41 +++++++++++ 6 files changed, 155 insertions(+), 47 deletions(-) delete mode 100644 meta-oe/recipes-devtools/libc-client/files/quote_cctype.patch delete mode 100644 meta-oe/recipes-devtools/libc-client/libc-client_2007e.bb create mode 100644 meta-oe/recipes-devtools/uw-imap/uw-imap/imap-2007e-shared.patch create mode 100644 meta-oe/recipes-devtools/uw-imap/uw-imap/imap-2007f-format-security.patch create mode 100644 meta-oe/recipes-devtools/uw-imap/uw-imap/quote_cctype.patch create mode 100644 meta-oe/recipes-devtools/uw-imap/uw-imap_2007f.bb diff --git a/meta-oe/recipes-devtools/libc-client/files/quote_cctype.patch b/meta-oe/recipes-devtools/libc-client/files/quote_cctype.patch deleted file mode 100644 index f729ee2074..0000000000 --- a/meta-oe/recipes-devtools/libc-client/files/quote_cctype.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -urN imap-2007.orig/Makefile imap-2007/Makefile ---- imap-2007.orig/Makefile 2007-12-20 23:11:10.000000000 +0100 -+++ imap-2007/Makefile 2008-03-19 14:08:47.000000000 +0100 -@@ -690,7 +690,7 @@ - @$(SH) -c '(test $(BUILDTYPE) = rebuild -o $(BUILDTYPE) = `$(CAT) OSTYPE`) || (echo Already built for `$(CAT) OSTYPE` -- you must do \"make clean\" first && exit 1)' - @echo Rebuilding c-client for `$(CAT) OSTYPE`... - @$(TOUCH) SPECIALS -- $(CD) c-client;$(MAKE) all CC=`$(CAT) CCTYPE` \ -+ $(CD) c-client;$(MAKE) all CC="`$(CAT) CCTYPE`" \ - CFLAGS="`$(CAT) CFLAGS`" `$(CAT) SPECIALS` - - rebuildclean: diff --git a/meta-oe/recipes-devtools/libc-client/libc-client_2007e.bb b/meta-oe/recipes-devtools/libc-client/libc-client_2007e.bb deleted file mode 100644 index 150ff9028d..0000000000 --- a/meta-oe/recipes-devtools/libc-client/libc-client_2007e.bb +++ /dev/null @@ -1,35 +0,0 @@ -SUMMARY = "UW c-client library for mail protocols" -SECTION = "devel" - -LICENSE = "Apache-2.0" -LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=a6a4ddbb7cd2999f6827ee143f6fcd97" - -DEPENDS = "openssl libpam" - -PR = "r1" - -SRC_URI = "ftp://ftp.cac.washington.edu/imap/imap-${PV}.tar.gz \ - file://quote_cctype.patch" - -SRC_URI[md5sum] = "7903800dc2604000016de070e0c55840" -SRC_URI[sha256sum] = "4b1137b87249782496ec3eeacaf83bbf09312a7d2ae3aead262179041b55565f" - -S = "${WORKDIR}/imap-${PV}" - -EXTRA_OEMAKE = "CC='${CC}'" - -HEADERS = "src/c-client/*.h src/osdep/unix/*.h c-client/auths.c c-client/linkage.c c-client/linkage.h c-client/osdep.h" - -do_compile() { - echo "SSLINCLUDE=${STAGING_INCDIR} SSLLIB=${STAGING_LIBDIR}" > ${S}/SPECIALS - oe_runmake lnp -} - -do_install() { - install -d ${D}${includedir}/c-client - install ${HEADERS} ${D}${includedir}/c-client - install -d ${D}${libdir} - install c-client/c-client.a ${D}${libdir}/libc-client.a -} - -ALLOW_EMPTY_${PN} = "1" diff --git a/meta-oe/recipes-devtools/uw-imap/uw-imap/imap-2007e-shared.patch b/meta-oe/recipes-devtools/uw-imap/uw-imap/imap-2007e-shared.patch new file mode 100644 index 0000000000..4434e839f8 --- /dev/null +++ b/meta-oe/recipes-devtools/uw-imap/uw-imap/imap-2007e-shared.patch @@ -0,0 +1,82 @@ +Fix linking libraries built with -fPIC with this library + +Patch borrowed from Fedora + +Signed-off-by: Paul Eggleton + +Upstream-Status: Pending + +diff -up imap-2007e/src/osdep/unix/Makefile.shared imap-2007e/src/osdep/unix/Makefile +--- imap-2007e/src/osdep/unix/Makefile.shared 2009-07-07 19:28:02.909755512 -0500 ++++ imap-2007e/src/osdep/unix/Makefile 2009-07-07 19:29:35.870006799 -0500 +@@ -170,6 +170,10 @@ BUILD=$(MAKE) build EXTRACFLAGS='$(EXTRA + EXTRADRIVERS='$(EXTRADRIVERS)' EXTRAAUTHENTICATORS='$(EXTRAAUTHENTICATORS)'\ + PASSWDTYPE=$(PASSWDTYPE) SSLTYPE=$(SSLTYPE) IP=$(IP) + ++# Need this for the shared library rule to work correctly ++.SUFFIXES: .o .so ++SOFILES=${BINARIES:.o=.so} ++ + + # Here if no make argument established + +@@ -845,18 +849,24 @@ vu2: # VAX Ultrix 2.3, etc. + + # Build it! + +-build: clean once $(ARCHIVE) ++build: clean once $(ARCHIVE) $(SHLIBNAME) + +-all: $(ARCHIVE) ++all: $(ARCHIVE) $(SHLIBNAME) + + $(ARCHIVE): $(BINARIES) + sh -c '$(RM) $(ARCHIVE) || true' + @$(CAT) ARCHIVE + @$(SH) ARCHIVE + +-.c.o: +- `$(CAT) CCTYPE` -c `$(CAT) CFLAGS` $*.c ++$(SHLIBNAME): $(SOFILES) ++ gcc -shared -Wl,-soname,$(SHLIBNAME) -o $(SHLIBNAME) $(SOFILES) `cat LDFLAGS` ++ ln -s $(SHLIBNAME) lib$(SHLIBBASE).so + ++.c.so: osdep.h ++ $(CC) -fPIC -DPIC -D_REENTRANT -c `$(CAT) CFLAGS` ${@:.so=.c} -o $@ ++ ++.c.o: ++ $(CC) -fPIC -DPIC -D_REENTRANT -c `$(CAT) CFLAGS` $*.c + + # Cleanup + +@@ -895,8 +905,7 @@ utf8aux.o: mail.h misc.h osdep.h utf8.h + + + # OS-dependent +- +-osdep.o:mail.h misc.h env.h fs.h ftl.h nl.h tcp.h \ ++OSDEPS= mail.h misc.h env.h fs.h ftl.h nl.h tcp.h \ + osdep.h env_unix.h tcp_unix.h \ + osdep.c env_unix.c fs_unix.c ftl_unix.c nl_unix.c tcp_unix.c ip_unix.c\ + auths.c crexcl.c flockcyg.c flocklnx.c flocksim.c fsync.c \ +@@ -910,12 +919,19 @@ osdep.o:mail.h misc.h env.h fs.h ftl.h n + write.c sslstdio.c \ + strerror.c strpbrk.c strstr.c strtok.c strtoul.c \ + OSCFLAGS ++ ++osdep.o: $(OSDEPS) ++ $(CC) -fPIC -DPIC -D_REENTRANT `$(CAT) CFLAGS` `$(CAT) OSCFLAGS` -c osdep.c ++ @echo ======================================================================== + @echo Building OS-dependent module + @echo If you get No such file error messages for files x509.h, ssl.h, + @echo pem.h, buffer.h, bio.h, and crypto.h, that means that OpenSSL + @echo is not installed on your system. Either install OpenSSL first + @echo or build with command: make `$(CAT) OSTYPE` SSLTYPE=none +- `$(CAT) CCTYPE` -c `$(CAT) CFLAGS` `$(CAT) OSCFLAGS` -c osdep.c ++ @echo ======================================================================== ++ ++osdep.so: $(OSDEPS) ++ $(CC) -fPIC -DPIC -D_REENTRANT `$(CAT) CFLAGS` `cat OSCFLAGS` -c osdep.c -o $@ + + osdep.c: osdepbas.c osdepckp.c osdeplog.c osdepssl.c + $(CAT) osdepbas.c osdepckp.c osdeplog.c osdepssl.c > osdep.c diff --git a/meta-oe/recipes-devtools/uw-imap/uw-imap/imap-2007f-format-security.patch b/meta-oe/recipes-devtools/uw-imap/uw-imap/imap-2007f-format-security.patch new file mode 100644 index 0000000000..6ec04761a3 --- /dev/null +++ b/meta-oe/recipes-devtools/uw-imap/uw-imap/imap-2007f-format-security.patch @@ -0,0 +1,20 @@ +Fix error found with "-Werror=format-security" flag + +Patch borrowed from Fedora + +Signed-off-by: Paul Eggleton + +Upstream-Status: Pending + +diff -Naur imap-2007f.orig/src/osdep/unix/flocklnx.c imap-2007f/src/osdep/unix/flocklnx.c +--- imap-2007f.orig/src/osdep/unix/flocklnx.c 2011-07-23 02:20:11.000000000 +0200 ++++ imap-2007f/src/osdep/unix/flocklnx.c 2014-04-14 19:17:46.429000000 +0200 +@@ -57,7 +57,7 @@ + case ENOLCK: /* lock table is full */ + sprintf (tmp,"File locking failure: %s",strerror (errno)); + mm_log (tmp,WARN); /* give the user a warning of what happened */ +- if (!logged++) syslog (LOG_ERR,tmp); ++ if (!logged++) syslog (LOG_ERR, "%s", tmp); + /* return failure if non-blocking lock */ + if (op & LOCK_NB) return -1; + sleep (5); /* slow down in case it loops */ diff --git a/meta-oe/recipes-devtools/uw-imap/uw-imap/quote_cctype.patch b/meta-oe/recipes-devtools/uw-imap/uw-imap/quote_cctype.patch new file mode 100644 index 0000000000..f729ee2074 --- /dev/null +++ b/meta-oe/recipes-devtools/uw-imap/uw-imap/quote_cctype.patch @@ -0,0 +1,12 @@ +diff -urN imap-2007.orig/Makefile imap-2007/Makefile +--- imap-2007.orig/Makefile 2007-12-20 23:11:10.000000000 +0100 ++++ imap-2007/Makefile 2008-03-19 14:08:47.000000000 +0100 +@@ -690,7 +690,7 @@ + @$(SH) -c '(test $(BUILDTYPE) = rebuild -o $(BUILDTYPE) = `$(CAT) OSTYPE`) || (echo Already built for `$(CAT) OSTYPE` -- you must do \"make clean\" first && exit 1)' + @echo Rebuilding c-client for `$(CAT) OSTYPE`... + @$(TOUCH) SPECIALS +- $(CD) c-client;$(MAKE) all CC=`$(CAT) CCTYPE` \ ++ $(CD) c-client;$(MAKE) all CC="`$(CAT) CCTYPE`" \ + CFLAGS="`$(CAT) CFLAGS`" `$(CAT) SPECIALS` + + rebuildclean: diff --git a/meta-oe/recipes-devtools/uw-imap/uw-imap_2007f.bb b/meta-oe/recipes-devtools/uw-imap/uw-imap_2007f.bb new file mode 100644 index 0000000000..e1a987710d --- /dev/null +++ b/meta-oe/recipes-devtools/uw-imap/uw-imap_2007f.bb @@ -0,0 +1,41 @@ +SUMMARY = "UW c-client library for mail protocols" +SECTION = "devel" + +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=a6a4ddbb7cd2999f6827ee143f6fcd97" + +DEPENDS = "openssl libpam" + +SRC_URI = "ftp://ftp.cac.washington.edu/imap/imap-${PV}.tar.gz \ + file://quote_cctype.patch \ + file://imap-2007e-shared.patch \ + file://imap-2007f-format-security.patch \ + " + +SRC_URI[md5sum] = "2126fd125ea26b73b20f01fcd5940369" +SRC_URI[sha256sum] = "53e15a2b5c1bc80161d42e9f69792a3fa18332b7b771910131004eb520004a28" + +S = "${WORKDIR}/imap-${PV}" + +EXTRA_OEMAKE = "CC='${CC}'" + +HEADERS = "src/c-client/*.h src/osdep/unix/*.h c-client/auths.c c-client/linkage.c c-client/linkage.h c-client/osdep.h" + +do_compile() { + echo "SSLINCLUDE=${STAGING_INCDIR} SSLLIB=${STAGING_LIBDIR}" > ${S}/SPECIALS + oe_runmake lnp +} + +do_install() { + install -d ${D}${includedir}/c-client + install ${HEADERS} ${D}${includedir}/c-client + install -d ${D}${libdir} + install c-client/c-client.a ${D}${libdir}/libc-client.a +} + +RPROVIDES_${PN} = "libc-client" +RREPLACES_${PN} = "libc-client" +RCONFLICTS_${PN} = "libc-client" + +ALLOW_EMPTY_${PN} = "1" + -- cgit 1.2.3-korg