Hi,

to whom it may concern, I've backported Fink 0.38.3 to 10.4.
It was surprisingly simple, I've only come across a handful
of issues, all of which are fixed by the following 2 commits:

https://github.com/l1k/fink/commit/59893b5af0f0e99aaf0a54b6ef80b1d93d5a2bf3
https://github.com/l1k/fink/commit/8fca33932264f58ef4a7174adc6f9d7d60e90433

How to replicate:
* Install Perl 5.18.2 using the attached perl5182.info
* Symlink /sw/bin/perl to /usr/bin/perl
* Install Fink 0.38.3 using the attached fink-10.4.info and
  fink-10.4.patch, the latter includes the 2 commits above

I've only tested this on powerpc32, I don't have an i386 machine
available. Also, I'm not sure if I've catched all portability
issues. That being said, I've used this to successfully compile
and install ntp 4.2.8, libidn 1.22 and mutt 1.5.23 (with fix
for CVE-2014-9116) using the attached info and patch files.

Best regards,

Lukas
Package: perl5182
Version: 5.18.2
Revision: 1
Distribution: 10.7, 10.8, 10.9, 10.4
Depends: %n-core (>= %v-%r)
Conflicts: perl5123, perl5124, perl5162, perl5182
Replaces: perl5123, perl5124, perl5162, perl5182
License: Artistic
Description: The Perl programming language, v. 5.18.2
DescDetail: <<
Perl is a high-level programming language with roots in C, sed, awk
and shell scripting.  Perl is good at handling processes and files,
and is especially good at handling text.  Perl's hallmarks are
practicality and efficiency.  While it is used to do a lot of
different things, Perl's most common applications are system
administration utilities and web programming.  A large proportion of
the CGI scripts on the web are written in Perl.

Fink's perl packages retain the perl version subdirectories in the
lib tree.  Without these, upgrading or downgrading Perl breaks all of
the binary modules.
<<
DescPort: <<
Disabled 'make test', since one test fails.

Because the perl build system is designed to download source files for
"extra" perlmodules directly from CPAN, we do not include those "extra" 
perlmodules in this package.  For that reason, the following packages
which are Provided by Apple's build of perl5.18.2 on 10.10 are not provided
here:
  convert-tnef-pm5182, html-parser-pm5182, 
  perl-objcbridge-pm5182, scalar-list-utils-pm5182, uri-pm5182, 
  algorithm-diff-pm5182, class-autouse-pm5182, corefoundation-pm5182, 
  data-hierarcy-pm5182, freezethaw-pm5182, io-pager-pm5182, 
  locale-maketext-lexicon-pm5182, perlio-eol-pm5182

"be_BY" locales are known broken on Darwin (at least through Darwin 12), so 
disable testing them.
http://grokbase.com/t/perl/perl5-porters/1289z1msea/whats-blocking-5-14-3
perl bug #35895
radar://4139653 (?)
<<
DescUsage: <<
Most perl scripts start with #!/usr/bin/perl which will invoke Apple's
/usr/bin/perl. This package does not alter /usr/bin/perl. If you wish
to use this version of perl in scripts, the script should begin with
#!%p/bin/perl5.18.2 instead of #!/usr/bin/perl
<<
Source: mirror:cpan:src/5.0/perl-%v.tar.bz2
Source-MD5: d549b16ee4e9210988da39193a9389c1
CompileScript: <<
#!/bin/sh -ev
 sh Configure -desr -Dcc="gcc" -Dcpp="-gcc -E" -Dprefix=%p 
-Dccflags=-I%p/include -Dldflags=-L%p/lib -Dperladmin=none -Uinstallusrbinperl 
-Dprivlib="%p/lib/perl5-core/5.18.2" 
-Darchlib="%p/lib/perl5-core/5.18.2/darwin-thread-multi-2level" 
-Dman3dir="%p/lib/perl5-core/5.18.2/man/man3" -Dman3ext=3pm 
-Dscriptdir="%p/bin" -Duseithreads -Dinc_version_list=none 
-Adefine:startperl="#!%p/bin/perl5.18.2" -Adefine:perlpath="%p/bin/perl5.18.2"
 make
<<
DocFiles: README Copying
InfoTest: <<
        TestScript: <<
                make test || exit 2
        <<
<<

InstallScript: <<
 make install DESTDIR=%d

 mkdir -p %i/etc/profile.d
 echo "append_path MANPATH %p/lib/perl5-core/5.18.2/man" >> 
%i/etc/profile.d/%N-core.csh
 echo "append_path MANPATH %p/lib/perl5/5.18.2/man" >> 
%i/etc/profile.d/%N-core.csh
 echo "append_path MANPATH %p/lib/perl5-core/5.18.2/man" >> 
%i/etc/profile.d/%N-core.sh
 echo "append_path MANPATH %p/lib/perl5/5.18.2/man" >> 
%i/etc/profile.d/%N-core.sh
 echo "export MANPATH" >> %i/etc/profile.d/%N-core.sh
 chmod 755 %i/etc/profile.d/%N-core.*

<<
SplitOff: <<
 Package: %N-core
 Conflicts: compress-zlib-pm (<= 1.19-2), crypt-ssleay-pm (<= 0.45-2), 
dbd-mysql-pm (<= 2.1026-1), dbd-pg-pm (<= 1.21-4), dbd-pg-pm-ssl (<= 1.21-4), 
dbi-pm (<= 1:1.35-1), digest-md5-pm (<= 2.24-1), digest-sha1-pm (<= 2.02-1), 
egd (<= 0.8-3), eperl-pm (<= 2.2.14-2), filter-util-pm (<= 1.26-1), fribidi-pm 
(<= 0.05-2), ftlib-pm (<= 1.2-1), gd-pm (<= 2.06-5), gimp-perl (<= 1.211-4), 
gtk-perl-pm (<= 0.7008-7), html-parser-pm (<= 3.27-1), http-ghttp-pm (<= 
1.07-1), irssi-ssl (<= 0.8.6-3), irssi (<= 0.8.6-2), jcode-pm (<= 0.82-1), 
libapreq-pm (<= 1.0-1), mac-carbon-pm (<= 0.05-1), macosx-file-pm (<= 0.64-1), 
mime-base64-pm (<= 2.18-1), net-ssleay-pm (<= 1.22-2), nkf (<= 1.92-1), 
params-validate-pm (<= 0.57-1), pdl (<= 2.3.2-1), perlmagick-pm (<= 5.5.4-1), 
pgplot-perl (<= 2.18-4), postgresql-perl (<= 7.3.2-7), postgresql-ssl-perl (<= 
7.3.2-7), rrdtool-perl (<= 1.0.41-1), scalar-list-utils-pm (<= 1.11-1), sha-pm 
(<= 1.2-2), shout-pm (<= 1.0-1), storable-pm (<= 1.0.14-1), string-approx-pm 
(<= 3.19-1), template-notex-pm (<= 2.08-13), template-pm (<= 2.08-13), 
term-readkey-pm (<= 2.21-1), term-readline-gnu-pm (<= 1.13-1), text-iconv-pm 
(<= 1.2-1), time-hires-pm (<= 1.46-1), time-piece-pm (<= 1.08-1), tk-pm (<= 
800.024-2), tk-tablematrix-pm (<= 1.01-1), unicode-string-pm (<= 2.07-1), 
xml-parser-pm (<= 2.31-4), xmms-pm (<= 0.12-2)
 Provides: <<
  archive-tar-pm5182,
  attribute-handlers-pm5182,
  carp-pm5182,
  cgi-pm5182,
  compress-raw-bzip2-pm5182,
  compress-raw-zlib-pm5182,
  compress-zlib-pm5182,
  cpanplus-dist-build-pm5182,
  cpanplus-pm5182,
  cpan-meta-requirements-pm5182,
  data-dumper-pm5182,
  db-pm5182,
  devel-peek-pm5182,
  digest-md5-pm5182,
  digest-pm5182,
  digest-sha-pm5182,
  extutils-cbuilder-pm5182,
  extutils-makemaker-pm5182,
  extutils-parsexs-pm5182,
  file-find-pm5182,
  file-path-pm5182,
  file-spec-pm5182,
  file-temp-pm5182,
  filter-simple-pm5182,
  getopt-long-pm5182,
  http-tiny-pm5182,
  i18n-langtags-pm5182,
  io-zlib-pm5182,
  libnet-pm5182,
  list-util-pm5182,
  locale-maketext-pm5182,
  locale-maketext-simple-pm5182,
  math-bigint-pm5182,
  memoize-pm5182,
  mime-base64-pm5182,
  module-build-pm5182,
  module-corelist-pm5182,
  module-load-conditional-pm5182,
  module-load-pm5182,
  module-pluggable-pm5182,
  package-constants-pm5182,
  params-check-pm5182,
  perl-ostype-pm5182,
  pod-escapes-pm5182,
  pod-parser-pm5182,
  pod-simple-pm5182,
  sys-syslog-pm5182,
  term-readline-pm5182,
  test-harness-pm5182,
  test-simple-pm5182,
  text-tabs-pm5182,
  text-wrap-pm5182,
  time-hires-pm5182,
  unicode-normalize-pm5182
 <<
 Files: bin/perl5.18.2 etc lib/perl5 lib/perl5-core
 Description: Core files for perl, v. 5.18.2
 DocFiles: README Copying
<<
DescPackaging: <<
 We split the perl5.18.2 binary and the files in lib/perl5* off as a separate
 "core" package which does not conflict with other versions of perl.
 %p/bin/perl and other binaries remain in the perl5182 package, and
 different versions of perl can be selected by installing a different
 package instead.

 We now use lib/perl5-core as the main installation directory to avoid
 conflicts with fink-installed perl modules.

 We do not supply perl5182 on 10.10, since that's the one supplied by Apple.
<<
Homepage: http://www.cpan.org/
Maintainer: Fink Core Group <fink-core@lists.sourceforge.net>
Info4: <<
Package: fink
Version: 0.38.3
Revision: 81
Distribution: 10.4
Depends: base-files
Recommends: <<
 apt (>= 0.5.4-41)
<<
Conflicts: gcc3.1 (= 1175-6)
Replaces: gcc3.1 (= 1175-6)
Essential: yes
Source: mirror:custom:fink/%n-%v.tar.gz
Source-MD5: 70472425b59b0775a5c66384f63fd854
PatchFile: %n-10.4.patch
PatchFile-MD5: fb37eeab7c13aa42adecc2508da22ccb
NoSetPATH: true
BuildAsNobody: false
CompileScript: <<
 ./pre-build-test.sh
 make test PREFIX=%p ARCHITECTURE=%m DISTRIBUTION=10.4
 ./setup.sh %p %m
<<
InstallScript: <<
 ./install.sh %i %m
 install -c -p -m 644 fink.shlibs "%d/DEBIAN/shlibs"
<<
PostInstScript: <<
 %p/lib/fink/postinstall.pl %m
 %p/bin/fink --no-use-binary-dist index

 # try to clean up left-overs from previous versions (old location)
 rm -f %p/var/db/fink.db
 rm -f %p/var/db/shlibs.db
 rm -f %p/var/lib/fink/fink.db
<<
PreRmScript: <<
 # clean up package indexes
 [ \! -d %p/var/lib/fink/finkinfodb ] || touch 
%p/var/lib/fink/finkinfodb/invalidate
 rm -f %p/var/lib/fink/index.db
 rm -f %p/var/lib/fink/index.db.lock
 rm -f %p/var/lib/fink/infolist
 rm -f %p/var/lib/fink/shlibs.db
 rm -f %p/var/lib/fink/shlibs.db.lock
<<
#
Description: Open-source software package manager
DescPackaging: <<
 Don't use mirror:sourceforge so that older package manager versions
 which do not know that mirror can still selfupdate.

 Must put "make test" before "./setup.sh %p %m", because make test runs
 the setup script itself, but pointed at the testing directory.
 The second run of setup.sh properly points fink at the installed
 configuration file.

 We are using Conflicts/Replaces against gcc3.1 so that the Fink gcc3.1 
 package is removed (in favor of an Apple-supplied gcc 3.1, represented
 by a virtual package).
<<
DescDetail: <<
fink is the Fink project's package manager. It is responsible for
downloading and compiling source and building binary packages from
it. Binary package handling is then delegated to dpkg.
<<
License: GPL
Maintainer: Fink Core Group <fink-core@lists.sourceforge.net>
Homepage: http://www.finkproject.org/
CustomMirror: <<
Primary: http://downloads.sourceforge.net
afr-KE: http://liquidtelecom.dl.sourceforge.net/sourceforge
afr-ZA: http://tenet.dl.sourceforge.net/sourceforge
asi-JP: http://jaist.dl.sourceforge.net/sourceforge
asi-KZ: http://kaz.dl.sourceforge.net/sourceforge
asi-SG: http://softlayer-sng.dl.sourceforge.net/sourceforge
asi-TW: http://nchc.dl.sourceforge.net/sourceforge
asi-TW: http://ncu.dl.sourceforge.net/sourceforge
aus-AU: http://aarnet.dl.sourceforge.net/sourceforge
aus-AU: http://internode.dl.sourceforge.net/sourceforge
aus-AU: http://waia.dl.sourceforge.net/sourceforge
eur-CH: http://switch.dl.sourceforge.net/sourceforge
eur-CZ: http://cznic.dl.sourceforge.net/sourceforge
eur-CZ: http://ignum.dl.sourceforge.net/sourceforge
eur-DE: http://netcologne.dl.sourceforge.net/sourceforge
eur-DE: http://optimate.dl.sourceforge.net/sourceforge
eur-DE: http://skylink.dl.sourceforge.net/sourceforge
eur-FR: http://freefr.dl.sourceforge.net/sourceforge
eur-IE: http://heanet.dl.sourceforge.net/sourceforge
eur-IT: http://garr.dl.sourceforge.net/sourceforge
eur-RU: http://citylan.dl.sourceforge.net/sourceforge
eur-SE: http://sunet.dl.sourceforge.net/sourceforge
eur-UK: http://kent.dl.sourceforge.net/sourceforge
eur-UK: http://vorboss.dl.sourceforge.net/sourceforge
nam-CA: http://iweb.dl.sourceforge.net/sourceforge
nam-US: http://colocrossing.dl.sourceforge.net/sourceforge
nam-US: http://downloads.sourceforge.net
nam-US: http://softlayer-ams.dl.sourceforge.net/sourceforge
nam-US: http://softlayer-dal.dl.sourceforge.net/sourceforge
nam-US: http://superb-dca2.dl.sourceforge.net/sourceforge
nam-US: http://tcpdiag.dl.sourceforge.net/sourceforge
sam-BR: http://ufpr.dl.sourceforge.net/sourceforge
<<

<<
diff --git a/perlmod/Fink/PkgVersion.pm b/perlmod/Fink/PkgVersion.pm
index 6612936..4064318 100644
--- a/perlmod/Fink/PkgVersion.pm
+++ b/perlmod/Fink/PkgVersion.pm
@@ -5144,8 +5144,19 @@ sub get_env {
                        }
                }
                if (defined $s) {
-                       # %-expand and store if we have anything at all
-                       $script_env{$varname} = &expand_percent($s, $expand, 
$self->get_info_filename." \"set$varname\" or 
\%Fink::PkgVersion::get_env::defaults");
+                       # %-expand if we have anything at all
+                       $s = &expand_percent($s, $expand, 
$self->get_info_filename." \"set$varname\" or 
\%Fink::PkgVersion::get_env::defaults");
+               }
+        # user-defined environment variables may override a package-specific 
or fink-default value
+               if (defined $ENV{$varname}) {
+                       if ((defined $s) && ($s ne $ENV{$varname})) {
+                           print_breaking_stderr("WARNING: Using environment 
variable " . $varname . "=\"" . $ENV{$varname} . "\" for the build process even 
though the package or the fink defaults provide the value \"" . $s . "\".\n");
+                       }
+                       $s=$ENV{$varname};
+               }
+               # if we have anything, store it
+               if (defined $s) {
+                       $script_env{$varname}=$s;
                } else {
                        # otherwise do not set
                        delete $script_env{$varname};
@@ -5180,7 +5191,9 @@ sub get_env {
                # use path-prefix-* to give magic to 'gcc' and related commands
                # Clang isn't the default compiler for Xcode 4.x, so wrapping 
mandatory on 10.7 and 10.8/Xcode 4.x .
                # Includes unused argument error suppression for clang-5's C 
compiler for 10.8 and 10.9 .
-               $script_env{'PATH'} = ensure_clang_prefix() . ':' . 
$script_env{'PATH'}; 
+               if  ( $distro ge version->parse ("v10.7") ) {
+                       $script_env{'PATH'} = ensure_clang_prefix() . ':' . 
$script_env{'PATH'};
+               }
                if  ( $distro ge version->parse ("v10.9") ) {
                        # Use -stdlib=libc++ for c++/g++/clang++ on 10.9 and 
later.
                        # Also includes unused argument error suppression for 
clang-5's C++ compiler for 10.9.
@@ -5195,7 +5208,11 @@ sub get_env {
                        my ($JAVA_HOME, $subtype, $dir, $versions_dir, @dirs);
                        if ($subtype = $self->get_subtype('java')) {
                                $subtype = '' if ($subtype eq 'java');
-                               chomp ($JAVA_HOME=`/usr/libexec/java_home`);
+                               if (-x '/usr/libexec/java_home') {
+                                       chomp 
($JAVA_HOME=`/usr/libexec/java_home`);
+                               } else {
+                                       chomp ($JAVA_HOME=`/usr/bin/strings 
/usr/bin/java | /usr/bin/grep /Home\$`);
+                               }
                        }
                        $script_env{'JAVA_HOME'} = $JAVA_HOME unless 
$self->has_param('SetJAVA_HOME');
                        $script_env{'PATH'}      = $JAVA_HOME . '/bin:' . 
$script_env{'PATH'} unless $self->has_param('SetPATH');
diff --git a/perlmod/Fink/VirtPackage.pm b/perlmod/Fink/VirtPackage.pm
index 1370773..a4bf7c6 100644
--- a/perlmod/Fink/VirtPackage.pm
+++ b/perlmod/Fink/VirtPackage.pm
@@ -407,7 +407,9 @@ directories exist.
        # add hardcoded patterns for Javas which are known to be available 
        # on supported OS X so that their system-* packages will show up as
        # potentially installable.
-       my @jdktest = ( split (/\n/, `/usr/libexec/java_home -V 2>&1`),
+       my @jdktest = ( ( -x '/usr/libexec/java_home' ) ?
+                                       split (/\n/, `/usr/libexec/java_home -V 
2>&1`) :
+                                       '1.4.2_AB-bCD-EFG.H, ' . 
Fink::FinkVersion::get_arch() . ':    "Java SE 6" ' . `/usr/bin/strings 
/usr/bin/java | /usr/bin/grep /Home\$`,
                                        '1.4.2_AB-bCD-EFG.H, x86_64:    "Java 
SE 6"     /System/Library/Java/JavaVirtualMachines/1.4.2.jdk/Contents/Home',
                                        '1.5.0_AB-bCD-EFG.H, x86_64:    "Java 
SE 6"     /System/Library/Java/JavaVirtualMachines/1.5.0.jdk/Contents/Home',
                                        '1.6.0_AB-bCD-EFG.H, x86_64:    "Java 
SE 6"     /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home',
@@ -753,6 +755,7 @@ END
        $hash->{compilescript} = &gen_compile_script($hash);
 
        chomp(my $xcodepath=`xcode-select -print-path 2>/dev/null`);
+       $xcodepath='/Developer' if !$xcodepath;
        # Xcode 4.3+ is relocatable
        my $result=`defaults read $xcodepath/../version 
CFBundleShortVersionString 2>&1`;
        my $xcode_app_version; # to use in the next entry
diff --git a/setup.sh b/setup.sh
index 042f5fe..ed9ca21 100755
--- a/setup.sh
+++ b/setup.sh
@@ -85,8 +85,11 @@ sed "s|@PREFIX@|$basepath|g" <fink-dpkg-status-cleanup.in 
>fink-dpkg-status-clea
 # apt-get-lockwait
 
 # set arguments for pack() up in an architecture-appropriate manner
-# These are appropriate for x86_64:
-packargs='"qqiss", 0, 0'
+if [ "$architecture" = "x86_64" -o "$architecture" = "powerpc64" ]; then
+       packargs='"qqiss", 0, 0'
+else
+       packargs='"lllliss", (0, 0), (0, 0)'
+fi
 
 echo "Creating lockwait wrappers..."
 for prog in dpkg; do
Package: ntp
Version: 4.2.8
Revision: 1
Depends: libedit-shlibs (>= 3.0-2), libncurses5-shlibs (>= 5.4-20041023-1011), 
openssl100-shlibs
BuildDepends: libedit (>= 3.0-2), libncurses5 (>= 5.4-20041023-1011), 
openssl100-dev
Source: http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-%v.tar.gz
Source-MD5: 6972a626be6150db8cfbd0b63d8719e7
PatchFile: %n.patch
PatchFile-MD5: 330a2ba6fcf451dafe14c1cfcc160306
SetCFLAGS: -Os -DHAVE_SNPRINTF -DHAVE_VSNPRINTF
SetLDFLAGS: -lresolv
ConfigureParams: --mandir=%p/share/man --with-extra-includes=%p/include 
--with-extra-libs=%p/lib --disable-dependency-tracking --enable-ipv6 
--enable-all-clocks --enable-ignore-dns-errors --enable-DUMBCLOCK
InstallScript: <<
  make install DESTDIR=%d perllibdir=%p/lib/perl5
  rmdir %i/libexec %i/lib/pkgconfig %i/include/event2 %i/include
<<
DocFiles: COPYRIGHT C*Log* NEWS NOTES* README* TODO WHERE*
License: OSI-Approved
Homepage: http://www.ntp.org
Maintainer: Jack Fink <jackf...@users.sourceforge.net>
Description: The Network Time Protocol

--- ntp-4.2.8/ntpd/ntp_io.c.orig        2014-12-19 11:56:55.000000000 +0000
+++ ntp-4.2.8/ntpd/ntp_io.c     2015-01-16 10:18:22.000000000 +0000
@@ -3454,15 +3454,15 @@
        if (AF_INET6 == itf->family) {
                DPRINTF(1, ("Got an IPv6 packet, from <%s> (%d) to <%s> (%d)\n",
                        stoa(&rb->recv_srcadr),
-                       IN6_IS_ADDR_LOOPBACK(&rb->recv_srcadr),
+                       IN6_IS_ADDR_LOOPBACK(&rb->recv_srcadr.sa6.sin6_addr),
                        stoa(&itf->sin),
-                       !IN6_IS_ADDR_LOOPBACK(&itf->sin)
+                       !IN6_IS_ADDR_LOOPBACK(&itf->sin.sa6.sin6_addr)
                        ));
        }
 
        if (   AF_INET6 == itf->family
-           && IN6_IS_ADDR_LOOPBACK(&rb->recv_srcadr)
-           && !IN6_IS_ADDR_LOOPBACK(&itf->sin)
+           && IN6_IS_ADDR_LOOPBACK(&rb->recv_srcadr.sa6.sin6_addr)
+           && !IN6_IS_ADDR_LOOPBACK(&itf->sin.sa6.sin6_addr)
           ) {
                packets_dropped++;
                DPRINTF(1, ("DROPPING that packet\n"));
Package: libidn
Version: 1.22
Revision: 6
Description: Internationalized domain names
Type: java(1.4)
License: LGPL
Maintainer: Benjamin Reed <lib...@fink.raccoonfink.com>

Depends: <<
        %N-shlibs (= %v-%r),
        pkgconfig (>= 0.23-1)
<<
BuildDepends: <<
        fink (>= 0.30.0-1),
        fink-package-precedence (>= 0.7-1),
        gettext-bin,
        gettext-tools,
        gtk-doc,
        libiconv-dev,
        libgettext8-dev,
        pkgconfig (>= 0.23-1),
        system-java-dev (>= 1.4-1)
<<
BuildDependsOnly: true
InfoTest:       TestScript: DYLD_LIBRARY_PATH=%b/lib/.libs make check

Source: mirror:gnu:%n/%n-%v.tar.gz
Source-MD5: 893a1df0cf3b28b72d248382eaeaca71
PatchScript: <<
        %{default_script}
        perl -pi -e 's,g_utf8,idn_utf8,g' lib/*.c
        perl -pi -e 's,for ac_prog in gcj,for ac_prog in false,' configure
<<
PatchFile: %n.patch
PatchFile-MD5: 979f877f2191edaeeeb48e4fec3dc04c

NoSetCPPFLAGS: true
NoSetLDFLAGS: true
UseMaxBuildJobs: true
ConfigureParams: --mandir=%p/share/man --infodir=%p/share/info --enable-gtk-doc 
--enable-java --disable-csharp
CompileScript: <<
        #!/bin/sh -ex
        
        rm -f java/*.jar
        export lt_cv_sys_max_cmd_len=65536
        export ac_cv_prog_JAVAC=javac
        ./configure %c
        make
        fink-package-precedence --prohibit-bdep %N .
<<

InstallScript: <<
#!/bin/sh -ex

        make -j1 install DESTDIR="%d"
        pushd doc
        make -j1 install-man1 install-man3 DESTDIR="%d"
        pushd java
        make -j1 install DESTDIR="%d"
        popd
        install -d -m 755 %i/share/info
        install -m 755 libidn.info %i/share/info
        popd

        rm -rf %i/share/java
        # don't want to builddepend on emacs just for some elc's  :P
        rm -rf %i/share/emacs
<<
DocFiles: AUTHORS COPYING* ChangeLog FAQ INSTALL NEWS README* THANKS TODO 
doc/libidn.html doc/libidn.ps doc/libidn.pdf
SplitOff: <<
        Package: %N-shlibs
        Description: Shared libraries for libidn
        Depends: libgettext8-shlibs, libiconv
        Files: lib/libidn.*.dylib
        Shlibs: %p/lib/libidn.11.dylib 18.0.0 %N-shlibs (>= 1.22-1)
<<
SplitOff2: <<
        Package: %N-java
        Description: Java implementation of libidn
        Depends: system-java (>= 1.4-1)
        JarFiles: java/%N-%v.jar
<<
SplitOff3: <<
        Package: %N-bin
        Description: Command-line tools for libidn
        Depends: <<
                %N-shlibs (>= %v-%r),
                libgettext8-shlibs
        <<
        Replaces: %N (<< 0.5.18-1)
        Files: bin share/locale share/man/man1 share/info
        InfoDocs: libidn.info
<<

Homepage: http://www.gnu.org/software/libidn/

diff -Nurd libidn-1.22/Makefile.in libidn-1.22-new/Makefile.in
--- libidn-1.22/Makefile.in     2011-05-04 14:38:11.000000000 -0400
+++ libidn-1.22-new/Makefile.in 2011-05-13 09:33:10.000000000 -0400
@@ -976,7 +976,7 @@
 top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
-SUBDIRS = gl lib/gl lib po src doc gltests lib/gltests tests examples  \
+SUBDIRS = gl lib/gl lib po src gltests lib/gltests tests examples      \
        java csharp
 
 
diff -Nurd libidn-1.22/java/gnu/inet/encoding/Makefile.in 
libidn-1.22-new/java/gnu/inet/encoding/Makefile.in
--- libidn-1.22/java/gnu/inet/encoding/Makefile.in      2011-05-04 
14:38:10.000000000 -0400
+++ libidn-1.22-new/java/gnu/inet/encoding/Makefile.in  2011-05-13 
23:13:42.000000000 -0400
@@ -34,6 +34,7 @@
 # License along with GNU Libidn; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 # 02110-1301, USA.
+AM_JAVACFLAGS = -target 1.4 -source 1.4
 VPATH = @srcdir@
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
diff -Nurd libidn-1.22/java/misc/Makefile.in 
libidn-1.22-new/java/misc/Makefile.in
--- libidn-1.22/java/misc/Makefile.in   2011-05-04 14:38:10.000000000 -0400
+++ libidn-1.22-new/java/misc/Makefile.in       2011-05-13 09:33:39.000000000 
-0400
@@ -895,7 +895,7 @@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 JAVAROOT = $(top_builddir)/java/misc
-AM_JAVACFLAGS = -classpath 
$(top_builddir)/java/libidn-$(VERSION).jar:$(top_srcdir)/java/libidn-$(VERSION).jar
+AM_JAVACFLAGS = -classpath 
$(top_builddir)/java/libidn-$(VERSION).jar:$(top_srcdir)/java/libidn-$(VERSION).jar
 -target 1.4 -source 1.4
 @JAVA_TRUE@dist_noinst_JAVA = GenerateRFC3454.java GenerateNFKC.java   \
 @JAVA_TRUE@                    TestIDNA.java TestNFKC.java
 
Package: mutt
Version: 1.5.23
Revision: 2
Description: Sophisticated text-based mail user agent
License: GPL
Replaces: mutt-ssl (<< %v-%r)
BuildDepends: <<
  fink (>= 0.32),
  libgettext8-dev, libiconv-dev, libncurses5, libncursesw5, cyrus-sasl2-dev,
  libidn, tokyocabinet9, openssl100-dev
<<
Depends: <<
  ncurses, libncurses5-shlibs, libncursesw5-shlibs, cyrus-sasl2-shlibs,
  tokyocabinet9-shlibs, libidn-shlibs, openssl100-shlibs
<<
Source: ftp://ftp.mutt.org/%n/%n-%v.tar.gz
Source-MD5: 11f5b6a3eeba1afa1257fe93c9f26bff
PatchFile: mutt-CVE-2014-9116.patch
PatchFile-MD5: 450cc45dae43946a150e7aa9b3a3561c
PatchFile2: mutt-ansi-escape-segfault.patch
PatchFile2-MD5: 32df342b473670840c44a47a29e902ac
ConfFiles: %p/etc/Muttrc
DocFiles: GPL NEWS README README.SSL README.SECURITY TODO

PatchScript: <<
  perl -pi -e 's/(^[^=]*)\@DOTLOCK_GROUP\@/\1\$(DOTLOCK_GROUP)/g' Makefile.in
  patch -p1 < %{PatchFile}
  patch -p1 < %{PatchFile2}
<<
ConfigureParams: CPPFLAGS="-I%p/lib/system-openssl/include $CPPFLAGS" 
LDFLAGS="-L%p/lib/system-openssl/lib $LDFLAGS" --disable-dependency-tracking 
--with-mailpath=/var/mail --with-mixmaster --enable-imap --enable-pop 
--enable-smtp --enable-hcache --with-ssl --with-sasl --with-idn 
--mandir=%p/share/man --with-docdir=%p/share/doc/%n
InstallScript: <<
  make install DESTDIR=%d DOTLOCK_GROUP=
  mv %i/etc/mime.types %i/etc/mime.types.mutt
  mkdir -p %i/share/doc/%n/man
  mv %i/share/man/man5/mbox.5 %i/share/doc/%n/man/mbox.5.mutt
  echo "This package should be removed" > %i/share/doc/%n/mutt-ssl
<<
SplitOff: <<
  Package: mutt-ssl
  RuntimeDepends: %N (= %v-%r), fink-obsolete-packages
  Description: Dummy upgrade package for mutt with system-openssl
  Files: share/doc/%N/%n
  DescDetail: <<
    This package only exists to migrate users to the new unified mutt package.
    You can safely remove it.
  <<
<<  
PostInstScript: <<
  update-alternatives --install %p/etc/mime.types mime.types 
%p/etc/mime.types.mutt 40
  update-alternatives --install %p/share/man/man5/mbox.5 mbox.5 
%p/share/doc/%n/man/mbox.5.mutt 30
  chgrp mail %p/bin/mutt_dotlock
  chmod 2755 %p/bin/mutt_dotlock
<<
PreRmScript: <<
if [ $1 != "upgrade" ]; then
  update-alternatives --remove mime.types %p/etc/mime.types.mutt
  update-alternatives --remove mbox.5 %p/share/doc/%n/man/mbox.5.mutt
fi
<<
DescDetail: <<
Mutt is a sophisticated text-based Mail User Agent. Some highlights:

 o MIME support (including RFC1522 encoding/decoding of 8-bit message
   headers).
 o PGP/MIME support (RFC 2015).
 o IMAP support.
 o POP3 support.
 o Mailbox threading (both strict and non-strict).
 o Default keybindings are much like ELM.
 o Keybindings are configurable; Mush and PINE-like ones are provided as
   examples.
 o Handles MMDF, MH and Maildir in addition to regular mbox format.
 o Messages may be (indefinitely) postponed.
 o Colour support.
 o Highly configurable through easy but powerful rc file.
<<
DescPort: By default, mutt searches for a user's mbox file in /var/mail.
DescUsage: <<
You need to create a .muttrc before Mutt will do anything useful for you.
See /sw/share/doc/mutt/samples/ for example configs, and consult the muttrc(5)
man page for reference.
<<
Homepage: http://www.mutt.org
Maintainer: Brendan Cully <f...@brendan.cully.org>
This patch solves the issue raised by CVE-2014-9116 in bug 771125.

We correctly redefine what are the whitespace characters as per RFC5322; by
doing so we prevent mutt_substrdup from being used in a way that could lead to
a segfault.

The lib.c part was written by Antonio Radici <anto...@debian.org> to prevent
crashes due to this kind of bugs from happening again.

The wheezy version of this patch is slightly different, therefore this patch
has -jessie prefixed in its name.

The sendlib.c part was provided by Salvatore Bonaccorso and it is the same as
the upstream patch reported here:
http://dev.mutt.org/trac/attachment/ticket/3716/ticket-3716-stable.patch

--- a/lib.c
+++ b/lib.c
@@ -815,6 +815,9 @@ char *mutt_substrdup (const char *begin,
   size_t len;
   char *p;
 
+  if (end != NULL && end < begin)
+    return NULL;
+
   if (end)
     len = end - begin;
   else
--- a/sendlib.c
+++ b/sendlib.c
@@ -1814,7 +1814,12 @@ static int write_one_header (FILE *fp, i
     {
       tagbuf = mutt_substrdup (start, t);
       /* skip over the colon separating the header field name and value */
-      t = skip_email_wsp(t + 1);
+      ++t;
+
+      /* skip over any leading whitespace (WSP, as defined in RFC5322) */
+      while (*t == ' ' || *t == '\t')
+        t++;
+
       valbuf = mutt_substrdup (t, end);
     }
     dprint(4,(debugfile,"mwoh: buf[%s%s] too long, "
From: Antonio Radici <anto...@debian.org>
Date: Thu, 27 Feb 2014 16:56:37 +0100
Subject: 553321-ansi-escape-segfault

This patch prevents Mutt from crashing when *buf is freed,
the root cause is the fact that an adjacent memory segment
(*fmt) overruns and overwrite prev_size field in the heap.

The bug and the patch were forwarded upstream,
see http://bugs.mutt.org/3371

Gbp-Pq: Topic upstream
---
 pager.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pager.c b/pager.c
index b17afb4..7b61266 100644
--- a/pager.c
+++ b/pager.c
@@ -1053,7 +1053,7 @@ fill_buffer (FILE *f, LOFF_T *last_pos, LOFF_T offset, 
unsigned char **buf,
     q = *fmt;
     while (*p)
     {
-      if (*p == '\010' && (p > *buf))
+      if (*p == '\010' && (p > *buf) && (q > *fmt))
       {
        if (*(p+1) == '_')      /* underline */
          p += 2;
------------------------------------------------------------------------------
New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
GigeNET is offering a free month of service with a new server in Ashburn.
Choose from 2 high performing configs, both with 100TB of bandwidth.
Higher redundancy.Lower latency.Increased capacity.Completely compliant.
http://p.sf.net/sfu/gigenet
_______________________________________________
fink-core mailing list
fink-core@lists.sourceforge.net
List archive:
http://news.gmane.org/gmane.os.apple.fink.core
Subscription management:
https://lists.sourceforge.net/lists/listinfo/fink-core

Reply via email to