File: rules

package info (click to toggle)
nvpy 0.9.7-1
  • links: PTS
  • area: contrib
  • in suites: stretch
  • size: 920 kB
  • ctags: 306
  • sloc: python: 2,453; makefile: 29
file content (36 lines) | stat: -rwxr-xr-x 1,170 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
#!/usr/bin/make -f

%:
	dh $@ --with python2

override_dh_auto_install:
	dh_auto_install -- --install-lib=/usr/share/nvpy

override_dh_install:
	dh_install
	rm -rf debian/nvpy/usr/share/nvpy/*.egg-info
	chmod +x debian/nvpy/usr/share/nvpy/nvpy/nvpy.py
	cd debian/nvpy/usr/share/nvpy/nvpy && \
		rm -f icons/nvpy.ico icons/README.md nvpy-example.cfg

# Download source
GIT_REPO ?= https://github.com/cpbotha/nvpy
RDATE=$(shell dpkg-parsechangelog | sed -rne 's,^Version: .*\~git([0-9]+).*,\1,p')
FDATE=$(shell echo $(RDATE) | sed -r 's/([0-9]{4})([0-9]{2})([0-9]{2})/\1-\2-\3/')
VER=$(shell dpkg-parsechangelog | sed -rne 's,^Version: (.+)-.*,\1,p')

get-packaged-orig-source:
	@echo "You can build this from a local repo by supplying the GIT_REPO variable"
	rm -rf nvpy-$(VER).orig
	git clone $(GIT_REPO) nvpy-$(VER).orig
ifeq (,$(RDATE))
	cd nvpy-$(VER).orig && git checkout $(VER)
else
	set -e; \
	cd nvpy-$(VER).orig; \
	git checkout $$(git rev-list --date-order --until=$(FDATE) master | head -n1)
endif
	rm -rf nvpy-$(VER).orig/.git*
	GZIP=--best tar -cz --owner root --group root --mode a+rX \
	-f nvpy_$(VER).orig.tar.gz nvpy-$(VER).orig
	rm -rf nvpy-$(VER).orig