system/ndctl/ndctl.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 1115
297b5eef115e
child 1216
6710613b88b9
permissions
-rw-r--r--

text/rarian: initial import, closes #2311

1115
297b5eef115e vanilla: change shebangs to /bin/sh
David Demelier <markand@malikania.fr>
parents: 1107
diff changeset
1 #!/bin/sh
1065
866d3dc627a1 system/ndctl: initial import, closes #2260
David Demelier <markand@malikania.fr>
parents:
diff changeset
2 #
866d3dc627a1 system/ndctl: initial import, closes #2260
David Demelier <markand@malikania.fr>
parents:
diff changeset
3 # Copyright (c) 2019 David Demelier <markand@malikania.fr>
866d3dc627a1 system/ndctl: initial import, closes #2260
David Demelier <markand@malikania.fr>
parents:
diff changeset
4 #
866d3dc627a1 system/ndctl: initial import, closes #2260
David Demelier <markand@malikania.fr>
parents:
diff changeset
5 # Permission to use, copy, modify, and/or distribute this software for any
866d3dc627a1 system/ndctl: initial import, closes #2260
David Demelier <markand@malikania.fr>
parents:
diff changeset
6 # purpose with or without fee is hereby granted, provided that the above
866d3dc627a1 system/ndctl: initial import, closes #2260
David Demelier <markand@malikania.fr>
parents:
diff changeset
7 # copyright notice and this permission notice appear in all copies.
866d3dc627a1 system/ndctl: initial import, closes #2260
David Demelier <markand@malikania.fr>
parents:
diff changeset
8 #
866d3dc627a1 system/ndctl: initial import, closes #2260
David Demelier <markand@malikania.fr>
parents:
diff changeset
9 # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
866d3dc627a1 system/ndctl: initial import, closes #2260
David Demelier <markand@malikania.fr>
parents:
diff changeset
10 # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
866d3dc627a1 system/ndctl: initial import, closes #2260
David Demelier <markand@malikania.fr>
parents:
diff changeset
11 # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
866d3dc627a1 system/ndctl: initial import, closes #2260
David Demelier <markand@malikania.fr>
parents:
diff changeset
12 # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
866d3dc627a1 system/ndctl: initial import, closes #2260
David Demelier <markand@malikania.fr>
parents:
diff changeset
13 # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
866d3dc627a1 system/ndctl: initial import, closes #2260
David Demelier <markand@malikania.fr>
parents:
diff changeset
14 # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
866d3dc627a1 system/ndctl: initial import, closes #2260
David Demelier <markand@malikania.fr>
parents:
diff changeset
15 # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
866d3dc627a1 system/ndctl: initial import, closes #2260
David Demelier <markand@malikania.fr>
parents:
diff changeset
16 #
866d3dc627a1 system/ndctl: initial import, closes #2260
David Demelier <markand@malikania.fr>
parents:
diff changeset
17
866d3dc627a1 system/ndctl: initial import, closes #2260
David Demelier <markand@malikania.fr>
parents:
diff changeset
18 # TODO: add asciidoctor, keyutils
866d3dc627a1 system/ndctl: initial import, closes #2260
David Demelier <markand@malikania.fr>
parents:
diff changeset
19
866d3dc627a1 system/ndctl: initial import, closes #2260
David Demelier <markand@malikania.fr>
parents:
diff changeset
20 PKGNAME=ndctl
866d3dc627a1 system/ndctl: initial import, closes #2260
David Demelier <markand@malikania.fr>
parents:
diff changeset
21 PKGVERSION=66
866d3dc627a1 system/ndctl: initial import, closes #2260
David Demelier <markand@malikania.fr>
parents:
diff changeset
22 PKGREVISION=1
1107
7791d3dbfecf vanilla: consolidate licenses and many options
David Demelier <markand@malikania.fr>
parents: 1065
diff changeset
23 PKGLICENSE="LGPLv21 GPLv20"
7791d3dbfecf vanilla: consolidate licenses and many options
David Demelier <markand@malikania.fr>
parents: 1065
diff changeset
24 PKGSUMMARY="non-volatile memory device library"
1065
866d3dc627a1 system/ndctl: initial import, closes #2260
David Demelier <markand@malikania.fr>
parents:
diff changeset
25 PKGDOWNLOAD="https://github.com/pmem/ndctl/archive/v$PKGVERSION.tar.gz"
866d3dc627a1 system/ndctl: initial import, closes #2260
David Demelier <markand@malikania.fr>
parents:
diff changeset
26 PKGDEPENDS="eudev kmod util-linux "
866d3dc627a1 system/ndctl: initial import, closes #2260
David Demelier <markand@malikania.fr>
parents:
diff changeset
27
866d3dc627a1 system/ndctl: initial import, closes #2260
David Demelier <markand@malikania.fr>
parents:
diff changeset
28 : ${CHOST:=$(uname -m)-linux-musl}
866d3dc627a1 system/ndctl: initial import, closes #2260
David Demelier <markand@malikania.fr>
parents:
diff changeset
29 : ${CBUILD:=$(uname -m)-linux-musl}
866d3dc627a1 system/ndctl: initial import, closes #2260
David Demelier <markand@malikania.fr>
parents:
diff changeset
30 : ${CC:=clang}
866d3dc627a1 system/ndctl: initial import, closes #2260
David Demelier <markand@malikania.fr>
parents:
diff changeset
31 : ${CFLAGS:=-O2}
866d3dc627a1 system/ndctl: initial import, closes #2260
David Demelier <markand@malikania.fr>
parents:
diff changeset
32 : ${LDFLAGS:=}
866d3dc627a1 system/ndctl: initial import, closes #2260
David Demelier <markand@malikania.fr>
parents:
diff changeset
33 : ${LIBS:=}
866d3dc627a1 system/ndctl: initial import, closes #2260
David Demelier <markand@malikania.fr>
parents:
diff changeset
34
866d3dc627a1 system/ndctl: initial import, closes #2260
David Demelier <markand@malikania.fr>
parents:
diff changeset
35 build()
866d3dc627a1 system/ndctl: initial import, closes #2260
David Demelier <markand@malikania.fr>
parents:
diff changeset
36 {
866d3dc627a1 system/ndctl: initial import, closes #2260
David Demelier <markand@malikania.fr>
parents:
diff changeset
37 rm -rf $PKGNAME-$PKGVERSION
866d3dc627a1 system/ndctl: initial import, closes #2260
David Demelier <markand@malikania.fr>
parents:
diff changeset
38 tar xvf v$PKGVERSION.tar.gz
866d3dc627a1 system/ndctl: initial import, closes #2260
David Demelier <markand@malikania.fr>
parents:
diff changeset
39 cd $PKGNAME-$PKGVERSION
866d3dc627a1 system/ndctl: initial import, closes #2260
David Demelier <markand@malikania.fr>
parents:
diff changeset
40
866d3dc627a1 system/ndctl: initial import, closes #2260
David Demelier <markand@malikania.fr>
parents:
diff changeset
41 ./autogen.sh
866d3dc627a1 system/ndctl: initial import, closes #2260
David Demelier <markand@malikania.fr>
parents:
diff changeset
42 CC="$CC" \
866d3dc627a1 system/ndctl: initial import, closes #2260
David Demelier <markand@malikania.fr>
parents:
diff changeset
43 CFLAGS="$CFLAGS" \
866d3dc627a1 system/ndctl: initial import, closes #2260
David Demelier <markand@malikania.fr>
parents:
diff changeset
44 LDFLAGS="$LDFLAGS" \
866d3dc627a1 system/ndctl: initial import, closes #2260
David Demelier <markand@malikania.fr>
parents:
diff changeset
45 LIBS="$LIBS" \
866d3dc627a1 system/ndctl: initial import, closes #2260
David Demelier <markand@malikania.fr>
parents:
diff changeset
46 ./configure \
866d3dc627a1 system/ndctl: initial import, closes #2260
David Demelier <markand@malikania.fr>
parents:
diff changeset
47 --build=$CBUILD \
866d3dc627a1 system/ndctl: initial import, closes #2260
David Demelier <markand@malikania.fr>
parents:
diff changeset
48 --host=$CHOST \
866d3dc627a1 system/ndctl: initial import, closes #2260
David Demelier <markand@malikania.fr>
parents:
diff changeset
49 --prefix= \
866d3dc627a1 system/ndctl: initial import, closes #2260
David Demelier <markand@malikania.fr>
parents:
diff changeset
50 --without-systemd \
866d3dc627a1 system/ndctl: initial import, closes #2260
David Demelier <markand@malikania.fr>
parents:
diff changeset
51 --without-keyutils \
866d3dc627a1 system/ndctl: initial import, closes #2260
David Demelier <markand@malikania.fr>
parents:
diff changeset
52 --disable-docs
866d3dc627a1 system/ndctl: initial import, closes #2260
David Demelier <markand@malikania.fr>
parents:
diff changeset
53 make
866d3dc627a1 system/ndctl: initial import, closes #2260
David Demelier <markand@malikania.fr>
parents:
diff changeset
54 make install DESTDIR=$DESTDIR
866d3dc627a1 system/ndctl: initial import, closes #2260
David Demelier <markand@malikania.fr>
parents:
diff changeset
55 find $DESTDIR -type f -name "*.la" -delete
866d3dc627a1 system/ndctl: initial import, closes #2260
David Demelier <markand@malikania.fr>
parents:
diff changeset
56
866d3dc627a1 system/ndctl: initial import, closes #2260
David Demelier <markand@malikania.fr>
parents:
diff changeset
57 cd ..
866d3dc627a1 system/ndctl: initial import, closes #2260
David Demelier <markand@malikania.fr>
parents:
diff changeset
58 rm -rf $PKGNAME-$PKGVERSION
866d3dc627a1 system/ndctl: initial import, closes #2260
David Demelier <markand@malikania.fr>
parents:
diff changeset
59 }

mercurial