summaryrefslogtreecommitdiff
path: root/debian/rules
blob: 292ee7feeb9830d7ae35116c130701ffbeb35aad (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
#!/usr/bin/make -f

package = getxbook
DESTDIR = debian/$(package)

build:
	$(MAKE)

binary: binary-arch binary-indep

binary-arch: build
	$(MAKE) DESTDIR=$(DESTDIR) PREFIX=/usr install
	mkdir -p $(DESTDIR)/usr/share/applications
	cp -f debian/$(package).desktop $(DESTDIR)/usr/share/applications/
	mkdir -p $(DESTDIR)/usr/share/menu
	cp -f debian/menu $(DESTDIR)/usr/share/menu/$(package)
	mkdir -p $(DESTDIR)/usr/share/doc/$(package)
	cp -f debian/copyright $(DESTDIR)/usr/share/doc/$(package)/
	cp -f debian/changelog $(DESTDIR)/usr/share/doc/$(package)/changelog.Debian
	gzip -9 $(DESTDIR)/usr/share/doc/$(package)/changelog.Debian
	for i in getabook getbnbook getgbook; \
	  do strip $(DESTDIR)/usr/bin/$$i; done
	for i in getabook getbnbook getgbook getxbook getxbookgui; \
	  do gzip -9 $(DESTDIR)/usr/share/man/man1/$$i.1; done
	mkdir -p $(DESTDIR)/DEBIAN
	cp -f debian/postinst debian/postrm $(DESTDIR)/DEBIAN/
	chmod 755 $(DESTDIR)/DEBIAN/post*
	dpkg-shlibdeps $(DESTDIR)/usr/bin/getabook \
	  $(DESTDIR)/usr/bin/getbnbook $(DESTDIR)/usr/bin/getgbook
	dpkg-gencontrol -P$(DESTDIR)
	dpkg-deb -b $(DESTDIR) ../

binary-indep: build

clean:
	make clean
	rm -rf debian/$(package) debian/files debian/substvars

.PHONY: build binary binary-arch binary-indep clean