summaryrefslogtreecommitdiff
path: root/openssl/Makefile
blob: 8b56b47d3cbf414bd11465fc35a133babff961c3 (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
include ../kolab.mk

NAME = openssl
PACKAGE = $(NAME)
VERSION = $(shell grep "^%define.*V_openssl" *.spec | sed -e "s/^%define.*V_openssl\s*\([0-9.]*\).*/\1/")
ZLIB_VERSION = $(shell grep "^%define.*V_zlib" *.spec | sed -e "s/^%define.*V_zlib\s*\([0-9.]*\).*/\1/")
RELEASE = $(shell grep "^Release:" *.spec | sed -e "s/^Release:\s*\([0-9]*\).*/\1/")
KOLABRELEASE = $(RELEASE)

SOURCE_0=ftp://ftp.openssl.org/source/$(NAME)-$(VERSION).tar.gz
SOURCE_1=http://www.zlib.net/zlib-$(ZLIB_VERSION).tar.gz
EXTRA=$(NAME).patch

.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)"
	cd $(KOLABRPMSRC)/$(PACKAGE) && wget -c "$(SOURCE_1)"

	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