~alpine/devel

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
3 2

[alpine-devel] [PATCH] New package - wifidog embedded captive portal

Nathan Angelacos <nangel@alpinelinux.org>
Details
Message ID
<1332712338-4483-1-git-send-email-nangel@alpinelinux.org>
Sender timestamp
1332712338
DKIM signature
missing
Download raw message
Patch: +78 -0
	new file:   testing/wifidog/APKBUILD
	new file:   testing/wifidog/wifidog.initd
---
 testing/wifidog/APKBUILD      |   39 +++++++++++++++++++++++++++++++++++++++
 testing/wifidog/wifidog.initd |   39 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 78 insertions(+), 0 deletions(-)
 create mode 100644 testing/wifidog/APKBUILD
 create mode 100755 testing/wifidog/wifidog.initd

diff --git a/testing/wifidog/APKBUILD b/testing/wifidog/APKBUILD
new file mode 100644
index 0000000..3e16875
--- /dev/null
+++ b/testing/wifidog/APKBUILD
@@ -0,0 +1,39 @@
# Maintainer: Nathan Angelacos <nangel@alpinelinux.org>
pkgname=wifidog
pkgver=20090925
pkgrel=0
pkgdesc="Wifi Captive Portal"
url="http://dev.wifidog.org/"
arch="all"
license="GPL-2"
depends=
makedepends=
subpackages="$pkgname-doc"
source="http://downloads.sourceforge.net/$pkgname/$pkgname-$pkgver.tar.gz
	wifidog.initd"

_httplib=/usr/lib

_builddir="$srcdir/$pkgname-$pkgver"
build() {
	cd "$_builddir"
	./configure --prefix=/usr --sysconfdir=/etc/wifidog || return 1
	make || return 1
}

package() {
	cd "$_builddir"
	make DESTDIR="$pkgdir/" install || return 1
	mkdir -p "$pkgdir"/etc/wifidog || return
	cp "$_builddir"/wifidog.conf "$pkgdir"/etc/wifidog/wifidog.conf
	cp "$_builddir"/wifidog-msg.html "$pkgdir"/etc/wifidog/wifidog-msg.html
	rm -rf "$pkgdir"/usr/include || return 1	
	rm "$pkgdir"/$_httplib/*.la || return 1	
	rm "$pkgdir"/$_httplib/*.a || return 1	
        install -Dm755 "$srcdir"/wifidog.initd "$pkgdir"/etc/init.d/wifidog \
		|| return 1

}

md5sums="e3ecacba67a91b6ea3c1072ba6c5a0b4  wifidog-20090925.tar.gz
410267a956ee1b12669353771fe3cafa  wifidog.initd"
diff --git a/testing/wifidog/wifidog.initd b/testing/wifidog/wifidog.initd
new file mode 100755
index 0000000..c5e3b37
--- /dev/null
+++ b/testing/wifidog/wifidog.initd
@@ -0,0 +1,39 @@
#!/sbin/runscript
# Copyright 2012 Nathan Angelacos for Alpine Linux
# Distributed under the terms of the GNU General Public License v2

SVCDIR=${SVCDIR:-/etc/wifidog}
SVC=${SVCNAME#*.}
if [ -n "${SVC}" ] && [ ${SVCNAME} != "wifidog" ]; then
	SVCPID="/var/run/wifidog.${SVC}.pid"
else
	SVCPID="/var/run/wifidog.pid"
fi
SVCCONF="${SVCDIR}/${SVC}.conf"

depend() {
	need  net
	use   dns
}


start() {
	ebegin "Starting ${SVCNAME}"

	start-stop-daemon --start --exec /usr/bin/wifidog -b -m --pidfile "${SVCPID}" \
		-- -f -s -c ${SVCCONF} ${CONF} 2&>1 >/dev/null
	if ! [ -d /proc/`cat ${SVCPID}` ]; then
		rm -f "${SVCPID}"
		eend 1 
		return 1
	fi
	eend 0
}

stop() {
	ebegin "Stopping ${SVCNAME}"
	start-stop-daemon --stop --quiet \
		--exec /usr/sbin/wifidog --pidfile "${SVCPID}"
	eend $?
}

-- 
1.7.7.1



---
Unsubscribe:  alpine-devel+unsubscribe@lists.alpinelinux.org
Help:         alpine-devel+help@lists.alpinelinux.org
---
Nathan Angelacos <nangel@nothome.org>
Details
Message ID
<4F70CA79.5080907@nothome.org>
In-Reply-To
<20120326214351.349fe605@alpinelinux.org> (view parent)
Sender timestamp
1332791929
DKIM signature
missing
Download raw message
On 03/26/2012 12:43 PM, Natanael Copa wrote:
> On Sun, 25 Mar 2012 21:52:18 +0000
> Nathan Angelacos<nangel@alpinelinux.org>  wrote:
>
>> 	new file:   testing/wifidog/APKBUILD
>> 	new file:   testing/wifidog/wifidog.initd
>> ---
>>   testing/wifidog/APKBUILD      |   39
>> +++++++++++++++++++++++++++++++++++++++ testing/wifidog/wifidog.initd
>> |   39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 78
>> insertions(+), 0 deletions(-) create mode 100644
>> testing/wifidog/APKBUILD create mode 100755
>> testing/wifidog/wifidog.initd
>
> I applied the patch. thanks!

> warning: 5 lines add whitespace errors.

Ok, I'll try to watch for that in the future.

>> +	rm -rf "$pkgdir"/usr/include || return 1	
>
> Why not craete a wifidog-dev package?

Because the include file is not for wifidog at all. Its from  of 
http://www.hughes.com.au/products/libhttpd/ (something wifidog uses 
internally.)

I have no idea why they thought it was a good idea to include it in the 
install process.



---
Unsubscribe:  alpine-devel+unsubscribe@lists.alpinelinux.org
Help:         alpine-devel+help@lists.alpinelinux.org
---
Natanael Copa <ncopa@alpinelinux.org>
Details
Message ID
<20120326214351.349fe605@alpinelinux.org>
In-Reply-To
<1332712338-4483-1-git-send-email-nangel@alpinelinux.org> (view parent)
Sender timestamp
1332791031
DKIM signature
missing
Download raw message
On Sun, 25 Mar 2012 21:52:18 +0000
Nathan Angelacos <nangel@alpinelinux.org> wrote:

> 	new file:   testing/wifidog/APKBUILD
> 	new file:   testing/wifidog/wifidog.initd
> ---
>  testing/wifidog/APKBUILD      |   39
> +++++++++++++++++++++++++++++++++++++++ testing/wifidog/wifidog.initd
> |   39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 78
> insertions(+), 0 deletions(-) create mode 100644
> testing/wifidog/APKBUILD create mode 100755
> testing/wifidog/wifidog.initd

I applied the patch. thanks!

some comments below.


Applying: New package - wifidog embedded captive portal
/home/ncopa/aports/.git/rebase-apply/patch:43: trailing whitespace.
        rm -rf "$pkgdir"/usr/include || return 1
/home/ncopa/aports/.git/rebase-apply/patch:44: trailing whitespace.
        rm "$pkgdir"/$_httplib/*.la || return 1
/home/ncopa/aports/.git/rebase-apply/patch:45: trailing whitespace.
        rm "$pkgdir"/$_httplib/*.a || return 1
/home/ncopa/aports/.git/rebase-apply/patch:85: trailing whitespace.
                eend 1 
/home/ncopa/aports/.git/rebase-apply/patch:97: new blank line at EOF.
+
warning: 5 lines add whitespace errors.


> 
> diff --git a/testing/wifidog/APKBUILD b/testing/wifidog/APKBUILD
> new file mode 100644
> index 0000000..3e16875
> --- /dev/null
> +++ b/testing/wifidog/APKBUILD
> @@ -0,0 +1,39 @@
> +# Maintainer: Nathan Angelacos <nangel@alpinelinux.org>
> +pkgname=wifidog
> +pkgver=20090925
> +pkgrel=0
> +pkgdesc="Wifi Captive Portal"
> +url="http://dev.wifidog.org/"
> +arch="all"
> +license="GPL-2"
> +depends=
> +makedepends=
> +subpackages="$pkgname-doc"
> +source="http://downloads.sourceforge.net/$pkgname/$pkgname-$pkgver.tar.gz
> +	wifidog.initd"
> +
> +_httplib=/usr/lib
> +
> +_builddir="$srcdir/$pkgname-$pkgver"
> +build() {
> +	cd "$_builddir"
> +	./configure --prefix=/usr --sysconfdir=/etc/wifidog ||
> return 1
> +	make || return 1
> +}
> +
> +package() {
> +	cd "$_builddir"
> +	make DESTDIR="$pkgdir/" install || return 1
> +	mkdir -p "$pkgdir"/etc/wifidog || return
> +	cp "$_builddir"/wifidog.conf
> "$pkgdir"/etc/wifidog/wifidog.conf
> +	cp "$_builddir"/wifidog-msg.html
> "$pkgdir"/etc/wifidog/wifidog-msg.html
> +	rm -rf "$pkgdir"/usr/include || return 1	

Why not craete a wifidog-dev package?

> +	rm "$pkgdir"/$_httplib/*.la || return 1	
> +	rm "$pkgdir"/$_httplib/*.a || return 1	
> +        install -Dm755 "$srcdir"/wifidog.initd
> "$pkgdir"/etc/init.d/wifidog \
> +		|| return 1
> +
> +}
> +
> +md5sums="e3ecacba67a91b6ea3c1072ba6c5a0b4  wifidog-20090925.tar.gz
> +410267a956ee1b12669353771fe3cafa  wifidog.initd"
> diff --git a/testing/wifidog/wifidog.initd
> b/testing/wifidog/wifidog.initd new file mode 100755
> index 0000000..c5e3b37
> --- /dev/null
> +++ b/testing/wifidog/wifidog.initd
> @@ -0,0 +1,39 @@
> +#!/sbin/runscript
> +# Copyright 2012 Nathan Angelacos for Alpine Linux
> +# Distributed under the terms of the GNU General Public License v2
> +
> +SVCDIR=${SVCDIR:-/etc/wifidog}
> +SVC=${SVCNAME#*.}
> +if [ -n "${SVC}" ] && [ ${SVCNAME} != "wifidog" ]; then
> +	SVCPID="/var/run/wifidog.${SVC}.pid"
> +else
> +	SVCPID="/var/run/wifidog.pid"
> +fi
> +SVCCONF="${SVCDIR}/${SVC}.conf"
> +
> +depend() {
> +	need  net
> +	use   dns
> +}
> +
> +
> +start() {
> +	ebegin "Starting ${SVCNAME}"
> +
> +	start-stop-daemon --start --exec /usr/bin/wifidog -b -m
> --pidfile "${SVCPID}" \
> +		-- -f -s -c ${SVCCONF} ${CONF} 2&>1 >/dev/null
> +	if ! [ -d /proc/`cat ${SVCPID}` ]; then
> +		rm -f "${SVCPID}"
> +		eend 1 
> +		return 1
> +	fi
> +	eend 0
> +}
> +
> +stop() {
> +	ebegin "Stopping ${SVCNAME}"
> +	start-stop-daemon --stop --quiet \
> +		--exec /usr/sbin/wifidog --pidfile "${SVCPID}"
> +	eend $?
> +}
> +



---
Unsubscribe:  alpine-devel+unsubscribe@lists.alpinelinux.org
Help:         alpine-devel+help@lists.alpinelinux.org
---
Natanael Copa <ncopa@alpinelinux.org>
Details
Message ID
<20120327171140.5b9c468c@alpinelinux.org>
In-Reply-To
<4F70CA79.5080907@nothome.org> (view parent)
Sender timestamp
1332861100
DKIM signature
missing
Download raw message
On Mon, 26 Mar 2012 12:58:49 -0700
Nathan Angelacos <nangel@nothome.org> wrote:

> On 03/26/2012 12:43 PM, Natanael Copa wrote:
> > On Sun, 25 Mar 2012 21:52:18 +0000
> > Nathan Angelacos<nangel@alpinelinux.org>  wrote:
> >
> >> 	new file:   testing/wifidog/APKBUILD
> >> 	new file:   testing/wifidog/wifidog.initd
> >> ---
> >>   testing/wifidog/APKBUILD      |   39
> >> +++++++++++++++++++++++++++++++++++++++
> >> testing/wifidog/wifidog.initd |   39
> >> +++++++++++++++++++++++++++++++++++++++ 2 files changed, 78
> >> insertions(+), 0 deletions(-) create mode 100644
> >> testing/wifidog/APKBUILD create mode 100755
> >> testing/wifidog/wifidog.initd
> >
> > I applied the patch. thanks!
> 
> > warning: 5 lines add whitespace errors.
> 
> Ok, I'll try to watch for that in the future.
> 
> >> +	rm -rf "$pkgdir"/usr/include || return 1	
> >
> > Why not craete a wifidog-dev package?
> 
> Because the include file is not for wifidog at all. Its from  of 
> http://www.hughes.com.au/products/libhttpd/ (something wifidog uses 
> internally.)
> 
> I have no idea why they thought it was a good idea to include it in
> the install process.

They probably just cloned the sources. They also ship libhttp as a
shared lib.

I think we should either:
* make wifidog link static to libhttp
* put libhttp in separate apkbuild

But we don't really need to anything of it til some other package start
use libhttp and causes a file conflict.

Thanks!

-nc


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