Skip to content

Commit

Permalink
Prepare ebuild for a new release
Browse files Browse the repository at this point in the history
1. Support control-socket in live ebuild.
2. Use git-r3 eclass.
3. Mask broken or not fully implemented flags using
   package.use.mask, drop -use statements.
4. v0.2.1 is now considered stable.
  • Loading branch information
bircoph committed May 15, 2014
1 parent abad311 commit ba704b0
Show file tree
Hide file tree
Showing 7 changed files with 133 additions and 8 deletions.
2 changes: 1 addition & 1 deletion gentoo/app-admin/clsync/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ChangeLog for app-admin/clsync
# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
# Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2
# $Header: $

*clsync-0.2.1 (15 Oct 2013)
Expand Down
1 change: 0 additions & 1 deletion gentoo/app-admin/clsync/clsync-0.2.1.ebuild

This file was deleted.

86 changes: 86 additions & 0 deletions gentoo/app-admin/clsync/clsync-0.2.1.ebuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

EAPI=5

if [[ ${PV} == "9999" ]] ; then
_GIT=git-2
EGIT_REPO_URI="https://github.com/xaionaro/${PN}.git"
SRC_URI=""
KEYWORDS=""
else
SRC_URI="https://github.com/xaionaro/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
KEYWORDS="x86 amd64"
fi

inherit autotools $_GIT

DESCRIPTION="Live sync tool based on inotify, written in GNU C"
HOMEPAGE="http://ut.mephi.ru/oss"
LICENSE="GPL-3+"
SLOT="0"
IUSE="-caps -cluster debug doc +examples extra-hardened hardened mhash"
REQUIRED_USE="
extra-hardened? ( hardened )
mhash? ( cluster )"

RDEPEND="
caps? ( sys-libs/libcap )
mhash? ( app-crypt/mhash )
dev-libs/glib:2
"
DEPEND="${RDEPEND}
virtual/pkgconfig
doc? ( app-doc/doxygen )
"

src_prepare() {
eautoreconf
}

src_configure() {
local harden_level=0
use hardened && harden_level=1
use extra-hardened && harden_level=2

econf \
--docdir="${EPREFIX}/usr/share/doc/${PF}" \
--enable-paranoid=${harden_level} \
$(use_enable cluster) \
$(use_enable debug) \
$(use_with caps capabilities) \
$(use_with mhash)
}

src_compile() {
emake
use doc && emake doc
}

src_install() {
emake DESTDIR="${D}" install
use doc && dohtml -r doc/html/*

# remove unwanted docs
rm "${ED}/usr/share/doc/${PF}"/{LICENSE,TODO} || die
use examples || rm -r "${ED}/usr/share/doc/${PF}/examples" || die

newinitd "${FILESDIR}/${PN}.initd" "${PN}"
newconfd "${FILESDIR}/${PN}.confd" "${PN}"

# filter rules and sync scripts are supposed to be here
keepdir "${EPREFIX}/etc/${PN}"
insinto "/etc/${PN}"
doins "${FILESDIR}/${PN}.conf"
}

pkg_postinst() {
einfo "${PN} is just a convenient way to run synchronization tools on live data,"
einfo "it doesn't copy data itself, so you need to install software to do actual"
einfo "data transfer. Usually net-misc/rsync is a good choise, but ${PN} is"
einfo "is flexible enough to use any user tool, see manual page for details."
einfo
einfo "${PN} init script can now be multiplexed, to use symlink init script to"
einfo "othername and use conf.d/othername to configure it."
}
13 changes: 7 additions & 6 deletions gentoo/app-admin/clsync/clsync-9999.ebuild
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Copyright 1999-2013 Gentoo Foundation
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

EAPI=5

if [[ ${PV} == "9999" ]] ; then
_GIT=git-2
inherit git-r3
EGIT_REPO_URI="https://github.com/xaionaro/${PN}.git"
SRC_URI=""
KEYWORDS=""
Expand All @@ -14,13 +14,13 @@ else
KEYWORDS="~x86 ~amd64"
fi

inherit autotools $_GIT
inherit autotools

DESCRIPTION="Live sync tool based on inotify, written in GNU C"
HOMEPAGE="http://ut.mephi.ru/oss"
LICENSE="GPL-3+"
SLOT="0"
IUSE="-caps -cluster debug doc +examples extra-hardened hardened mhash"
IUSE="caps cluster control-socket debug doc +examples extra-hardened hardened mhash"
REQUIRED_USE="
extra-hardened? ( hardened )
mhash? ( cluster )"
Expand Down Expand Up @@ -48,6 +48,7 @@ src_configure() {
--docdir="${EPREFIX}/usr/share/doc/${PF}" \
--enable-paranoid=${harden_level} \
$(use_enable cluster) \
$(use_enable control-socket socket) \
$(use_enable debug) \
$(use_with caps capabilities) \
$(use_with mhash)
Expand All @@ -66,13 +67,13 @@ src_install() {
rm "${ED}/usr/share/doc/${PF}"/{LICENSE,TODO} || die
use examples || rm -r "${ED}/usr/share/doc/${PF}/examples" || die

newinitd "${FILESDIR}/${PN}.initd" "${PN}"
newinitd "${FILESDIR}/${PN}.initd-2" "${PN}"
newconfd "${FILESDIR}/${PN}.confd" "${PN}"

# filter rules and sync scripts are supposed to be here
keepdir "${EPREFIX}/etc/${PN}"
insinto "/etc/${PN}"
doins "${FILESDIR}/${PN}.conf"
newins "${FILESDIR}/${PN}.conf-2" "${PN}.conf"
}

pkg_postinst() {
Expand Down
18 changes: 18 additions & 0 deletions gentoo/app-admin/clsync/files/clsync.conf-2
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# clsync system configuration file
#
# General recommendations:
# 1. Put --dir-lists on tmpfs.
# 2. Use --uid and --gid to drop privileges whenever possible.
# 3. Keeep your clsync rules and sync scripts in /etc/clsync/.

[default]
# Put your options here, see clsync man pages for a list of valid options.
# Also check examples directory (/usr/share/doc/clsync-*/examples).
#
#watch-dir = /what/dir/to/sync
#sync-handler = /etc/clsync/action.sh
#rules-dir = /etc/clsync/rules
#lists-dir = /tmp/clsync
#threading = safe
#delay-sync = 5
#delay-collect = 5
18 changes: 18 additions & 0 deletions gentoo/app-admin/clsync/files/clsync.initd-2
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/sbin/runscript
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

[[ -n "${CLSYNC_CONF}" ]] && conffile="--config-file ${CLSYNC_CONF}"
[[ -n "${CLSYNC_NICE}" ]] && cmd_nice="--nice ${CLSYNC_NICE}"
[[ -n "${CLSYNC_IONICE}" ]] && cmd_ionice="--ionice ${CLSYNC_IONICE}"

command="/usr/bin/clsync"
pidfile="/var/run/${SVCNAME}.pid"
command_args="--background --output=syslog --pid-file=${pidfile} \
${conffile} ${CLSYNC_OPTS}"
start_stop_daemon_args="${cmd_nice} ${cmd_ionice}"

depend() {
use net
}
1 change: 1 addition & 0 deletions gentoo/app-admin/clsync/metadata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<use>
<flag name="caps">Capabilities support. Under development, may not work properly now.</flag>
<flag name="cluster">Enable clustering support (allows master-master clsync on multiple hosts). Not fully implemented yet.</flag>
<flag name="control-socket">Enable AF_UNIX control socket support.</flag>
<flag name="extra-hardened">Enable extra security checks. This may hurt performance.</flag>
</use>
</pkgmetadata>
2 changes: 2 additions & 0 deletions gentoo/profiles/package.use.mask
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Features are still under development and not working properly
app-admin/clsync caps cluster

0 comments on commit ba704b0

Please sign in to comment.