summaryrefslogtreecommitdiff
path: root/sqlite/Makefile
blob: c4eb45f7353f8ea4e5649f5932983c20be64802d (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
NAME = sqlite
PACKAGE = $(NAME)
VERSION3 = $(shell grep "define *V_v3" sqlite.spec | sed -e "s/.*V_v3\s*\([0-9.]*\).*/\1/")
VERSION2 = $(shell grep "define *V_v2" sqlite.spec | sed -e "s/.*V_v2\s*\([0-9.]*\).*/\1/")
RELEASE = $(shell grep "^Release:" sqlite.spec | sed -e "s/^Release:\s*\([0-9]*\).*/\1/")
KOLABRELEASE = $(RELEASE)

ifeq "x$(RPM)" "x"
  RPM = $(HOME)/bin/openpkg rpm
endif
ifeq "x$(KOLABRPMSRC)" "x"
  KOLABRPMSRC = $(HOME)/RPM/SRC
endif
ifeq "x$(KOLABRPMPKG)" "x"
  KOLABRPMPKG = $(HOME)/RPM/PKG
endif
ifeq "x$(KOLABRPMTMP)" "x"
  KOLABRPMTMP = $(HOME)/RPM/TMP
endif

SOURCE_0=http://www.sqlite.org/sqlite-$(VERSION2).tar.gz
SOURCE_1=http://www.sqlite.org/sqlite-$(VERSION3).tar.gz

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

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

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

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

	cp $(PACKAGE).spec $(PACKAGE).patch.* $(KOLABRPMSRC)/$(PACKAGE)
	cd $(KOLABRPMSRC)/$(PACKAGE) && $(RPM) -ba $(PACKAGE).spec --define 'with_pth no'

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