system/sdparm/sdparm.sh

Fri, 15 Nov 2019 20:11:00 +0100

author
David Demelier <markand@malikania.fr>
date
Fri, 15 Nov 2019 20:11:00 +0100
changeset 1210
422313c3fcbd
parent 1121
4d8dae2b477b
child 1216
6710613b88b9
permissions
-rw-r--r--

text/rarian: initial import, closes #2311

1121
4d8dae2b477b system/sdparm: initial import, closes #1044
David Demelier <markand@malikania.fr>
parents:
diff changeset
1 #!/bin/sh
4d8dae2b477b system/sdparm: initial import, closes #1044
David Demelier <markand@malikania.fr>
parents:
diff changeset
2 #
4d8dae2b477b system/sdparm: initial import, closes #1044
David Demelier <markand@malikania.fr>
parents:
diff changeset
3 # Copyright (c) 2019 David Demelier <markand@malikania.fr>
4d8dae2b477b system/sdparm: initial import, closes #1044
David Demelier <markand@malikania.fr>
parents:
diff changeset
4 #
4d8dae2b477b system/sdparm: initial import, closes #1044
David Demelier <markand@malikania.fr>
parents:
diff changeset
5 # Permission to use, copy, modify, and/or distribute this software for any
4d8dae2b477b system/sdparm: initial import, closes #1044
David Demelier <markand@malikania.fr>
parents:
diff changeset
6 # purpose with or without fee is hereby granted, provided that the above
4d8dae2b477b system/sdparm: initial import, closes #1044
David Demelier <markand@malikania.fr>
parents:
diff changeset
7 # copyright notice and this permission notice appear in all copies.
4d8dae2b477b system/sdparm: initial import, closes #1044
David Demelier <markand@malikania.fr>
parents:
diff changeset
8 #
4d8dae2b477b system/sdparm: initial import, closes #1044
David Demelier <markand@malikania.fr>
parents:
diff changeset
9 # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
4d8dae2b477b system/sdparm: initial import, closes #1044
David Demelier <markand@malikania.fr>
parents:
diff changeset
10 # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
4d8dae2b477b system/sdparm: initial import, closes #1044
David Demelier <markand@malikania.fr>
parents:
diff changeset
11 # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
4d8dae2b477b system/sdparm: initial import, closes #1044
David Demelier <markand@malikania.fr>
parents:
diff changeset
12 # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
4d8dae2b477b system/sdparm: initial import, closes #1044
David Demelier <markand@malikania.fr>
parents:
diff changeset
13 # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
4d8dae2b477b system/sdparm: initial import, closes #1044
David Demelier <markand@malikania.fr>
parents:
diff changeset
14 # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
4d8dae2b477b system/sdparm: initial import, closes #1044
David Demelier <markand@malikania.fr>
parents:
diff changeset
15 # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
4d8dae2b477b system/sdparm: initial import, closes #1044
David Demelier <markand@malikania.fr>
parents:
diff changeset
16 #
4d8dae2b477b system/sdparm: initial import, closes #1044
David Demelier <markand@malikania.fr>
parents:
diff changeset
17
4d8dae2b477b system/sdparm: initial import, closes #1044
David Demelier <markand@malikania.fr>
parents:
diff changeset
18 PKGNAME=sdparm
4d8dae2b477b system/sdparm: initial import, closes #1044
David Demelier <markand@malikania.fr>
parents:
diff changeset
19 PKGVERSION=1.10
4d8dae2b477b system/sdparm: initial import, closes #1044
David Demelier <markand@malikania.fr>
parents:
diff changeset
20 PKGREVISION=1
4d8dae2b477b system/sdparm: initial import, closes #1044
David Demelier <markand@malikania.fr>
parents:
diff changeset
21 PKGLICENSE="BSD3CLAUSE"
4d8dae2b477b system/sdparm: initial import, closes #1044
David Demelier <markand@malikania.fr>
parents:
diff changeset
22 PKGSUMMARY="utility for listing and potentially changing SCSI disk parameters"
4d8dae2b477b system/sdparm: initial import, closes #1044
David Demelier <markand@malikania.fr>
parents:
diff changeset
23 PKGDOWNLOAD="http://sg.danny.cz/sg/p/$PKGNAME-$PKGVERSION.tar.xz"
4d8dae2b477b system/sdparm: initial import, closes #1044
David Demelier <markand@malikania.fr>
parents:
diff changeset
24 PKGDEPENDS="bash sg3-utils"
4d8dae2b477b system/sdparm: initial import, closes #1044
David Demelier <markand@malikania.fr>
parents:
diff changeset
25
4d8dae2b477b system/sdparm: initial import, closes #1044
David Demelier <markand@malikania.fr>
parents:
diff changeset
26 : ${CHOST:=$(uname -m)-linux-musl}
4d8dae2b477b system/sdparm: initial import, closes #1044
David Demelier <markand@malikania.fr>
parents:
diff changeset
27 : ${CBUILD:=$(uname -m)-linux-musl}
4d8dae2b477b system/sdparm: initial import, closes #1044
David Demelier <markand@malikania.fr>
parents:
diff changeset
28 : ${CC:=clang}
4d8dae2b477b system/sdparm: initial import, closes #1044
David Demelier <markand@malikania.fr>
parents:
diff changeset
29 : ${CFLAGS:=-O2}
4d8dae2b477b system/sdparm: initial import, closes #1044
David Demelier <markand@malikania.fr>
parents:
diff changeset
30 : ${LDFLAGS:=}
4d8dae2b477b system/sdparm: initial import, closes #1044
David Demelier <markand@malikania.fr>
parents:
diff changeset
31 : ${LIBS:=}
4d8dae2b477b system/sdparm: initial import, closes #1044
David Demelier <markand@malikania.fr>
parents:
diff changeset
32
4d8dae2b477b system/sdparm: initial import, closes #1044
David Demelier <markand@malikania.fr>
parents:
diff changeset
33 build()
4d8dae2b477b system/sdparm: initial import, closes #1044
David Demelier <markand@malikania.fr>
parents:
diff changeset
34 {
4d8dae2b477b system/sdparm: initial import, closes #1044
David Demelier <markand@malikania.fr>
parents:
diff changeset
35 rm -rf $PKGNAME-$PKGVERSION
4d8dae2b477b system/sdparm: initial import, closes #1044
David Demelier <markand@malikania.fr>
parents:
diff changeset
36 tar xvf $PKGNAME-$PKGVERSION.tar.xz
4d8dae2b477b system/sdparm: initial import, closes #1044
David Demelier <markand@malikania.fr>
parents:
diff changeset
37 cd $PKGNAME-$PKGVERSION
4d8dae2b477b system/sdparm: initial import, closes #1044
David Demelier <markand@malikania.fr>
parents:
diff changeset
38
4d8dae2b477b system/sdparm: initial import, closes #1044
David Demelier <markand@malikania.fr>
parents:
diff changeset
39 CC="$CC" \
4d8dae2b477b system/sdparm: initial import, closes #1044
David Demelier <markand@malikania.fr>
parents:
diff changeset
40 CFLAGS="$CFLAGS" \
4d8dae2b477b system/sdparm: initial import, closes #1044
David Demelier <markand@malikania.fr>
parents:
diff changeset
41 LDFLAGS="$LDFLAGS" \
4d8dae2b477b system/sdparm: initial import, closes #1044
David Demelier <markand@malikania.fr>
parents:
diff changeset
42 LIBS="$LIBS" \
4d8dae2b477b system/sdparm: initial import, closes #1044
David Demelier <markand@malikania.fr>
parents:
diff changeset
43 ./configure \
4d8dae2b477b system/sdparm: initial import, closes #1044
David Demelier <markand@malikania.fr>
parents:
diff changeset
44 --build=$CBUILD \
4d8dae2b477b system/sdparm: initial import, closes #1044
David Demelier <markand@malikania.fr>
parents:
diff changeset
45 --host=$CHOST \
4d8dae2b477b system/sdparm: initial import, closes #1044
David Demelier <markand@malikania.fr>
parents:
diff changeset
46 --prefix=
4d8dae2b477b system/sdparm: initial import, closes #1044
David Demelier <markand@malikania.fr>
parents:
diff changeset
47 make
4d8dae2b477b system/sdparm: initial import, closes #1044
David Demelier <markand@malikania.fr>
parents:
diff changeset
48 make install DESTDIR=$DESTDIR
4d8dae2b477b system/sdparm: initial import, closes #1044
David Demelier <markand@malikania.fr>
parents:
diff changeset
49
4d8dae2b477b system/sdparm: initial import, closes #1044
David Demelier <markand@malikania.fr>
parents:
diff changeset
50 cd ..
4d8dae2b477b system/sdparm: initial import, closes #1044
David Demelier <markand@malikania.fr>
parents:
diff changeset
51 rm -rf $PKGNAME-$PKGVERSION
4d8dae2b477b system/sdparm: initial import, closes #1044
David Demelier <markand@malikania.fr>
parents:
diff changeset
52 }

mercurial