mirror of
https://github.com/archlinuxarm/PKGBUILDs.git
synced 2025-01-27 23:44:04 +00:00
added community/netbrake
This commit is contained in:
parent
79c53063c3
commit
2c0977161e
2 changed files with 85 additions and 0 deletions
46
community/netbrake/PKGBUILD
Normal file
46
community/netbrake/PKGBUILD
Normal file
|
@ -0,0 +1,46 @@
|
|||
# $Id$
|
||||
# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
|
||||
# Contributor: Zsolt Varadi <sysop_xxl@fibermail.hu>
|
||||
|
||||
# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
|
||||
# - patch arch-x86_64.patch for AArch64
|
||||
|
||||
pkgname=netbrake
|
||||
pkgver=0.2
|
||||
pkgrel=6
|
||||
pkgdesc="Netbrake is an utility to limit the bandwidth used by a process"
|
||||
arch=(x86_64)
|
||||
url="http://www.hping.org/netbrake/"
|
||||
license=('GPL')
|
||||
depends=(glibc)
|
||||
makedepends=()
|
||||
source=($url/$pkgname-$pkgver.tar.gz
|
||||
arch-x86_64.patch)
|
||||
sha512sums=('be19e7a85a10060874048cfce2715fa0766f477f584ba958fcee05737302f21ed658660f62d55c844440fa61e99689bcf3c3a6454638f11f0e68d52cd850fde5'
|
||||
'74067212147f05a36d59549cf90d4639e8e9f85393c8e2062438b62eb84fb5fd6a72a79edbb452aac20aa8d6742edc45f60c5314b49830ccfcf0ac9ae18cacfa')
|
||||
|
||||
build() {
|
||||
cd "$srcdir"/$pkgname
|
||||
|
||||
[ $CARCH == "x86_64" -o $CARCH == "aarch64" ] && patch -Np1 <../arch-x86_64.patch
|
||||
|
||||
cp Makefile.in Makefile
|
||||
sed -i -e 's|LIBPATH=@LIBPATH@|LIBPATH=/usr/lib|g' Makefile
|
||||
sed -i -e 's|BINPATH=@BINPATH@|BINPATH=/usr/bin|g' Makefile
|
||||
sed -i -e 's|COMPILE_TIME=@COMPILE_TIME@|COMPILE_TIME=-DNB_HTTPFS|g' Makefile
|
||||
|
||||
cp netbrake.h.in netbrake.h
|
||||
sed -i -e 's|#define LIBPATH "@LIBPATH@"|#define LIBPATH "/usr/lib"|g' netbrake.h
|
||||
|
||||
make
|
||||
}
|
||||
|
||||
package() {
|
||||
cd "$srcdir"/$pkgname
|
||||
|
||||
mkdir -p "$pkgdir"/usr/bin
|
||||
mkdir -p "$pkgdir"/usr/lib
|
||||
|
||||
install -m 755 netbrake "$pkgdir"/usr/bin
|
||||
install -m 755 libnetbrake.so.0.1 "$pkgdir"/usr/lib
|
||||
}
|
39
community/netbrake/arch-x86_64.patch
Normal file
39
community/netbrake/arch-x86_64.patch
Normal file
|
@ -0,0 +1,39 @@
|
|||
diff -wbBur netbrake/libnetbrake.c netbrake.my/libnetbrake.c
|
||||
--- netbrake/libnetbrake.c 2003-12-04 09:33:00.000000000 +0300
|
||||
+++ netbrake.my/libnetbrake.c 2007-10-11 13:29:22.000000000 +0400
|
||||
@@ -236,7 +236,7 @@
|
||||
return retval;
|
||||
}
|
||||
|
||||
-int recv(int s, void *buf, size_t len, int flags)
|
||||
+ssize_t recv(int s, void *buf, size_t len, int flags)
|
||||
{
|
||||
int retval;
|
||||
|
||||
@@ -245,7 +245,7 @@
|
||||
return retval;
|
||||
}
|
||||
|
||||
-int recvfrom(int s, void *buf, size_t len, int flags,
|
||||
+ssize_t recvfrom(int s, void *buf, size_t len, int flags,
|
||||
struct sockaddr *from, socklen_t *fromlen)
|
||||
{
|
||||
int retval;
|
||||
@@ -255,7 +255,7 @@
|
||||
return retval;
|
||||
}
|
||||
|
||||
-int send(int s, const void *msg, size_t len , int flags)
|
||||
+ssize_t send(int s, const void *msg, size_t len , int flags)
|
||||
{
|
||||
int retval;
|
||||
|
||||
@@ -264,7 +264,7 @@
|
||||
return retval;
|
||||
}
|
||||
|
||||
-int sendto(int s, const void *msg, size_t len, int flags,
|
||||
+ssize_t sendto(int s, const void *msg, size_t len, int flags,
|
||||
const struct sockaddr *to, socklen_t tolen)
|
||||
{
|
||||
int retval;
|
Loading…
Reference in a new issue