add high-speed usb serial fix from Junxion (closes: #2274)
[openwrt.git] / include / package-ipkg.mk
1 #
2 # Copyright (C) 2006,2007 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 define BuildIPKGVariable
9 $(call shexport,Package/$(1)/$(2))
10 $(1)_COMMANDS += var2file "$(call shvar,Package/$(1)/$(2))" $(2);
11 endef
12
13 ifeq ($(DUMP),)
14 define BuildIPKG
15 IPKG_$(1):=$(PACKAGE_DIR)/$(1)_$(VERSION)_$(PKGARCH).ipk
16 IDIR_$(1):=$(PKG_BUILD_DIR)/ipkg/$(1)
17 INFO_$(1):=$(IPKG_STATE_DIR)/info/$(1).list
18
19 ifdef Package/$(1)/install
20 ifneq ($(CONFIG_PACKAGE_$(1))$(SDK)$(DEVELOPER),)
21 compile: $$(IPKG_$(1))
22
23 ifeq ($(CONFIG_PACKAGE_$(1)),y)
24 install: $$(INFO_$(1))
25 endif
26 else
27 compile: $(1)-disabled
28 $(1)-disabled:
29 @echo "WARNING: skipping $(1) -- package not selected"
30 endif
31 endif
32
33 IDEPEND_$(1):=$$(strip $$(DEPENDS))
34
35 $(eval $(call BuildIPKGVariable,$(1),conffiles))
36 $(eval $(call BuildIPKGVariable,$(1),preinst))
37 $(eval $(call BuildIPKGVariable,$(1),postinst))
38 $(eval $(call BuildIPKGVariable,$(1),prerm))
39 $(eval $(call BuildIPKGVariable,$(1),postrm))
40 $$(IDIR_$(1))/CONTROL/control: $(PKG_BUILD_DIR)/.version-$(1)_$(VERSION)_$(PKGARCH)
41 @rm -f $(PACKAGE_DIR)/$(1)_*
42 mkdir -p $$(IDIR_$(1))/CONTROL
43 echo "Package: $(1)" > $$(IDIR_$(1))/CONTROL/control
44 echo "Version: $(VERSION)" >> $$(IDIR_$(1))/CONTROL/control
45 ( \
46 DEPENDS='$(EXTRA_DEPENDS)'; \
47 for depend in $$(filter-out @%,$$(IDEPEND_$(1))); do \
48 DEPENDS=$$$${DEPENDS:+$$$$DEPENDS, }$$$${depend##+}; \
49 done; \
50 echo "Depends: $$$$DEPENDS"; \
51 echo "Source: $(SOURCE)"; \
52 echo "Section: $(SECTION)"; \
53 echo "Priority: $(PRIORITY)"; \
54 echo "Maintainer: $(MAINTAINER)"; \
55 echo "Architecture: $(PKGARCH)"; \
56 echo -n "Description: "; getvar $(call shvar,Package/$(1)/description) | sed -e 's,^[[:space:]]*, ,g'; \
57 ) >> $$(IDIR_$(1))/CONTROL/control
58 chmod 644 $$(IDIR_$(1))/CONTROL/control
59 (cd $$(IDIR_$(1))/CONTROL; \
60 $($(1)_COMMANDS) \
61 )
62
63 $$(IPKG_$(1)): $(STAGING_DIR)/etc/ipkg.conf $(PKG_BUILD_DIR)/.built $$(IDIR_$(1))/CONTROL/control
64 $(call Package/$(1)/install,$$(IDIR_$(1)))
65 mkdir -p $(PACKAGE_DIR)
66 -find $$(IDIR_$(1)) -name 'CVS' -o -name '.svn' -o -name '.#*' | $(XARGS) rm -rf
67 $(RSTRIP) $$(IDIR_$(1))
68 $(IPKG_BUILD) $$(IDIR_$(1)) $(PACKAGE_DIR)
69 @[ -f $$(IPKG_$(1)) ] || false
70
71 $$(INFO_$(1)): $$(IPKG_$(1))
72 $(IPKG) install $$(IPKG_$(1))
73
74 $(1)-clean:
75 rm -f $(PACKAGE_DIR)/$(1)_*
76
77 clean: $(1)-clean
78
79 $(PKG_BUILD_DIR)/.version-$(1)_$(VERSION)_$(PKGARCH): $(STAMP_PREPARED)
80 -@rm -f $(PKG_BUILD_DIR)/.version-$(1)_* 2>/dev/null
81 @touch $$@
82
83 $$(eval $$(call Build/DefaultTargets,$(1)))
84
85 endef
86
87 $(STAGING_DIR)/etc/ipkg.conf:
88 mkdir -p $(STAGING_DIR)/etc
89 echo "dest root /" > $(STAGING_DIR)/etc/ipkg.conf
90 echo "option offline_root $(TARGET_DIR)" >> $(STAGING_DIR)/etc/ipkg.conf
91
92 endif
This page took 0.052704 seconds and 5 git commands to generate.