Skip to contentSkip to conversation

Add package for open2300

PATCH Superseded Alexandre Belloni 2 participants 2 messages Jan 12, 2012

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Add package for open2300

Open2300 is a package of software tools that reads (and writes) data from a Lacrosse WS2300/WS2305/WS2310/WS2315 Weather Station.

This package will install all the binaries on the target.

---
 package/Config.in            |    1 +
 package/open2300/Config.in   |    5 +++++
 package/open2300/open2300.mk |   24 ++++++++++++++++++++++++
 3 files changed, 30 insertions(+), 0 deletions(-)
 create mode 100644 package/open2300/Config.in
 create mode 100644 package/open2300/open2300.mk
package/Config.in +1 -0
index 1042d95..2ce4a36 100644
@@ -412,6 +412,7 @@ endmenu
 endmenu
 
 menu "Miscellaneous"
+source "package/open2300/Config.in"
 source "package/shared-mime-info/Config.in"
 endmenu
 
package/open2300/Config.in new file +5 -0
new file mode 100644
index 0000000..0f9c83d
@@ -0,0 +1,5 @@
+config BR2_PACKAGE_OPEN2300
+	bool "open2300"
+	help
+	  open2300 reads (and writes) data from a Lacrosse
+	  WS2300/WS2305/WS2310/WS2315 Weather Station
package/open2300/open2300.mk new file +24 -0
new file mode 100644
index 0000000..0467fb2
@@ -0,0 +1,24 @@
+############################################################
+#
+# Open2300
+#
+############################################################
+
+OPEN2300_SITE:=http://www.lavrsen.dk/svn/open2300/trunk/
+OPEN2300_SITE_METHOD:=svn
+OPEN2300_VERSION:=12
+
+OPEN2300_BINS = open2300 dump2300 log2300 fetch2300 wu2300 cw2300 history2300 histlog2300 bin2300 xml2300 light2300 interval2300 minmax2300
+ifeq ($(BR2_PACKAGE_MYSQL),y)
+	OPEN2300_BINS += mysql2300 mysqlhistlog2300
+endif
+
+define OPEN2300_BUILD_CMDS
+	$(MAKE) CC=$(TARGET_CC) LD=$(TARGET_LD) -C $(@D) $(OPEN2300_BINS)
+endef
+
+define OPEN2300_INSTALL_TARGET_CMDS
+	$(INSTALL) -D -m 0755 $(addprefix $(@D)/,$(OPEN2300_BINS)) $(TARGET_DIR)/usr/bin/
+endef
+
+$(eval $(call GENTARGETS,package,open2300))
Signature · 1 line
1.7.5.4
#1 lore raw

PATCH 1/1 Add package for open2300

Le Thu, 12 Jan 2012 14:33:41 +0100,
Alexandre Belloni <[email protected]> a ?crit :

Quoted 4 lines

menu "Miscellaneous"
+source "package/open2300/Config.in"
source "package/shared-mime-info/Config.in"
endmenu

Looking at what the application does, probably it needs to go in the "Hardware handling" menu.

package/open2300/Config.in line 5

Quoted 5 lines
package/open2300/Config.in new file +5 -0
+config BR2_PACKAGE_OPEN2300
+	bool "open2300"
+	help
+	  open2300 reads (and writes) data from a Lacrosse
+	  WS2300/WS2305/WS2310/WS2315 Weather Station

We generally add an empty line here, and then the URL of the project.

package/open2300/open2300.mk line 9

Quoted 3 lines
package/open2300/open2300.mk new file +3 -0
+OPEN2300_SITE:=http://www.lavrsen.dk/svn/open2300/trunk/
+OPEN2300_SITE_METHOD:=svn
+OPEN2300_VERSION:=12

Use = instead of := and do some nice formatting:

OPEN2300_SITE = http://www.lavrsen.dk/svn/open2300/trunk/
OPEN2300_SITE_METHOD = svn
OPEN2300_VERSION = 12

Quoted 3 lines

+OPEN2300_BINS = open2300 dump2300 log2300 fetch2300 wu2300 cw2300 history2300 histlog2300 bin2300 xml2300 light2300 interval2300 minmax2300

Please use \ at some point to avoid the very long line.

package/open2300/open2300.mk line 14

Quoted 3 lines
package/open2300/open2300.mk new file +3 -0
+ifeq ($(BR2_PACKAGE_MYSQL),y)
+	OPEN2300_BINS += mysql2300 mysqlhistlog2300
+endif

Do those programs need the mysql client library to be built? If so, then you need:

OPEN2300_DEPENDENCIES += mysql_client

to ensure that mysql is built before open2300.

Quoted 7 lines
(quoted diff) +2 -0
+define OPEN2300_BUILD_CMDS
+	$(MAKE) CC=$(TARGET_CC) LD=$(TARGET_LD) -C $(@D)

$(OPEN2300_BINS) +endef

package/open2300/open2300.mk new file +3 -0
+
+define OPEN2300_INSTALL_TARGET_CMDS
+	$(INSTALL) -D -m 0755 $(addprefix $(@D)/,$(OPEN2300_BINS))

$(TARGET_DIR)/usr/bin/ +endef

Won't work. If you use -D, you must pass the complete path of the target file, i.e:

	for prog in $(OPEN2300_BINS); do \
		$(INSTALL) -D -m 0755 $(@D)/$$prog $(TARGET_DIR)/usr/bin/$$prog ; \
	done
Quoted 1 line

+$(eval $(call GENTARGETS,package,open2300))

Just:

$(eval $(call GENTARGETS))

Regards,

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com