File: rules

package info (click to toggle)
switchconf 0.0.15-1
  • links: PTS
  • area: main
  • in suites: buster, stretch
  • size: 156 kB
  • ctags: 41
  • sloc: sh: 437; makefile: 156
file content (176 lines) | stat: -rwxr-xr-x 4,604 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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
#!/usr/bin/make -f
# -*- makefile -*-
# Sample debian/rules that uses debhelper.
# This file was originally written by Joey Hess and Craig Small.
# As a special exception, when this file is copied by dh-make into a
# dh-make output file, you may use that output file without restriction.
# This special exception was added by Craig Small in version 0.37 of dh-make.

#  "based" on template debian/rules for most debian packages version 0.24

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

#For overriding debian/compat
#export DH_COMPAT=7

#This rule file have a bashism
SHELL:=/bin/bash

# These are used for cross-compiling and for saving the configure script
# from having to guess our platform (since we know it already)
DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)

# "based" on template Makefile for most debian packages version 0.7
# Personall Variables
PACKNAME=$(shell dh_listpackages)
PACKAGE=$(shell dh_listpackages)

# Variabels used by the Debian Maintainer exclusively for package
# development.
SOURCENAME=$(shell dpkg-parsechangelog | grep "Source:" | cut -d ' ' -f 2)
DEBVER=$(shell dpkg-parsechangelog | grep "Version:" | cut -d ' ' -f 2)
VER=$(shell dpkg-parsechangelog | grep "Version:" | cut -d ' ' -f 2 | cut -f 1 -d -)
ifeq ($(DEBVER),$(VER))
NATIVE=1
else
NATIVE=0
endif
MDIST=wheezy
DIST=$(shell dpkg-parsechangelog | grep "Distribution" | cut -d ' ' -f 2)
SECTION=main
CATEG=my_sources
#CATEG=other_sources
ifeq ($(NATIVE),0)
DISTFILE=$(SOURCENAME)_$(VER).orig.tar.xz
#DISTFILES=$(DISTFILE) $(SOURCENAME)_$(DEBVER).diff.gz
DISTFILES=$(DISTFILE) $(SOURCENAME)_$(DEBVER).debian.tar.xz
else
DISTFILE=$(SOURCENAME)_$(DEBVER).tar.xz
DISTFILES=$(DISTFILE)
endif

build-arch: build-arch-up-stamp
build-arch-up-stamp:
	touch $@


build-indep: build-indep-up-stamp
build-indep-up-stamp:
	touch $@


build: build-stamp
build-stamp:
	dh_testdir

	# Add here commands to compile the package.
	$(MAKE)
	#docbook-to-man debian/$(PACKAGE).sgml > $(PACKAGE).1

	touch $@

clean:
	dh_testdir
	dh_testroot
	rm -f build-stamp configure-stamp

	# Add here commands to clean up after the build process.
	$(MAKE) clean

	dh_clean 

install: build
	dh_testdir
	dh_testroot
	#dh_clean -k 
	dh_prep
	dh_installdirs

	# Add here commands to install the package into debian/$(PACKAGE).
	$(MAKE) DESTDIR=$(CURDIR)/debian/$(PACKAGE) install 


binary-indep: build install
	dh_testdir
	dh_testroot
	dh_installchangelogs 
	dh_installdocs
	dh_installexamples --exclude=.svn
#	dh_install
#	dh_installmenu
#	dh_installdebconf	
	dh_installlogrotate
#	dh_installemacsen
#	dh_installpam
#	dh_installmime
#	dh_python
	dh_systemd_enable
	dh_installinit --no-start --update-rcd-params="start 37 S ."
	dh_systemd_start
#	dh_installcron
#	dh_installinfo
	dh_installman
	dh_lintian
	dh_link
	dh_strip
	dh_compress
	dh_fixperms
#	dh_perl
#	dh_makeshlibs
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb


binary-arch: build install


binary: binary-indep binary-arch


# Check variabels used by the Debian Maintainer exclusively for
# package development.
vars:
	echo $(VER) $(DEBVER) $(MDIST) $(DIST) $(PACKNAME) $(SOURCENAME)
	echo $(REPOSTARGET)
	echo $(REPOSARCH)
	echo $(DEB_HOST_GNU_TYPE) $(DEB_BUILD_GNU_TYPE)


# Upload the packages and the distribution files into the rigth places
upload: 
	make -f ../upload upload


# Make tags of the sources as documented by subversion
tag:
	cd .. ; svn add $(DISTFILES) ;\
		echo $(CURDIR)
	cd .. ; svn add $(SOURCENAME)_$(DEBVER)_*.changes \
			$(SOURCENAME)_$(DEBVER)_*.build \
			$(SOURCENAME)_$(DEBVER).dsc
	cd .. ; svn add *_$(DEBVER)_*.deb
	cd .. ; svn st ; echo "enter to continue" ; read enter
	cd .. ; shopt -s nullglob ; svn ci -m "released v$(DEBVER)" \
		$(DISTFILES) \
		$(SOURCENAME)_$(DEBVER)_*.changes \
		$(SOURCENAME)_$(DEBVER)_*.build \
		$(SOURCENAME)_$(DEBVER).dsc \
		*_$(DEBVER)_*.deb
	svn mkdir --parents -m "Preparing tag directory for release v$(DEBVER)" $(shell svn info | grep "Repository Root" | cut -d ' ' -f 3)/tags/src/$(SOURCENAME)/$(SOURCENAME)-$(DEBVER)
	cd .. ; shopt -s nullglob ; svn copy -m "released v$(DEBVER)" \
		$(DISTFILES) \
		$(SOURCENAME)_$(DEBVER)_*.changes \
		$(SOURCENAME)_$(DEBVER)_*.build \
		$(SOURCENAME)_$(DEBVER).dsc \
		*_$(DEBVER)_*.deb \
		$(shell svn info | grep "Repository Root" | cut -d ' ' -f 3)/tags/src/$(SOURCENAME)/$(SOURCENAME)-$(DEBVER)
	debchange -i "New release"


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