2 # Linux-specific packaging script
5 ifndef TOP_LEVEL_MAKEFILE
6 $(error Top level Makefile must be used to build this target
)
9 SED_SCRIPT
:= sed
-i
-e
' \
10 s/<ARCHIVE_PREFIX>/$(PACKAGE_NAME)/g; \
11 s/<EMAIL>/$(PACKAGING_EMAIL_ADDRESS)/g; \
12 s,<URL>,$(WEBSITE_URL),g; \
13 s,<GIT_URL>,$(GIT_URL),g; \
14 s,<GITWEB_URL>,$(GITWEB_URL),g; \
17 # Are we using a debian based distro?
18 ifneq ($(wildcard /etc
/apt
/sources.list
),)
20 # Are we using a rpm based distro?
21 else ifneq ($(wildcard /etc
/yum.repos.d
/*),)
23 # Are we using an Arch based distro?
24 else ifneq ($(wildcard /etc
/pacman.conf
),)
25 $(info TODO
: built in arch package
)
28 -include $(ROOT_DIR
)/package
/linux
/$(PKG_TYPE
).mk
30 ##############################
32 # Install Linux Target
34 ##############################
35 enable-udev-rules
:= no
38 bindir := $(prefix)/bin
40 libdir := $(prefix)/$(libbasename
)
41 datadir := $(prefix)/share
42 udevrulesdir
:= /etc
/udev
/rules.d
44 INSTALL
= cp
-a
--no-preserve
=ownership
51 @
$(ECHO
) " INSTALLING GCS TO $(DESTDIR)/)"
52 $(V1
) $(MKDIR
) -p
$(DESTDIR
)$(bindir)
53 $(V1
) $(MKDIR
) -p
$(DESTDIR
)$(libdir)
54 $(V1
) $(MKDIR
) -p
$(DESTDIR
)$(datadir)
55 $(V1
) $(MKDIR
) -p
$(DESTDIR
)$(datadir)/applications
56 $(V1
) $(MKDIR
) -p
$(DESTDIR
)$(datadir)/pixmaps
57 $(V1
) $(INSTALL
) $(GCS_DIR
)/bin
/$(GCS_SMALL_NAME
) $(DESTDIR
)$(bindir)
58 $(V1
) $(INSTALL
) $(GCS_DIR
)/$(libbasename
)/$(GCS_SMALL_NAME
) $(DESTDIR
)$(libdir)
59 $(V1
) $(INSTALL
) $(GCS_DIR
)/share
/$(GCS_SMALL_NAME
) $(DESTDIR
)$(datadir)
60 $(V1
) $(INSTALL
) -T
$(ROOT_DIR
)/package
/linux
/gcs.desktop
$(DESTDIR
)$(datadir)/applications
/$(ORG_SMALL_NAME
).desktop
61 $(V1
) $(INSTALL
) -T
$(ROOT_DIR
)/ground
/gcs
/src
/plugins
/coreplugin
/images
/$(ORG_SMALL_NAME
)_logo_128.png \
62 $(DESTDIR
)$(datadir)/pixmaps
/$(ORG_SMALL_NAME
).png
64 $(V1
) sed
-i
-e
's/gcs/$(GCS_SMALL_NAME)/g;s/GCS/$(GCS_BIG_NAME)/g;s/org/$(ORG_SMALL_NAME)/g;s/ORG/$(ORG_BIG_NAME)/g' \
65 $(DESTDIR
)$(datadir)/applications
/$(ORG_SMALL_NAME
).desktop
67 ifneq ($(enable-udev-rules
), no
)
68 $(V1
) $(MKDIR
) -p
$(DESTDIR
)$(udevrulesdir
)
69 $(V1
) $(INSTALL
) -T
$(ROOT_DIR
)/package
/linux
/45-uav.rules
$(DESTDIR
)$(udevrulesdir
)/45-$(ORG_SMALL_NAME
).rules
72 # uninstall target to ensure no side effects from previous installations
75 @
$(ECHO
) " UNINSTALLING GCS FROM $(DESTDIR)/)"
76 # Protect against inadvertant 'rm -rf /'
77 ifeq ($(GCS_SMALL_NAME
),)
78 @
$(ECHO
) "Error in build configuration - GCS_SMALL_NAME not defined"
81 ifeq ($(ORG_SMALL_NAME
),)
82 @
$(ECHO
) "Error in build configuration - ORG_SMALL_NAME not defined"
86 $(V1
) $(RM_RF
) $(DESTDIR
)$(bindir)/$(GCS_SMALL_NAME
) # Remove application
87 $(V1
) $(RM_RF
) $(DESTDIR
)$(libdir)/$(GCS_SMALL_NAME
) # Remove libraries
88 $(V1
) $(RM_RF
) $(DESTDIR
)$(datadir)/$(GCS_SMALL_NAME
) # Remove other data
89 $(V1
) $(RM_F
) $(DESTDIR
)$(datadir)/applications
/$(ORG_SMALL_NAME
).desktop
90 $(V1
) $(RM_F
) $(DESTDIR
)$(datadir)/pixmaps
/$(ORG_SMALL_NAME
).png
91 $(V1
) $(RM_F
) $(DESTDIR
)$(udevrulesdir
)/45-$(ORG_SMALL_NAME
).rules