blob: da0554d49e607e7263582f9917cae1d204b4f516 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
{ lib, stdenv, fetchurl }:
# this expression is mostly based on debian's packaging
# https://tracker.debian.org/media/packages/u/udns/rules-0.4-1
stdenv.mkDerivation rec {
pname = "udns";
version = "0.4";
configurePhase = "./configure --enable-ipv6";
buildPhase = "make staticlib sharedlib rblcheck_s dnsget_s";
src = fetchurl {
url = "http://www.corpit.ru/mjt/udns/${pname}-${version}.tar.gz";
sha256 = "0447fv1hmb44nnchdn6p5pd9b44x8p5jn0ahw6crwbqsg7f0hl8i";
};
# udns uses a very custom build and hardcodes a .so name in a few places.
# Instead of fighting with it to apply the standard dylib script, change
# the right place in the Makefile itself.
postPatch =
if stdenv.isDarwin
then
''
substituteInPlace Makefile.in \
--replace --soname, -install_name,$out/lib/
''
else "";
installPhase = ''
runHook preInstall
mkdir -p $out/bin
mkdir -p $out/include
mkdir -p $out/lib
mkdir -p $out/share/man/man1
mkdir -p $out/share/man/man3
cp dnsget_s $out/bin/dnsget
cp rblcheck_s $out/bin/rblcheck
cp udns.h $out/include/
cp libudns.a $out/lib/
cp libudns.so.0 $out/lib/
ln -rs $out/lib/libudns.so.0 $out/lib/libudns.so
cp dnsget.1 rblcheck.1 $out/share/man/man1
cp udns.3 $out/share/man/man3
runHook postInstall
'';
# keep man3
outputDevdoc = "out";
meta = with lib; {
homepage = "http://www.corpit.ru/mjt/udns.html";
description = "Async-capable DNS stub resolver library";
license = licenses.lgpl21Plus;
maintainers = [ maintainers.womfoo ];
platforms = platforms.unix;
};
}
|