File: rules

package info (click to toggle)
fex 20200429-1
  • links: PTS, VCS
  • area: non-free
  • in suites: sid
  • size: 3,532 kB
  • sloc: perl: 32,103; sh: 410; javascript: 53; makefile: 42
file content (62 lines) | stat: -rwxr-xr-x 2,421 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
#!/usr/bin/make -f
# -*- makefile -*-
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

# This has to be exported to make some magic below work.
export DH_OPTIONS

include /usr/share/dpkg/default.mk
LOCALES:=$(shell (cd locale;find . -mindepth 1 -maxdepth 1 -type d)|sed -e 's,^./,,')

%:
	dh $@

override_dh_auto_build:
	locale/debian_translate . /usr/share/fex locale/export
	for file in afex asex fexget fexpack fexpush fexsend fexsync sexget sexsend;do \
		if ! cmp -s bin/$$file htdocs/download/$$file;then \
			echo File $$file differs in bin and htdocs! Package will contain only version from bin in both locations!; \
		fi; \
	done

override_dh_clean:
	rm -rf locale/export
	dh_clean
	if [ ! -f debian/htdocs.md5/$(DEB_VERSION_UPSTREAM_REVISION) ];then \
		echo -n "Missing MD5sum file, generating: " ;\
		find htdocs/ -type f|grep -v -e version -e Licence -e FAQ/jquery.js -e download/ |LC_ALL=C sort|xargs -n 1 md5sum >debian/htdocs.md5/$(DEB_VERSION_UPSTREAM_REVISION) ;\
		echo "done. Stopping as failed now to check file into Git."; \
		exit 1 ;\
	fi

override_dh_auto_install:
	# exclude vv and dereference symlinks
	# we still ship vv as example
	cp bin/zz debian/fex-utils/usr/bin

overide_dh_installdocs:
	dh_installdocs
	cp doc/new debian/fex/usr/share/doc/fex/NEWS
	echo "fex_$(DEB_VERSION)" >debian/fex/usr/share/fex/htdocs/version
	# update file system paths in FAQ
	sed -i -e 's,/home/fex/,/var/lib/fex/,g' debian/fex/usr/share/fex/htdocs/FAQ/*
	@(cd debian/fex/usr/share/fex/;find htdocs/ -type f|grep -v -e version -e FAQ/jquery.js -e download/ |LC_ALL=C sort|xargs -n 1 md5sum >../../../../fex.md5.check)
	if diff -q debian/fex.md5.check debian/htdocs.md5/$(DEB_VERSION_UPSTREAM_REVISION) >/dev/null;then \
		echo "Correct htdocs md5sum found."; \
		rm -f debian/fex.md5.check; \
	else \
		echo "htdocs contents changed! Please add the following to your md5 cache:" ; \
		cat debian/fex.md5.check; \
		exit 1 ; \
	fi
	(cd debian/htdocs.md5;tar czf ../fex/usr/share/fex/.md5/htdocs.tgz *)

override_dh_link:
	dh_link
	# add custom symlink without path
	mkdir -p debian/fex/usr/share/fex/htdocs/download
	# This link is definitely broken - see bug #864176
	# ln -s :sexsend:sexget: debian/fex/usr/share/fex/htdocs/download/sex.stream
	# just assuming sexget was intende - just file another bug report if this is wrong
	ln -s sexget debian/fex/usr/share/fex/htdocs/download/sex.stream