summaryrefslogtreecommitdiffstats
path: root/rules/usb-modeswitch.make
blob: 95149a3b989dc39c33632eb087b65f432cf397fc (plain)
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
74
75
76
77
78
79
80
81
82
83
# -*-makefile-*-
#
# Copyright (C) 2013 by Bernhard Walle <bernhard@bwalle.de>
#
# See CREDITS for details about who has contributed to this project.
#
# For further information about the PTXdist project and license conditions
# see the README file.
#

#
# We provide this package
#
PACKAGES-$(PTXCONF_USB_MODESWITCH) += usb-modeswitch

#
# Paths and names
#
USB_MODESWITCH_VERSION	:= 2.3.0
USB_MODESWITCH_MD5	:= 7faf7dccd50b3ca8aaa16fcb5bf0dc2f
USB_MODESWITCH		:= usb-modeswitch-$(USB_MODESWITCH_VERSION)
USB_MODESWITCH_SUFFIX	:= tar.bz2
USB_MODESWITCH_URL	:= http://www.draisberghof.de/usb_modeswitch/$(USB_MODESWITCH).$(USB_MODESWITCH_SUFFIX)
USB_MODESWITCH_SOURCE	:= $(SRCDIR)/$(USB_MODESWITCH).$(USB_MODESWITCH_SUFFIX)
USB_MODESWITCH_DIR	:= $(BUILDDIR)/$(USB_MODESWITCH)
USB_MODESWITCH_LICENSE	:= GPL-2.0

# ----------------------------------------------------------------------------
# Prepare
# ----------------------------------------------------------------------------

#
# autoconf
#
USB_MODESWITCH_CONF_TOOL	:= NO
USB_MODESWITCH_MAKE_ENV		:= $(CROSS_ENV)
USB_MODESWITCH_MAKE_OPT		:= $(CROSS_ENV_PROGS)

# ----------------------------------------------------------------------------
# Install
# ----------------------------------------------------------------------------

$(STATEDIR)/usb-modeswitch.install:
	@$(call targetinfo)
	@$(call world/install, USB_MODESWITCH)
	@mkdir -p $(USB_MODESWITCH_PKGDIR)/lib/systemd/system
	@install -m 0644 $(USB_MODESWITCH_DIR)/usb_modeswitch@.service \
		$(USB_MODESWITCH_PKGDIR)/lib/systemd/system/usb_modeswitch@.service
	@$(call touch)

# ----------------------------------------------------------------------------
# Target-Install
# ----------------------------------------------------------------------------

$(STATEDIR)/usb-modeswitch.targetinstall:
	@$(call targetinfo)

	@$(call install_init, usb-modeswitch)
	@$(call install_fixup, usb-modeswitch,PRIORITY,optional)
	@$(call install_fixup, usb-modeswitch,SECTION,base)
	@$(call install_fixup, usb-modeswitch,AUTHOR,"Bernhard Walle <bernhard@bwalle.de>")
	@$(call install_fixup, usb-modeswitch,DESCRIPTION,missing)

	@$(call install_copy, usb-modeswitch, 0, 0, 0755, -, \
		/usr/sbin/usb_modeswitch)
ifneq ($(PTXCONF_USB_MODESWITCH_UDEV_HELPER)$(PTXCONF_USB_MODESWITCH_SYSTEMD_UNIT),)
	@$(call install_copy, usb-modeswitch, 0, 0, 0755, -, \
		/usr/sbin/usb_modeswitch_dispatcher)
endif
ifdef PTXCONF_USB_MODESWITCH_UDEV_HELPER
	@$(call install_copy, usb-modeswitch, 0, 0, 0755, -, \
		/lib/udev/usb_modeswitch)
endif
ifdef PTXCONF_USB_MODESWITCH_SYSTEMD_UNIT
	@$(call install_copy, usb-modeswitch, 0, 0, 0644, -, \
		/lib/systemd/system/usb_modeswitch@.service)
endif

	@$(call install_finish, usb-modeswitch)

	@$(call touch)

# vim: syntax=make