Skip to content

Commit 7818c4a

Browse files
committed
added build command make tarball to create a versioned tarball
1 parent e6ffb36 commit 7818c4a

File tree

2 files changed

+31
-5
lines changed

2 files changed

+31
-5
lines changed

makefile

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,29 @@
1-
## make help: Display help text
1+
VER=1.0
2+
TARBALL-LOCATION:=pkgs/tarball
3+
PKGNAME:=unix-notes-$(VER)
4+
TARBALL=$(PKGNAME)-tar
5+
GZTARBALL=$(TARBALL).gz
6+
SHATXT=$(PKGNAME)-sha256.txt
7+
8+
## make help: Display help text
29
help:
310
@echo ""
411
@echo "Standard(?) Unix Notes"
512
@echo ""
613
@echo "GPG encrypted Notes system"
714
@echo ""
815
@sed -n s/^##//p makefile
9-
@echo ""
1016

11-
## make install: install the Unix Notes application
17+
## make var: Show makefile variables
18+
var:
19+
@echo Version = $(VER)
20+
@echo Tarball Location = $(TARBALL-LOCATION)
21+
@echo Package Name = $(PKGNAME)
22+
@echo Tarball Name = $(TARBALL)
23+
@echo Gzipped Tarball = $(GZTARBALL)
24+
@echo SHA text file = $(SHATXT)
25+
26+
## make install: Install the Unix Notes application
1227
install: manpages install_files
1328

1429
install_files:
@@ -28,14 +43,22 @@ clean:
2843
-rm tmp/notes.1.gz
2944
-rm tmp/notebook.1.gz
3045

31-
## make uninstall: uninstall the application
46+
## make uninstall: Uninstall the application
3247
uninstall:
3348
@echo uninstall application
3449
-sudo rm -f /usr/share/man/man1/notes.1.gz
3550
-sudo rm -f /usr/share/man/man1/notebook.1.gz
3651
-sudo rm -f /usr/local/bin/notes
3752
-sudo rm -f /usr/local/bin/notebook
3853

39-
## make reinstall: reinstall the application
54+
## make reinstall: Reinstall the application
4055
reinstall: uninstall install
4156
@echo reinstall application
57+
58+
## make tarball: Package up into tarball
59+
tarball:
60+
git archive --format tar v$(VER) -o $(TARBALL)
61+
gzip $(TARBALL)
62+
sha256 $(GZTARBALL) | tee $(SHATXT)
63+
mv $(GZTARBALL) $(TARBALL-LOCATION)
64+
mv $(SHATXT) $(TARBALL-LOCATION)

pkgs/tarball/README

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Tarballs created by <make tarball> are put here
2+
3+
This includes a sha256 sum of the tarball

0 commit comments

Comments
 (0)