diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 0000000..29d970c --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,29 @@ +pkgbase = scst + pkgdesc = Generic SCSI Target Subsystem For Linux + pkgver = 3.3.0.7403 + pkgrel = 1 + url = http://scst.sourceforge.net + install = scst.install + arch = i686 + arch = x86_64 + license = GPL + makedepends = linux + makedepends = linux-headers + source = "git+https://github.com/bvanassche/scst.git#branch=master" + md5sums = SKIP + +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 diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 0000000..753e8aa --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,149 @@ +# Original maintainer Alex Talker < Alextalker at openmailbox dot com > +# Support Maintainer Filip Brcic < brcha at gna dot org > +# Contributor bitwave < aur [at] oomlu [d0t] de > +# Forker Ada Sauce < ada @ with dot parts > +# Alex say thanks to Filip about support this package while he was away from Arch. + +pkgname=(scst scst_local iscsi-scst scstadmin) +pkgver=3.3.0.48965 +pkgrel=1 +pkgdesc="Generic SCSI Target Subsystem For Linux" +arch=('i686' 'x86_64') +url="http://scst.sourceforge.net" +license=('GPL') +install=${pkgname}.install +makedepends=('linux' 'linux-headers') + +_version="3.3.0" +_branch="master" + +source=( + "git+https://github.com/bvanassche/scst.git#branch=$_branch" +) + +md5sums=( + 'SKIP' +) + +pkgver() { + cd $(find "$srcdir" -maxdepth 1 -type d -name 'scst*') + + local ver="$(git rev-parse --short HEAD)" + printf "${_version}.%s" "${ver//[[:alpha:]]}" +} + +_base() { + cd $(find "$srcdir" -maxdepth 1 -type d -name 'scst*') + + # Fix problem with scstadmin + unset PERL_MM_OPT + + export KVER=$(uname -r) + export KVERSION=$(uname -r) + export PREFIX="/usr" + export MANDIR=/usr/share/man +} + +_package_module() { + msg "Package module $1..." + + _base + export DESTDIR="$pkgdir" + + 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 + 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 $(find "$srcdir" -maxdepth 1 -type d -name 'scst*') + +} + +build() { + msg "Build package..." + + _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'" + + make -C scst 2debug + make -C scst + + make -C scst_local + + make -C iscsi-scst + + # 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..." + + _base + export DESTDIR="$pkgdir" + + # Resolve path to install man pages + # and move script from sbin to bin + export MANDIR="$pkgdir"/usr/share/man + + 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 scstadmin" +} diff --git a/scst.install b/scst.install new file mode 100644 index 0000000..fdf8fe8 --- /dev/null +++ b/scst.install @@ -0,0 +1,13 @@ +post_install() { + EXTRAMODULES='extramodules-ARCH' + depmod $(cat /usr/lib/modules/${EXTRAMODULES}/version) + echo 'In order to use scst module, reboot the system or insert manually.' +} + +post_upgrade() { + post_install +} + +post_remove() { + post_install +}