| 1 |
|
|---|
| 2 |
|
|---|
| 3 |
SWAPPARENT=/var/lib |
|---|
| 4 |
SWAPDIR=$(SWAPPARENT)/swapspace |
|---|
| 5 |
|
|---|
| 6 |
all: VERSION DATE |
|---|
| 7 |
+$(MAKE) -C src VERSION="`cat VERSION`" DATE="`cat DATE`" |
|---|
| 8 |
+$(MAKE) -C doc VERSION="`cat VERSION`" DATE="`cat DATE`" |
|---|
| 9 |
|
|---|
| 10 |
clean: |
|---|
| 11 |
+$(MAKE) -C src clean |
|---|
| 12 |
|
|---|
| 13 |
distclean: clean |
|---|
| 14 |
+$(MAKE) -C src distclean |
|---|
| 15 |
|
|---|
| 16 |
install: all |
|---|
| 17 |
install -d $(DESTDIR)/$(SWAPPARENT) |
|---|
| 18 |
install -d -m700 $(DESTDIR)/$(SWAPDIR) |
|---|
| 19 |
install -d $(DESTDIR)/usr/sbin $(DESTDIR)/etc $(DESTDIR)/etc/init.d |
|---|
| 20 |
install -d $(DESTDIR)/usr/share/man/man8 |
|---|
| 21 |
strip src/swapspace || true |
|---|
| 22 |
install -m755 src/swapspace $(DESTDIR)/usr/sbin |
|---|
| 23 |
install -m644 swapspace.conf $(DESTDIR)/etc |
|---|
| 24 |
install -m744 debian/swapspace.init $(DESTDIR)/etc/init.d/swapspace |
|---|
| 25 |
install -m644 doc/swapspace.8 $(DESTDIR)/usr/share/man/man8 |
|---|
| 26 |
|
|---|
| 27 |
uninstall: |
|---|
| 28 |
/usr/sbin/swapspace -e |
|---|
| 29 |
$(RM) -r $(SWAPDIR) |
|---|
| 30 |
$(RM) /usr/sbin/swapspace /etc/swapspace.conf /etc/init.d/swapspace |
|---|
| 31 |
$(RM) /usr/share/man/man8/swapspace.8 |
|---|
| 32 |
|
|---|
| 33 |
dist : distclean VERSION |
|---|
| 34 |
tar -czf swapspace-`cat VERSION`.tar.gz --exclude=debian --exclude=.svn --exclude=.*.swp --exclude=tmp --exclude=swapspace-*.tar.gz . |
|---|
| 35 |
$(RM) -r tmp |
|---|
| 36 |
mkdir -p tmp/swapspace-`cat VERSION` |
|---|
| 37 |
tar -xzf swapspace-`cat VERSION`.tar.gz -C tmp/swapspace-`cat VERSION` |
|---|
| 38 |
$(RM) swapspace-`cat VERSION`.tar.gz |
|---|
| 39 |
tar -czf ../swapspace-`cat VERSION`.tar.gz -C tmp swapspace-`cat VERSION` |
|---|
| 40 |
$(RM) -r tmp |
|---|
| 41 |
|
|---|
| 42 |
|
|---|
| 43 |
|
|---|
| 44 |
VERSION: debian/changelog |
|---|
| 45 |
head -n 1 $< | sed -e 's/^.*(\([0-9][^)]*\)).*/\1/' >$@ |
|---|
| 46 |
|
|---|
| 47 |
DATE: debian/changelog |
|---|
| 48 |
grep '^ -- ' $< | sed -e 's/^.*> \([MTWFS][a-z]\{2\}, \{1,2\}[[:digit:]]\{1,2\} [JFBAMSOND][a-z]* 2[[:digit:]]\{3\}\) .*/\1/' | head -n 1 >$@ |
|---|
| 49 |
|
|---|
| 50 |
.PHONY: all clean install uninstall |
|---|
| 51 |
|
|---|