File: rules

package info (click to toggle)
telegram-cli 1.3.1+git20160323.6547c0b21-1
  • links: PTS
  • area: main
  • in suites: sid
  • size: 1,120 kB
  • sloc: ansic: 10,549; sh: 256; perl: 154; makefile: 75; python: 48
file content (49 lines) | stat: -rwxr-xr-x 2,034 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
#!/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.

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

VERSION=$(shell dpkg-parsechangelog | sed -n 's/^Version: //p' | cut -f1 -d'-')
PACKAGE_NAME=$(shell dpkg-parsechangelog | sed -n 's/^Source: //p')
%:
	dh $@

override_dh_auto_configure:
	ln -s -f /etc/mime.types $(CURDIR)/mime.types
	dh_auto_configure -- --disable-openssl OPENSSL_INCLUDES="-I/usr/include/wolfssl -DWC_NO_HARDEN"

build-orig:
			mkdir -p $(PACKAGE_NAME)-$(VERSION)
			tar --exclude=ax_lua.m4 --exclude=debian --exclude=\.pc \
						--exclude=$(PACKAGE_NAME)-$(VERSION) -cf - . \
						| ( cd $(PACKAGE_NAME)-$(VERSION) && tar xf - )
			tar -cf ../$(PACKAGE_NAME)_$(VERSION).orig.tar $(PACKAGE_NAME)-$(VERSION)
			$(RM) -r $(PACKAGE_NAME)-$(VERSION)
			xz ../$(PACKAGE_NAME)_$(VERSION).orig.tar

DEB_SOURCE := $(shell dpkg-parsechangelog | grep Source: | sed -e 's/Source: //')
DEB_VERSION := $(shell dpkg-parsechangelog | grep Version: | sed -e 's/Version: //')
DEB_UPSTREAM_VERSION := $(shell echo $(DEB_VERSION) | sed -e 's/-[^-]*$$//')
GIT_URL = https://github.com/vysheng/tg.git

get-orig-source:
	set -e; if echo $(DEB_VERSION) | grep -c "git"; \
	then \
		git_version=`echo $(DEB_VERSION) | sed -e 's/^.*git\([0-9]*\)*\.\(.*\)-.*$$/\2/g'`; \
	else \
		git_version=$(DEB_UPSTREAM_VERSION); \
	fi; \
	tmpdir=`mktemp -d -t`; \
	cd $$tmpdir; \
	echo "checkout upstream repository ..."; \
	git clone $(GIT_URL); echo "getting specific upstream revision/tag: $$git_version"; \
	cd `ls | head -n 1`; git checkout -b orig $$git_version; cd ..; \
	tar --exclude=.git -cJvf $(CURDIR)/$(DEB_SOURCE)_$(DEB_UPSTREAM_VERSION).orig.tar.xz `ls | head -n 1`; \
	cd $(CURDIR); \
	rm -rf $$tmpdir