diff options
author | Chris Severance | 2015-08-03 22:52:15 -0400 |
---|---|---|
committer | Chris Severance | 2015-08-03 22:52:15 -0400 |
commit | a482519685ccf6bfd671f87ec5a198d0e85a7c0f (patch) | |
tree | 673225bf42db6c4c8184124695efc69f6ef6a64e | |
download | aur-a482519685ccf6bfd671f87ec5a198d0e85a7c0f.tar.gz |
Initial Import
-rw-r--r-- | .SRCINFO | 29 | ||||
-rw-r--r-- | PKGBUILD | 99 | ||||
-rw-r--r-- | mdadm.install | 25 |
3 files changed, 153 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..bc0e5121a227 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,29 @@ +pkgbase = mdadm-git + pkgdesc = create, manage, and monitor Linux md block device RAID arrays + pkgver = mdadm.3.3.3.r16.g53a087b + pkgrel = 1 + url = http://neil.brown.name/blog/mdadm + install = mdadm.install + arch = i686 + arch = x86_64 + license = GPL + makedepends = git + depends = linux + depends = glibc + conflicts = mkinitcpio<0.7 + conflicts = mdadm + replaces = raidtools + backup = etc/mdadm.conf + source = mdadm_github::git+https://github.com/neilbrown/mdadm.git + source = mdadm.conf::https://projects.archlinux.org/svntogit/packages.git/plain/trunk/mdadm.conf?h=packages/mdadm + source = mdadm_install::https://projects.archlinux.org/svntogit/packages.git/plain/trunk/mdadm_install?h=packages/mdadm + source = mdadm_udev_install::https://projects.archlinux.org/svntogit/packages.git/plain/trunk/mdadm_udev_install?h=packages/mdadm + source = mdadm_hook::https://projects.archlinux.org/svntogit/packages.git/plain/trunk/mdadm_hook?h=packages/mdadm + sha256sums = SKIP + sha256sums = 4ce1e90690282f98e4828e11576fbd61be65e97a2cdae6c7eac7035ea5ee53e5 + sha256sums = 15bc46b9fa663dc204e2168861fabfd26e0dbcbb073792f271e3e4510897fb4e + sha256sums = 170b0e5d548416c0adb9df4e6941bea6bc33d843419c997e45ecaf9e36a58f38 + sha256sums = d297b4fa6213016ec08e4f66d07cf7eb03426e4e17ab31eddfa5c5c1d82ea294 + +pkgname = mdadm-git + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..1f6f22c466f8 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,99 @@ +# Maintainer: Chris Severance aur.severach aATt spamgourmet dott com +# Contributor: Mathias Buren <mathias.buren@gmail.com> +# From core package +# Contributor: Tobias Powalowski <tpowa@archlinux.org> +# Contributor: Judd Vinet <jvinet@zeroflux.org> + +set -u +_pkgname='mdadm' +pkgname="${_pkgname}-git" +pkgver=mdadm.3.3.3.r16.g53a087b +pkgrel=1 +pkgdesc='create, manage, and monitor Linux md block device RAID arrays' +arch=('i686' 'x86_64') +license=('GPL') +url='http://neil.brown.name/blog/mdadm' +conflicts=('mkinitcpio<0.7' 'mdadm') +makedepends=('git') +depends=('linux' 'glibc') +backup=("etc/${_pkgname}.conf") +_archlink="@@@::https://projects.archlinux.org/svntogit/packages.git/plain/trunk/@@@?h=packages/${_pkgname}" +source=(# use either one, but not both. Reset with makepkg -sCf. My comparison shows these are identical, including the tags. Github is faster. + #"mdadm_gitnb::git://neil.brown.name/${_pkgname}" + "mdadm_github::git+https://github.com/neilbrown/${_pkgname}.git" + "${_archlink//@@@/${_pkgname}.conf}" + "${_archlink//@@@/${_pkgname}_install}" + "${_archlink//@@@/${_pkgname}_udev_install}" + "${_archlink//@@@/${_pkgname}_hook}") +install="${_pkgname}.install" +replaces=('raidtools') + +sha256sums=('SKIP' + '4ce1e90690282f98e4828e11576fbd61be65e97a2cdae6c7eac7035ea5ee53e5' + '15bc46b9fa663dc204e2168861fabfd26e0dbcbb073792f271e3e4510897fb4e' + '170b0e5d548416c0adb9df4e6941bea6bc33d843419c997e45ecaf9e36a58f38' + 'd297b4fa6213016ec08e4f66d07cf7eb03426e4e17ab31eddfa5c5c1d82ea294') + +pkgver() { + cd mdadm_git*/ + git describe --long | sed -e 's/\([^-]*-g\)/r\1/' -e 's/-/./g' +} + +prepare() { + set -u + cd mdadm_git*/ + sed -i -e 's: -Werror : :g' 'Makefile' # disable-werror.patch. NB strives for warning free code so this patch should not be necessary. + sed -i -e 's:/usr/sbin/:/usr/bin:g' -e 's:/sbin:/usr/bin:g' 'Makefile' 'test' 'mkinitramfs' 'mdadm.conf.5' + set +u +} + +build() { + set -u + cd mdadm_git*/ + local _XFlags='-O' # -Wno-maybe-uninitialized' # uninitalized warnings are too dangerous to be hidden + CPPFLAGS+=" ${_XFlags}" # warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Wcpp] + CXXFLAGS+=" ${_XFlags}" # Despite claims in the Makefile, make CXFLAGS='-O' doesn't work. + make -s -j $(nproc) BINDIR='/usr/bin' UDEVDIR='/usr/lib/udev' + # build static mdassemble for Arch's initramfs for use with (deprecated) mkinitcpio hook mdadm + make -s MDASSEMBLE_AUTO=1 mdassemble + # https://github.com/neilbrown/mdadm/issues/10 + # mdassemble used by hook mdadm does not update the map file + set +u +} + +check() { + set -u + cd mdadm_git*/ + make -s test + #sudo ./test # can't do sudo in a PKGBUILD + set +u +} + +package() { + set -u + cd mdadm_git*/ + make -s INSTALL='/usr/bin/install' BINDIR='/usr/bin' DESTDIR="${pkgdir}" UDEVDIR='/usr/lib/udev' install + make -s SYSTEMD_DIR="${pkgdir}/usr/lib/systemd/system" install-systemd # does not honor silent -s + install -Dpm755 'mdassemble' -t "${pkgdir}/usr/bin/" + install -Dpm644 "${srcdir}/mdadm.conf" -t "${pkgdir}/etc/" + sed -i -e 's:/usr/sbin/:/usr/bin:g' "${pkgdir}/etc/mdadm.conf" + install -Dpm644 "${srcdir}/mdadm_install" "${pkgdir}/usr/lib/initcpio/install/mdadm" + install -Dpm644 "${srcdir}/mdadm_hook" "${pkgdir}/usr/lib/initcpio/hooks/mdadm" + install -Dpm644 "${srcdir}/mdadm_udev_install" "${pkgdir}/usr/lib/initcpio/install/mdadm_udev" + sed -i -e 's:#!/bin/bash:#!/usr/bin/bash:g' "${pkgdir}/usr/lib/initcpio/install"/{mdadm,mdadm_udev} + sed -i -e 's:#!/bin/sh:#!/usr/bin/sh:g' "${pkgdir}/usr/lib/systemd/system-shutdown/mdadm.shutdown" + #ln -sf 'mdadm' "${pkgdir}/usr/lib/initcpio/hooks/raid" # symlink for backward compatibility + set +u + # Ensure there are no forbidden paths. Place at the end of package() and comment out as you find or need exceptions. (git-aurcheck) + ! test -d "${pkgdir}/bin" || { echo "Line ${LINENO} Forbidden: /bin"; echo "${}"; } + ! test -d "${pkgdir}/sbin" || { echo "Line ${LINENO} Forbidden: /sbin"; echo "${}"; } + ! test -d "${pkgdir}/lib" || { echo "Line ${LINENO} Forbidden: /lib"; echo "${}"; } + ! test -d "${pkgdir}/share" || { echo "Line ${LINENO} Forbidden: /share"; echo "${}"; } + ! test -d "${pkgdir}/usr/sbin" || { echo "Line ${LINENO} Forbidden: /usr/sbin"; echo "${}"; } + ! test -d "${pkgdir}/usr/local" || { echo "Line ${LINENO} Forbidden: /usr/local"; echo "${}"; } + ! grep -lr "/sbin" "${pkgdir}" || { echo "Line ${LINENO} Forbidden: /sbin"; echo "${}"; } + ! grep -lr "/usr/tmp" "${pkgdir}" || { echo "Line ${LINENO} Forbidden: /usr/tmp"; echo "${}"; } + ! grep -lr "/usr/local" "${pkgdir}" || { echo "Line ${LINENO} Forbidden: /usr/local"; echo "${}"; } + ! pcre2grep -Ilr "(?<!/usr)/bin" "${pkgdir}" || { echo "Line ${LINENO} Forbidden: /bin"; echo "${}"; } +} +set +u diff --git a/mdadm.install b/mdadm.install new file mode 100644 index 000000000000..1a5d0eb6b447 --- /dev/null +++ b/mdadm.install @@ -0,0 +1,25 @@ +# arg 1: the new package version +# arg 2: the old package version + +post_upgrade() { + if [ "$(vercmp "$2" '2.6.8-2')" -lt 0 -a "$(grep 'raid_partitions' '/etc/mkinitcpio.conf')" ]; then + echo "Attention mdadm update:" + echo "raid_partitions hook has been replaced by the more powerfull mdadm hook." + echo "Please update your /etc/mkinitcpio.conf accordingly." + fi + if [ -s '/etc/mkinitcpio.conf' ] && grep -q '^\s*HOOKS=".*\smdadm\s.*$' '/etc/mkinitcpio.conf'; then + echo "Attention mdadm update:" + echo "mdadm is deprecated for mdadm_udev" + echo "Please update your /etc/mkinitcpio.conf accordingly." + fi + if ! mdadm -D --scan >/dev/null; then + cat '/proc/mdstat' + tput 'rev' + echo 'One or more arrays may be damaged. Please repair soon.' + tput 'sgr0' + fi +} + +post_install() { + post_upgrade +} |