Commit 81bb34b9 authored by yorn's avatar yorn

Add building of RPM and DEB packages

parent 3c9083ff
*.o *.o
*.rpm
*.deb
*~ *~
/crude/crude /crude/crude
/rude/rude /rude/rude
......
...@@ -18,6 +18,16 @@ all: ...@@ -18,6 +18,16 @@ all:
(cd $$i && $(MAKE) all) \ (cd $$i && $(MAKE) all) \
done done
rpm:
@for i in $(SUBDIRS); do \
(cd $$i && $(MAKE) rpm) \
done
deb:
@for i in $(SUBDIRS); do \
(cd $$i && $(MAKE) deb) \
done
clean: clean:
rm -f *~ config.cache config.log config.status rm -f *~ config.cache config.log config.status
@for i in $(SUBDIRS); do \ @for i in $(SUBDIRS); do \
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
############################################################################## ##############################################################################
# Process any command-line arguments and find the source code directory # Process any command-line arguments and find the source code directory
AC_INIT(rude/main.c) AC_INIT([RUDE and CRUDE], m4_esyscmd([grep VERSION include/rude.h | cut -d\" -f2 | tr -d '\n']))
# Set the auxilary directory, make and install # Set the auxilary directory, make and install
AC_CONFIG_AUX_DIR(autoconf) AC_CONFIG_AUX_DIR(autoconf)
......
...@@ -19,15 +19,17 @@ mandir = @mandir@/man8 ...@@ -19,15 +19,17 @@ mandir = @mandir@/man8
sbindir = @sbindir@ sbindir = @sbindir@
srcdir = @srcdir@ srcdir = @srcdir@
INSTALL = @INSTALL@ -o root -g root -m 0755 BININSTALL = @INSTALL@ -o root -g root -m 0755
VPATH = @srcdir@ MANINSTALL = @INSTALL@ -o root -g root -m 0644
VERSION = @PACKAGE_VERSION@
VPATH = @srcdir@
CC = @CC@ CC = @CC@
CFLAGS = @CFLAGS@ CFLAGS = @CFLAGS@
LDFLAGS = @LDFLAGS@ LDFLAGS = @LDFLAGS@
DEFS = @DEFS@ DEFS = @DEFS@
LIBS = @LIBS@ LIBS = @LIBS@
MAN8 = crude.8 MAN8 = crude.8
CRUDE_OBJS = main.o ../rude/mcast.o CRUDE_OBJS = main.o ../rude/mcast.o
...@@ -43,14 +45,24 @@ crude: $(CRUDE_OBJS) ...@@ -43,14 +45,24 @@ crude: $(CRUDE_OBJS)
$(CC) $(CFLAGS) $(LIBS) $(DEFS) $(LDFLAGS) -o crude $(CRUDE_OBJS) $(CC) $(CFLAGS) $(LIBS) $(DEFS) $(LDFLAGS) -o crude $(CRUDE_OBJS)
clean: clean:
rm -f *~ *.o crude rm -f *~ *.o *.rpm *.deb crude
distclean: distclean:
rm -f *~ *.o crude Makefile rm -f *~ *.o *.rpm *.deb crude Makefile
install: crude install: crude
@if [ ! -d $(bindir) ]; then mkdir -m 0755 $(bindir); fi; @if [ ! -d $(bindir) ]; then mkdir -m 0755 $(bindir); fi;
$(INSTALL) crude $(bindir) $(BININSTALL) crude $(bindir)
@if [ ! -d $(mandir) ]; then mkdir -m 0755 $(mandir); fi; @if [ ! -d $(mandir) ]; then mkdir -m 0755 $(mandir); fi;
$(INSTALL) crude.8 $(mandir) $(MANINSTALL) crude.8 $(mandir)
rpm deb: | crude
fpm -s dir -t $@ -n crude -v $(VERSION) \
--replaces crude \
--description "collector for rude (real-time UDP data emitter)" \
--url "http://rude.sourceforge.net" \
crude=$(bindir)/crude \
crude.8=$(mandir)/crude.8 \
############################################################################## ##############################################################################
...@@ -19,15 +19,17 @@ mandir = @mandir@/man8 ...@@ -19,15 +19,17 @@ mandir = @mandir@/man8
sbindir = @sbindir@ sbindir = @sbindir@
srcdir = @srcdir@ srcdir = @srcdir@
INSTALL = @INSTALL@ -o root -g root -m 0755 BININSTALL = @INSTALL@ -o root -g root -m 0755
VPATH = @srcdir@ MANINSTALL = @INSTALL@ -o root -g root -m 0644
VERSION = @PACKAGE_VERSION@
VPATH = @srcdir@
CC = @CC@ CC = @CC@
CFLAGS = @CFLAGS@ CFLAGS = @CFLAGS@
LDFLAGS = @LDFLAGS@ LDFLAGS = @LDFLAGS@
DEFS = @DEFS@ DEFS = @DEFS@
LIBS = @LIBS@ LIBS = @LIBS@
MAN8 = rude.8 MAN8 = rude.8
RUDE_OBJS = flow_cntl.o flow_txmit.o main.o parse.o mcast.o RUDE_OBJS = flow_cntl.o flow_txmit.o main.o parse.o mcast.o
...@@ -43,16 +45,24 @@ rude: $(RUDE_OBJS) ...@@ -43,16 +45,24 @@ rude: $(RUDE_OBJS)
$(CC) $(CFLAGS) $(LIBS) $(DEFS) $(LDFLAGS) -o rude $(RUDE_OBJS) $(CC) $(CFLAGS) $(LIBS) $(DEFS) $(LDFLAGS) -o rude $(RUDE_OBJS)
clean: clean:
rm -f *~ *.o rude rm -f *~ *.o *.rpm *.deb rude
distclean: distclean:
rm -f *~ *.o rude Makefile rm -f *~ *.o *.rpm *.deb rude Makefile
install: rude install: rude
@if [ ! -d $(bindir) ]; then mkdir -m 0755 $(bindir); fi; @if [ ! -d $(bindir) ]; then mkdir -m 0755 $(bindir); fi;
$(INSTALL) rude $(bindir) $(BININSTALL) rude $(bindir)
@if [ ! -d $(mandir) ]; then mkdir -m 0755 $(mandir); fi; @if [ ! -d $(mandir) ]; then mkdir -m 0755 $(mandir); fi;
$(INSTALL) rude.8 $(mandir) $(MANINSTALL) rude.8 $(mandir)
rpm deb: | rude
fpm -s dir -t $@ -n rude -v $(VERSION) \
--replaces rude \
--description "real-time UDP data emitter" \
--url "http://rude.sourceforge.net" \
rude=$(bindir)/rude \
rude.8=$(mandir)/rude.8 \
############################################################################## ##############################################################################
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment