File: rules

package info (click to toggle)
snd 26.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 44,028 kB
  • sloc: ansic: 291,903; lisp: 260,506; ruby: 71,134; sh: 3,293; fortran: 2,342; csh: 1,067; makefile: 294; cpp: 294; python: 87; xml: 27; javascript: 1
file content (140 lines) | stat: -rwxr-xr-x 4,773 bytes parent folder | download | duplicates (2)
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
#!/usr/bin/make -f
# -*- mode: makefile; coding: utf-8 -*-
# Copyright © 2014-2016 IOhannes m zmölnig <zmoelnig@iem.at>
# Description: Main Debian packaging script for snd
#
# The authors hereby grant permission to use, copy, modify, distribute,
# and license this software and its documentation for any purpose.  No
# written agreement, license, or royalty fee is required.  Modifications
# to this software may be copyrighted by their authors and need not
# follow the licensing terms described here.
#
# IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY
# FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
# ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY
# DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
# THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES,
# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT.  THIS SOFTWARE
# IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE
# NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR
# MODIFICATIONS.

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

# needs to be declared before including makefile.mk
FLAVORS = nox gui-jack gui-pulse

export AUTOHEADER=true

builddir=debian/build/flavor-

include /usr/share/dpkg/pkg-info.mk
include /usr/share/dpkg/buildtools.mk
PKG_CONFIG ?= pkg-config

CONFIG = \
	--with-ladspa \
	--prefix=/usr \
	PATH_OGGENC=oggenc PATH_OGGDEC=oggdec \
	PATH_MPG321=mpg321 \
	PATH_SPEEXENC=speexenc PATH_SPEEXDEC=speexdec  \
	PATH_FLAC=flac \
	PATH_TIMIDITY=timidity \
	PATH_WAVPACK=wavpack PATH_WVUNPACK=wvunpack \
	$(empty)

## per flavor configure options
configureflags_audio_jack  = --with-jack
# use ALSA on linux, and OSS non non-linux
ifneq (,$(findstring linux,$(DEB_HOST_ARCH_OS)))
configureflags_audio_default  = --with-alsa
else
configureflags_audio_default  = --with-oss
endif
configureflags_gui = --with-motif --with-gl --with-gl2ps

# nox (alsa/oss + jack)
CONFIG_nox       = --without-gui --with-notcurses \
	$(configureflags_audio_default) $(configureflags_audio_jack)

# gui-jack (jack + alsa[sic!]/oss)
CONFIG_gui-jack  = $(configureflags_gui) \
	$(configureflags_audio_default) $(configureflags_audio_jack)

## gui-pulse (pulseaudio)
CONFIG_gui-pulse = $(configureflags_gui) \
       	--with-pulseaudio

## do not embed __DATE__ (see debian/patches/reproducible.diff)
CPPFLAGS+=-DREPRODUCIBLE_BUILD=1

## on Debian notcurses2 is at time of writing (2020/11/23) at version 2.0.7
## so we need to enable to new API
CPPFLAGS+=-DNOTCURSES_2_0_5=1


# Use the default debhelper scripts, where possible.
%:
	dh $@

# Add configuration options:
override_dh_auto_configure: $(patsubst %,configure_%,$(FLAVORS))
configure_%:
	$(info $()   debian/rules $@)
	mkdir -p $(builddir)$*
	dh_auto_configure --builddirectory=$(builddir)$* -- $(strip $(CONFIG) $(CONFIG_$*)) || (cat $(builddir)$*/config.log && exit 1)

# Remove the subdirectories generated for the flavors.
override_dh_auto_clean:
	rm -rf $(patsubst %,$(builddir)%,$(FLAVORS))
	rmdir -p $(dir $(builddir)) || echo "couldn't cleanup build-dirs...ignoring"
	rm -f $(SND_MANPAGES)

# Create doxygen documentation:
override_dh_auto_build-indep:
	:
override_dh_auto_build-arch: $(patsubst %,build_%,$(FLAVORS))

build_%:
	$(info $()  debian/rules $@)
	dh_auto_build -a --builddirectory=$(builddir)$* || (cat $(builddir)$*/config.log && exit 1)
	mv $(builddir)$*/snd $(builddir)$*/snd.$*


override_dh_installchangelogs:
	dh_installchangelogs debian/upstream-changelog

# build manpages
build_nox: snd.nox.1
build_gui-jack: snd.gui-jack.1
build_gui-pulse: snd.gui-pulse.1

SND_MANPAGES=snd.nox.1 snd.gui-jack.1 snd.gui-pulse.1
$(SND_MANPAGES): snd.1
	cp $^ $@

## missing sources for s7webserver/jqconsole.min.js
##  it seems like the minification was done with a different version of
##  'uglifyjs', as it doesn't produce the same output (whereas the current
##  version of jqconsole builds reproducible)
JQCONSOLE_COMMIT=96eb6c42434d2cd30c83cc9af4e3d574cd6c39c6
s7webserver/jqconsole.min.js: debian/missing-sources/jqconsole.coffee
	coffee -c -p $< | uglifyjs -m -o $@
debian/missing-sources/jqconsole.coffee:
	wget -O $@ https://raw.githubusercontent.com/replit/jq-console/$(JQCONSOLE_COMMIT)/src/jqconsole.coffee

DEB_COPYRIGHT_CHECK_IGNORE_REGEX = \
	debian/.*|pix/.*\.png

# licensecheck v1
.PHONY: licensecheck
licensecheck:
	LANG=C.UTF-8 licensecheck \
		-i "^($(DEB_COPYRIGHT_CHECK_IGNORE_REGEX))$$" \
		--check '.*' --recursive --deb-machine --lines 0 * \
		> debian/copyright_newhints
	cmp debian/copyright_hints debian/copyright_newhints \
		&& rm debian/copyright_newhints