diff options
author | Michael Raskin <7c6f434c@mail.ru> | 2014-10-20 22:00:59 +0400 |
---|---|---|
committer | Michael Raskin <7c6f434c@mail.ru> | 2014-10-20 22:00:59 +0400 |
commit | 6b727e8d6803ac60be8322f014ded2eee9910d5b (patch) | |
tree | a59895f73e2b2b88cb2168dfd3e054381c55c0bc /pkgs | |
parent | c47d41d783fb960611d50f7db1842630e28fa26d (diff) | |
parent | 307af9148b46fd4358012e6a1dd01e49c3496f26 (diff) |
Merge pull request #4596 from abbradar/rpmextract
Add "rpmextract" script and use it
Diffstat (limited to 'pkgs')
-rw-r--r-- | pkgs/development/python-modules/rhpl/builder.sh | 2 | ||||
-rw-r--r-- | pkgs/development/python-modules/rhpl/default.nix | 4 | ||||
-rw-r--r-- | pkgs/servers/sql/oracle-xe/default.nix | 4 | ||||
-rw-r--r-- | pkgs/tools/archivers/rpmextract/default.nix | 23 | ||||
-rw-r--r-- | pkgs/tools/archivers/rpmextract/rpmextract.sh | 8 | ||||
-rw-r--r-- | pkgs/tools/filesystems/yandex-disk/default.nix | 4 | ||||
-rw-r--r-- | pkgs/tools/misc/megacli/default.nix | 6 | ||||
-rw-r--r-- | pkgs/top-level/all-packages.nix | 2 |
8 files changed, 43 insertions, 10 deletions
diff --git a/pkgs/development/python-modules/rhpl/builder.sh b/pkgs/development/python-modules/rhpl/builder.sh index b37e9081832f..dc93effe802f 100644 --- a/pkgs/development/python-modules/rhpl/builder.sh +++ b/pkgs/development/python-modules/rhpl/builder.sh @@ -1,6 +1,6 @@ source $stdenv/setup -rpm2cpio $src | cpio -idv +rpmextract $src tar xfvj rhpl-*.tar.bz2 rm rhpl-*.tar.bz2 cd rhpl-* diff --git a/pkgs/development/python-modules/rhpl/default.nix b/pkgs/development/python-modules/rhpl/default.nix index 92330a378c89..ee1d0ec1738b 100644 --- a/pkgs/development/python-modules/rhpl/default.nix +++ b/pkgs/development/python-modules/rhpl/default.nix @@ -1,4 +1,4 @@ -{stdenv, fetchurl, rpm, cpio, python, wirelesstools, gettext}: +{stdenv, fetchurl, rpmextract, python, wirelesstools, gettext}: stdenv.mkDerivation { name = "rhpl-0.218"; @@ -12,5 +12,5 @@ stdenv.mkDerivation { builder = ./builder.sh; - buildInputs = [ rpm cpio python wirelesstools gettext ]; + buildInputs = [ rpmextract python wirelesstools gettext ]; } diff --git a/pkgs/servers/sql/oracle-xe/default.nix b/pkgs/servers/sql/oracle-xe/default.nix index 57ff50175bb5..cd333152a2ae 100644 --- a/pkgs/servers/sql/oracle-xe/default.nix +++ b/pkgs/servers/sql/oracle-xe/default.nix @@ -1,4 +1,4 @@ -{ stdenv, makeWrapper, requireFile, patchelf, rpm, cpio, libaio }: +{ stdenv, makeWrapper, requireFile, patchelf, rpmextract, libaio }: assert stdenv.system == "x86_64-linux"; @@ -20,7 +20,7 @@ stdenv.mkDerivation rec { unpackCmd = '' (mkdir -p "${name}" && cd "${name}" && - ${rpm}/bin/rpm2cpio "$curSrc" | ${cpio}/bin/cpio -id) + ${rpmextract}/bin/rpmextract "$curSrc") ''; buildPhase = let diff --git a/pkgs/tools/archivers/rpmextract/default.nix b/pkgs/tools/archivers/rpmextract/default.nix new file mode 100644 index 000000000000..bee5a71333a7 --- /dev/null +++ b/pkgs/tools/archivers/rpmextract/default.nix @@ -0,0 +1,23 @@ +{ stdenv, fetchurl, rpm, cpio, substituteAll }: + +stdenv.mkDerivation rec { + name = "rpmextract"; + + builder = builtins.toFile "builder.sh" '' + source $stdenv/setup + + install -Dm755 $script $out/bin/rpmextract + ''; + + script = substituteAll { + src = ./rpmextract.sh; + inherit rpm cpio; + }; + + meta = with stdenv.lib; { + description = "Script to extract RPM archives"; + platforms = platforms.all; + license = licenses.gpl2; + maintainers = maintainers.abbradar; + }; +} diff --git a/pkgs/tools/archivers/rpmextract/rpmextract.sh b/pkgs/tools/archivers/rpmextract/rpmextract.sh new file mode 100644 index 000000000000..b910a9926063 --- /dev/null +++ b/pkgs/tools/archivers/rpmextract/rpmextract.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +if [ "$1" = "" ]; then + echo "usage: rpmextract package_name" 1>&2 + exit 1 +fi + +@rpm@/bin/rpm2cpio "$1" | @cpio@/bin/cpio -idv diff --git a/pkgs/tools/filesystems/yandex-disk/default.nix b/pkgs/tools/filesystems/yandex-disk/default.nix index e33f46ea9ccd..8b0b3a9898b2 100644 --- a/pkgs/tools/filesystems/yandex-disk/default.nix +++ b/pkgs/tools/filesystems/yandex-disk/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, writeText, zlib, rpm, cpio, patchelf, which }: +{ stdenv, fetchurl, writeText, zlib, rpmextract, patchelf, which }: assert stdenv.isLinux; @@ -31,7 +31,7 @@ stdenv.mkDerivation rec { mkdir -pv unpacked cd unpacked - ${rpm}/bin/rpm2cpio $src | ${cpio}/bin/cpio -imd + ${rpmextract}/bin/rpmextract $src cp -r -t $out/bin usr/bin/* cp -r -t $out/share usr/share/* diff --git a/pkgs/tools/misc/megacli/default.nix b/pkgs/tools/misc/megacli/default.nix index 7fd6ce966d6d..2d45bee49076 100644 --- a/pkgs/tools/misc/megacli/default.nix +++ b/pkgs/tools/misc/megacli/default.nix @@ -1,4 +1,4 @@ -{ stdenv, rpm, cpio, ncurses, patchelf, makeWrapper, requireFile, unzip }: +{ stdenv, rpmextract, ncurses, patchelf, makeWrapper, requireFile, unzip }: assert stdenv.system == "x86_64-linux"; @@ -12,7 +12,7 @@ stdenv.mkDerivation rec { sha256 = "11jzvh25mlygflazd37gi05xv67im4rgq7sbs5nwgw3gxdh4xfjj"; }; - buildInputs = [rpm cpio ncurses unzip makeWrapper]; + buildInputs = [rpmextract ncurses unzip makeWrapper]; libPath = stdenv.lib.makeLibraryPath [ stdenv.gcc.gcc stdenv.gcc.libc ncurses ]; @@ -21,7 +21,7 @@ stdenv.mkDerivation rec { mkdir -p $out/bin cd $out unzip ${src} - rpm2cpio linux/MegaCli-8.07.07-1.noarch.rpm | cpio -idmv + rpmextract linux/MegaCli-8.07.07-1.noarch.rpm ${patchelf}/bin/patchelf --interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" --set-rpath ${libPath}:$out/opt/lsi/3rdpartylibs/x86_64:$out/opt/lsi/3rdpartylibs:${stdenv.gcc.gcc}/lib64:${stdenv.gcc.gcc}/lib opt/MegaRAID/MegaCli/MegaCli64 wrapProgram $out/opt/MegaRAID/MegaCli/MegaCli64 --set LD_LIBRARY_PATH $out/opt/lsi/3rdpartylibs/x86_64 ln -s $out/opt/MegaRAID/MegaCli/MegaCli64 $out/bin/MegaCli64 diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 8fe787cc82d0..0f38232c54dd 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -2172,6 +2172,8 @@ let rpm = callPackage ../tools/package-management/rpm { }; + rpmextract = callPackage ../tools/archivers/rpmextract { }; + rrdtool = callPackage ../tools/misc/rrdtool { }; rtorrent = callPackage ../tools/networking/p2p/rtorrent { }; |