File: rules

package info (click to toggle)
musescore 1.3%2Bdfsg1-0.1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 148,004 kB
  • ctags: 30,854
  • sloc: cpp: 372,716; xml: 148,276; ansic: 6,156; python: 2,202; perl: 710; sh: 505; makefile: 227
file content (149 lines) | stat: -rwxr-xr-x 5,343 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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
#!/usr/bin/make -f
# -*- makefile -*-

configure: configure-stamp
configure-stamp:
	dh_testdir
	touch configure-stamp

build: build-arch build-indep
build-arch: build-stamp
build-indep: build-stamp

build-stamp: configure-stamp 
	dh_testdir
	#cd mscore/manual && \
	#python ProcessHTML.py -o
	$(MAKE) PREFIX="/usr" release
	cp mscore/packaging/mscore.1 mscore/packaging/musescore.1
	touch $@

clean:
	dh_testdir
	dh_testroot
	rm -f build-stamp configure-stamp
	rm -f mscore/share/locale/mscore_*.qm
	rm -f mscore/manual/*.pyc mscore/manual/*.pdf mscore/manual/*.html
	rm -rf web
	$(MAKE) clean
	dh_clean 

install: build
	dh_testdir
	dh_testroot
	dh_prep
	dh_installdirs
	$(MAKE) DESTDIR=$(CURDIR)/debian/musescore install

# Build architecture-independent files here.
binary-indep: build install

# Build architecture-dependent files here.
binary-arch: build install
	dh_testdir
	dh_testroot
	dh_installchangelogs $(CURDIR)/mscore/ChangeLog
	dh_installdocs
	dh_install
	chrpath -d $(CURDIR)/debian/musescore/usr/bin/mscore
	rm -r $(CURDIR)/debian/musescore/usr/share/mscore*
	cd $(CURDIR)/debian/musescore-common/usr/share && ln -s mscore-* mscore
	rm -r $(CURDIR)/debian/musescore-common/usr/share/mscore/sound
	dh_installman
	dh_installmenu
	dh_installmime
	dh_link
	dh_strip
	dh_icons
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

binary: binary-indep binary-arch

get-orig-source: version = $(shell uscan --force-download --dehs --destdir . | sed -n 's/.*<upstream-version>\(.*\)<\/upstream-version>.*/\1/p')
get-orig-source:
	-mkdir tmp-musescore-$(version)
	tar -C tmp-musescore-$(version) -xjf mscore-$(version).tar.bz2
	cd tmp-musescore-$(version)/mscore* && \
	find -name *pdf -exec rm {} + && \
	rm mscore/rtf2html/rtf2html && \
	rm mscore/demos/prelude.mscx
	mv tmp-musescore-$(version)/mscore* \
	    tmp-musescore-$(version)/musescore-$(version)\+dfsg1
	tar -C tmp-musescore-$(version) -caf musescore_$(version)\+dfsg1.orig.tar.xz \
	    musescore-$(version)\+dfsg1/
	#mv musescore_$(version)\+dfsg.orig.tar.gz ../
	rm -r tmp-musescore-$(version)
	-rm mscore*bz2 musescore*bz2

#this requires subversion
#get-orig-source: version = "0.9.6~beta1+dfsg"
#get-orig-source: revision = 2674
#get-orig-source:
#	svn co -r $(revision) https://mscore.svn.sourceforge.net/svnroot/mscore/trunk \
#	    musescore-$(version)
#	cd musescore-$(version) && \
#	    find -name *pdf -exec rm {} + && \
#	    find -name .svn -exec rm -rf {} +
#	tar czf musescore_$(version).orig.tar.gz musescore-$(version)/
#	rm -r musescore-$(version)

#### ----------------- Note on usage of below rules ------------------ ####
## The update-to-svn and build-svn rules are written from an Ubuntu	 ##
## perspective, designed to be able to automate the building of packages ##
## from svn for either Debian or Ubuntu systems, on Ubuntu systems.	 ##
## Apart from the standard coreutils and dephelper, the rules may	 ##
## require the following packages: svn, lsb-release, ubuntu-dev-tools	 ## 
## and python-pisa. By default, packages for Debian unstable are	 ##
## produced. If Ubuntu packages are required, set the environment	 ##
## variable "BUILD_UBUNTU". This will build for the currently running	 ##
## release by default; if you wish to build for any other, set the	 ##
## environment variable "UBUNTU_RELEASE" to the codename of that	 ## 
## release.								 ##
#### ----------------------------------------------------------------- ####

update-to-svn: version = $(shell svn up > /dev/null; make version)
update-to-svn: pkgdate = $(shell date +"%a, %d %b %Y %T %z")
update-to-svn:
	mv debian ..
	find -name *pdf -exec rm {} +
	-rm mscore/rtf2html/rtf2html
	cp -r . ../svn-musescore-$(version)
	cd ../svn-musescore-$(version) && find -name .svn -exec rm -rf {} +
	if [ ! -e ../musescore_$(version)+dfsg.orig.tar.gz ]; then \
		tar czf ../musescore_$(version)+dfsg.orig.tar.gz ../svn-musescore-$(version); \
	fi
	rm -rf ../svn-musescore-$(version)
	mv ../debian .
	#cp -r ./debian ../svn-musescore-$(version)/
	mv debian/changelog debian/changelog.old
	if [ "$(BUILD_UBUNTU)" -o "$(UBUNTU_RELEASE)" ]; then \
		if [ "$(UBUNTU_RELEASE)" ]; then \
			echo "musescore ($(version)+dfsg-0ubuntu~$(UBUNTU_RELEASE)1) $(UBUNTU_RELEASE); urgency=low" > debian/changelog.new; \
		else \
			echo "musescore ($(version)+dfsg-0ubuntu~$(shell lsb_release -sc)1) $(shell lsb_release -sc); urgency=low" > debian/changelog.new; \
		fi; \
	else \
		echo "musescore ($(version)+dfsg-1) unstable; urgency=low" > debian/changelog.new; \
	fi
	echo >> debian/changelog.new
	echo "	* New svn revision" >> debian/changelog.new
	echo >> debian/changelog.new
	echo " -- Toby Smithe <tsmithe@ubuntu.com>  $(pkgdate)" >> debian/changelog.new
	echo >> debian/changelog.new
	cat debian/changelog.new debian/changelog.old > debian/changelog
	rm debian/changelog.new debian/changelog.old

build-svn: version = $(shell dpkg-parsechangelog -n0 | grep Version | cut -c10-)
build-svn: dist = $(shell dpkg-parsechangelog -n0 | grep Distribution | cut -c15-)
build-svn: update-to-svn
	debuild --no-tgz-check -S -sa -i".svn"\|"/.svn"\|"/.bzr" -k3939EBEE
	cd .. && \
	pbuilder-dist $(dist) build musescore_$(version).dsc

.PHONY: update-to-svn build-svn build-manuals get-orig-source build clean binary-indep binary-arch binary install configure