summaryrefslogtreecommitdiff
path: root/clamav/Makefile
blob: 95a06774477949b997bbdb51fd3ecac72a4385b2 (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
include ../kolab.mk

NAME = clamav
PACKAGE = $(NAME)
VERSION = $(shell grep "^Version:" *.spec | sed -e "s/^Version:\s*\([0-9.]*\).*/\1/")
RELEASE = $(shell grep "^Release:" *.spec | sed -e "s/^Release:\s*\([0-9]*\).*/\1/")

SOURCE_0=http://files.kolab.org/server/development-2.2/externals/$(NAME)-$(VERSION).tar.gz
EXTRA=clamav.patch rc.clamav

.PHONY: all
all: $(PACKAGE)-$(VERSION)-$(RELEASE).src.rpm

.PHONY: dist
dist: all
	cp $(PACKAGE)-$(VERSION)-$(RELEASE).src.rpm ../stage/

.PHONY: clean
clean:
	rm -rf $(KOLABRPMTMP)/$(NAME)*
	rm -rf $(KOLABRPMTMP)/$(PACKAGE)
	rm -rf $(PACKAGE)-$(VERSION)-$(RELEASE).src.rpm
	rm -rf *~

$(KOLABRPMPKG)/$(PACKAGE)-$(VERSION)-$(RELEASE).$(PLATTAG).rpm $(PACKAGE)-$(VERSION)-$(RELEASE).src.rpm: Makefile $(PACKAGE).spec $(EXTRA)
	test -d $(KOLABRPMSRC)/$(PACKAGE) || mkdir $(KOLABRPMSRC)/$(PACKAGE)
	cd  $(KOLABRPMSRC)/$(PACKAGE)/ && wget -c "$(SOURCE_0)"

	cp $(PACKAGE).spec $(EXTRA) $(KOLABRPMSRC)/$(PACKAGE)
	cd $(KOLABRPMSRC)/$(PACKAGE) && $(RPM) -ba $(PACKAGE).spec

	cp -p $(KOLABRPMPKG)/$(PACKAGE)-$(VERSION)-$(RELEASE).src.rpm .

.PHONY: install
install: $(KOLABRPMPKG)/$(PACKAGE)-$(VERSION)-$(RELEASE).$(PLATTAG).rpm
	$(RPM) -Uhv --force $(KOLABRPMPKG)/$(PACKAGE)-$(VERSION)-$(RELEASE).$(PLATTAG).rpm