File: rules

package info (click to toggle)
wmweather 2.4.7-3
  • links: PTS
  • area: main
  • in suites: bookworm, bullseye
  • size: 492 kB
  • sloc: ansic: 1,544; sh: 322; makefile: 93
file content (73 lines) | stat: -rwxr-xr-x 2,571 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
#!/usr/bin/make -f

testdir  = test -f src/wmweather.c && test -f debian/rules
testroot = test x`whoami` = xroot

# FOR AUTOCONF 2.52 AND NEWER ONLY
ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
	CONFFLAGS += --build $(DEB_HOST_GNU_TYPE)
else
	CONFFLAGS += --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
endif

CPPFLAGS = $(shell dpkg-buildflags --get CPPFLAGS)
CFLAGS   = $(shell dpkg-buildflags --get CFLAGS)
LDFLAGS  = $(shell dpkg-buildflags --get LDFLAGS)
export CPPFLAGS
export CFLAGS
export LDFLAGS

clean:
	$(testdir)
	rm -f build-stamp debian/files debian/substvars
	[ ! -f src/Makefile ] || $(MAKE) -C src -i distclean
	rm -rf debian/wmweather

build: build-arch build-indep

build-arch: build-stamp

build-indep: build-stamp

build-stamp:
	$(testdir)
	cd src && ./configure $(CONFFLAGS) --prefix=/usr --mandir=/usr/share/man --sysconfdir=/etc --with-xmessage=/usr/bin/xmessage
	$(MAKE) -C src
	touch $@

binary: binary-arch binary-indep

binary-arch: build
	$(testdir)
	$(testroot)
	rm -rf debian/wmweather

	$(MAKE) -C src install DESTDIR=$(CURDIR)/debian/wmweather
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
	strip --strip-unneeded -R .comment -R .note debian/wmweather/usr/bin/wmweather
endif
	gzip -9n debian/wmweather/usr/share/man/man1/wmweather.1
	rm -f debian/wmweather/usr/share/man/man1/wmWeather.1
	ln -s wmweather.1.gz debian/wmweather/usr/share/man/man1/wmWeather.1.gz
	install -D -p -m 0644 src/wmweather.conf debian/wmweather/etc/wmweather.conf
	install -D -p -m 0755 debian/ip-up debian/wmweather/etc/ppp/ip-up.d/wmweather
	install -D -p -m 0644 debian/desktop debian/wmweather/usr/share/applications/wmweather.desktop

	install -D -p -m 0644 CHANGES debian/wmweather/usr/share/doc/wmweather/changelog
	install -D -p -m 0644 debian/changelog debian/wmweather/usr/share/doc/wmweather/changelog.Debian
	install    -p -m 0644 README debian/copyright debian/wmweather/usr/share/doc/wmweather
	gzip -9n debian/wmweather/usr/share/doc/wmweather/changelog*

	install -d -p -m 0755 debian/wmweather/DEBIAN
	install    -p -m 0644 debian/control debian/conffiles debian/wmweather/DEBIAN
	install    -p -m 0755 debian/postinst debian/postrm debian/wmweather/DEBIAN
	cd debian/wmweather && find usr -type f -print0 | LC_ALL=C sort -z | xargs -0 md5sum > DEBIAN/md5sums

	dpkg-shlibdeps debian/wmweather/usr/bin/wmweather
	dpkg-gencontrol -pwmweather -Pdebian/wmweather
	chmod -R u+w,go=u-w debian/wmweather
	dpkg --build debian/wmweather ..

binary-indep:

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