aboutsummaryrefslogtreecommitdiffstats
path: root/testing/lizardfs/APKBUILD
blob: d7f4d74ef456b0d3d51d8c0dbdd7aa4865eafc95 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
# Contributor:
# Maintainer:
pkgname=lizardfs
pkgver=3.12.0
pkgrel=0
pkgdesc="a highly reliable, scalable and efficient distributed file system"
url="https://github.com/lizardfs/lizardfs/"
arch="all"
license="GPL-3.0"
makedepends="$depends_dev boost-dev cmake fuse-dev zlib-dev asciidoc python2"
pkgusers="mfs"
pkggroups="mfs"
install="$pkgname.pre-install"
subpackages="$pkgname-doc $pkgname-master $pkgname-metalogger
	$pkgname-chunkserver $pkgname-tools $pkgname-cgi $pkgname-cgiserv
	$pkgname-adm"
source="lizardfs-$pkgver.tar.gz::https://github.com/lizardfs/lizardfs/archive/v$pkgver.tar.gz
	lizardfs-cgiserv.initd
	lizardfs-chunkserver.initd
	lizardfs-master.initd
	lizardfs-metalogger.initd
	677.patch
	"

prepare() {
	local i
	for i in $source; do
		case $i in
		*.patch) msg $i; patch -p1 -i "$srcdir"/$i;;
		esac
	done
	mkdir -p build
}

build() {
	mkdir -p "$builddir"/build
	cd "$builddir"/build
	cmake .. \
		-DCMAKE_BUILD_TYPE=Release \
		-DCMAKE_INSTALL_PREFIX="/" \
		-DENABLE_TESTS=NO \
		-DENABLE_DEBIAN_PATHS=YES
	make
}

package() {
	cd "$builddir"/build
	make DESTDIR="$pkgdir" install
	chown -R mfs:mfs "$pkgdir"/var/lib/mfs
	for i in $source; do
		case $i in
		*.initd)
			install -Dm755 "$srcdir"/$i \
				"$pkgdir"/etc/init.d/${i%.*}
			;;
		esac
	done
}

_mv_files() {
	local i
	for i in "$@"; do
		case $i in
		*/*) mkdir -p "$subpkgdir"/${i%/*};;
		*) mkdir -p "$subpkgdir";;
		esac
		mv "$pkgdir"/$i "$subpkgdir"/$i
	done
}

master() {
	pkgdesc="LizardFS master server"
	depends="lizardfs=$pkgver-r$pkgrel"
	cd "$pkgdir"
	_mv_files \
		usr/sbin/mfsmaster \
		usr/sbin/mfsrestoremaster \
		usr/sbin/mfsmetadump \
		usr/sbin/mfsmetarestore \
		etc/mfs/mfsexports.cfg.dist \
		etc/mfs/mfstopology.cfg.dist \
		etc/mfs/mfsgoals.cfg.dist \
		etc/mfs/mfsmaster.cfg.dist \
		etc/mfs/globaliolimits.cfg.dist \
		var/lib/mfs/metadata.mfs.empty \
		etc/init.d/lizardfs-master
	chown -R mfs:mfs "$subpkgdir"/var/lib/mfs
}

metalogger() {
	pkgdesc="LizardFS metadata replication server"
	depends="lizardfs=$pkgver-r$pkgrel"
	cd "$pkgdir"
	_mv_files \
		usr/sbin/mfsmetalogger \
		etc/mfs/mfsmetalogger.cfg.dist \
		etc/init.d/lizardfs-metalogger
}

chunkserver() {
	pkgdesc="LizardFS data server"
	depends="lizardfs=$pkgver-r$pkgrel"
	cd "$pkgdir"
	_mv_files \
		usr/sbin/mfschunkserver \
		etc/mfs/mfschunkserver.cfg.dist \
		etc/mfs/mfshdd.cfg.dist \
		etc/init.d/lizardfs-chunkserver
}

tools() {
	pkgdesc="LizardFS tools"
	depends="fuse"
	cd "$pkgdir"
	_mv_files \
		usr/bin/mfstools.sh \
		usr/bin/mfsmount \
		usr/bin/mfsappendchunks \
		usr/bin/mfscheckfile \
		usr/bin/mfsdeleattr \
		usr/bin/mfsdirinfo \
		usr/bin/mfsfileinfo \
		usr/bin/mfsfilerepair \
		usr/bin/mfsgeteattr \
		usr/bin/mfsgetgoal \
		usr/bin/mfsgettrashtime \
		usr/bin/mfsmakesnapshot \
		usr/bin/mfsrepquota \
		usr/bin/mfsrgetgoal \
		usr/bin/mfsrgettrashtime \
		usr/bin/mfsrsetgoal \
		usr/bin/mfsrsettrashtime \
		usr/bin/mfsseteattr \
		usr/bin/mfssetgoal \
		usr/bin/mfssetquota \
		usr/bin/mfssettrashtime \
		etc/mfs/mfsmount.cfg.dist \
		etc/mfs/iolimits.cfg.dist

}

cgi() {
	pkgdesc="LizardFS CGI Monitor"
	depends="python2"
	cd "$pkgdir"
	_mv_files \
		usr/share/mfscgi
}

cgiserv() {
	pkgdesc="Simple CGI-capable HTTP server to run LizardFS CGI Monitor"
	depends="$pkgname-cgi=$pkgver-r$pkgrel"
	cd "$pkgdir"
	_mv_files \
		usr/sbin/lizardfs-cgiserver \
		usr/sbin/mfscgiserv \
		etc/init.d/lizardfs-cgiserv
}

adm() {
	pkgdesc="LizardFS administration utility"
	depends=""
	cd "$pkgdir"
	_mv_files \
		usr/bin/lizardfs-admin \
		usr/bin/lizardfs-probe
}

sha512sums="0136114266dfadcf8e2205bfd19f50ee201566958fba1dc97d4a238ed63ca91dc2cd6352f25d911f4410b0fbd59846f54206da773789d5b959c8c02bde5adf20  lizardfs-3.12.0.tar.gz
2c78af05c2eeba866c25c58d996c64d16a590248660a362e29a52065af93c126c6eb3232c8cdbb797e60cca406608b77f29ce62717446b7c3d1a8d35e0a722d8  lizardfs-cgiserv.initd
f5de527f2c6f729d49c365cbac64d938d8f90de2c78ac2f4fdbb445532fbc6438ed7380b7963f70cfbf99d48282d7da6a8dbb3df9ae84ac7d2fcebda2ce308c8  lizardfs-chunkserver.initd
6234131965bf52ef0bb859a50010b649b10b81786ff302f6ff65429d03026b32d0e1ad2daeab99dea4bd8cc94ac5aed75707d640adf33b4fb79e22185e77ac01  lizardfs-master.initd
76951ecdbaa69cef0fc383bbc3d36b1eb00aced3c98750676ab159a44a9e50d29ebe188080a08a2a09df6c62f6899bb093cf94e9e3e1688826f5ff8dfdc0fa68  lizardfs-metalogger.initd
a565d1eb682934d47bcae7e0b3ce37a08fa0e28b732e965083a878f5e9e1e846b329643c8ab02bc0f74eac54881d5287c739df6df528b78ccfc388b76af5b8c8  677.patch"