mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-16 14:54:29 +01:00
Adding atftp
svn path=/nixpkgs/trunk/; revision=28874
This commit is contained in:
parent
946458d4f9
commit
b612e07c0b
6 changed files with 15140 additions and 0 deletions
74
pkgs/development/libraries/tcp-wrappers/default.nix
Normal file
74
pkgs/development/libraries/tcp-wrappers/default.nix
Normal file
|
@ -0,0 +1,74 @@
|
|||
x@{builderDefsPackage
|
||||
, flex, bison
|
||||
, ...}:
|
||||
builderDefsPackage
|
||||
(a :
|
||||
let
|
||||
helperArgNames = ["stdenv" "fetchurl" "builderDefsPackage"] ++
|
||||
[];
|
||||
|
||||
buildInputs = map (n: builtins.getAttr n x)
|
||||
(builtins.attrNames (builtins.removeAttrs x helperArgNames));
|
||||
sourceInfo = rec {
|
||||
baseName="tcp-wrappers";
|
||||
version="7.6";
|
||||
name="${baseName}-${version}";
|
||||
url="http://ftp.porcupine.org/pub/security/tcp_wrappers_${version}.tar.gz";
|
||||
hash="0p9ilj4v96q32klavx0phw9va21fjp8vpk11nbh6v2ppxnnxfhwm";
|
||||
};
|
||||
in
|
||||
rec {
|
||||
src = a.fetchurl {
|
||||
url = sourceInfo.url;
|
||||
sha256 = sourceInfo.hash;
|
||||
};
|
||||
|
||||
inherit (sourceInfo) name version;
|
||||
inherit buildInputs;
|
||||
|
||||
/* doConfigure should be removed if not needed */
|
||||
phaseNames = ["setVars" "doUnpack" "fixMakefile" "doPatch"
|
||||
"doMake" "doDeploy"];
|
||||
|
||||
patches = [./have-strerror.patch ./trivial-fixes.patch];
|
||||
|
||||
makeFlags = [
|
||||
"REAL_DAEMON_DIR=$out/bin"
|
||||
"STYLE='\"-DHAVE_STRERROR -DSYS_ERRLIST_DEFINED\"'"
|
||||
"generic"
|
||||
];
|
||||
|
||||
setVars = a.noDepEntry ''
|
||||
export NIX_LDFLAGS="$NIX_LDFLAGS -lnsl"
|
||||
export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -fPIC"
|
||||
'';
|
||||
|
||||
fixMakefile = a.fullDepEntry ''
|
||||
chmod u+w Makefile
|
||||
echo 'libwrap.so: $(LIB_OBJ)' >> Makefile
|
||||
echo ' ld $(LIB_OBJ) --shared -o libwrap.so' >> Makefile
|
||||
'' ["minInit"];
|
||||
|
||||
doDeploy = a.fullDepEntry ''
|
||||
ensureDir "$out"/{sbin,lib}
|
||||
make libwrap.so
|
||||
cp libwrap.{a,so} "$out/lib"
|
||||
find . -perm +111 -a ! -name '*.*' -exec cp '{}' "$out/sbin" ';'
|
||||
'' ["defEnsureDir" "minInit"];
|
||||
|
||||
meta = {
|
||||
description = "Network logging TCP wrappers";
|
||||
maintainers = with a.lib.maintainers;
|
||||
[
|
||||
raskin
|
||||
];
|
||||
platforms = with a.lib.platforms;
|
||||
linux;
|
||||
license = "free-noncopyleft";
|
||||
};
|
||||
passthru = {
|
||||
updateInfo = {
|
||||
downloadPage = "http://ftp.porcupine.org/pub/security/index.html";
|
||||
};
|
||||
};
|
||||
}) x
|
20
pkgs/development/libraries/tcp-wrappers/have-strerror.patch
Normal file
20
pkgs/development/libraries/tcp-wrappers/have-strerror.patch
Normal file
|
@ -0,0 +1,20 @@
|
|||
Debian patch
|
||||
diff -ruN tcp_wrappers_7.6.orig/percent_m.c tcp_wrappers_7.6/percent_m.c
|
||||
--- tcp_wrappers_7.6.orig/percent_m.c 1994-12-28 17:42:37.000000000 +0100
|
||||
+++ tcp_wrappers_7.6/percent_m.c 2003-08-21 02:45:31.000000000 +0200
|
||||
@@ -29,11 +29,15 @@
|
||||
|
||||
while (*bp = *cp)
|
||||
if (*cp == '%' && cp[1] == 'm') {
|
||||
+#ifdef HAVE_STRERROR
|
||||
+ strcpy(bp, strerror(errno));
|
||||
+#else
|
||||
if (errno < sys_nerr && errno > 0) {
|
||||
strcpy(bp, sys_errlist[errno]);
|
||||
} else {
|
||||
sprintf(bp, "Unknown error %d", errno);
|
||||
}
|
||||
+#endif
|
||||
bp += strlen(bp);
|
||||
cp += 2;
|
||||
} else {
|
27
pkgs/development/libraries/tcp-wrappers/trivial-fixes.patch
Normal file
27
pkgs/development/libraries/tcp-wrappers/trivial-fixes.patch
Normal file
|
@ -0,0 +1,27 @@
|
|||
Debian patch
|
||||
diff -ruNp tcp_wrappers_7.6.orig/options.c tcp_wrappers_7.6/options.c
|
||||
--- tcp_wrappers_7.6.orig/options.c 2006-03-01 23:45:28.000000000 +0100
|
||||
+++ tcp_wrappers_7.6/options.c 2006-03-01 22:55:44.000000000 +0100
|
||||
@@ -41,6 +41,7 @@ static char sccsid[] = "@(#) options.c 1
|
||||
#include <netinet/in.h>
|
||||
#include <netdb.h>
|
||||
#include <stdio.h>
|
||||
+#include <unistd.h>
|
||||
#include <syslog.h>
|
||||
#include <pwd.h>
|
||||
#include <grp.h>
|
||||
diff -ruNp tcp_wrappers_7.6.orig/scaffold.c tcp_wrappers_7.6/scaffold.c
|
||||
--- tcp_wrappers_7.6.orig/scaffold.c 2006-03-01 23:45:28.000000000 +0100
|
||||
+++ tcp_wrappers_7.6/scaffold.c 2006-03-01 22:56:13.000000000 +0100
|
||||
@@ -17,6 +17,7 @@ static char sccs_id[] = "@(#) scaffold.c
|
||||
#include <arpa/inet.h>
|
||||
#include <netdb.h>
|
||||
#include <stdio.h>
|
||||
+#include <stdlib.h>
|
||||
#include <syslog.h>
|
||||
#include <setjmp.h>
|
||||
#include <string.h>
|
||||
@@ -28,3 +28,2 @@
|
||||
|
||||
-extern char *malloc();
|
||||
|
14965
pkgs/tools/networking/atftp/debian.patch
Normal file
14965
pkgs/tools/networking/atftp/debian.patch
Normal file
File diff suppressed because it is too large
Load diff
50
pkgs/tools/networking/atftp/default.nix
Normal file
50
pkgs/tools/networking/atftp/default.nix
Normal file
|
@ -0,0 +1,50 @@
|
|||
x@{builderDefsPackage
|
||||
, readline, tcp_wrappers, pcre
|
||||
, ...}:
|
||||
builderDefsPackage
|
||||
(a :
|
||||
let
|
||||
helperArgNames = ["stdenv" "fetchurl" "builderDefsPackage"] ++
|
||||
[];
|
||||
|
||||
buildInputs = map (n: builtins.getAttr n x)
|
||||
(builtins.attrNames (builtins.removeAttrs x helperArgNames));
|
||||
sourceInfo = rec {
|
||||
baseName="atftp";
|
||||
version="0.7";
|
||||
name="${baseName}-${version}";
|
||||
url="mirror://debian/pool/main/a/atftp/atftp_${version}.dfsg.orig.tar.gz";
|
||||
hash="0nd5dl14d6z5abgcbxcn41rfn3syza6s57bbgh4aq3r9cxdmz08q";
|
||||
};
|
||||
in
|
||||
rec {
|
||||
src = a.fetchurl {
|
||||
url = sourceInfo.url;
|
||||
sha256 = sourceInfo.hash;
|
||||
};
|
||||
|
||||
inherit (sourceInfo) name version;
|
||||
inherit buildInputs;
|
||||
|
||||
/* doConfigure should be removed if not needed */
|
||||
phaseNames = ["doPatch" "doConfigure" "doMakeInstall"];
|
||||
|
||||
patches = [./debian.patch];
|
||||
|
||||
meta = {
|
||||
description = "Advanced tftp tools";
|
||||
maintainers = with a.lib.maintainers;
|
||||
[
|
||||
raskin
|
||||
];
|
||||
platforms = with a.lib.platforms;
|
||||
linux;
|
||||
license = a.lib.licenses.gpl2Plus;
|
||||
};
|
||||
passthru = {
|
||||
updateInfo = {
|
||||
downloadPage = "http://packages.debian.org/source/sid/atftp";
|
||||
};
|
||||
};
|
||||
}) x
|
||||
|
|
@ -387,6 +387,8 @@ let
|
|||
|
||||
at = callPackage ../tools/system/at { };
|
||||
|
||||
atftp = callPackage ../tools/networking/atftp {};
|
||||
|
||||
autogen = callPackage ../development/tools/misc/autogen {
|
||||
guile = guile_1_8;
|
||||
};
|
||||
|
@ -4436,6 +4438,8 @@ let
|
|||
## inherit stdenv fetchurl cmake qt4 telepathy_qt;
|
||||
## };
|
||||
|
||||
tcp_wrappers = callPackage ../development/libraries/tcp-wrappers {};
|
||||
|
||||
tdb = callPackage ../development/libraries/tdb { };
|
||||
|
||||
tecla = callPackage ../development/libraries/tecla { };
|
||||
|
|
Loading…
Reference in a new issue