1 |
commit: 12ef9b3a598775cfa576812182006dcc0e8eaac7 |
2 |
Author: Andrew Savchenko <bircoph <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun May 31 07:56:15 2020 +0000 |
4 |
Commit: Andrew Savchenko <bircoph <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun May 31 08:09:52 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=12ef9b3a |
7 |
|
8 |
app-admin/clsync: add live ebuild |
9 |
|
10 |
- Add live ebuild to facilitate development and testing |
11 |
- Merge all clsync components (libclsync, clsync-docs) back to the |
12 |
main package. |
13 |
|
14 |
Package-Manager: Portage-2.3.82, Repoman-2.3.20 |
15 |
Signed-off-by: Andrew Savchenko <bircoph <AT> gentoo.org> |
16 |
|
17 |
app-admin/clsync/clsync-9999.ebuild | 143 ++++++++++++++++++++++++++++++++++++ |
18 |
app-admin/clsync/metadata.xml | 3 + |
19 |
2 files changed, 146 insertions(+) |
20 |
|
21 |
diff --git a/app-admin/clsync/clsync-9999.ebuild b/app-admin/clsync/clsync-9999.ebuild |
22 |
new file mode 100644 |
23 |
index 00000000000..05e00ff84f2 |
24 |
--- /dev/null |
25 |
+++ b/app-admin/clsync/clsync-9999.ebuild |
26 |
@@ -0,0 +1,143 @@ |
27 |
+# Copyright 1999-2020 Gentoo Authors |
28 |
+# Distributed under the terms of the GNU General Public License v2 |
29 |
+ |
30 |
+EAPI=7 |
31 |
+ |
32 |
+if [[ ${PV} == "9999" ]] ; then |
33 |
+ EGIT_REPO_URI="https://github.com/clsync/clsync.git" |
34 |
+ inherit git-r3 |
35 |
+ KEYWORDS="" |
36 |
+else |
37 |
+ SRC_URI="https://github.com/clsync/${MY_PN}/archive/v${PV}.tar.gz -> ${MY_P}.tar.gz" |
38 |
+ KEYWORDS="~amd64 ~x86" |
39 |
+fi |
40 |
+ |
41 |
+inherit autotools linux-info systemd |
42 |
+ |
43 |
+DESCRIPTION="Live sync tool based on inotify, written in GNU C" |
44 |
+HOMEPAGE="https://github.com/clsync/clsync http://ut.mephi.ru/oss/clsync" |
45 |
+LICENSE="GPL-3+" |
46 |
+SLOT="0" |
47 |
+IUSE="apidoc +caps +clsync cluster control-socket cgroups doc debug |
48 |
+examples extra-debug extra-hardened gio +hardened +highload-locks |
49 |
++inotify mhash namespaces seccomp socket-library static-libs" |
50 |
+ |
51 |
+REQUIRED_USE=" |
52 |
+ || ( clsync socket-library ) |
53 |
+ || ( gio inotify ) |
54 |
+ mhash? ( cluster ) |
55 |
+ seccomp? ( caps ) |
56 |
+" |
57 |
+BDEPEND=" |
58 |
+ virtual/pkgconfig |
59 |
+ apidoc? ( app-doc/doxygen[dot] ) |
60 |
+" |
61 |
+DEPEND=" |
62 |
+ caps? ( sys-libs/libcap ) |
63 |
+ cgroups? ( dev-libs/libcgroup ) |
64 |
+ clsync? ( dev-libs/glib:2 ) |
65 |
+ mhash? ( app-crypt/mhash ) |
66 |
+" |
67 |
+RDEPEND="${DEPEND} |
68 |
+ !app-doc/clsync-docs |
69 |
+ !dev-libs/libclsync |
70 |
+" |
71 |
+ |
72 |
+pkg_pretend() { |
73 |
+ if use clsync; then |
74 |
+ use inotify && CONFIG_CHECK+=" ~INOTIFY_USER" |
75 |
+ use namespaces && CONFIG_CHECK="~NAMESPACES ~UTS_NS ~IPC_NS ~USER_NS ~PID_NS ~NET_NS" |
76 |
+ use seccomp && CONFIG_CHECK+=" ~SECCOMP" |
77 |
+ check_extra_config |
78 |
+ fi |
79 |
+} |
80 |
+ |
81 |
+src_prepare() { |
82 |
+ eapply_user |
83 |
+ eautoreconf |
84 |
+} |
85 |
+ |
86 |
+src_configure() { |
87 |
+ local harden_level=0 |
88 |
+ use hardened && harden_level=1 |
89 |
+ use extra-hardened && harden_level=2 |
90 |
+ |
91 |
+ local debug_level=0 |
92 |
+ use debug && debug_level=1 |
93 |
+ use extra-debug && debug_level=2 |
94 |
+ |
95 |
+ econf \ |
96 |
+ --enable-debug=${debug_level} \ |
97 |
+ --enable-paranoid=${harden_level} \ |
98 |
+ --without-bsm \ |
99 |
+ --without-kqueue \ |
100 |
+ $(use_enable caps capabilities) \ |
101 |
+ $(use_enable clsync) \ |
102 |
+ $(use_enable cluster) \ |
103 |
+ $(use_enable control-socket socket) \ |
104 |
+ $(use_enable highload-locks) \ |
105 |
+ $(use_enable namespaces unshare) \ |
106 |
+ $(use_enable seccomp) \ |
107 |
+ $(use_enable socket-library) \ |
108 |
+ $(use_with cgroups libcgroup) \ |
109 |
+ $(use_with gio gio lib) \ |
110 |
+ $(use_with inotify inotify native) \ |
111 |
+ $(use_with mhash) |
112 |
+} |
113 |
+ |
114 |
+src_compile() { |
115 |
+ default |
116 |
+ if use apidoc; then |
117 |
+ doxygen .doxygen || die "doxygen failed" |
118 |
+ fi |
119 |
+} |
120 |
+ |
121 |
+src_install() { |
122 |
+ emake DESTDIR="${D}" install |
123 |
+ |
124 |
+ if use socket-library; then |
125 |
+ find "${ED}" -name "*.la" -delete |
126 |
+ use static-libs || find "${ED}" -name "*.a" -delete || die "failed to remove static libs" |
127 |
+ fi |
128 |
+ |
129 |
+ if use clsync; then |
130 |
+ newinitd "${FILESDIR}/${PN}.initd" "${PN}" |
131 |
+ newconfd "${FILESDIR}/${PN}.confd" "${PN}" |
132 |
+ |
133 |
+ # filter rules and sync scripts are supposed to be here |
134 |
+ insinto /etc/${PN} |
135 |
+ newins "${FILESDIR}/${PN}.conf" "${PN}.conf" |
136 |
+ keepdir /etc/${PN} |
137 |
+ |
138 |
+ systemd_dounit "examples/clsync@.service" |
139 |
+ fi |
140 |
+ |
141 |
+ if use doc; then |
142 |
+ dodoc -r DEVELOPING NOTES PROTOCOL SHORTHANDS TODO doc/devel/* |
143 |
+ else |
144 |
+ rm "${ED}/usr/share/doc/${PF}/"{DEVELOPING,LICENSE,PROTOCOL,TODO}* || die |
145 |
+ fi |
146 |
+ use apidoc && dodoc -r doc/doxygen/html |
147 |
+ if ! use examples; then |
148 |
+ rm -r "${ED}/usr/share/doc/${PF}/examples" || die |
149 |
+ fi |
150 |
+} |
151 |
+ |
152 |
+pkg_postinst() { |
153 |
+ einfo "${PN} is just a convenient way to run synchronization tools on live data," |
154 |
+ einfo "it doesn't copy data itself, so you need to install software to do actual" |
155 |
+ einfo "data transfer. Usually net-misc/rsync is a good choise, but ${PN} is" |
156 |
+ einfo "is flexible enough to use any user tool, see manual page for details." |
157 |
+ einfo |
158 |
+ einfo "${PN} init script can be multiplexed, to use symlink init script to" |
159 |
+ einfo "othername and use conf.d/othername to configure it." |
160 |
+ einfo |
161 |
+ einfo "If you're interested in improved security, enable" |
162 |
+ einfo "USE=\"caps cgroups extra-hardened namespaces seccomp\"" |
163 |
+ |
164 |
+ if use socket-library; then |
165 |
+ einfo |
166 |
+ einfo "clsync instances you are going to use _must_ be compiled" |
167 |
+ einfo "with control-socket support" |
168 |
+ fi |
169 |
+} |
170 |
|
171 |
diff --git a/app-admin/clsync/metadata.xml b/app-admin/clsync/metadata.xml |
172 |
index 824f11d2a13..fd64593a277 100644 |
173 |
--- a/app-admin/clsync/metadata.xml |
174 |
+++ b/app-admin/clsync/metadata.xml |
175 |
@@ -15,6 +15,8 @@ |
176 |
namespaces, seccomp, code hardening. |
177 |
</longdescription> |
178 |
<use> |
179 |
+ <flag name="apidoc">Provide doxygen generated API docs.</flag> |
180 |
+ <flag name="clsync">Build clsync binary. Most likely you want it. However it is possible to build only libclsync without clsync itself. </flag> |
181 |
<flag name="cluster">Enable clustering support (allows master-master clsync on multiple hosts). Not fully implemented yet.</flag> |
182 |
<flag name="control-socket">Enable AF_UNIX control socket support.</flag> |
183 |
<flag name="cgroups">Use cgroups to limit /dev access.</flag> |
184 |
@@ -23,6 +25,7 @@ |
185 |
<flag name="gio">Enable GIO for FS monitoring (glib based alternative to inotify interface, not recommended; if both are compiled, may be selected at runtime).</flag> |
186 |
<flag name="highload-locks">Allows to use spinlocks for short delays instead of mutexes, but only on SMP systems.</flag> |
187 |
<flag name="namespaces">Enable namespaces isolation.</flag> |
188 |
+ <flag name="socket-library">Build the control and monitoring socket library: libclsync.</flag> |
189 |
</use> |
190 |
<upstream> |
191 |
<remote-id type="github">clsync/clsync</remote-id> |