diff options
author | Alex Talker | 2017-04-08 19:20:00 +0300 |
---|---|---|
committer | Alex Talker | 2017-04-08 19:20:00 +0300 |
commit | c9316bffa4168d8370f65401d5ab7d200726b33c (patch) | |
tree | fe4dec2c9430c2fb4c2f8ff70a67ec1560be9dd8 | |
parent | 511100f022d3a36a33d80553d7f43b3d27caf05e (diff) | |
download | aur-c9316bffa4168d8370f65401d5ab7d200726b33c.tar.gz |
Split single package to few specific
-rw-r--r-- | .SRCINFO | 22 | ||||
-rw-r--r-- | PKGBUILD | 146 |
2 files changed, 115 insertions, 53 deletions
@@ -1,5 +1,5 @@ # Generated by mksrcinfo v8 -# Sat Apr 8 14:58:32 UTC 2017 +# Sat Apr 8 16:19:28 UTC 2017 pkgbase = scst pkgdesc = Generic SCSI Target Subsystem For Linux pkgver = 3.2.0.7058 @@ -9,10 +9,8 @@ pkgbase = scst arch = i686 arch = x86_64 license = GPL - depends = linux - depends = linux-headers - provides = scst - conflicts = scst + makedepends = linux + makedepends = linux-headers source = https://sourceforge.net/projects/scst/files/scst-.tar.bz2/download source = https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.10.8.tar.xz source = queue.patch @@ -21,4 +19,18 @@ pkgbase = scst md5sums = 0e0c06a0f050f8aca3824e7d371b9a50 pkgname = scst + pkgdesc = Generic SCSI Target Subsystem For Linux + depends = + +pkgname = scst_local + pkgdesc = Driver for support of local targets in SCST + depends = scst + +pkgname = iscsi-scst + pkgdesc = Driver & daemon for support iSCSI in SCST + depends = scst + +pkgname = scstadmin + pkgdesc = Administration utilit for SCST + depends = perl @@ -2,7 +2,7 @@ # Support Maintainer Filip Brcic < brcha at gna dot org > # Contributor bitwave < aur [at] oomlu [d0t] de > # Alex say thanks to Filip about support this package while he was away from Arch. -pkgname=scst +pkgname=(scst scst_local iscsi-scst scstadmin) pkgver=3.2.0.7058 kversion=4.10.8 pkgrel=1 @@ -10,10 +10,8 @@ pkgdesc="Generic SCSI Target Subsystem For Linux" arch=('i686' 'x86_64') url="http://scst.sourceforge.net" license=('GPL') -conflicts=("${pkgname}") -provides=("${pkgname}") install=${pkgname}.install -depends=('linux' 'linux-headers') +makedepends=('linux' 'linux-headers') source=( "https://sourceforge.net/projects/scst/files/scst-${version}.tar.bz2/download" "https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-${kversion}.tar.xz" @@ -25,16 +23,7 @@ md5sums=( '0e0c06a0f050f8aca3824e7d371b9a50' ) -prepare() { - cd "$srcdir"/scst* - - patch -Np0 -i "$srcdir/queue.patch" -} - -build() { - msg "Build package..." - cd "$srcdir"/scst* - +_base() { # Fix problem with scstadmin unset PERL_MM_OPT @@ -42,49 +31,110 @@ build() { export KVERSION=$(uname -r) export PREFIX="/usr" export MANDIR=/usr/man - - # Fix problems with linux-headers package - # (rdma headers is missing) - _kern_inc=("$srcdir"/linux-*/include/) - export C_INCLUDE_PATH="$_kern_inc:$C_INCLUDE_PATH" - - for d in scst scst_local iscsi-scst; do - make -C "$d" 2release - make -C "$d" - done - - export MANDIR="$pkgdir"/usr/man - make -C scstadmin - msg "Done building!" } -package() { - msg "Package scst..." +_package_module() { + msg "Package module $1..." cd "$srcdir"/scst* - unset PERL_MM_OPT - export KVER=$(uname -r) - export KVERSION=$(uname -r) - export PREFIX="/usr" + _base export DESTDIR="$pkgdir" - export MANDIR=/usr/man - for d in scst scst_local iscsi-scst; do - make -C "$d" INSTALL_MOD_PATH="$pkgdir" install - done - # Clean up conflic files - for f in "$pkgdir"/lib/modules/"$KVER"/modules.*; do + make -C "$1" INSTALL_MOD_PATH="$pkgdir" install + + shopt -s nullglob + _mod_dir="$pkgdir"/lib/modules/"$KVER" + # Clean up conflict files + for f in "$_mod_dir"/modules.*; do rm "$f" done + # Resolve symlink - mv "$pkgdir"/lib "$pkgdir"/usr/ + if [[ -d "$pkgdir"/lib ]]; then + mkdir -p "$pkgdir"/usr/lib + mv -v "$pkgdir"/lib/* "$pkgdir"/usr/lib/ + rm -rf "$pkgdir"/lib + fi + + # Resolve sbin + if [[ -d "$pkgdir"/usr/sbin ]]; then + mkdir -p "$pkgdir"/usr/bin + mv "$pkgdir"/usr/sbin/* "$pkgdir"/usr/bin/ + rm -rf "$pkgdir"/usr/sbin + fi + + msg "Done with packaging module $1" +} + +prepare() { + cd "$srcdir"/scst* + + patch -Np0 -i "$srcdir/queue.patch" +} + +build() { + msg "Build package..." + cd "$srcdir"/scst* + + _base + + # Fix problems with linux-headers package + # (rdma headers is missing) + _kern_inc=("$srcdir"/linux-*/include/) + cp -r "$_kern_inc/rdma" "scst/include" + #export CFLAGS="$CFLAGS -I'$_kern_inc'" + + for d in scst scst_local iscsi-scst; do + make -C "$d" 2release + make -C "$d" + done + + # Fix issue with man pages + export MANDIR="$pkgdir"/usr/man + make -C scstadmin + + msg "Done building" +} + +package_scst() { + pkgdesc="Generic SCSI Target Subsystem For Linux" + depends=() + + _package_module scst +} + +package_scst_local() { + pkgdesc="Driver for support of local targets in SCST" + depends=('scst') + + _package_module scst_local +} + +package_iscsi-scst() { + pkgdesc="Driver & daemon for support iSCSI in SCST" + depends=('scst') + + _package_module iscsi-scst +} + +package_scstadmin() { + pkgdesc="Administration utilit for SCST" + depends=('perl') + + msg "Package scstadmin util..." + cd "$srcdir"/scst* + + _base + export DESTDIR="$pkgdir" + + # Resolve path to install man pages + # and move script from sbin to bin + export MANDIR="$pkgdir"/usr/man - # scstadmin magic - export MANDIR="$pkgdir"/usr/man - make -C scstadmin install_vendor - mkdir -p "$pkgdir"/usr/bin - mv "$pkgdir"/usr/sbin/* "$pkgdir"/usr/bin - rm -rf "$pkgdir"/usr/sbin + make -C scstadmin install_vendor + mkdir -p "$pkgdir"/usr/bin + mv "$pkgdir"/usr/sbin/* "$pkgdir"/usr/bin + rm -rf "$pkgdir"/usr/sbin - msg "Done with packaging scst" + msg "Done with packaging scstadmin" } |