aboutsummaryrefslogtreecommitdiffstats
path: root/main/seafile/APKBUILD
blob: 40213d0cee3d1c9c03259d1613fa60e4d013e272 (plain)
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
# Contributor: <xmingske@gmail.com>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=seafile
pkgver=4.2.2
pkgrel=0
pkgdesc="Cloud storage system with advanced support for file syncing, privacy protection and teamwork"
url="https://github.com/haiwen/seafile/"
arch="all"
license="GPL3"
makedepends="autoconf automake bash ccnet-dev curl-dev fuse-dev glib-dev
	intltool jansson-dev libarchive-dev libevent-dev libevhtp-dev
	libsearpc-dev libtool libzdb-dev openssl-dev sqlite-dev util-linux-dev
	vala bsd-compat-headers"
depends="bash ${pkgname}-common"
pkgusers="seafile"
pkggroups="seafile"
source="$pkgname-$pkgver.tar.gz::https://github.com/haiwen/seafile/archive/v${pkgver}.tar.gz
       seafile-controller.patch seafile-scripts.patch seafile.initd seafile.confd"
subpackages="$pkgname-dev py-$pkgname:py $pkgname-server $pkgname-common"
install="seafile-server.pre-install seafile-server.post-install"

_builddir="${srcdir}/${pkgname}-${pkgver}"

prepare() {
	local pf
	cd "${_builddir}" || return 1
	for pf in $source; do
		case $pf in
		*.patch) msg $pf; patch -p1 -i "$srcdir"/${pf} || return 1;;
		esac
	done
}

build() {
	cd "${_builddir}"
	./autogen.sh
	./configure \
                --prefix=/usr \
                --sysconfdir=/etc \
                --mandir=/usr/share/man \
                --infodir=/usr/share/info \
		--enable-server \
		--enable-python \
		--enable-fuse \
		--enable-client \
		--enable-console
	make || return 1
}

package() {
	cd "${_builddir}"
	make DESTDIR="${pkgdir}" install || return 1
	rm "${pkgdir}"/usr/lib/libseafile.la || return 1
}

py() {
        arch="noarch"
        cd "$_builddir"
        pkgdesc="$pkgname python bindings"
        install -d "$subpkgdir"/usr/lib || return 1
        mv "$pkgdir"/usr/lib/python* "$subpkgdir"/usr/lib/ || return 1
}

common() {
	mkdir -p "${subpkgdir}"/usr/bin || return 1
	mkdir -p "${subpkgdir}"/usr/lib || return 1
	mv "${pkgdir}"/usr/bin/seafile "${subpkgdir}"/usr/bin
	mv "${pkgdir}"/usr/lib/libseafile.so.0* "${subpkgdir}"/usr/lib
}

server() {
	mkdir -p "${subpkgdir}"/usr/bin
	for b in "${pkgdir}"/usr/bin/*; do
		if [[ "$b" != "${pkgdir}/usr/bin/seaf-cli" ]] && \
		[[ "$b" != "${pkgdir}/usr/bin/seaf-daemon" ]] && \
		[[ "$b" != "${pkgdir}/usr/bin/seafile" ]]; then
			mv "$b" "${subpkgdir}/usr/bin" || return 1
		fi
	done
	mkdir -m 755 -p "${subpkgdir}"/usr/share/seafile || return 1
	cp -ar "${_builddir}"/scripts "${subpkgdir}"/usr/share/seafile || return 1
	install -D -m0644 "${srcdir}"/seafile.confd "${subpkgdir}"/etc/conf.d/seafile \
	    || return 1
	install -D -m0755 "${srcdir}"/seafile.initd "${subpkgdir}"/etc/init.d/seafile \
	    || return 1

	#make dirs for default instance
	SEAFILE_HOME="${subpkgdir}"/var/lib/seafile
	SEAFILE_DEFAULT=$SEAFILE_HOME/default
	mkdir -m 755 -p $SEAFILE_DEFAULT 2>/dev/null
	chown seafile:seafile $SEAFILE_DEFAULT

}
md5sums="84db983bece1aa253cdb7a6edacb417e  seafile-4.2.2.tar.gz
3f2b5457441871a4922d873e2b386711  seafile-controller.patch
5d5217a4616ba9d57b56f0b61797b419  seafile-scripts.patch
d2319373c376bff87a3005057d887193  seafile.initd
cc33cc3ef3b04415a7b1d160e6b64e2b  seafile.confd"
sha256sums="15b1e6477924669c244e861b2814ad87ca353041eff6d3ee043e70cf8f47b9e6  seafile-4.2.2.tar.gz
03fa3d43bcaed4bf720e7cbec5ea0fe9e1d8d90987bc8b69a045dafe10e1c27a  seafile-controller.patch
42fc1ed64c0a3cac0c5f74f2c269d96eba80e8b7a9dbff6332726342b576edf6  seafile-scripts.patch
aaf173e5df205fc4b152f6d75c5b3b7ec738bb1acbbe413ea6fce268b1d830c1  seafile.initd
a78183173ce054a245878d309dda9bff7981193d2b0594d299030e403e857952  seafile.confd"
sha512sums="90151dbcd8480f06e22d5ff8e0bde8a6e57a1f811db29ce43e4e48ef6ea5e6ac7a589306d7a29170a31f3f8ece1cbaf7fe27841fd0023576f54788ebd80070c5  seafile-4.2.2.tar.gz
6b70df847d2d3f1fbd856f220dd5686d04c1ee4810c60d3bb28c80e85f508d3b448a0e6cfb9a83a43876285968ec917867838ef31c00cfb431a8e1e953241246  seafile-controller.patch
9af26dbbc62c2e135d1ecb29243de658524d3cdbcfdfbaafcb30e137d0230792a7466b7b01a449a113ddf87f89acdceaf8c06192dd2ee28b3bbd18e9973a7b0d  seafile-scripts.patch
66b84519ab66e7435da13a2ed1869bac3ead1f7b46ed4b0a5ecda6dfcea056c5e0af8abcf1eba00fc2e68b8df7e07e3951968c385850f01ecf46f08dfdbe7083  seafile.initd
051ccc065a3b7abc7c802e00e364da1c3f689e133c4ba37385dbff97cfe8ad4b490cf53778344d129213fb0238258690a47f5e737387bce1368db59d22ee8504  seafile.confd"