@@ -1,36 +1,42 @@
11{ stdenv, fetchurl }:
22
3−stdenv.mkDerivation {
4− name = "stun-0.96.dfsg-5";
3+stdenv.mkDerivation rec {
4+ name = "${pname}-${version}";
5+ pname = "stun";
6+ version = "0.97";
57
68 src = fetchurl {
7− url = mirror://debian/pool/main/s/stun/stun_0.96.dfsg.orig.tar.gz;
8− sha256 = "09bnb3p6h8fhsskdp4wrl9hhml1va0xb28fkwgyzs32q2333pgz4";
9+ url = "mirror://sourceforge/${pname}/stund-${version}.tgz";
10+ sha256 = "1mxirnnqfqdwb9x8hfjjsscp6lx3468ph6ddx32l94ir46fbzqc3";
911 };
1012
11− # make it compile on x86_64-linux:
12− postUnpack = ''
13− sed -i 's@|| defined(__i386__)@|| defined(__x86_64__) || defined(__i386__)@' stund/stun.cxx
13+ srcManpages = fetchurl {
14+ url = "mirror://ubuntu/pool/universe/s/stun/stun_0.97~dfsg-2.debian.tar.xz";
15+ name = "stun-debian.tar.xz";
16+ sha256 = "1pr6zrdhia0aafsvywl1hrhlgl00vahp63bw1z2mzvdxri7q88f0";
17+ };
18+
19+ outputs = [ "out" "server" ];
20+
21+ preBuild = ''
22+ tar Jxvf ${srcManpages} debian/manpages
23+ gzip -9 debian/manpages/stun.1
24+ gzip -9 debian/manpages/stund.8
1425 '';
1526
1627 installPhase = ''
17− mkdir -p $out/{bin,man/man8,man/man1}
18− cp client $out/bin/stun
19− cp server $out/bin/stund
20− cp debian/manpages/stund.8 $out/man/man8
21− cp debian/manpages/stun.1 $out/man/man1
28+ mkdir -p $out/bin $server/bin $out/man/man1 $server/man/man8
29+ cp -v client $out/bin/stun
30+ cp -v server $server/bin/stund
31+ cp -v debian/manpages/stun.1.gz $out/man/man1
32+ cp -v debian/manpages/stund.8.gz $server/man/man8
2233 '';
2334
24− patches = fetchurl {
25− url = mirror://debian/pool/main/s/stun/stun_0.96.dfsg-5.diff.gz;
26− sha256 = "0a6iig58zykdab89b99v1w4fn3gf2d8wz9c01vx2zvlg22gyji0l";
27− };
28−
29− meta = {
35+ meta = with stdenv.lib; {
3036 description = "Stun server and test client";
31− homepage = http://sourceforge.net/projects/stun/;
32− license = stdenv.lib.licenses.vsl10;
33− maintainers = [ stdenv.lib.maintainers.marcweber ];
34− platforms = stdenv.lib.platforms.linux;
37+ homepage = http://sourceforge.net/projects/stun/;
38+ license = licenses.vsl10;
39+ maintainers = with maintainers; [ marcweber obadz ];
40+ platforms = platforms.linux;
3541 };
3642}