File: rules

package info (click to toggle)
zypper 1.11.13-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 9,668 kB
  • ctags: 1,830
  • sloc: cpp: 20,176; sh: 380; python: 122; xml: 109; perl: 35; makefile: 34
file content (50 lines) | stat: -rwxr-xr-x 1,923 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
#!/usr/bin/make -f

PKD   = $(word 1,$(abspath $(dir $(MAKEFILE_LIST))))
PKG   = $(word 2,$(shell dpkg-parsechangelog -l$(PKD)/changelog | grep ^Source))
UVER  = $(shell dpkg-parsechangelog -l$(PKD)/changelog | perl -ne 'print $$1 if m{^Version:\s+(?:\d+:)?(\d.*)(?:\-\d+.*)};')
DTYPE =
VER  ?= $(subst $(DTYPE),,$(UVER))


include /usr/share/cdbs/1/class/cmake.mk
include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/rules/utils.mk

DEB_BUILD_PARALLEL = 1

DEB_DH_INSTALL_ARGS   += --fail-missing

DEB_CMAKE_EXTRA_FLAGS += -DCMAKE_INSTALL_PREFIX=/usr \
                         -DLIB=lib/$(shell dpkg-architecture -qDEB_BUILD_MULTIARCH) \
                         -DCMAKE_VERBOSE_MAKEFILE=ON

common-install-indep:: remove-cruft
common-install-arch:: remove-cruft

remove-cruft::
	rm -f $(CURDIR)/debian/tmp/usr/bin/aptitude
	rm -f $(CURDIR)/debian/tmp/usr/bin/installation_sources
	rm -f $(CURDIR)/debian/tmp/usr/share/doc/packages/zypper/COPYING

get-orig-source: $(PKG)_$(VER)$(DTYPE).orig.tar.xz $(info I: $(PKG)_$(VER)$(DTYPE))
	@

$(PKG)_$(VER)$(DTYPE).orig.tar.xz:
	@echo "# Downloading..."
	uscan --noconf --verbose --rename --destdir=$(CURDIR) --check-dirname-level=0 --force-download --download-version $(VER) $(PKD)
	$(if $(wildcard $(PKG)-$(VER)),$(error $(PKG)-$(VER) exist, aborting..))
	@echo "# Extracting..."
	mkdir $(PKG)-$(VER) \
	    && tar -xf $(PKG)_$(VER).orig.tar.* --directory $(PKG)-$(VER) --strip-components 1 \
	    || $(RM) -r $(PKG)-$(VER)
#	@echo "# Cleaning-up..."
#	cd $(PKG)-$(VER) \
#	    && find . -depth -type d -name 'windows' -exec $(RM) -r {} \; -printf 'removed %p\n' \
#	    && $(RM) -r -v \
#	        docs/
	$(RM) -v $(PKG)_$(VER).orig.tar.*
	@echo "# Packing..."
	find -L "$(PKG)-$(VER)" -xdev -type f -print | sort \
	    | XZ_OPT="-6v" tar -caf "$(PKG)_$(VER)$(DTYPE).orig.tar.xz" -T- --owner=root --group=root --mode=a+rX \
	    && $(RM) -r "$(PKG)-$(VER)"