Skip to content

Commit

Permalink
add makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
EZLippi committed Apr 13, 2015
1 parent 65a3296 commit c2c7f34
Show file tree
Hide file tree
Showing 14 changed files with 840 additions and 0 deletions.
1 change: 1 addition & 0 deletions COPYRIGHT
1 change: 1 addition & 0 deletions ChangeLog
40 changes: 40 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
CFLAGS?= -Wall -ggdb -W -O
CC?= gcc
LIBS?=
LDFLAGS?=
PREFIX?= /usr/local
VERSION=1.5
TMPDIR=/tmp/webbench-$(VERSION)

all: webbench tags

tags: *.c
-ctags *.c

install: webbench
install -s webbench $(DESTDIR)$(PREFIX)/bin
install -m 644 webbench.1 $(DESTDIR)$(PREFIX)/man/man1
install -d $(DESTDIR)$(PREFIX)/share/doc/webbench
install -m 644 debian/copyright $(DESTDIR)$(PREFIX)/share/doc/webbench
install -m 644 debian/changelog $(DESTDIR)$(PREFIX)/share/doc/webbench

webbench: webbench.o Makefile
$(CC) $(CFLAGS) $(LDFLAGS) -o webbench webbench.o $(LIBS)

clean:
-rm -f *.o webbench *~ core *.core tags

tar: clean
-debian/rules clean
rm -rf $(TMPDIR)
install -d $(TMPDIR)
cp -p Makefile webbench.c socket.c webbench.1 $(TMPDIR)
install -d $(TMPDIR)/debian
-cp -p debian/* $(TMPDIR)/debian
ln -sf debian/copyright $(TMPDIR)/COPYRIGHT
ln -sf debian/changelog $(TMPDIR)/ChangeLog
-cd $(TMPDIR) && cd .. && tar cozf webbench-$(VERSION).tar.gz webbench-$(VERSION)

webbench.o: webbench.c socket.c Makefile

.PHONY: clean install all tar
56 changes: 56 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
webbench (1.5) unstable; urgency=low

* allow building with both Gnu and BSD make

-- Radim Kolar <hsn@home> Fri, Jun 25 12:00:20 CEST 2004

webbench (1.4) unstable; urgency=low

* check if url is not too long
* report correct program version number
* use yield() when waiting for test start
* corrected error codes
* check availability of test server first
* do not abort test if first request failed
* report when some childrens are dead.
* use alarm, not time() for lower syscal use by bench
* use mode 644 for installed doc
* makefile cleaned for better freebsd ports integration

-- Radim Kolar <hsn@home> Thu, 15 Jan 2004 11:15:52 +0100

webbench (1.3) unstable; urgency=low

* Build fixes for freeBSD
* Default benchmark time 60 -> 30
* generate tar with subdirectory
* added to freeBSD ports collection

-- Radim Kolar <hsn@home> Mon, 12 Jan 2004 17:00:24 +0100

webbench (1.2) unstable; urgency=low

* Only debian-related bugfixes
* Updated Debian/rules
* Adapted to fit new directory system
* moved from debstd to dh_*

-- Radim Kolar <hsn@home> Fri, 18 Jan 2002 12:33:04 +0100

webbench (1.1) unstable; urgency=medium

* Program debianized
* added support for multiple methods (GET, HEAD, OPTIONS, TRACE)
* added support for multiple HTTP versions (0.9 -- 1.1)
* added long options
* added multiple clients
* wait for start of second before test
* test time can be specified
* better error checking when reading reply from server
* FIX: tests was one second longer than expected

-- Radim Kolar <hsn@home> Thu, 16 Sep 1999 18:48:00 +0200

Local variables:
mode: debian-changelog
End:
14 changes: 14 additions & 0 deletions debian/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Source: webbench
Section: web
Priority: extra
Maintainer: Radim Kolar <hsn@cybermail.net>
Build-Depends: debhelper (>> 3.0.0)
Standards-Version: 3.5.2

Package: webbench
Architecture: any
Depends: ${shlibs:Depends}
Description: Simple forking Web benchmark
webbench is very simple program for benchmarking WWW or Proxy servers.
Uses fork() for simulating multiple clients load. Can use HTTP 0.9 - 1.1
requests, but Keep-Alive connections are not supported.
6 changes: 6 additions & 0 deletions debian/copyright
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Webbench was written by Radim Kolar 1997-2004 (hsn@netmag.cz).

UNIX sockets code (socket.c) taken from popclient 1.5 4/1/94
public domain code, created by Virginia Tech Computing Center.

Copyright: GPL (see /usr/share/common-licenses/GPL)
1 change: 1 addition & 0 deletions debian/dirs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
usr/bin
64 changes: 64 additions & 0 deletions debian/rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
#!/usr/bin/make -f
# Sample debian/rules that uses debhelper.
# GNU copyright 1997 to 1999 by Joey Hess.

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

# This is the debhelper compatability version to use.
export DH_COMPAT=3

configure: configure-stamp
configure-stamp:
dh_testdir
touch configure-stamp

build: configure-stamp build-stamp
build-stamp:
dh_testdir
$(MAKE)
touch build-stamp

clean:
dh_testdir
rm -f build-stamp configure-stamp

# Add here commands to clean up after the build process.
-$(MAKE) clean

dh_clean

install: build
dh_testdir
dh_testroot
dh_clean -k
dh_installdirs

# Add here commands to install the package into debian/webbench.
$(MAKE) install DESTDIR=$(CURDIR)/debian/webbench


# Build architecture-independent files here.
binary-indep: build install
# We have nothing to do by default.

# Build architecture-dependent files here.
binary-arch: build install
dh_testdir
dh_testroot
dh_installdocs
dh_installman webbench.1
dh_installchangelogs
dh_link
dh_strip
dh_compress
dh_fixperms
# dh_makeshlibs
dh_installdeb
dh_shlibdeps
dh_gencontrol
dh_md5sums
dh_builddeb

binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install configure
58 changes: 58 additions & 0 deletions socket.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/* $Id: socket.c 1.1 1995/01/01 07:11:14 cthuang Exp $
*
* This module has been modified by Radim Kolar for OS/2 emx
*/

/***********************************************************************
module: socket.c
program: popclient
SCCS ID: @(#)socket.c 1.5 4/1/94
programmer: Virginia Tech Computing Center
compiler: DEC RISC C compiler (Ultrix 4.1)
environment: DEC Ultrix 4.3
description: UNIX sockets code.
***********************************************************************/

#include <sys/types.h>
#include <sys/socket.h>
#include <fcntl.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <sys/time.h>
#include <string.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>

int Socket(const char *host, int clientPort)
{
int sock;
unsigned long inaddr;
struct sockaddr_in ad;
struct hostent *hp;

memset(&ad, 0, sizeof(ad));
ad.sin_family = AF_INET;

inaddr = inet_addr(host);
if (inaddr != INADDR_NONE)
memcpy(&ad.sin_addr, &inaddr, sizeof(inaddr));
else
{
hp = gethostbyname(host);
if (hp == NULL)
return -1;
memcpy(&ad.sin_addr, hp->h_addr, hp->h_length);
}
ad.sin_port = htons(clientPort);

sock = socket(AF_INET, SOCK_STREAM, 0);
if (sock < 0)
return sock;
if (connect(sock, (struct sockaddr *)&ad, sizeof(ad)) < 0)
return -1;
return sock;
}

46 changes: 46 additions & 0 deletions tags
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
!_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/
!_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/
!_TAG_PROGRAM_AUTHOR Darren Hiebert /dhiebert@users.sourceforge.net/
!_TAG_PROGRAM_NAME Exuberant Ctags //
!_TAG_PROGRAM_URL http://ctags.sourceforge.net /official site/
!_TAG_PROGRAM_VERSION 5.9~svn20110310 //
CC Makefile /^CC?= gcc$/;" m
CFLAGS Makefile /^CFLAGS?= -Wall -ggdb -W -O$/;" m
DH_COMPAT debian/rules /^export DH_COMPAT=3$/;" m
LDFLAGS Makefile /^LDFLAGS?=$/;" m
LIBS Makefile /^LIBS?=$/;" m
METHOD_GET webbench.c 35;" d file:
METHOD_HEAD webbench.c 36;" d file:
METHOD_OPTIONS webbench.c 37;" d file:
METHOD_TRACE webbench.c 38;" d file:
PREFIX Makefile /^PREFIX?= \/usr\/local$/;" m
PROGRAM_VERSION webbench.c 39;" d file:
REQUEST_SIZE webbench.c 50;" d file:
Socket socket.c /^int Socket(const char *host, int clientPort)$/;" f signature:(const char *host, int clientPort)
TMPDIR Makefile /^TMPDIR=\/tmp\/webbench-$(VERSION)$/;" m
VERSION Makefile /^VERSION=1.5$/;" m
alarm_handler webbench.c /^static void alarm_handler(int signal)$/;" f file: signature:(int signal)
bench webbench.c /^static int bench(void)$/;" f file: signature:(void)
bench webbench.c /^static int bench(void);$/;" p file: signature:(void)
benchcore webbench.c /^static void benchcore(const char* host,const int port, const char *request);$/;" p file: signature:(const char* host,const int port, const char *request)
benchcore webbench.c /^void benchcore(const char *host,const int port,const char *req)$/;" f signature:(const char *host,const int port,const char *req)
benchtime webbench.c /^int benchtime=30;$/;" v
build_request webbench.c /^static void build_request(const char *url);$/;" p file: signature:(const char *url)
build_request webbench.c /^void build_request(const char *url)$/;" f signature:(const char *url)
bytes webbench.c /^int bytes=0;$/;" v
clients webbench.c /^int clients=1;$/;" v
failed webbench.c /^int failed=0;$/;" v
force webbench.c /^int force=0;$/;" v
force_reload webbench.c /^int force_reload=0;$/;" v
host webbench.c /^char host[MAXHOSTNAMELEN];$/;" v
http10 webbench.c /^int http10=1; \/* 0 - http\/0.9, 1 - http\/1.0, 2 - http\/1.1 *\/$/;" v
long_options webbench.c /^static const struct option long_options[]=$/;" v typeref:struct:option file:
main webbench.c /^int main(int argc, char *argv[])$/;" f signature:(int argc, char *argv[])
method webbench.c /^int method=METHOD_GET;$/;" v
mypipe webbench.c /^int mypipe[2];$/;" v
proxyhost webbench.c /^char *proxyhost=NULL;$/;" v
proxyport webbench.c /^int proxyport=80;$/;" v
request webbench.c /^char request[REQUEST_SIZE];$/;" v
speed webbench.c /^int speed=0;$/;" v
timerexpired webbench.c /^volatile int timerexpired=0;$/;" v
usage webbench.c /^static void usage(void)$/;" f file: signature:(void)
Binary file added webbench
Binary file not shown.
Loading

0 comments on commit c2c7f34

Please sign in to comment.