greatscottgadgets / ubertooth

Software, firmware, and hardware designs for Ubertooth
https://greatscottgadgets.com/ubertoothone/
GNU General Public License v2.0
1.94k stars 433 forks source link

Add version numbers to commandline tools #12

Closed dominicgs closed 9 years ago

dominicgs commented 10 years ago

It would be nice to have version numbers added to the tools in the same way that we add them to the firmware. Running ubertooth-rx -v would give the output for Ubertooth and probably libbtbb, e.g. Ubertooth 2014-02-R2, libbtbb 2014-02-R2 or Ubertooth git-ae7923f, libbtbb git-83b7ca6.

mikeryan commented 9 years ago

This is going to take some doing under cmake. Possible solution:

https://github.com/rpavlik/cmake-modules/tree/master/cmake-2.8.12-modules

dominicgs commented 9 years ago

I was thinking that we'd use the same method as we do for pkg-config files: https://github.com/dominicgs/USBProxy/blob/master/src/lib/usbproxy.pc.in https://github.com/dominicgs/USBProxy/blob/master/src/lib/CMakeLists.txt

dominicgs commented 9 years ago

Added some initial support in commit 00b38e6. A couple of questions: Should we version the tools separately from the lib? Should we also version libbtbb and print it at the same time? The formatting looks a bit strange, better ideas are welcome.

mikeryan commented 9 years ago

00b38e6 breaks the build for me:

CMakeFiles/ubertooth-btle.dir/ubertooth-btle.c.o: In function `main':
ubertooth-btle.c:(.text+0x48a): undefined reference to `h_pcap_le'
ubertooth-btle.c:(.text+0x49b): undefined reference to `h_pcap_le'
ubertooth-btle.c:(.text+0x4e5): undefined reference to `h_pcap_le'
ubertooth-btle.c:(.text+0x4f6): undefined reference to `h_pcap_le'
collect2: error: ld returned 1 exit status
dominicgs commented 9 years ago

Yes, known issue, already fixed on master.

mikeryan commented 9 years ago

Where did MAJOR and MINOR come from? If we include those, they should be in sync with YYYY.MMRN format.

I think it would be wise to add the same functionality to libbtbb. A simple char *btbb_version(void) that we can call from Ubertooth utilities would be sufficient.

dominicgs commented 9 years ago

MAJOR and MINOR come from the library version number, they're set in a higher level CMakeLists.txt file. They aren't in sync with the release number because we don't always bump the library version with a release.

mikeryan commented 9 years ago

My ideal format: ubertooth git-00f80d5*, libbtbb git-1234567, libUbertooth 0.2 For releases it would look like: ubertooth 2014-11-R1, libbtbb 2014-11-R1, libUbertooth 0.2

mikeryan commented 9 years ago

Be sure to update the release procedure wiki page so that the releases have symbolic names instead of git commits.

dominicgs commented 9 years ago

Done - in a number of commits because it's sort of required for testing.