aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: 9db040e2f7892b14f93a1fa711df8d53d5b3f98b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
.POSIX:

DESTDIR=/home/minimun/minimun
WEBLOC=/minimun
SYSWEBROOT=/var/www/html
WEBROOT=$(SYSWEBROOT)$(WEBLOC)
DIRS=$(DESTDIR) $(WEBROOT)
VER=1.2
REL=1

all: format.tex minimun

minimun: orig/minimun
	sed 's:%%DEST%%:$(DESTDIR):' orig/minimun > minimun
	chmod +x minimun

format.tex: orig/format.tex
	sed 's:%%DEST%%:$(DESTDIR):' orig/format.tex > format.tex

clean:
	rm -f minimun format.tex minimun.spec minimun.tar.gz \
	minimun-$(VER)-$(REL).noarch.rpm

install: $(DIRS) all
	cp -t $(DESTDIR) minimun format.tex logo.png
	cp -RT www $(WEBROOT)

uninstall:
	rm -f $(DESTDIR)/{minimun,format.tex,logo.png} $(WEBROOT)/*
	rmdir -p $(DIRS)

SRC = LICENCE logo.png Makefile minimun.ini orig\
nginx.example.conf README www minimun.spec
dist: minimun.tar.gz minimun.spec
	mkdir -pv ~/rpmbuild/SOURCES
	cp minimun.tar.gz ~/rpmbuild/SOURCES
	rpmbuild minimun.spec -ba
	cp ~/rpmbuild/RPMS/noarch/minimun-$(VER)-$(REL).noarch.rpm .
	touch dist
minimun.tar.gz: $(SRC)
	mkdir minimun-$(VER)
	cp -r -t minimun-$(VER) $(SRC)
	tar -czf minimun.tar.gz minimun-$(VER)
	rm -rf minimun-$(VER)
minimun.spec: orig/minimun.spec
	sed -e 's/VERSION/$(VER)/' -e 's/RELEASE/$(REL)/' orig/minimun.spec\
	> $@

$(DIRS):
	mkdir -p $@