summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorP. J. McDermott <pjm@nac.net>2012-02-13 22:41:37 (EST)
committer P. J. McDermott <pjm@nac.net>2012-02-13 22:41:37 (EST)
commit9ce21757892648fa12d66747deed0dd9db790b9e (patch)
treec6ae6885ff771bcdadfa05c968bcf5e8cb5e7b1d
parentde1fd1294b9d5f1853c369d7c8825f3e8f2fd4ef (diff)
Add distribution targets to build system.
-rw-r--r--Makefile.in23
-rwxr-xr-xconfigure4
-rw-r--r--lib/Makefile.in11
-rw-r--r--man/Makefile.in11
-rw-r--r--src/Makefile.in11
5 files changed, 59 insertions, 1 deletions
diff --git a/Makefile.in b/Makefile.in
index ee9a703..994eacf 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -28,6 +28,12 @@ LIBDIR = @libdir@
MANDIR = @mandir@
MAKE = @make@
+PACKAGE = @package@
+VERSION = @version@
+
+distdir = $(PACKAGE)-$(VERSION)
+distfiles = configure Makefile.in COPYING INSTALL TODO genopkg.sh
+
.SUFFIXES:
.PHONY: all
@@ -80,3 +86,20 @@ uninstall:
@cd lib && $(MAKE) $$(cat ../install.config) uninstall
@printf 'Uninstalling manual pages...\n'
@cd man && $(MAKE) $$(cat ../install.config) uninstall
+
+.PHONY: distdir dist dist-gzip dist-bzip2
+
+distdir:
+ @[ -d '$(distdir)' ] || mkdir '$(distdir)'
+ @cp -pR $(distfiles) $(distdir)
+ @cd src && $(MAKE) distdir
+ @cd lib && $(MAKE) distdir
+ @cd man && $(MAKE) distdir
+
+dist dist-gzip: distdir
+ @tar -cf - '$(distdir)' | gzip -9c > '$(distdir).tar.gz'
+ @rm -Rf '$(distdir)'
+
+dist-bzip2: distdir
+ @tar -cf - '$(distdir)' | bzip2 -9c > '$(destdir).tar.bz2'
+ @rm -Rf '$(distdir)'
diff --git a/configure b/configure
index a9114a8..78f05bb 100755
--- a/configure
+++ b/configure
@@ -189,7 +189,9 @@ s&@srcdir@&${SRCDIR}&
s&@prefix@&${PREFIX}&
s&@bindir@&${BINDIR}&
s&@libdir@&${LIBDIR}&
-s&@mandir@&${MANDIR}&"
+s&@mandir@&${MANDIR}&
+s&@package@&${PACKAGE}&
+s&@version@&${VERSION}&"
# Replace configuration variables in Makefile.in
mkdir -p src lib man
diff --git a/lib/Makefile.in b/lib/Makefile.in
index 07c5b35..f0ecb1a 100644
--- a/lib/Makefile.in
+++ b/lib/Makefile.in
@@ -29,6 +29,12 @@ LIBDIR = @libdir@
OBJS = controlfields architecture archive
+PACKAGE = @package@
+VERSION = @version@
+
+distdir = ../$(PACKAGE)-$(VERSION)/lib
+distfiles = Makefile.in $(OBJS)
+
.PHONY: all
all: $(OBJS)
@@ -56,3 +62,8 @@ uninstall:
printf ' RM %s\n' "$${obj}"; \
rm -f "$(DESTDIR)/$(LIBDIR)/opkhelper/$${obj}"; \
done
+
+.PHONY: distdir
+distdir:
+ @[ -d '$(distdir)' ] || mkdir '$(distdir)'
+ @cp -pR $(distfiles) $(distdir)
diff --git a/man/Makefile.in b/man/Makefile.in
index 3ea062c..c8141bb 100644
--- a/man/Makefile.in
+++ b/man/Makefile.in
@@ -31,6 +31,12 @@ OBJS = opkbuild.1 oh-checkbuilddeps.1 oh-applypatches.1 oh-copyconfig.1 \
oh-strip.1 oh-installfiles.1 oh-installdocs.1 oh-gencontrol.1 \
oh-buildopk.1
+PACKAGE = @package@
+VERSION = @version@
+
+distdir = ../$(PACKAGE)-$(VERSION)/man
+distfiles = Makefile.in $(OBJS)
+
.PHONY: all
all: $(OBJS)
@@ -60,3 +66,8 @@ uninstall:
section=$$(echo "$${obj}" | sed 's/^.*[.]\([0-9]\)$$/\1/'); \
rm -f "$(DESTDIR)/$(MANDIR)/man$${section}/$${obj}"; \
done
+
+.PHONY: distdir
+distdir:
+ @[ -d '$(distdir)' ] || mkdir '$(distdir)'
+ @cp -pR $(distfiles) $(distdir)
diff --git a/src/Makefile.in b/src/Makefile.in
index dfbb9d7..62eaded 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -31,6 +31,12 @@ OBJS = opkbuild oh-checkbuilddeps oh-applypatches oh-copyconfig \
oh-strip oh-installfiles oh-installdocs oh-gencontrol \
oh-buildopk
+PACKAGE = @package@
+VERSION = @version@
+
+distdir = ../$(PACKAGE)-$(VERSION)/src
+distfiles = Makefile.in $(OBJS)
+
.PHONY: all
all: $(OBJS)
@@ -58,3 +64,8 @@ uninstall:
printf ' RM %s\n' "$${obj}"; \
rm -f "$(DESTDIR)/$(BINDIR)/$${obj}"; \
done
+
+.PHONY: distdir
+distdir:
+ @[ -d '$(distdir)' ] || mkdir '$(distdir)'
+ @cp -pR $(distfiles) $(distdir)