2012-10-07 15:02:46 +01:00
|
|
|
{stdenv, fetchurl, perl, CryptSSLeay, LWP, unzip, xz, dpkg, TimeDate, DBFile
|
2015-04-20 13:39:07 +01:00
|
|
|
, FileDesktopEntry, libxslt, docbook_xsl, python3, setuptools, makeWrapper
|
2015-08-31 13:39:44 +01:00
|
|
|
, perlPackages, curl, gnupg, diffutils
|
|
|
|
, sendmailPath ? "/var/setuid-wrappers/sendmail"
|
2012-10-07 15:02:46 +01:00
|
|
|
}:
|
2015-08-31 13:39:44 +01:00
|
|
|
|
2012-10-07 15:02:46 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2015-08-31 13:39:44 +01:00
|
|
|
version = "2.15.8";
|
2012-10-07 15:02:46 +01:00
|
|
|
name = "debian-devscripts-${version}";
|
2015-08-31 13:39:44 +01:00
|
|
|
|
2012-10-07 15:02:46 +01:00
|
|
|
src = fetchurl {
|
2015-04-20 13:39:07 +01:00
|
|
|
url = "mirror://debian/pool/main/d/devscripts/devscripts_${version}.tar.xz";
|
2015-08-31 13:39:44 +01:00
|
|
|
sha256 = "1zw7phaigncblxb3jp4m8pk165hylk1f088k51nhj9d7z5iz6bbx";
|
2012-10-07 15:02:46 +01:00
|
|
|
};
|
2015-08-31 13:39:44 +01:00
|
|
|
|
2012-10-07 15:02:46 +01:00
|
|
|
buildInputs = [ perl CryptSSLeay LWP unzip xz dpkg TimeDate DBFile
|
2015-04-20 13:39:07 +01:00
|
|
|
FileDesktopEntry libxslt python3 setuptools makeWrapper
|
2015-08-31 13:39:44 +01:00
|
|
|
perlPackages.ParseDebControl perlPackages.LWPProtocolHttps
|
|
|
|
curl gnupg diffutils ];
|
|
|
|
|
2012-10-07 15:02:46 +01:00
|
|
|
preConfigure = ''
|
|
|
|
export PERL5LIB="$PERL5LIB''${PERL5LIB:+:}${dpkg}";
|
2015-04-20 13:39:07 +01:00
|
|
|
tgtpy="$out/lib/${python3.libPrefix}/site-packages"
|
2012-10-07 15:02:46 +01:00
|
|
|
mkdir -p "$tgtpy"
|
|
|
|
export PYTHONPATH="$PYTHONPATH''${PYTHONPATH:+:}$tgtpy"
|
2015-08-31 13:39:44 +01:00
|
|
|
find po4a scripts -type f -exec sed -r \
|
|
|
|
-e "s@/usr/bin/gpg(2|)@${gnupg}/bin/gpg2@g" \
|
|
|
|
-e "s@/usr/(s|)bin/sendmail@${sendmailPath}@g" \
|
|
|
|
-e "s@/usr/bin/diff@${diffutils}/bin/diff@g" \
|
|
|
|
-e "s@/usr/bin/gpgv(2|)@${gnupg}/bin/gpgv2@g" \
|
|
|
|
-e "s@(command -v|/usr/bin/)curl@${curl}/bin/curl@g" \
|
|
|
|
-i {} +
|
|
|
|
sed -e "s@/usr/share/sgml/[^ ]*/manpages/docbook.xsl@${docbook_xsl}/xml/xsl/docbook/manpages/docbook.xsl@" -i scripts/Makefile
|
|
|
|
sed -r \
|
|
|
|
-e "s@/usr( |$|/)@$out\\1@g" \
|
|
|
|
-e "s@/etc( |$|/)@$out/etc\\1@g" \
|
|
|
|
-e 's/ translated_manpages//; s/--install-layout=deb//; s@--root="[^ ]*"@--prefix="'"$out"'"@' \
|
|
|
|
-i Makefile* */Makefile*
|
2012-10-07 15:02:46 +01:00
|
|
|
'';
|
2015-08-31 13:39:44 +01:00
|
|
|
|
|
|
|
makeFlags = [
|
|
|
|
"DESTDIR=$(out)"
|
|
|
|
"PREFIX="
|
|
|
|
"COMPL_DIR=/share/bash-completion/completions"
|
|
|
|
"PERLMOD_DIR=/share/devscripts"
|
|
|
|
];
|
|
|
|
|
2012-10-07 15:02:46 +01:00
|
|
|
postInstall = ''
|
2012-10-09 08:02:06 +01:00
|
|
|
sed -re 's@(^|[ !`"])/bin/bash@\1${stdenv.shell}@g' -i "$out/bin"/*
|
2012-10-07 15:02:46 +01:00
|
|
|
for i in "$out/bin"/*; do
|
|
|
|
wrapProgram "$i" \
|
|
|
|
--prefix PERL5LIB : "$PERL5LIB" \
|
2015-04-20 13:39:07 +01:00
|
|
|
--prefix PERL5LIB : "$out/share/devscripts" \
|
|
|
|
--prefix PYTHONPATH : "$out/lib/python3.4/site-packages"
|
2012-10-07 15:02:46 +01:00
|
|
|
done
|
|
|
|
'';
|
2015-08-31 13:39:44 +01:00
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
2012-10-07 15:02:46 +01:00
|
|
|
description = ''Debian package maintenance scripts'';
|
2015-08-31 13:39:44 +01:00
|
|
|
license = licenses.free; # Mix of public domain, Artistic+GPL, GPL1+, GPL2+, GPL3+, and GPL2-only... TODO
|
|
|
|
maintainers = with maintainers; [raskin];
|
2012-10-07 15:02:46 +01:00
|
|
|
};
|
|
|
|
}
|