Makefile: compile shared library only
[lbook_fbreader.git] / makefiles / packaging.mk
blob4fffd3a21e2433e611b49ff1cc789b8cfddca3cc
1 VERSION = $(shell cat fbreader/VERSION)
2 SOVERSION = $(shell cat zlibrary/SOVERSION)
3 TMPDIR = $(CURDIR)/fbreader-$(VERSION)
5 motopkg:
6 @echo -n "Building $(ARCHITECTURE) $@ package..."
7 @make -f $(DIST_DIR)/$@/$(ARCHITECTURE)/rules build 1> $(ARCHITECTURE)-$@.log 2>&1
8 @mkdir $(TMPDIR)
9 @make -f $(DIST_DIR)/$@/$(ARCHITECTURE)/rules DESTDIR=$(TMPDIR) install 1>> $(ARCHITECTURE)-$@.log 2>&1
10 @make -f $(DIST_DIR)/$@/$(ARCHITECTURE)/rules DESTDIR=$(TMPDIR) package 1>> $(ARCHITECTURE)-$@.log 2>&1
11 @make -f $(DIST_DIR)/$@/$(ARCHITECTURE)/rules clean 1> /dev/null 2>&1
12 @rm -rf $(TMPDIR)
13 @rm -f $(CURDIR)/$(ARCHITECTURE)-$@.log
14 @echo " OK"
16 tarball:
17 @echo -n "Building $(ARCHITECTURE) $@ package..."
18 @make -f $(DIST_DIR)/$@/$(ARCHITECTURE)/rules build 1> $(ARCHITECTURE)-$@.log 2>&1
19 @mkdir $(TMPDIR)
20 @make -f $(DIST_DIR)/$@/$(ARCHITECTURE)/rules DESTDIR=$(TMPDIR) install 1>> $(ARCHITECTURE)-$@.log 2>&1
21 @make -f $(DIST_DIR)/$@/$(ARCHITECTURE)/rules DESTDIR=$(TMPDIR) package 1>> $(ARCHITECTURE)-$@.log 2>&1
22 @make -f $(DIST_DIR)/$@/$(ARCHITECTURE)/rules clean 1> /dev/null 2>&1
23 @rm -rf $(TMPDIR)
24 @rm -f $(CURDIR)/$(ARCHITECTURE)-$@.log
25 @echo " OK"
27 debian:
28 @echo -n "Building $(ARCHITECTURE) debian package..."
29 @mkdir $(TMPDIR)
30 @cp -a Makefile zlibrary fbreader makefiles $(TMPDIR)
31 @rm -rf `find $(TMPDIR) -name ".svn"`
32 @mkdir $(TMPDIR)/debian
33 @for file in $(DIST_DIR)/debian/$(ARCHITECTURE)/*; do \
34 sed -e "s#@SOVERSION@#$(SOVERSION)#g" $$file | \
35 sed -e "s#@VERSION@#$(VERSION)#g" > $(TMPDIR)/debian/`basename $$file`; \
36 chmod --reference $$file $(TMPDIR)/debian/`basename $$file`; \
37 done
38 @cd $(TMPDIR); dpkg-buildpackage -rfakeroot -us -uc 1> $(CURDIR)/$(ARCHITECTURE)-debian.log 2>&1; cd $(CURDIR)
39 @rm -rf $(TMPDIR)
40 @rm -f $(CURDIR)/$(ARCHITECTURE)-debian.log
41 @echo " OK"
43 ipk:
44 @echo -n "Building $(ARCHITECTURE) ipk package..."
45 @make -f $(DIST_DIR)/ipk/$(ARCHITECTURE)/rules build 1> $(ARCHITECTURE)-ipk.log 2>&1
46 @for controlfile in $(DIST_DIR)/ipk/$(ARCHITECTURE)/*.control; do \
47 controlname=`basename $$controlfile .control`; \
48 mkdir $(TMPDIR); \
49 mkdir $(TMPDIR)/data; \
50 make -f $(DIST_DIR)/ipk/$(ARCHITECTURE)/rules DESTDIR=$(TMPDIR)/data install-$$controlname 1>> $(ARCHITECTURE)-ipk.log 2>&1; \
51 sed \
52 -e "s#@VERSION@#$(VERSION)#" \
53 -e "s#@SIZE@#`du -s -b $(TMPDIR)/data | cut -f1`#" \
54 $$controlfile > $(TMPDIR)/control; \
55 tar czf $(TMPDIR)/control.tar.gz -C $(TMPDIR) ./control; \
56 tar czf $(TMPDIR)/data.tar.gz -C $(TMPDIR)/data .; \
57 echo 2.0 > $(TMPDIR)/debian-binary; \
58 tar czf `egrep ^Filename: $(TMPDIR)/control | cut -d' ' -f2` -C $(TMPDIR) ./debian-binary ./control.tar.gz ./data.tar.gz; \
59 rm -rf $(TMPDIR); \
60 done
61 @make -f $(DIST_DIR)/ipk/$(ARCHITECTURE)/rules clean 1> /dev/null 2>&1;
62 @rm -f $(CURDIR)/$(ARCHITECTURE)-ipk.log
63 @echo " OK"
65 debipk:
66 @echo -n "Building $(ARCHITECTURE) debipk package..."
67 @make -f $(DIST_DIR)/debipk/$(ARCHITECTURE)/rules build 1> $(ARCHITECTURE)-debipk.log 2>&1
68 @for controlfile in $(DIST_DIR)/debipk/$(ARCHITECTURE)/*.control; do \
69 controlname=`basename $$controlfile .control`; \
70 mkdir $(TMPDIR); \
71 make -f $(DIST_DIR)/debipk/$(ARCHITECTURE)/rules DESTDIR=$(TMPDIR) install-$$controlname 1>> $(ARCHITECTURE)-debipk.log 2>&1; \
72 mkdir $(TMPDIR)/DEBIAN; \
73 sed \
74 -e "s#@VERSION@#$(VERSION)#" \
75 -e "s#@SIZE@#`du -s -b $(TMPDIR) | cut -f1`#" \
76 $$controlfile > $(TMPDIR)/DEBIAN/control; \
77 dpkg -b $(TMPDIR) `sed "s#@VERSION@#$(VERSION)#" $(DIST_DIR)/debipk/$(ARCHITECTURE)/$$controlname.name` 1>> $(ARCHITECTURE)-debipk.log 2>&1; \
78 rm -rf $(TMPDIR); \
79 done
80 @make -f $(DIST_DIR)/debipk/$(ARCHITECTURE)/rules clean 1> /dev/null 2>&1
81 @rm -f $(CURDIR)/$(ARCHITECTURE)-debipk.log
82 @echo " OK"
84 nsi:
85 @echo -n "Building $(ARCHITECTURE) nsi package..."
86 @make -f $(DIST_DIR)/nsi/$(ARCHITECTURE)/rules build 1> $(ARCHITECTURE)-nsi.log 2>&1
87 @mkdir $(TMPDIR)
88 @make -f $(DIST_DIR)/nsi/$(ARCHITECTURE)/rules DESTDIR=$(TMPDIR) install 1>> $(ARCHITECTURE)-nsi.log 2>&1
89 @sed "s#@VERSION@#$(VERSION)#" $(DIST_DIR)/nsi/$(ARCHITECTURE)/control.nsi > $(TMPDIR)/control.nsi
90 @cd $(TMPDIR); makensis control.nsi 1>> $(CURDIR)/$(ARCHITECTURE)-nsi.log 2>&1
91 @mv $(TMPDIR)/*.exe .
92 @make -f $(DIST_DIR)/nsi/$(ARCHITECTURE)/rules clean 1> /dev/null 2>&1
93 @rm -rf $(TMPDIR)
94 @rm -f $(CURDIR)/$(ARCHITECTURE)-nsi.log
95 @echo " OK"