2021-01-11 07:54:33 +00:00
|
|
|
{lib, stdenv, fetchurl, unzip, xz, dpkg
|
2018-12-15 03:50:31 +00:00
|
|
|
, libxslt, docbook_xsl, makeWrapper
|
2016-08-14 11:06:42 +00:00
|
|
|
, python3Packages
|
2015-08-31 12:39:44 +00:00
|
|
|
, perlPackages, curl, gnupg, diffutils
|
2017-01-29 10:11:01 +00:00
|
|
|
, sendmailPath ? "/run/wrappers/bin/sendmail"
|
2012-10-07 14:02:46 +00:00
|
|
|
}:
|
2015-08-31 12:39:44 +00:00
|
|
|
|
2016-08-14 11:06:42 +00:00
|
|
|
let
|
|
|
|
inherit (python3Packages) python setuptools;
|
|
|
|
in stdenv.mkDerivation rec {
|
2016-11-16 17:42:33 +00:00
|
|
|
version = "2.16.8";
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "debian-devscripts";
|
2015-08-31 12:39:44 +00:00
|
|
|
|
2012-10-07 14:02:46 +00:00
|
|
|
src = fetchurl {
|
2015-04-20 12:39:07 +00:00
|
|
|
url = "mirror://debian/pool/main/d/devscripts/devscripts_${version}.tar.xz";
|
2016-11-16 17:42:33 +00:00
|
|
|
sha256 = "0xy1nvqrnifx46g8ch69pk31by0va6hn10wpi1fkrsrgncanjjh1";
|
2012-10-07 14:02:46 +00:00
|
|
|
};
|
2015-08-31 12:39:44 +00:00
|
|
|
|
2021-02-20 21:01:53 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper unzip ];
|
|
|
|
buildInputs = [ xz dpkg libxslt python setuptools curl gnupg diffutils ] ++
|
2018-12-15 03:50:31 +00:00
|
|
|
(with perlPackages; [ perl CryptSSLeay LWP TimeDate DBFile FileDesktopEntry ParseDebControl LWPProtocolHttps ]);
|
2015-08-31 12:39:44 +00:00
|
|
|
|
2012-10-07 14:02:46 +00:00
|
|
|
preConfigure = ''
|
|
|
|
export PERL5LIB="$PERL5LIB''${PERL5LIB:+:}${dpkg}";
|
2016-08-14 11:06:42 +00:00
|
|
|
tgtpy="$out/lib/${python.libPrefix}/site-packages"
|
2012-10-07 14:02:46 +00:00
|
|
|
mkdir -p "$tgtpy"
|
|
|
|
export PYTHONPATH="$PYTHONPATH''${PYTHONPATH:+:}$tgtpy"
|
2015-08-31 12:39:44 +00:00
|
|
|
find po4a scripts -type f -exec sed -r \
|
2017-08-10 09:43:48 +00:00
|
|
|
-e "s@/usr/bin/gpg(2|)@${gnupg}/bin/gpg@g" \
|
2015-08-31 12:39:44 +00:00
|
|
|
-e "s@/usr/(s|)bin/sendmail@${sendmailPath}@g" \
|
|
|
|
-e "s@/usr/bin/diff@${diffutils}/bin/diff@g" \
|
2017-08-10 09:43:48 +00:00
|
|
|
-e "s@/usr/bin/gpgv(2|)@${gnupg}/bin/gpgv@g" \
|
2015-10-06 13:32:17 +00:00
|
|
|
-e "s@(command -v|/usr/bin/)curl@${curl.bin}/bin/curl@g" \
|
2015-08-31 12:39:44 +00:00
|
|
|
-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 14:02:46 +00:00
|
|
|
'';
|
2015-08-31 12:39:44 +00:00
|
|
|
|
|
|
|
makeFlags = [
|
|
|
|
"DESTDIR=$(out)"
|
|
|
|
"PREFIX="
|
|
|
|
"COMPL_DIR=/share/bash-completion/completions"
|
|
|
|
"PERLMOD_DIR=/share/devscripts"
|
|
|
|
];
|
|
|
|
|
2012-10-07 14:02:46 +00:00
|
|
|
postInstall = ''
|
2012-10-09 07:02:06 +00:00
|
|
|
sed -re 's@(^|[ !`"])/bin/bash@\1${stdenv.shell}@g' -i "$out/bin"/*
|
2012-10-07 14:02:46 +00:00
|
|
|
for i in "$out/bin"/*; do
|
|
|
|
wrapProgram "$i" \
|
|
|
|
--prefix PERL5LIB : "$PERL5LIB" \
|
2015-04-20 12:39:07 +00:00
|
|
|
--prefix PERL5LIB : "$out/share/devscripts" \
|
2018-03-25 07:00:31 +00:00
|
|
|
--prefix PYTHONPATH : "$out/lib/python3.4/site-packages" \
|
|
|
|
--prefix PATH : "${dpkg}/bin"
|
2012-10-07 14:02:46 +00:00
|
|
|
done
|
|
|
|
'';
|
2015-08-31 12:39:44 +00:00
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2021-01-24 09:19:10 +00:00
|
|
|
description = "Debian package maintenance scripts";
|
2015-08-31 12:39:44 +00:00
|
|
|
license = licenses.free; # Mix of public domain, Artistic+GPL, GPL1+, GPL2+, GPL3+, and GPL2-only... TODO
|
|
|
|
maintainers = with maintainers; [raskin];
|
2016-08-02 17:50:55 +00:00
|
|
|
platforms = with platforms; linux;
|
2012-10-07 14:02:46 +00:00
|
|
|
};
|
|
|
|
}
|