File: rules

package info (click to toggle)
xmcd 2.6-17sarge1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 3,464 kB
  • ctags: 5,075
  • sloc: ansic: 51,322; sh: 4,039; makefile: 82; pascal: 67
file content (116 lines) | stat: -rwxr-xr-x 3,428 bytes parent folder | download
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
108
109
110
111
112
113
114
115
116
#!/usr/bin/make -f
# This script uses debhelper by Joey Hess
export DH_VERBOSE=1
export DH_COMPAT=2

XMCD=`pwd`/debian/xmcd
XMCDLIB=$(XMCD)/usr/share/xmcd
CDDB=`pwd`/debian/cddb

libdir		= /usr/X11R6/lib/X11/xmcd
tmpdir		:= $(shell pwd)/debian/tmp

build:  build-stamp
build-stamp:
	dh_testdir
	xmkmf -a
	make LOCAL_LIBRARIES="-lXm -lXt -lX11 -lncurses -lz"
	touch build-stamp

clean:
	dh_testdir
	dh_testroot
	rm -f build-stamp
	dh_clean
	-make clean
	-rm -f Makefile *_d/Makefile 

binary-indep:
	@echo Nothing to do

binary-arch: build
	dh_testdir
	dh_testroot
	dh_installdirs -p xmcd usr/bin usr/sbin etc \
           etc/X11/app-defaults usr/share/doc/cddb usr/share/xmcd/config.new
	BATCH_BINDIR=$(XMCD)/usr/bin \
		BATCH_LIBDIR=$(XMCD)/usr/share \
		BATCH_MANDIR=$(XMCD)/usr/share/man/man1 \
		BATCH_CDDBDIR=$(XMCD)/var/lib/cddb \
		BATCH_DISCOGDIR=$(XMCD)/var/lib/xmcd/discog \
		sh install.sh -n -b

	# move app-defaults to correct place
	mv $(XMCDLIB)/app-defaults/XMcd $(XMCD)/etc/X11/app-defaults
	# remove junk that just installed (XKeysymDB)
	rm -rf $(XMCDLIB)/app-defaults
	rm -rf $(XMCDLIB)/docs

	# move some binaries to/usr/bin
	mv $(XMCD)/usr/lib/xmcd/?????* $(XMCD)/usr/bin	

	# This doesn't need to be hidden (and we don't want it in config)
	mv $(XMCDLIB)/config/.tbl $(XMCDLIB)/tbl

	# This is our configuration program
	mv $(XMCDLIB)/config/config.sh $(XMCD)/usr/sbin/xmcdconfig

	# move the contents of the config directory around
	mv $(XMCDLIB)/config $(XMCD)/etc/xmcd
	for i in common.cfg device.cfg; do \
	  mv $(XMCD)/etc/xmcd/$$i $(XMCD)/usr/share/xmcd/config.new ; \
	done
	ln -s /etc/xmcd $(XMCDLIB)/config
	ln -s ../doc/xmcd $(XMCDLIB)/docs

	# Install our little icon
	cp debian/xmcd.xpm $(XMCDLIB)/pixmaps/xmcd_small.xpm

        # strip $(XMCD) from generated files
	for i in usr/bin/xmcd usr/bin/cda var/lib/xmcd/discog/discog.html \
	         usr/share/xmcd/scripts/genidx usr/sbin/xmcdconfig; do \
	  echo $(XMCD)/$$i; \
	done | xargs perl -i -p -e "s!$(XMCD)!!"

	# same for symlinks
	# I'm sure this is a bug - -f should override!
	rm $(XMCDLIB)/cddb $(XMCDLIB)/discog
	ln -sf /var/lib/cddb $(XMCDLIB)/cddb
	ln -sf /var/lib/xmcd/discog $(XMCDLIB)/discog

	cp docs_d/DRIVES docs_d/FEATURES docs_d/README docs_d/RELNOTES \
	  $(XMCD)/usr/share/doc/cddb
	ln -s cddb $(XMCD)/usr/share/doc/xmcd
	dh_installdocs -p cddb docs_d/ACKS docs_d/CDDB docs_d/FAQ docs_d/WEB
	dh_installmanpages -p xmcd
	dh_installdirs -p cddb usr/share/man/man1
	mv $(XMCD)/usr/share/man/man1/cddbcmd.1 $(CDDB)/usr/share/man/man1
	dh_installchangelogs -p cddb docs_d/CHANGES
	dh_installmenu
	dh_strip
	dh_compress
	dh_fixperms
	# move cddb stuff to where it should be
	dh_installdirs -p cddb var/lib usr/bin
	mv $(XMCD)/var/lib/cddb $(CDDB)/var/lib
	# this was done in xmcdconfig
	for i in rock jazz blues newage classical reggae folk country \
	  soundtrack misc data; do \
	  install -d -o root -g audio -m 3775 $(CDDB)/var/lib/cddb/$i; \
	  install -d -o root -g audio -m 3775 $(XMCD)/var/lib/xmcd/discog/$i; \
	done
	mv $(XMCD)/usr/bin/cddbcmd $(CDDB)/usr/bin
	# now we need to refix the perms :-)
	chgrp -R audio $(CDDB)/var/lib/cddb $(XMCD)/var/lib/xmcd/discog
	chmod 3775 $(CDDB)/var/lib/cddb $(XMCD)/var/lib/xmcd/discog
	dh_shlibdeps
	dh_installdeb
	dh_gencontrol
	dh_md5sums
	dh_builddeb

# Below here is fairly generic really

binary:		binary-indep binary-arch

.PHONY: binary binary-arch binary-indep clean