Skip to content

Commit 8e7e412

Browse files
committed
Changes to make it easier to bump the version number, also allow the individual components to have their own version numbers
1 parent edf1433 commit 8e7e412

File tree

7 files changed

+60
-17
lines changed

7 files changed

+60
-17
lines changed

CHANGELOG

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
NetLabel Tools CHANGELOG
22
==============================================================================
33

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

1011
* Version 0.16 (August 3, 2006)
1112
------------------------------------------------------------------------------

Makefile

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -56,20 +56,15 @@ SUBDIRS = libnetlabel netlabelctl
5656

5757
all: $(SUBDIRS)
5858

59-
$(SUBDIRS):
60-
@echo "INFO: entering directory $@/ ..."
61-
@$(MAKE) -s -C $@
62-
6359
tarball: clean
64-
@name=$$(grep "^Name:" netlabel_tools.spec | awk '{ print $$2 }'); \
65-
ver=$$(grep "^Version:" netlabel_tools.spec | awk '{ print $$2 }'); \
66-
tarball=$$name-$$ver.tar.gz; \
60+
@ver=$$(. version_info; echo $$VERSION_RELEASE); \
61+
tarball=netlabel_tools-$$ver.tar.gz; \
6762
echo "INFO: creating the tarball ../$$tarball"; \
6863
tmp_dir=$$(mktemp -d /tmp/netlabel_tools.XXXXX); \
69-
rel_dir=$$tmp_dir/$$name-$$ver; \
64+
rel_dir=$$tmp_dir/netlabel_tools-$$ver; \
7065
mkdir $$rel_dir; \
7166
tar cf - . | (cd $$rel_dir; tar xf -); \
72-
(cd $$tmp_dir; tar zcf $$tarball $$name-$$ver); \
67+
(cd $$tmp_dir; tar zcf $$tarball netlabel_tools-$$ver); \
7368
mv $$tmp_dir/$$tarball ..; \
7469
rm -rf $$tmp_dir;
7570

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

80+
$(VERSION_HDR): version_info
81+
@echo "INFO: creating the version header file"
82+
@hdr="$(VERSION_HDR)"; \
83+
. version_info; \
84+
echo "/* automatically generated - do not edit */" > $$hdr; \
85+
echo "#ifndef _VERSION_H" >> $$hdr; \
86+
echo "#define _VERSION_H" >> $$hdr; \
87+
echo "#define VERSION_RELEASE \"$$VERSION_RELEASE\"" >> $$hdr; \
88+
echo "#define VERSION_LIBNETLABEL \"$$VERSION_LIBNETLABEL\"" >> $$hdr;\
89+
echo "#define VERSION_NETLABELCTL \"$$VERSION_NETLABELCTL\"" >> $$hdr;\
90+
echo "#define VERSION_NETLABELD \"$$VERSION_NETLABELD\"" >> $$hdr; \
91+
echo "#endif" >> $$hdr;
92+
93+
94+
$(SUBDIRS): $(VERSION_HDR)
95+
@echo "INFO: entering directory $@/ ..."
96+
@$(MAKE) -s -C $@
97+
8598
clean:
99+
@echo "INFO: removing the version header file"; \
100+
rm -f $(VERSION_HDR)
86101
@for dir in $(SUBDIRS); do \
87102
echo "INFO: cleaning in $$dir/"; \
88103
$(MAKE) -s -C $$dir clean; \

netlabel_tools.spec renamed to extra/netlabel_tools.spec

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ rm -rf $RPM_BUILD_ROOT
3737
%attr(0644,root,root) %{_mandir}/man8/*
3838

3939
%changelog
40+
* Thu Sep 28 2006 Paul Moore <paul.moore@hp.com> X.XX-1
41+
- This specfile will no longer be updated for individual release numbers,
42+
however, it will be kept up to date so that it could be used to build
43+
a netlabel_tools RPM once the correct version information has been entered
44+
4045
* Thu Aug 3 2006 Paul Moore <paul.moore@hp.com> 0.16-1
4146
- Bumped version number.
4247

include/libnetlabel.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@
3434
#include <netlink/attr.h>
3535

3636
#include <netlabel.h>
37+
#include <version.h>
3738

3839
/*
3940
* Version
4041
*/
4142

42-
#define NETLBL_VER_STRING "X.XX"
43-
#define NETLBL_VER_DATE "Development"
43+
#define NETLBL_VER_STRING VERSION_LIBNETLABEL
4444

4545
/*
4646
* Types

macros.mk

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
# simple /bin/sh script to find the top of the tree
3232
#
3333

34-
TOPDIR = ` \
34+
TOPDIR = $$( \
3535
ftd() { \
3636
cd $$1; \
3737
if [ -r "macros.mk" ]; then \
@@ -40,7 +40,7 @@ TOPDIR = ` \
4040
ftd "../"; \
4141
fi \
4242
}; \
43-
ftd .`
43+
ftd .)
4444

4545
#
4646
# build configuration
@@ -52,6 +52,12 @@ LIBFLAGS =
5252
CFLAGS = -O0 -g -Wall
5353
LDFLAGS = -g
5454

55+
#
56+
# build constants
57+
#
58+
59+
VERSION_HDR = include/version.h
60+
5561
#
5662
# build macros
5763
#

netlabelctl/main.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
#include <getopt.h>
3333

3434
#include <libnetlabel.h>
35+
#include <version.h>
3536

3637
#include "netlabelctl.h"
3738

@@ -72,9 +73,9 @@ static void nlctl_usage_print(FILE *fp)
7273
static void nlctl_ver_print(FILE *fp)
7374
{
7475
fprintf(fp,
75-
"NetLabel Control Utility, version %s (%s)\n",
76-
NETLBL_VER_STRING,
77-
NETLBL_VER_DATE);
76+
"NetLabel Control Utility, version %s (libnetlabel %s)\n",
77+
VERSION_NETLABELCTL,
78+
NETLBL_VER_STRING);
7879
}
7980

8081
/**

version_info

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#
2+
# version_info - version information for the various netlabel tool components
3+
#
4+
5+
# release
6+
VERSION_RELEASE="X.XX"
7+
8+
# libnetlabel
9+
VERSION_LIBNETLABEL="X.XX"
10+
11+
# netlabelctl
12+
VERSION_NETLABELCTL="X.XX"
13+
14+
# netlabeld
15+
VERSION_NETLABELD="X.XX"

0 commit comments

Comments
 (0)