--- mp-3.7.1.orig/debian/rules +++ mp-3.7.1/debian/rules @@ -0,0 +1,161 @@ +#!/usr/bin/make -f +# Sample debian/rules that uses debhelper. +# GNU copyright 1997 to 1999 by Joey Hess. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +# uncomment this to test for bashisms +#SHELL=/bin/ash + +CFLAGS = -Wall -Wshadow -g +ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) + CFLAGS += -O0 +else + CFLAGS += -O2 +endif +export CFLAGS + +TOPDIR=$(shell pwd) +FULLVERSION=$(shell dpkg-parsechangelog | grep ^Version: | cut -d' ' -f2 ) +VERSION=$(word 1,$(subst -, ,$(FULLVERSION))) +BUILDDIR=mpdist-$(VERSION) + +INSTALL=install +INSTALL_PROGRAM = $(INSTALL) -p -m 755 +INSTALL_SCRIPT = $(INSTALL_PROGRAM) +INSTALL_DATA = $(INSTALL) -p -m 644 +ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) +INSTALL_PROGRAM += -s +endif +export INSTALL +export INSTALL_PROGRAM +export INSTALL_SCRIPT +export INSTALL_DATA + +# TOPDIR=$(TOPDIR) + +unpack: $(BUILDDIR)/configure +$(BUILDDIR)/configure: + # unpack + [ -e "$(BUILDDIR)" ] || tar xzf $(BUILDDIR).tar.gz --no-same-permissions + + +patch: patch-stamp +patch-stamp: $(BUILDDIR)/configure + dh_testdir + + # patch + cd $(BUILDDIR) && \ + for p in $(TOPDIR)/debian/patches/*.patch; do \ + echo '==>' `basename $$p`; \ + patch -p1 < $$p; \ + done + + # install new config.{sub,guess} + cp /usr/share/misc/config.sub $(BUILDDIR) + cp /usr/share/misc/config.guess $(BUILDDIR) + + touch patch-stamp + +build: build-stamp +build-stamp: patch-stamp + #VERSION=$(VERSION) + #TOPDIR=$(TOPDIR) + dh_testdir + + # configure + cd $(BUILDDIR) && \ + ./configure --prefix=/usr \ + --mandir=\$${prefix}/share/man \ + --datadir=\$${prefix}/share/ \ + --with-prologue=\$${prefix}/share/mp \ + --disable-duplex \ + --disable-mptool \ + --disable-gtktest + + # don't link mp and mimep against libICE en libSM + sed -i -e 's/-lICE//' -e 's/-lSM//' $(BUILDDIR)/mp/Makefile + sed -i -e 's/-lICE//' -e 's/-lSM//' $(BUILDDIR)/mimep/mimep/Makefile + + # build + cd $(BUILDDIR) && $(MAKE) + + touch build-stamp + +clean: + dh_testdir + -rm -rf $(BUILDDIR) + -rm -f *-stamp + dh_clean + +install: build-stamp install-stamp +install-stamp: + dh_testdir + + dh_clean -k + + dh_installdirs + + cd $(BUILDDIR) && \ + $(MAKE) install DESTDIR=$(TOPDIR)/debian/mp PACKAGE=mp + + mv debian/mp/usr/share/mpdist debian/mp/usr/share/mp + + # remove unused binaries + for f in ertf2latex iseps mimepps cutlines text2latex mimepurl ; \ + do \ + rm -f "$(TOPDIR)/debian/mp/usr/bin/$$f"; \ + done + + # remove useless fake binary symlinks + # the names clash with real binaries in other packages, and the + # functionality is avilable through mp's command line arguments anyway + ## Note: filep and mailp re-added in 3.7.1-11 (bug #516947) + for f in digestp filofaxp fileofaxpp franklinp newsp proplanp timemanp timesysip timesyspp; \ + do \ + rm -f "debian/mp/usr/bin/$$f"; \ + done + + # add manpage for links + for f in filep mailp; \ + do \ + ln -s "mp.1.gz" "debian/mp/usr/share/man/man1/$$f.1.gz"; \ + done + + # remove manpages for binaries we don't build anymore + rm -f "debian/mp/usr/share/man/man1/mimep_fr.1" \ + "debian/mp/usr/share/man/man1/mimep_fr3.1" \ + "debian/mp/usr/share/man/man1/mptool.1" + + cd $(BUILDDIR) && cp AUTHORS NEWS README TODO \ + $(TOPDIR)/debian/mp/usr/share/doc/mp/ + + touch install-stamp + + +# Build architecture-independent files here. +binary-indep: build install +# We have nothing to do by default. + +# Build architecture-dependent files here. +binary-arch: build install + dh_testdir + dh_testroot + dh_installdocs + dh_installmenu + #dh_installmanpages + dh_installinfo + dh_installchangelogs $(BUILDDIR)/ChangeLog + dh_link + dh_strip + dh_compress + dh_fixperms + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install --- mp-3.7.1.orig/debian/watch +++ mp-3.7.1/debian/watch @@ -0,0 +1,2 @@ +version=3 +http://sf.net/mpdist/mpdist-([\d.]+)\.tar\.gz --- mp-3.7.1.orig/debian/dirs +++ mp-3.7.1/debian/dirs @@ -0,0 +1,2 @@ +usr/bin +usr/share/doc/mp --- mp-3.7.1.orig/debian/control +++ mp-3.7.1/debian/control @@ -0,0 +1,21 @@ +Source: mp +Section: text +Priority: optional +Maintainer: Bas Zoetekouw +Build-Depends: debhelper (>=5), autotools-dev, libx11-dev, libxt-dev +Standards-Version: 3.8.2 +Homepage: http://mpdist.sourceforge.net/ + +Package: mp +Architecture: any +Depends: ${shlibs:Depends} +Suggests: texlive-latex-base, texlive-base-bin, cups-client | cups-bsd | lpr +Description: pretty-printer for email messages and other text files + The mp program will pretty print various files for you. It can be used + in conjunction with a mail reading utility for producing a pretty print + of your mail items. It can be used with a news reading tool to pretty + print news articles. Digests can also be printed, and this version can + pretty print ordinary ASCII files as well. Support for personal + organiser printing was added into the last released version. There are + numerous configuration options to allow you to adjust the way mp + generates its output. --- mp-3.7.1.orig/debian/changelog +++ mp-3.7.1/debian/changelog @@ -0,0 +1,193 @@ +mp (3.7.1-11) unstable; urgency=low + + * Fixed watch file (now uses proper sourceforge format) + * Bump standards-version to 3.8.2: + - Add Homepage field to control file + * Re-added filep and mailp + (Closes: #516947) + * Fix copyright file to list an explciit copyrght and point to + /usr/share/common-licenses/GPL-2 instead of GPL + + -- Bas Zoetekouw Tue, 30 Jun 2009 14:45:19 +0200 + +mp (3.7.1-10) unstable; urgency=low + + * Restore the mimep program, as soem peopel have reported it is useful. + (Closes: #452088) + * Fix insecure tempfile handling in mimep. + Thanks to Rafael Laboissiere for the patches. + [20_mimep_tempnam.patch] [21_mimep_TMPDIR.patch] + * Fix calling of LaTeX from mimep: use a separate temporary dir for it, to + prevent LaTeX from overwriting other files + [22_mimep_latex.patch] + * Fix removal of temporary files in mimep + [23_mimep_rm.patch] + * Add suggests on texlive-latex-base, texlive-base-bin, cupsys-client | lpr + (those are needed for mimep) + * Remove irrelevant information for mimep man page + [03_mimep_man.patch] + * Move patching into its own rule in debian/rules + * Bump Standards-Version to 3.7.3 (no changes required) + * Don't link against libICE and libSM (doesn't use it) + + -- Bas Zoetekouw Fri, 14 Dec 2007 18:15:43 +0100 + +mp (3.7.1-9) unstable; urgency=low + + * Remove mention of mptool from Description + + -- Bas Zoetekouw Sat, 22 Sep 2007 18:10:53 +0200 + +mp (3.7.1-8) unstable; urgency=low + + * Removed mptool to get rid of the dependency on gtk-1.2 + * Removed old build-dep on autoconf + * Remove mimep because it uses insecure tempfiles and insecure calls to + LaTeX and dvips; removes suggests on latex binaries. + * Got rid of binary symlinks (digestp filep filofaxp franklinp mailp newsp + proplanp timemanp timesysip timesyspp); the filenames clash with file sin + other packages and these functionalities are also available through + command line options of mp + (closes: #442237) + * Remove references to these binaries from the man page + [02_man_obsolete.patch] + * Fix the path to the postscript preambles + [10_path.patch] + * Removed the menu entry (which depended on mptool) + + -- Bas Zoetekouw Fri, 21 Sep 2007 20:41:08 +0200 + +mp (3.7.1-7) unstable; urgency=low + + * Fixed the watch file + * Removed DH_COMPAT from debian/rules, and added debian/compat + + -- Bas Zoetekouw Sun, 15 Apr 2007 19:30:19 +0200 + +mp (3.7.1-6) unstable; urgency=low + + * Really fix bashism in debian/rules (closes: #376479) + + -- Bas Zoetekouw Thu, 13 Jul 2006 21:49:42 +0200 + +mp (3.7.1-5) unstable; urgency=low + + * Fixed bashism in debian/rules (closes: #376479) + * Bumped Standards-Version to 3.7.2 (no changes needed) + + -- Bas Zoetekouw Wed, 12 Jul 2006 11:56:25 +0200 + +mp (3.7.1-4) unstable; urgency=low + + * Added an "unpack" target in debian/rules + * Use Debhelper level 5 instead of 3 + * Changed Build-deps on xlibs-dev to libx11-dev, x-dev, libxt-dev + * Make sure tar honors the umask while unpacking + * Upgraded build-dep on debhelper to version 5 + * Fixed groff errors in man pages + * Moved french man pages to /usr/share/man/fr/ + * Disabled handling of duplexing; this caused postscript errors, and + should be handled by the printer/printing system anyway + + -- Bas Zoetekouw Wed, 30 Nov 2005 10:53:39 +0100 + +mp (3.7.1-3) unstable; urgency=low + + * Now really fixed the typo in the description + + -- Bas Zoetekouw Tue, 12 Jul 2005 16:27:51 +0200 + +mp (3.7.1-2) unstable; urgency=low + + * Added watch file + * Fixed typo in desription (closes: #277237, #268531) + Thanks to Florian and Kevin for bringing this to my attention. + * Added versioned build-depends on debhelper + * Boosted Standards-version to 3.6.2 (no changes necessary) + * Properly quoted the menu entry + * Added Suggests on tetex-bin, metamail and lpr|lprng|cupsys-bsd + (all used by mimep) + * Moved binaries that are only used internally to /usr/lib/mp + + -- Bas Zoetekouw Tue, 12 Jul 2005 15:02:44 +0200 + +mp (3.7.1-1) unstable; urgency=low + + * New upstream release + * Repackaged the package + + -- Bas Zoetekouw Wed, 18 Feb 2004 13:41:40 +0100 + +mp (3.6.1-3) unstable; urgency=low + + * Fixed xlib6g-dev builddep (closes: #170194) + + -- Bas Zoetekouw Fri, 22 Nov 2002 18:56:42 +0100 + +mp (3.6.1-2) unstable; urgency=low + + * Updated package to Policy version 3.5.7. + * Moved build process to build/ directory to make cleaning up easier and + diff.gz smaller. + + -- Bas Zoetekouw Sun, 17 Nov 2002 23:59:25 +0100 + +mp (3.6.1-1) unstable; urgency=low + + * New upstream release. + + -- Bas Zoetekouw Fri, 15 Feb 2002 10:23:31 +0100 + +mp (3.6.0-4) unstable; urgency=medium + + * Added build-dependency on autoconf (closes: #123138) + * Chmodded the script named ``missing'' +x + + -- Bas Zoetekouw Mon, 10 Dec 2001 09:34:51 +0100 + +mp (3.6.0-3) unstable; urgency=medium + + * Added automatical copying of config.{sub,guess} from autotools-dev + (closes: #121572) + * Set DH_COMPAT version to 3 + * Boosted standards version to 3.5.6 + + -- Bas Zoetekouw Wed, 28 Nov 2001 20:11:21 +0100 + +mp (3.6.0-2) unstable; urgency=low + + * Added watch file. + + -- Bas Zoetekouw Sat, 13 Oct 2001 18:22:19 +0200 + +mp (3.6.0-1) unstable; urgency=low + + * New upstream release. + * Cleaned out the debian/ dir + * Added support for the `debug' and `nostrip' options in + DEB_BUILD_OPTIONS. + + -- Bas Zoetekouw Sun, 6 May 2001 16:16:46 +0200 + +mp (3.5.2-3) unstable; urgency=low + + * Added Build-Depends on debhelper + + -- Bas Zoetekouw Mon, 8 Jan 2001 19:19:02 +0100 + +mp (3.5.2-2) unstable; urgency=low + + * Upgraded standard-version to 3.1.1 + + -- Bas Zoetekouw Tue, 19 Dec 2000 16:06:25 +0100 + +mp (3.5.2-1) unstable; urgency=low + + * Initial Release. + + -- Bas Zoetekouw Tue, 28 Nov 2000 19:35:06 +0100 + +Local variables: +mode: debian-changelog +End: +# vim:ts=8:sw=4:expandtab: --- mp-3.7.1.orig/debian/compat +++ mp-3.7.1/debian/compat @@ -0,0 +1 @@ +5 --- mp-3.7.1.orig/debian/copyright +++ mp-3.7.1/debian/copyright @@ -0,0 +1,15 @@ +This package was debianized by Bas Zoetekouw on +Wed, 22 Mar 2000 14:51:23 -0600. + +It was downloaded from http://mpdist.sourceforge.net/ + +Upstream Author: Rich Burridge + +Copyright (C) 1987-2002 Rich Burridge, Sun Microsystems Inc. +All rights reserved. + +You are free to distribute and modify this software under the terms of +the GNU General Public License, version 2.0. On Debian systems, the +complete text of the GNU General Public License can be found in +/usr/share/common-licenses/GPL-2 file. + --- mp-3.7.1.orig/debian/README.Debian +++ mp-3.7.1/debian/README.Debian @@ -0,0 +1,20 @@ +mp for Debian +------------- + +mp is a nice and small pretty-printer for all kinds of text files. It +basically takes text as input and spits out a nicely formatted postscript +file. + +As of version 3.7.1-8, I've removed the mimp program. It uses insecure +temporary files, and insecure calls to LaTeX and dvips, which could in theory +be exploited by other users on your system to gain access to your account. I +don't think it's worth the trouble fixing it, but if you would like the +functionality back, please let me know, and I'll see if I can clean up the +code. + +I also removed the many alternive names of the mp binary (digestp filep +filofaxp franklinp mailp newsp proplanp timemanp timesysip timesyspp) because +the filenames clash with files in other packages. The functionality is +available through mp's command line option + + -- Bas Zoetekouw Sat, 22 Sep 2007 14:03:05 +0200 --- mp-3.7.1.orig/debian/patches/10_path.patch +++ mp-3.7.1/debian/patches/10_path.patch @@ -0,0 +1,11 @@ +--- mp/common/option.h.eerst 2007-09-22 13:20:59.000000000 +0200 ++++ mp/common/option.h 2007-09-22 13:21:22.000000000 +0200 +@@ -68,7 +68,7 @@ + #endif /* MAXPATHLEN */ + + #ifndef PROLOGDIR /* PostScript prologue file. */ +-#define PROLOGDIR "/usr/local/lib/mp" ++#define PROLOGDIR "/usr/share/mp" + #endif /* PROLOGDIR */ + + #define PRO_FILOFAX "mp.pro.ff.ps" --- mp-3.7.1.orig/debian/patches/03_mimep_man.patch +++ mp-3.7.1/debian/patches/03_mimep_man.patch @@ -0,0 +1,60 @@ +--- mp-old/man/mimep.1 2007-12-14 20:14:20.000000000 +0100 ++++ mp-new/man/mimep.1 2007-12-14 20:19:46.000000000 +0100 +@@ -9,51 +9,13 @@ + The + .I mimep + program allows users to print multimedia messages composed with any UA respecting the MIME standard. It can print most of the bodyparts composing this kind of mail (gif, jpeg images, text/plain, text/enriched, postscript files ...). To achieve its goal, mimep builds a LaTeX document from the MIME message. Afterwards, it converts it into a "dvi" file, then into Postscript, outputting either to a file or to a printer. +-Mimep can be used in an UA such as +-.I exmh, +-just by installing the mimep distribution, putting the binaries in a directory accessible through your search +-.I path +-and configuring the printing preferences of exmh with such a line: + +- mimep $file & +- +-With this done, mimep still cannot run yet... +- +-Indeed, to work, mimep needs these programs to be installed: +- +- +- - +-.I metamail, +-used to decode the MIME messages, it furnishes the different bodyparts of a mail to the shell script "printmim" of the Mimep distribution. +-.sp +- - +-.I LaTeX2e +-a complete distribution with a binary named latex, to transform the LaTeX document, created by mimep and printmim into a dvi file. +-.sp +- - +-.I dvips, +-to convert the dvi file into printable Postscript code. +-.sp +- - +-.I lpr, +-to print. +- +-As it uses metamail, it also needs its +-.I mailcap +-or +-.I $HOME/.mailcap +-configuration file. +-For each "mailcap entry" handled by mimep, the "print field" must be correctly filled in. +-One must specify that the printmim command must be called by metamail with the correct options. A "print field" in the "mailcap entry" should be: +- +- print= printmim %t %s; +- +-(%t being the content/type of the bodypart given by metamail to printmim and %s being the reference to the file given by metamail to printmim) +- +-.sp +-(For more details see the mailcap_example file in the mimep distribution and the metamail's manpages.) +- +-The configuration of metamail done, mimep can be used with its default parameters... ++.P ++To mimep, use need to have LaTeX and a printing system installed. To install ++these on a Debian system, use the command ++.IP ++apt-get install texlive-latex-base texlive-base-bin cupsys-client ++.P + + Mimep may be distributed as part of the Mp distribution, because it uses some files of this distribution, and also because Mp was one of the first Postscript pretty printer command for mailers. + --- mp-3.7.1.orig/debian/patches/02_man_obsolete.patch +++ mp-3.7.1/debian/patches/02_man_obsolete.patch @@ -0,0 +1,68 @@ +--- mp/man/mp.1.old 2002-04-12 18:47:26.000000000 +0200 ++++ mp/man/mp.1 2007-09-22 13:43:22.000000000 +0200 +@@ -124,26 +124,6 @@ + .I filename .\|.\|. + ] + .PP +-.BR digestp " [ options ] file ..." +-.PP +-.BR filep " [ options ] file ..." +-.PP +-.BR filofaxp " [ options ] file ..." +-.PP +-.BR franklinp " [ options ] file ..." +-.PP +-.BR mailp " [ options ] file ..." +-.PP +-.BR newsp " [ options ] file ..." +-.PP +-.BR proplanp " [ options ] file ..." +-.PP +-.BR timemanp " [ options ] file ..." +-.PP +-.BR timesysip " [ options ] file ..." +-.PP +-.BR timesyspp " [ options ] file ..." +-.PP + The version of + .B mp + installed at your site might also support the command line options from the +@@ -201,37 +181,7 @@ + \*(Ps format. By default the output is sent to standard output. If you use + one of the different names, output is sent direct to the printer. + .PP +-.I mailp +-will print out mail messages. +-.PP +-.I newsp +-will print out USENET news articles. +-.PP +-.I digestp +-will print out USENET digest files. +-.PP +-.I filep +-will print out ordinary ASCII files. +-.PP +-.I filofaxp +-will print out in Filofax personal organiser format. +-.PP +-.I franklinp +-will print out in Franklin Planner personal organiser format. +-.PP +-.I proplanp +-will print out in ProPlan personal organiser format. +-.PP +-.I timemanp +-will print out in Time Manager personal organiser format. +-.PP +-.I timesysip +-will print out in Time/System (International) personal organiser format. +-.PP +-.I timesyspp +-will print out in Time/System (Partner) personal organiser format. +-.PP +-These programs will use the ++The program will use the + .B PRINTER + or + .B LPDEST --- mp-3.7.1.orig/debian/patches/21_mimep_TMPDIR.patch +++ mp-3.7.1/debian/patches/21_mimep_TMPDIR.patch @@ -0,0 +1,35 @@ +--- mpdist-3.7.1.orig/mimep/mimep/mimep.c 2002-04-12 18:47:26.000000000 +0200 ++++ mpdist-3.7.1/mimep/mimep/mimep.c 2007-11-20 08:14:34.000000000 +0100 +@@ -40,11 +39,15 @@ + /* + * If the MIMEPTMPDIR environment variable is set with a valid + * directory name, mimep uses this directory to create its temporary files. ++ * ++ * [RML] Otherwise, if the environment variable TMPDIR is set, use it. + */ + + if (!(TMPDIR = getenv(MIMEPTMPDIR))) { +- TMPDIR = (char *) malloc(sizeof(char) * (strlen(DEFTMPDIR) + 1)); +- STRCPY(TMPDIR, DEFTMPDIR); ++ if (!(TMPDIR = getenv("TMPDIR"))) { ++ TMPDIR = (char *) malloc(sizeof(char) * (strlen(DEFTMPDIR) + 1)); ++ STRCPY(TMPDIR, DEFTMPDIR); ++ } + } + Header(); /* mp */ + +--- mpdist-3.7.1.orig/man/mimep.1 2002-04-12 18:47:26.000000000 +0200 ++++ mpdist-3.7.1/man/mimep.1-new 2007-11-20 10:42:02.000000000 +0100 +@@ -337,6 +337,11 @@ + .sp + .TP + .B \MIMEPTMPDIR ++If set, this variable overrides both the TMPDIR environment variable and "/tmp" as the name of the directory in which mimep will create temporary files. ++.\"========================================================================= ++.sp ++.TP ++.B \TMPDIR + If set, this variable overrides "/tmp" as the name of the directory in which mimep will create temporary files. + .\"========================================================================= + .sp + --- mp-3.7.1.orig/debian/patches/23_mimep_rm.patch +++ mp-3.7.1/debian/patches/23_mimep_rm.patch @@ -0,0 +1,102 @@ +--- mp-old/mimep/mimep/mimep.c 2007-12-14 19:51:27.649356168 +0100 ++++ mp-new/mimep/mimep/mimep.c 2007-12-14 19:52:14.137611704 +0100 +@@ -22,16 +22,21 @@ + #include "mimep.h" + + #include ++#include ++#include + + static int _TRACE = 0; + ++char * outputfile = NULL; ++char * latexdir = NULL; ++ + int + main(int narg, char **tabarg) + { +- char *inputfile, *outputfile, outputstr[MAXARRAY], boundarystr[MAXARRAY]; ++ char *inputfile, outputstr[MAXARRAY], boundarystr[MAXARRAY]; + char rulehstr[MAXARRAY], printerstr[MAXARRAY], comm_mm[MAXARRAY]; + char comm_latex[MAXARRAY], comm_dvips[MAXARRAY], comm_lpr[MAXARRAY]; +- char *lastdir, *latexdir; ++ char *lastdir; + + argc = narg; + argv = tabarg; +@@ -770,19 +775,61 @@ + static void + clean(void) + { +- char comm_rm[MAXARRAY]; ++ /* unlink LaTeX input file */ ++ if ( outputfile != NULL ) ++ { ++ if ( unlink( outputfile ) != 0 ) ++ { ++ fprintf( stderr, "Can't unlink %s: %s\n", outputfile, strerror(errno) ); ++ exit( -1 ); ++ } ++ } ++ ++ /* unlink other files LaTeX might have created */ ++ if ( latexdir != NULL ) ++ { ++ struct dirent * entry = NULL; ++ DIR *dir = opendir( latexdir ); ++ if ( dir == NULL ) ++ { ++ fprintf( stderr, "Can't open dir %s: %s\n", latexdir, strerror(errno) ); ++ exit( -1 ); ++ } ++ ++ while ( ( entry = readdir( dir ) ) != NULL ) ++ { ++ unsigned int len; ++ char * filename; ++ ++ if ( strcmp( entry->d_name, "." ) == 0 || strcmp( entry->d_name, ".." ) == 0 ) ++ { ++ continue; ++ } ++ ++ len = strlen(latexdir) + 1 + strlen(entry->d_name) +1; ++ filename = alloca( len * sizeof(char) ); ++ memset( filename, 0, len * sizeof(char) ); ++ ++ sprintf( filename, "%s/%s", latexdir, entry->d_name ); ++ ++ if (_TRACE) fprintf(stderr, "removing %s\n", filename ); ++ ++ if ( unlink( filename ) != 0 ) ++ { ++ fprintf( stderr, "Can't unlink %s: %s\n", filename, strerror(errno) ); ++ exit( -1 ); ++ } ++ } ++ ++ closedir( dir ); ++ ++ if (_TRACE) fprintf(stderr, "removing dir %s\n", latexdir ); ++ if ( rmdir( latexdir) != 0 ) ++ { ++ fprintf( stderr, "Can't rmdir %s: %s\n", latexdir, strerror(errno) ); ++ exit( -1 ); ++ } ++ } + +- STRCPY(comm_rm, RM); +- STRCAT(comm_rm, TMPDIR); +- STRCAT(comm_rm, SLASHSTR); +- STRCAT(comm_rm, TMPREFIX); +- STRCAT(comm_rm, STAR); +- SYSTEM(comm_rm); +- +- STRCPY(comm_rm, RM); +- STRCAT(comm_rm, TMPDIR); +- STRCAT(comm_rm, SLASHSTR); +- STRCAT(comm_rm, MMPREFIX); +- STRCAT(comm_rm, STAR); +- SYSTEM(comm_rm); ++ return; + } --- mp-3.7.1.orig/debian/patches/01_man_typos.patch +++ mp-3.7.1/debian/patches/01_man_typos.patch @@ -0,0 +1,54 @@ +diff -Naur mpdist-3.7.1.orig/man/mimep.1 mpdist-3.7.1/man/mimep.1 +--- mpdist-3.7.1.orig/man/mimep.1 2002-04-12 18:47:26.000000000 +0200 ++++ mpdist-3.7.1/man/mimep.1 2005-12-02 21:22:43.000000000 +0100 +@@ -3,7 +3,7 @@ + mimep - to print a Multimedia Internet MEssage + .SH SYNOPSIS + .ta 8n +-\fBmimep\fP [source_file] [-o target_file] [-f] [-fp] [-printer printername] [-a4] [-us] [-typesize size] [-noburstpage] [-nopagenum] [-addhdrs headertype...] [-rmhdrs headertype...] [-allheaders] [-boundary filename | default | none] ++\fBmimep\fP [source_file] [\-o target_file] [\-f] [\-fp] [\-printer printername] [\-a4] [\-us] [\-typesize size] [\-noburstpage] [\-nopagenum] [\-addhdrs headertype...] [\-rmhdrs headertype...] [\-allheaders] [\-boundary filename | default | none] + .br + .SH DESCRIPTION + The +@@ -200,7 +200,7 @@ + .\"========================================================================= + .sp + .TP +-.B \[source_file] ++.B [source_file] + If no source_file is specified, mimep will use the standard input, + else mimep will interpret the mail named "source_file". + .\"========================================================================= +diff -Naur mpdist-3.7.1.orig/man/mimep_fr.1 mpdist-3.7.1/man/mimep_fr.1 +--- mpdist-3.7.1.orig/man/mimep_fr.1 2002-04-12 18:47:26.000000000 +0200 ++++ mpdist-3.7.1/man/mimep_fr.1 2005-12-02 21:16:17.000000000 +0100 +@@ -35,7 +35,7 @@ + .sp + - + .I convert, +-pour convertir les images gif et jpeg en fichiers PostScript, inclus après cela, dans le source LaTeX\ ; ++pour convertir les images gif et jpeg en fichiers PostScript, inclus apr\[`e]s cela, dans le source LaTeX\ ; + .sp + - + .I LaTeX2e, +@@ -225,7 +225,7 @@ + .\"========================================================================= + .sp + .TP +-.B \[source_file] ++.B [source_file] + Si aucun fichier source n'est specifie, mimep utilisera + l'entree standard, + sinon mimep interpretera le message appele "source_file". +diff -Naur mpdist-3.7.1.orig/man/mimep_fr3.1 mpdist-3.7.1/man/mimep_fr3.1 +--- mpdist-3.7.1.orig/man/mimep_fr3.1 2002-04-12 18:47:26.000000000 +0200 ++++ mpdist-3.7.1/man/mimep_fr3.1 2005-12-02 21:13:02.000000000 +0100 +@@ -227,7 +227,7 @@ + .\"========================================================================= + .sp + .TP +-.B \[source_file] ++.B [source_file] + Si aucun fichier source n'est spe\*'cifie\*', mimep utilisera + l'entre\*'e standard, + sinon mimep interpre\*'tera le message appele\*' "source_file". --- mp-3.7.1.orig/debian/patches/22_mimep_latex.patch +++ mp-3.7.1/debian/patches/22_mimep_latex.patch @@ -0,0 +1,98 @@ +--- mp-old/mimep/mimep/mimep.c 2007-12-14 19:46:59.883840937 +0100 ++++ mp-new/mimep/mimep/mimep.c 2007-12-14 19:51:27.649356168 +0100 +@@ -21,8 +21,9 @@ + + #include "mimep.h" + +-static int _TRACE = 0; ++#include + ++static int _TRACE = 0; + + int + main(int narg, char **tabarg) +@@ -185,9 +186,31 @@ + FPRINTF(stderr, "%s %s", ERR4, lastdir); + } + ++/* Create a temporary directory to run LaTeX in */ ++ { ++ char * the_dir = getdir(outputfile); ++ int len = strlen(the_dir) + 1 + 5 + 1 + 6 + 1; ++ latexdir = alloca( sizeof(char) * len ); ++ memset( latexdir, 0, len * sizeof(char) ); ++ ++ sprintf( latexdir, "%s/%s.XXXXXX", the_dir, "mimep" ); ++ latexdir = mkdtemp( latexdir ); ++ ++ if (_TRACE) ++ { ++ FPRINTF(stderr, "latexdir: %s\n", latexdir); ++ } ++ ++ if ( ! latexdir ) ++ { ++ fprintf( stderr, "Couldn't create temp dir %s: %s\n", latexdir, strerror(errno) ); ++ exit( -1 ); ++ } ++ } ++ + /* Chdir to the directory of the LaTeX file */ + +- if ((latexdir = getdir(outputfile))) { ++ { + if ((chdir(latexdir)) == -1) { + FPRINTF(stderr, "%s %s", ERR5, latexdir); + } +@@ -207,23 +230,15 @@ + + SYSTEM(comm_latex); + +-/* Returns to the original directory */ +- +- if ((lastdir) && (latexdir)) { +- if ((chdir(lastdir)) == -1) { +- FPRINTF(stderr, ERR6); +- } +- } +- + /* Builds the dvips' call command line then calls dvips */ + +- STRCPY(comm_dvips, DVIPS); +- STRCAT(comm_dvips, outputfile); ++ snprintf(comm_dvips, MAXARRAY, "%s %s/%s.dvi", DVIPS, latexdir, TMPREFIX ); + + if (tofile) { + STRCAT(comm_dvips, DVIPSO); + STRCAT(comm_dvips, outputfile); + STRCAT(comm_dvips, PSSUFFIX); ++ if (_TRACE) FPRINTF(stderr, "comm_dvips(1): %s\n", comm_dvips); + SYSTEM(comm_dvips); /* For an output to a file */ + } + if (toprinter) { /* For an output to a printer */ +@@ -239,6 +254,7 @@ + } + STRCAT(comm_lpr, outputfile); + STRCAT(comm_lpr, PSSUFFIX); ++ if (_TRACE) FPRINTF(stderr, "comm_dvips(2): %s\n", comm_dvips); + SYSTEM(comm_lpr); + } else { + STRCAT(comm_dvips, DVIPSO); +@@ -251,6 +267,7 @@ + STRCAT(comm_dvips, printername); + } + STRCAT(comm_dvips, ENDVIPSO); ++ if (_TRACE) FPRINTF(stderr, "comm_dvips(3): %s\n", comm_dvips); + SYSTEM(comm_dvips); + } + if (_TRACE) { +@@ -260,9 +277,6 @@ + STRCAT(comm_dvips, DVIPSF); + SYSTEM(comm_dvips); + } +- if (_TRACE) { +- FPRINTF(stderr, "comm_dvips: %s\n", comm_dvips); +- } + + clean(); /* Removes the temporary files */ + return(0); --- mp-3.7.1.orig/debian/patches/20_mimep_tempnam.patch +++ mp-3.7.1/debian/patches/20_mimep_tempnam.patch @@ -0,0 +1,42 @@ +--- mpdist-3.7.1.orig/mimep/mimep/mimep.c 2002-04-12 18:47:26.000000000 +0200 ++++ mpdist-3.7.1/mimep/mimep/mimep.c 2007-11-20 08:14:34.000000000 +0100 +@@ -65,12 +65,21 @@ + outputfile = removesuffix(outputfilename()); + + if (!(strcmp(outputfile, NOOUTPUTFILE))) { +- outputfile = tempnam(TMPDIR, TMPREFIX); ++ outputfile = (char *) malloc (strlen (TMPDIR) ++ + strlen (TMPREFIX) + 9); ++ strcpy (outputfile, TMPDIR); ++ strcat (outputfile, "/"); ++ strcat (outputfile, TMPREFIX); ++ strcat (outputfile, ".XXXXXX"); ++ if (!(fp_out = fdopen (mkstemp (outputfile), "w"))) { ++ FPRINTF (stderr, ERR3); ++ exit (1); ++ } + } + + /* Opens the output file which will contain the LaTeX document */ + +- if (!(fp_out = fopen(outputfile, "w"))) { ++ else if (!(fp_out = fopen(outputfile, "w"))) { + FPRINTF(stderr, ERR3); + exit(1); + } +@@ -331,8 +341,13 @@ + * temporary file, then, returns the name of this file. + */ + +- filename = tempnam(TMPDIR, TMPREFIX); +- if (!(fp = fopen(filename, "w"))) { ++ filename = (char *) malloc (strlen (TMPDIR) + strlen (TMPREFIX) + 9); ++ strcpy (filename, TMPDIR); ++ strcat (filename, "/"); ++ strcat (filename, TMPREFIX); ++ strcat (filename, ".XXXXXX"); ++ ++ if (!(fp = fdopen (mkstemp (filename), "w"))) { + FPRINTF(stderr, ERR1); + } + while (fscanf(stdin, "%c", &car) != EOF) {