Skip to content

Commit

Permalink
Changes to make it easier to bump the version number, also allow the …
Browse files Browse the repository at this point in the history
…individual components to have their own version numbers
  • Loading branch information
pcmoore committed Sep 28, 2006
1 parent edf1433 commit 8e7e412
Show file tree
Hide file tree
Showing 7 changed files with 60 additions and 17 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
NetLabel Tools CHANGELOG
==============================================================================

* Version X.XX (XXXXXX)
* Release X.XX (XXXXXX)
------------------------------------------------------------------------------
o Changed to support the updated use of Netlink attributes by NetLabel
o Ported to use the libnl (version 1.0-pre5/6) library
o Try to cleanup the error reporting a little bit
o Changed the version/release information

* Version 0.16 (August 3, 2006)
------------------------------------------------------------------------------
Expand Down
33 changes: 24 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -56,20 +56,15 @@ SUBDIRS = libnetlabel netlabelctl

all: $(SUBDIRS)

$(SUBDIRS):
@echo "INFO: entering directory $@/ ..."
@$(MAKE) -s -C $@

tarball: clean
@name=$$(grep "^Name:" netlabel_tools.spec | awk '{ print $$2 }'); \
ver=$$(grep "^Version:" netlabel_tools.spec | awk '{ print $$2 }'); \
tarball=$$name-$$ver.tar.gz; \
@ver=$$(. version_info; echo $$VERSION_RELEASE); \
tarball=netlabel_tools-$$ver.tar.gz; \
echo "INFO: creating the tarball ../$$tarball"; \
tmp_dir=$$(mktemp -d /tmp/netlabel_tools.XXXXX); \
rel_dir=$$tmp_dir/$$name-$$ver; \
rel_dir=$$tmp_dir/netlabel_tools-$$ver; \
mkdir $$rel_dir; \
tar cf - . | (cd $$rel_dir; tar xf -); \
(cd $$tmp_dir; tar zcf $$tarball $$name-$$ver); \
(cd $$tmp_dir; tar zcf $$tarball netlabel_tools-$$ver); \
mv $$tmp_dir/$$tarball ..; \
rm -rf $$tmp_dir;

Expand All @@ -82,7 +77,27 @@ install: $(SUBDIRS)
@install -o $(OWNER) -g $(GROUP) -m 644 docs/man/netlabelctl.8 \
$(INSTALL_MAN_DIR)/man8

$(VERSION_HDR): version_info
@echo "INFO: creating the version header file"
@hdr="$(VERSION_HDR)"; \
. version_info; \
echo "/* automatically generated - do not edit */" > $$hdr; \
echo "#ifndef _VERSION_H" >> $$hdr; \
echo "#define _VERSION_H" >> $$hdr; \
echo "#define VERSION_RELEASE \"$$VERSION_RELEASE\"" >> $$hdr; \
echo "#define VERSION_LIBNETLABEL \"$$VERSION_LIBNETLABEL\"" >> $$hdr;\
echo "#define VERSION_NETLABELCTL \"$$VERSION_NETLABELCTL\"" >> $$hdr;\
echo "#define VERSION_NETLABELD \"$$VERSION_NETLABELD\"" >> $$hdr; \
echo "#endif" >> $$hdr;


$(SUBDIRS): $(VERSION_HDR)
@echo "INFO: entering directory $@/ ..."
@$(MAKE) -s -C $@

clean:
@echo "INFO: removing the version header file"; \
rm -f $(VERSION_HDR)
@for dir in $(SUBDIRS); do \
echo "INFO: cleaning in $$dir/"; \
$(MAKE) -s -C $$dir clean; \
Expand Down
5 changes: 5 additions & 0 deletions netlabel_tools.spec → extra/netlabel_tools.spec
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ rm -rf $RPM_BUILD_ROOT
%attr(0644,root,root) %{_mandir}/man8/*

%changelog
* Thu Sep 28 2006 Paul Moore <[email protected]> X.XX-1
- This specfile will no longer be updated for individual release numbers,
however, it will be kept up to date so that it could be used to build
a netlabel_tools RPM once the correct version information has been entered

* Thu Aug 3 2006 Paul Moore <[email protected]> 0.16-1
- Bumped version number.

Expand Down
4 changes: 2 additions & 2 deletions include/libnetlabel.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@
#include <netlink/attr.h>

#include <netlabel.h>
#include <version.h>

/*
* Version
*/

#define NETLBL_VER_STRING "X.XX"
#define NETLBL_VER_DATE "Development"
#define NETLBL_VER_STRING VERSION_LIBNETLABEL

/*
* Types
Expand Down
10 changes: 8 additions & 2 deletions macros.mk
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
# simple /bin/sh script to find the top of the tree
#

TOPDIR = ` \
TOPDIR = $$( \
ftd() { \
cd $$1; \
if [ -r "macros.mk" ]; then \
Expand All @@ -40,7 +40,7 @@ TOPDIR = ` \
ftd "../"; \
fi \
}; \
ftd .`
ftd .)

#
# build configuration
Expand All @@ -52,6 +52,12 @@ LIBFLAGS =
CFLAGS = -O0 -g -Wall
LDFLAGS = -g

#
# build constants
#

VERSION_HDR = include/version.h

#
# build macros
#
Expand Down
7 changes: 4 additions & 3 deletions netlabelctl/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include <getopt.h>

#include <libnetlabel.h>
#include <version.h>

#include "netlabelctl.h"

Expand Down Expand Up @@ -72,9 +73,9 @@ static void nlctl_usage_print(FILE *fp)
static void nlctl_ver_print(FILE *fp)
{
fprintf(fp,
"NetLabel Control Utility, version %s (%s)\n",
NETLBL_VER_STRING,
NETLBL_VER_DATE);
"NetLabel Control Utility, version %s (libnetlabel %s)\n",
VERSION_NETLABELCTL,
NETLBL_VER_STRING);
}

/**
Expand Down
15 changes: 15 additions & 0 deletions version_info
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#
# version_info - version information for the various netlabel tool components
#

# release
VERSION_RELEASE="X.XX"

# libnetlabel
VERSION_LIBNETLABEL="X.XX"

# netlabelctl
VERSION_NETLABELCTL="X.XX"

# netlabeld
VERSION_NETLABELD="X.XX"

0 comments on commit 8e7e412

Please sign in to comment.