aboutsummaryrefslogtreecommitdiffstats
path: root/protocols/skype/Makefile
blob: bebfe86c307075a163acf1a404d03e73e3e3c1c0 (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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
-include ../../Makefile.settings
ifdef SRCDIR
SRCDIR := $(SRCDIR)protocls/skype/
endif

VERSION = 0.9.0
DATE := $(shell date +%Y-%m-%d)
# latest stable
BITLBEE_VERSION = 3.0.1

ifeq ($(ASCIIDOC),yes)
MANPAGES = skyped.1
else
MANPAGES =
endif

ifeq ($(BITLBEE),yes)
LIBS = skype.$(SHARED_EXT)
else
LIBS =
endif

all: $(LIBS) $(MANPAGES)

skype.$(SHARED_EXT): skype.c config.mak
ifeq ($(BITLBEE),yes)
	$(CC) $(CFLAGS) $(SHARED_FLAGS) -o skype.$(SHARED_EXT) skype.c $(LDFLAGS)
endif

install: all
ifeq ($(ASCIIDOC),yes)
	$(INSTALL) -d $(DESTDIR)$(mandir)/man1
	$(INSTALL) -m644 $(MANPAGES) $(DESTDIR)$(mandir)/man1
endif
ifeq ($(BITLBEE),yes)
	$(INSTALL) -d $(DESTDIR)$(plugindir)
	$(INSTALL) skype.$(SHARED_EXT) $(DESTDIR)$(plugindir)
endif
ifeq ($(SKYPE4PY),yes)
	$(INSTALL) -d $(DESTDIR)$(bindir)
	$(INSTALL) -d $(DESTDIR)$(sysconfdir)
	$(INSTALL) skyped.py $(DESTDIR)$(bindir)/skyped
	perl -p -i -e 's|/usr/local/etc/skyped|$(sysconfdir)|' $(DESTDIR)$(bindir)/skyped
	$(INSTALL) -m644 skyped.conf.dist $(DESTDIR)$(sysconfdir)/skyped.conf
	perl -p -i -e 's|\$${prefix}|$(prefix)|' $(DESTDIR)$(sysconfdir)/skyped.conf
	$(INSTALL) -m644 skyped.cnf $(DESTDIR)$(sysconfdir)
endif

client: client.c

autogen: configure.ac
	cp $(shell ls /usr/share/automake-*/install-sh | tail -n1) ./
	autoconf

clean:
	rm -f $(LIBS) $(MANPAGES)

distclean: clean
	rm -f config.log config.mak config.status

autoclean: distclean
	rm -rf aclocal.m4 autom4te.cache configure install-sh

# take this from the kernel
check:
	perl checkpatch.pl --no-tree --file skype.c

test: all
	$(MAKE) -C t/ all

dist:
	git archive --format=tar --prefix=bitlbee-skype-$(VERSION)/ HEAD | tar xf -
	mkdir -p bitlbee-skype-$(VERSION)
	git log --no-merges |git name-rev --tags --stdin > bitlbee-skype-$(VERSION)/Changelog
	make -C bitlbee-skype-$(VERSION) autogen
	tar czf bitlbee-skype-$(VERSION).tar.gz bitlbee-skype-$(VERSION)
	rm -rf bitlbee-skype-$(VERSION)

release:
	git tag $(VERSION)
	$(MAKE) dist
	gpg --comment "See http://vmiklos.hu/gpg/ for info" \
		-ba bitlbee-skype-$(VERSION).tar.gz

doc: skyped.1

install-doc:
	mkdir -p $(DESTDIR)$(MANDIR)/man1/
	install -m 0644 $(SRCDIR)skyped.1 $(DESTDIR)$(MANDIR)/man1/

uninstall-doc:
	rm -f $(DESTDIR)$(MANDIR)/man1/skyped.1*

HEADER.html: README Makefile
	asciidoc -a toc -a numbered -a sectids -o HEADER.html -a icons -a data-uri --attribute iconsdir=./images/icons README
	sed -i 's|@VERSION@|$(VERSION)|g' HEADER.html
	sed -i 's|@BITLBEE_VERSION@|$(BITLBEE_VERSION)|g' HEADER.html

Changelog: .git/refs/heads/master
	git log --no-merges |git name-rev --tags --stdin >Changelog

AUTHORS: .git/refs/heads/master
	git shortlog -s -n |sed 's/.*\t//'> AUTHORS

%.1: %.txt asciidoc.conf
	a2x --asciidoc-opts="-f asciidoc.conf" \
		-a bs_version=$(VERSION) -a bs_date=$(DATE) -f manpage $<