~alpine/devel

1

[alpine-devel] [PATCH 1/2] ifplugd: new aport

Details
Message ID
<1353416120-12198-1-git-send-email-pcastorino@mendoza-conicet.gob.ar>
Sender timestamp
1353416119
DKIM signature
missing
Download raw message
Patch: +80 -0
---
 testing/ifplugd/APKBUILD      |   48 +++++++++++++++++++++++++++++++++++++++++
 testing/ifplugd/ifplugd.initd |   32 +++++++++++++++++++++++++++
 2 files changed, 80 insertions(+)
 create mode 100644 testing/ifplugd/APKBUILD
 create mode 100644 testing/ifplugd/ifplugd.initd

diff --git a/testing/ifplugd/APKBUILD b/testing/ifplugd/APKBUILD
new file mode 100644
index 0000000..8a75dfd
--- /dev/null
+++ b/testing/ifplugd/APKBUILD
@@ -0,0 +1,48 @@
# Contributor: Pablo Castorino <pcastorino@mendoza-conicet.gob.ar>
# Maintainer:
pkgname=ifplugd
pkgver=0.28
pkgrel=0
pkgdesc="ifplugd is a Linux daemon which will automatically configure your ethernet device when a cable is plugged in and automatically unconfigure it if the cable is pulled. This is useful on laptops with onboard network adapters, since it will only configure the interface when a cable is really connected."
url="http://0pointer.de/lennart/projects/ifplugd"
arch="all"
license="GPL2"
depends="libdaemon"
depends_dev="libdaemon-dev"
makedepends="$depends_dev"
install=""
subpackages=""
source="http://0pointer.de/lennart/projects/ifplugd/ifplugd-$pkgver.tar.gz
	$pkgname.initd"

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

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

build() {
	cd "$_builddir"
		./configure --prefix=/usr \
		--sysconfdir=/etc \
		--localstatedir=/var \
        --disable-lynx \
                || return 1
        make || return 1
}

package() {
	cd "$_builddir"
 	make DESTDIR="$pkgdir" install
 	install -m755 -D "$pkgdir"/etc/init.d/$pkgname "$pkgdir"/usr/sbin/$pkgname-helper
 	install -m755 -D "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname
}

md5sums="df6f4bab52f46ffd6eb1f5912d4ccee3  ifplugd-0.28.tar.gz
7d7d45d6cf8edcb46ff18bedf7cfb961  ifplugd.initd"
diff --git a/testing/ifplugd/ifplugd.initd b/testing/ifplugd/ifplugd.initd
new file mode 100644
index 0000000..c5b8ec5
--- /dev/null
+++ b/testing/ifplugd/ifplugd.initd
@@ -0,0 +1,32 @@
#!/sbin/runscript
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License, v2 or later
# $Header: /var/cvsroot/gentoo-x86/net-misc/quagga/files/ifplugd.init,v 1.2 2007/02/25 09:57:18 mrness Exp $

depend() {
	need net
	after firewall opennhrp
}

checkconfig() {
        if [ ! -e /etc/ifplugd/ifplugd.conf ] ; then
        	eerror "You need to create /etc/ifplugd/ifplugd.conf first."
          return 1
        fi
}

start() {
	checkconfig || return 1

	ebegin "Starting ifplugd"
	sh /usr/sbin/ifplugd-helper start
	result=$?
	eend $result
}

stop() {
	ebegin "Stopping ifplugd"
	sh /usr/sbin/ifplugd-helper stop
	result=$?
	eend $result
}
-- 
1.7.10



---
Unsubscribe:  alpine-devel+unsubscribe@lists.alpinelinux.org
Help:         alpine-devel+help@lists.alpinelinux.org
---
Natanael Copa <ncopa@alpinelinux.org>
Details
Message ID
<20121121104036.56a41f7b@ncopa-desktop.alpinelinux.org>
In-Reply-To
<1353416120-12198-1-git-send-email-pcastorino@mendoza-conicet.gob.ar> (view parent)
Sender timestamp
1353490836
DKIM signature
missing
Download raw message
On Tue, 20 Nov 2012 09:55:19 -0300
Pablo Castorino <pcastorino@mendoza-conicet.gob.ar> wrote:

> ---
>  testing/ifplugd/APKBUILD      |   48

Applied. I also fixed mandir, added a -doc subpackage and removed
libdaemon depends as it gets autodetected by abuild.

> +++++++++++++++++++++++++++++++++++++++++
> testing/ifplugd/ifplugd.initd |   32 +++++++++++++++++++++++++++ 2
> files changed, 80 insertions(+) create mode 100644
> testing/ifplugd/APKBUILD create mode 100644
> testing/ifplugd/ifplugd.initd
> 
> diff --git a/testing/ifplugd/APKBUILD b/testing/ifplugd/APKBUILD
> new file mode 100644
> index 0000000..8a75dfd
> --- /dev/null
> +++ b/testing/ifplugd/APKBUILD
...

> +start() {
> +	checkconfig || return 1
> +
> +	ebegin "Starting ifplugd"
> +	sh /usr/sbin/ifplugd-helper start

I think the ifplugd-helper script, which appears to be a sysv/upstart
script, should be ported to a proper openrc runscript. In other words,
do what the helper script does in initd instead of just wrap it.

> +	result=$?
> +	eend $result
> +}

-nc


---
Unsubscribe:  alpine-devel+unsubscribe@lists.alpinelinux.org
Help:         alpine-devel+help@lists.alpinelinux.org
---
Reply to thread Export thread (mbox)