diff options
author | Arnold Krille <arnold@arnoldarts.de> | 2016-02-13 18:50:07 +0100 |
---|---|---|
committer | Arnold Krille <arnold@arnoldarts.de> | 2016-02-20 11:59:50 +0100 |
commit | c3b4dd920b50d6fd7625ada250d042b47fbd0217 (patch) | |
tree | f0bf5527d05cee4f82baded9dc6ce4a4a4a6575c /pkgs/applications/networking/sync | |
parent | 243c336022e9f324b721630a163bfa7b01939fa9 (diff) |
rsync/rrsync: less code duplication
- refactor the common parts all into the base.nix - add myself as maintainer
Diffstat (limited to 'pkgs/applications/networking/sync')
-rw-r--r-- | pkgs/applications/networking/sync/rsync/base.nix | 26 | ||||
-rw-r--r-- | pkgs/applications/networking/sync/rsync/default.nix | 20 | ||||
-rw-r--r-- | pkgs/applications/networking/sync/rsync/rrsync.nix | 18 | ||||
-rw-r--r-- | pkgs/applications/networking/sync/rsync/src.nix | 7 |
4 files changed, 41 insertions, 30 deletions
diff --git a/pkgs/applications/networking/sync/rsync/base.nix b/pkgs/applications/networking/sync/rsync/base.nix new file mode 100644 index 0000000000000..ef159d4d0e396 --- /dev/null +++ b/pkgs/applications/networking/sync/rsync/base.nix @@ -0,0 +1,26 @@ +{ stdenv, fetchurl }: + +let + version = "3.2.1"; +in +{ + version = version; + src = fetchurl { + # signed with key 0048 C8B0 26D4 C96F 0E58 9C2F 6C85 9FB1 4B96 A8C5 + url = "mirror://samba/rsync/src/rsync-${version}.tar.gz"; + sha256 = "1hm1q04hz15509f0p9bflw4d6jzfvpm1d36dxjwihk1wzakn5ypc"; + }; + patches = fetchurl { + # signed with key 0048 C8B0 26D4 C96F 0E58 9C2F 6C85 9FB1 4B96 A8C5 + url = "mirror://samba/rsync/rsync-patches-${version}.tar.gz"; + sha256 = "09i3dcl37p22dp75vlnsvx7bm05ggafnrf1zwhf2kbij4ngvxvpd"; + }; + + meta = with stdenv.lib; { + homepage = http://rsync.samba.org/; + #description = "A helper to run rsync-only environments from ssh-logins."; + license = licenses.gpl3Plus; + platforms = platforms.unix; + maintainers = with maintainers; [ simons ehmry kampfschlaefer ]; + }; +} \ No newline at end of file diff --git a/pkgs/applications/networking/sync/rsync/default.nix b/pkgs/applications/networking/sync/rsync/default.nix index 6608e32e8bcbe..8a4ff67e2eb5c 100644 --- a/pkgs/applications/networking/sync/rsync/default.nix +++ b/pkgs/applications/networking/sync/rsync/default.nix @@ -5,17 +5,15 @@ assert enableACLs -> acl != null; +let + base = import ./base.nix { inherit stdenv fetchurl; }; +in stdenv.mkDerivation rec { - name = "rsync-${version}"; - version = "3.1.2"; + name = "rsync-${base.version}"; - mainSrc = import ./src.nix { inherit fetchurl version; }; + mainSrc = base.src; - patchesSrc = fetchurl { - # signed with key 0048 C8B0 26D4 C96F 0E58 9C2F 6C85 9FB1 4B96 A8C5 - url = "mirror://samba/rsync/rsync-patches-${version}.tar.gz"; - sha256 = "09i3dcl37p22dp75vlnsvx7bm05ggafnrf1zwhf2kbij4ngvxvpd"; - }; + patchesSrc = base.patches; srcs = [mainSrc] ++ stdenv.lib.optional enableCopyDevicesPatch patchesSrc; patches = stdenv.lib.optional enableCopyDevicesPatch "./patches/copy-devices.diff"; @@ -25,11 +23,7 @@ stdenv.mkDerivation rec { configureFlags = "--with-nobody-group=nogroup"; - meta = with stdenv.lib; { - homepage = http://rsync.samba.org/; + meta = base.meta // { description = "A fast incremental file transfer utility"; - license = licenses.gpl3Plus; - platforms = platforms.unix; - maintainers = with maintainers; [ simons ehmry ]; }; } diff --git a/pkgs/applications/networking/sync/rsync/rrsync.nix b/pkgs/applications/networking/sync/rsync/rrsync.nix index 044a01993f9d0..6260fc0ddecaf 100644 --- a/pkgs/applications/networking/sync/rsync/rrsync.nix +++ b/pkgs/applications/networking/sync/rsync/rrsync.nix @@ -1,10 +1,12 @@ { stdenv, fetchurl, perl, rsync }: +let + base = import ./base.nix { inherit stdenv fetchurl; }; +in stdenv.mkDerivation rec { - name = "rrsync-${version}"; - version = "3.1.2"; + name = "rrsync-${base.version}"; - src = import ./src.nix { inherit fetchurl version; }; + src = base.src; buildInputs = [ rsync ]; nativeBuildInputs = [perl]; @@ -15,7 +17,7 @@ stdenv.mkDerivation rec { dontBuild = true; postPatch = '' - sed -i 's#/usr/bin/rsync#${rsync}/bin/rsync#' support/rrsync + substituteInPlace support/rrsync --replace /usr/bin/rsync ${rsync}/bin/rsync ''; installPhase = '' @@ -24,11 +26,7 @@ stdenv.mkDerivation rec { chmod a+x $out/bin/rrsync ''; - meta = with stdenv.lib; { - homepage = http://rsync.samba.org/; - description = "A helper to run rsync-only environments from ssh-logins."; - license = licenses.gpl3Plus; - platforms = platforms.unix; - maintainers = with maintainers; [ simons ehmry ]; + meta = base.meta // { + description = "A helper to run rsync-only environments from ssh-logins"; }; } diff --git a/pkgs/applications/networking/sync/rsync/src.nix b/pkgs/applications/networking/sync/rsync/src.nix deleted file mode 100644 index f6896d2c59853..0000000000000 --- a/pkgs/applications/networking/sync/rsync/src.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ version, fetchurl }: - -fetchurl { - # signed with key 0048 C8B0 26D4 C96F 0E58 9C2F 6C85 9FB1 4B96 A8C5 - url = "mirror://samba/rsync/src/rsync-${version}.tar.gz"; - sha256 = "1hm1q04hz15509f0p9bflw4d6jzfvpm1d36dxjwihk1wzakn5ypc"; -} \ No newline at end of file |