Makefile 1.03 KB
Newer Older
Ted Trask's avatar
Ted Trask committed
1 2
APP_NAME=weblog
PACKAGE=acf-$(APP_NAME)
Ted Trask's avatar
Ted Trask committed
3
VERSION=0.11.1
Ted Trask's avatar
Ted Trask committed
4

5
CRON_FILE=weblogimport
Ted Trask's avatar
Ted Trask committed
6

Ted Trask's avatar
Ted Trask committed
7 8 9
IMAGE_DIST=bypass.png \
	denied.png \
	dodgy.png \
Ted Trask's avatar
Ted Trask committed
10

Ted Trask's avatar
Ted Trask committed
11 12 13
APP_DIST=weblog-* \
	weblog.roles \
	weblog.menu \
Ted Trask's avatar
Ted Trask committed
14

Ted Trask's avatar
Ted Trask committed
15 16 17
EXTRA_DIST=README Makefile config.mk

DISTFILES=$(CRON_FILE) $(IMAGE_DIST) $(APP_DIST) $(EXTRA_DIST)
Ted Trask's avatar
Ted Trask committed
18 19 20 21 22 23

TAR=tar

P=$(PACKAGE)-$(VERSION)
tarball=$(P).tar.bz2
install_dir=$(DESTDIR)/$(appdir)/$(APP_NAME)
24
cron_dir=$(DESTDIR)/etc/periodic/daily
Ted Trask's avatar
Ted Trask committed
25
static_dir=$(DESTDIR)/${wwwdir}/skins/static
Ted Trask's avatar
Ted Trask committed
26 27 28 29 30 31 32 33

all:
clean:
	rm -rf $(tarball) $(P)

dist: $(tarball)

install:
Ted Trask's avatar
Ted Trask committed
34
	mkdir -p "$(install_dir)" "$(cron_dir)" "$(static_dir)"
Ted Trask's avatar
Ted Trask committed
35
	cp -a $(APP_DIST) "$(install_dir)"
36
	cp -a $(CRON_FILE) "$(cron_dir)"
Ted Trask's avatar
Ted Trask committed
37
	cp -a $(IMAGE_DIST) "$(static_dir)"
Ted Trask's avatar
Ted Trask committed
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54

$(tarball):	$(DISTFILES)
	rm -rf $(P)
	mkdir -p $(P)
	cp -a $(DISTFILES) $(P)
	$(TAR) -jcf $@ $(P)
	rm -rf $(P)

# target that creates a tar package, unpacks is and install from package
dist-install: $(tarball)
	$(TAR) -jxf $(tarball)
	$(MAKE) -C $(P) install DESTDIR=$(DESTDIR)
	rm -rf $(P)

include config.mk

.PHONY: all clean dist install dist-install