From d06d776adb0fef9504bd7662760e4cd0971fb748 Mon Sep 17 00:00:00 2001 From: Nima Talebi Date: Fri, 22 May 2009 23:49:55 +1000 Subject: Reversioned, relicensed, and rejigged The version is of now, v3.10.6. The version major field has been upped due to the newly added XML functionality. The version has been reverted to GPLv2. Some headers have been cleaned up, copyright notices added etc. Credits given where due. --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 8e69bb5..c1e46a7 100644 --- a/Makefile +++ b/Makefile @@ -3,10 +3,10 @@ #. #. (C) 2008 Nima Talebi #. -#. Licensed under the GNU Public License v3 +#. Licensed under the GNU Public License v2 #. -VERSION := 2.10 +VERSION := 3.10.6 PY := $(shell python -V 2>&1 |sed -e 's/.\(ython\) \(2\.[0-9]\)\..*/p\1\2/') PY_VER := $(subst python,,$(PY)) PACKAGE := python-dmidecode -- cgit From 6b1598c8b98699b115525155b43d19365e79dd08 Mon Sep 17 00:00:00 2001 From: Nima Talebi Date: Sat, 23 May 2009 23:02:46 +1000 Subject: Reimplementing the type() function - WIP --- Makefile | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index c1e46a7..1bd17b4 100644 --- a/Makefile +++ b/Makefile @@ -36,6 +36,11 @@ vpath %.c $(SRC_D) vpath %.h $(SRC_D) vpath % $(OBJ_D) +ifeq (0,1) +TEMP: + sudo make install + sudo python -c 'import dmidecode; print "-"*80; print dmidecode.slot(); print "-"*80; print dmidecode.type(1)' +endif ############################################################################### build: $(PY)-dmidecode.so @@ -57,6 +62,7 @@ clean : $(PY) src/setup.py clean -$(RM) *.so lib/*.o core -rm -rf build .dpkg + cd unit-tests && $(MAKE) clean tarball: rm -rf $(PACKAGE)-$(VERSION) -- cgit From af27ba4dd2ffdef8e4ee3abf187475c1b3303f71 Mon Sep 17 00:00:00 2001 From: Nima Talebi Date: Sun, 24 May 2009 00:26:23 +1000 Subject: Completed preliminary reimplementation of type() Updated test unit to match. Throw an exception instead of returning None/False in some functions. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 1bd17b4..48f3132 100644 --- a/Makefile +++ b/Makefile @@ -39,7 +39,7 @@ vpath % $(OBJ_D) ifeq (0,1) TEMP: sudo make install - sudo python -c 'import dmidecode; print "-"*80; print dmidecode.slot(); print "-"*80; print dmidecode.type(1)' + sudo python -c 'import dmidecode; print "-"*80; print dmidecode.slot(); print "-"*80; print dmidecode.type(9)' endif ############################################################################### -- cgit From 6b21c755269a80f3988259157d47430f491448be Mon Sep 17 00:00:00 2001 From: Nima Talebi Date: Sun, 24 May 2009 02:17:21 +1000 Subject: Broken commit - change in XML mapping design Rather than hardcoding the data by function name (e.g. system, bios, connector, slot, etc), create each `type' as an individual XML tree, then group them under user-friendly names (as per the function names). Here the `pythonmap.xml' groups (but does not define) the various types (0..255), the types themselves are however defined in `typemap.xml'. This commit is broken, and a WIP. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 48f3132..a0299c3 100644 --- a/Makefile +++ b/Makefile @@ -36,7 +36,7 @@ vpath %.c $(SRC_D) vpath %.h $(SRC_D) vpath % $(OBJ_D) -ifeq (0,1) +ifeq (0,0) TEMP: sudo make install sudo python -c 'import dmidecode; print "-"*80; print dmidecode.slot(); print "-"*80; print dmidecode.type(9)' -- cgit From 64d2c31c902439eb0e62471fe97086bf217e7926 Mon Sep 17 00:00:00 2001 From: Nima Talebi Date: Sun, 24 May 2009 04:09:58 +1000 Subject: Follow-up on recent XML config file rename --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index a0299c3..48f3132 100644 --- a/Makefile +++ b/Makefile @@ -36,7 +36,7 @@ vpath %.c $(SRC_D) vpath %.h $(SRC_D) vpath % $(OBJ_D) -ifeq (0,0) +ifeq (0,1) TEMP: sudo make install sudo python -c 'import dmidecode; print "-"*80; print dmidecode.slot(); print "-"*80; print dmidecode.type(9)' -- cgit From 87fabb17f5e54f1db6c48baeb33d8445b55bfa2d Mon Sep 17 00:00:00 2001 From: Nima Talebi Date: Sun, 24 May 2009 12:09:20 +1000 Subject: Added new target `unit' --- Makefile | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 48f3132..c4e28e5 100644 --- a/Makefile +++ b/Makefile @@ -77,6 +77,9 @@ rpm: tarball cp $(PACKAGE)-$(VERSION).tar.gz rpm/SOURCES rpmbuild -ba --define "_topdir $(shell pwd)/rpm" rpm/SPECS/$(PACKAGE).spec +unit: + cd unit-tests && $(MAKE) + ############################################################################### libdmidecode.so: dmihelper.o util.o dmioem.o dmidecode.o dmidecodemodule.o $(CC) $(LDFLAGS) $(SOFLAGS) $^ -o $@ -- cgit From f744a1428ddd9e0c1a90f2725192abf9cd4d3628 Mon Sep 17 00:00:00 2001 From: David Sommerseth Date: Wed, 10 Jun 2009 21:03:54 +0200 Subject: Updated Makefile and redhat.spec to work --- Makefile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index c4e28e5..da32cb6 100644 --- a/Makefile +++ b/Makefile @@ -28,7 +28,7 @@ CFLAGS += -O3 #LDFLAGS = -lefence LDFLAGS = SOFLAGS = -pthread -shared -L/home/nima/dev-room/projects/dmidecode -lutil -SO = build/lib.linux-$(shell uname -m)-$(PY_VER)/dmidecode.so +SO = build/lib.linux-$(shell uname -m)-$(PY_VER)/dmidecodemod.so #. Search vpath %.o $(OBJ_D) @@ -43,8 +43,8 @@ TEMP: endif ############################################################################### -build: $(PY)-dmidecode.so -$(PY)-dmidecode.so: $(SO) +build: $(PY)-dmidecodemod.so +$(PY)-dmidecodemod.so: $(SO) cp $< $@ build: $(SO) @@ -58,7 +58,7 @@ uninstall: $(PY) src/setup.py uninstall clean : - dh_clean +# dh_clean $(PY) src/setup.py clean -$(RM) *.so lib/*.o core -rm -rf build .dpkg @@ -67,7 +67,7 @@ clean : tarball: rm -rf $(PACKAGE)-$(VERSION) mkdir $(PACKAGE)-$(VERSION) - cp -r contrib doc examples lib Makefile man README src $(PACKAGE)-$(VERSION) + cp -r contrib doc examples lib Makefile man README src dmidecode.py redhat.spec $(PACKAGE)-$(VERSION) tar -czvf $(PACKAGE)-$(VERSION).tar.gz $(PACKAGE)-$(VERSION) rpm: tarball -- cgit From 2a5a2f697a60bbfe30102d37121227ae7dad5c93 Mon Sep 17 00:00:00 2001 From: David Sommerseth Date: Thu, 11 Jun 2009 15:34:56 +0200 Subject: Use version info from version.h in Makefile Also cleaned up a little bit and added 'version' as a new target to show some version info --- Makefile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index da32cb6..f428ca3 100644 --- a/Makefile +++ b/Makefile @@ -6,11 +6,10 @@ #. Licensed under the GNU Public License v2 #. -VERSION := 3.10.6 +VERSION := $(shell cd src;python -c "from setup_common import *; print get_version();") PY := $(shell python -V 2>&1 |sed -e 's/.\(ython\) \(2\.[0-9]\)\..*/p\1\2/') PY_VER := $(subst python,,$(PY)) PACKAGE := python-dmidecode -SRCSRV := /var/www/nima/sites/src.autonomy.net.au/pub CC := gcc RM := rm -f @@ -57,6 +56,10 @@ install: uninstall: $(PY) src/setup.py uninstall +version : + @echo "python-dmidecode: $(VERSION)" + @echo "python version: $(PY_VER) ($(PY))" + clean : # dh_clean $(PY) src/setup.py clean -- cgit From 3909bcf91e2f1393582a5b949359d57919cedee9 Mon Sep 17 00:00:00 2001 From: Nima Talebi Date: Fri, 12 Jun 2009 22:30:07 +1000 Subject: A nothing-change --- Makefile | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index f428ca3..0ba7e19 100644 --- a/Makefile +++ b/Makefile @@ -27,7 +27,7 @@ CFLAGS += -O3 #LDFLAGS = -lefence LDFLAGS = SOFLAGS = -pthread -shared -L/home/nima/dev-room/projects/dmidecode -lutil -SO = build/lib.linux-$(shell uname -m)-$(PY_VER)/dmidecodemod.so +SO = build/lib.linux-$(shell uname -m)-$(PY_VER)/dmidecodemodule.so #. Search vpath %.o $(OBJ_D) @@ -42,8 +42,8 @@ TEMP: endif ############################################################################### -build: $(PY)-dmidecodemod.so -$(PY)-dmidecodemod.so: $(SO) +build: $(PY)-dmidecodemodule.so +$(PY)-dmidecodemodule.so: $(SO) cp $< $@ build: $(SO) @@ -56,15 +56,16 @@ install: uninstall: $(PY) src/setup.py uninstall -version : +version: @echo "python-dmidecode: $(VERSION)" @echo "python version: $(PY_VER) ($(PY))" -clean : -# dh_clean - $(PY) src/setup.py clean +clean: + -$(PY) src/setup.py clean --all -$(RM) *.so lib/*.o core - -rm -rf build .dpkg + -rm -rf build + -rm -rf rpm + -rm -rf src/setup_common.py[oc] cd unit-tests && $(MAKE) clean tarball: @@ -74,7 +75,6 @@ tarball: tar -czvf $(PACKAGE)-$(VERSION).tar.gz $(PACKAGE)-$(VERSION) rpm: tarball - rm -rf rpm mkdir -p rpm/{BUILD,RPMS,SRPMS,SPECS,SOURCES} cp contrib/$(PACKAGE).spec rpm/SPECS cp $(PACKAGE)-$(VERSION).tar.gz rpm/SOURCES -- cgit From d0e32662845f2c86fd8090858a51a90408d39172 Mon Sep 17 00:00:00 2001 From: Nima Talebi Date: Fri, 12 Jun 2009 23:01:27 +1000 Subject: Cleanup --- Makefile | 78 +++++++++------------------------------------------------------- 1 file changed, 10 insertions(+), 68 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 0ba7e19..1427f5a 100644 --- a/Makefile +++ b/Makefile @@ -6,47 +6,17 @@ #. Licensed under the GNU Public License v2 #. -VERSION := $(shell cd src;python -c "from setup_common import *; print get_version();") -PY := $(shell python -V 2>&1 |sed -e 's/.\(ython\) \(2\.[0-9]\)\..*/p\1\2/') -PY_VER := $(subst python,,$(PY)) PACKAGE := python-dmidecode - -CC := gcc -RM := rm -f -SRC_D := src -OBJ_D := lib -CFLAGS = -g -D_XOPEN_SOURCE=600 -CFLAGS += -Wall -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-align -CFLAGS += -Wwrite-strings -Wmissing-prototypes -Winline -Wundef #-Wcast-qual -CFLAGS += -pthread -fno-strict-aliasing -DNDEBUG -fPIC -CFLAGS += -I/usr/include/$(PY) -CFLAGS += -O3 -#CFLAGS += -DNDEBUG -#CFLAGS += -DBIGENDIAN -#CFLAGS += -DALIGNMENT_WORKAROUND -#LDFLAGS = -lefence -LDFLAGS = -SOFLAGS = -pthread -shared -L/home/nima/dev-room/projects/dmidecode -lutil -SO = build/lib.linux-$(shell uname -m)-$(PY_VER)/dmidecodemodule.so - -#. Search -vpath %.o $(OBJ_D) -vpath %.c $(SRC_D) -vpath %.h $(SRC_D) -vpath % $(OBJ_D) - -ifeq (0,1) -TEMP: - sudo make install - sudo python -c 'import dmidecode; print "-"*80; print dmidecode.slot(); print "-"*80; print dmidecode.type(9)' -endif +PY_VER := $(shell python -c 'import sys; print "python%d.%d"%sys.version_info[0:2]') +PY := python$(PY_VER) +SO = build/lib.linux-$(shell uname -m)-$(PY_VER)/dmidecodemod.so ############################################################################### -build: $(PY)-dmidecodemodule.so -$(PY)-dmidecodemodule.so: $(SO) - cp $< $@ +.PHONY: build install uninstall clean tarball rpm unit -build: $(SO) +build: $(PY)-dmidecodemod.so +$(PY)-dmidecodemod.so: $(SO) + cp $< $@ $(SO): $(PY) src/setup.py build @@ -56,13 +26,9 @@ install: uninstall: $(PY) src/setup.py uninstall -version: - @echo "python-dmidecode: $(VERSION)" - @echo "python version: $(PY_VER) ($(PY))" - clean: -$(PY) src/setup.py clean --all - -$(RM) *.so lib/*.o core + -rm -f *.so lib/*.o core -rm -rf build -rm -rf rpm -rm -rf src/setup_common.py[oc] @@ -74,36 +40,12 @@ tarball: cp -r contrib doc examples lib Makefile man README src dmidecode.py redhat.spec $(PACKAGE)-$(VERSION) tar -czvf $(PACKAGE)-$(VERSION).tar.gz $(PACKAGE)-$(VERSION) -rpm: tarball +rpm: tarball mkdir -p rpm/{BUILD,RPMS,SRPMS,SPECS,SOURCES} cp contrib/$(PACKAGE).spec rpm/SPECS cp $(PACKAGE)-$(VERSION).tar.gz rpm/SOURCES rpmbuild -ba --define "_topdir $(shell pwd)/rpm" rpm/SPECS/$(PACKAGE).spec unit: - cd unit-tests && $(MAKE) - -############################################################################### -libdmidecode.so: dmihelper.o util.o dmioem.o dmidecode.o dmidecodemodule.o - $(CC) $(LDFLAGS) $(SOFLAGS) $^ -o $@ + $(MAKE) -C unit-tests -$(OBJ_D)/dmidecodemodule.o: dmidecodemodule.c - $(CC) $(CFLAGS) -c -o $@ $< - -$(OBJ_D)/dmidecode.o: dmidecode.c version.h types.h util.h config.h dmidecode.h dmioem.h - $(CC) $(CFLAGS) -c -o $@ $< - -$(OBJ_D)/dmihelper.o: dmihelper.c dmihelper.h - $(CC) $(CFLAGS) -c -o $@ $< - -$(OBJ_D)/util.o: util.c types.h util.h config.h - $(CC) $(CFLAGS) -c -o $@ $< - -$(OBJ_D)/dmioem.o: dmioem.c types.h dmidecode.h dmioem.h - $(CC) $(CFLAGS) -c -o $@ $< - - - -############################################################################### -.PHONY: install clean uninstall build dupload -.PHONY: srcsrv binary source orig.tar.gz all -- cgit From 0d157f366fe0dbae27ace5cdfa7e1b501e5c2ad8 Mon Sep 17 00:00:00 2001 From: David Sommerseth Date: Fri, 12 Jun 2009 14:57:24 +0200 Subject: Fixed some issues after commit d0e32662845f2c86fd8090858a51a90408d39172 --- Makefile | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 1427f5a..669e7f3 100644 --- a/Makefile +++ b/Makefile @@ -6,13 +6,15 @@ #. Licensed under the GNU Public License v2 #. +VERSION := $(shell cd src;python -c "from setup_common import *; print get_version();") PACKAGE := python-dmidecode -PY_VER := $(shell python -c 'import sys; print "python%d.%d"%sys.version_info[0:2]') +PY := $(shell python -V 2>&1 |sed -e 's/.\(ython\) \(2\.[0-9]\)\..*/p\1\2/') +PY_VER := $(shell python -c 'import sys; print "%d.%d"%sys.version_info[0:2]') PY := python$(PY_VER) SO = build/lib.linux-$(shell uname -m)-$(PY_VER)/dmidecodemod.so ############################################################################### -.PHONY: build install uninstall clean tarball rpm unit +.PHONY: build install uninstall clean tarball rpm unit version build: $(PY)-dmidecodemod.so $(PY)-dmidecodemod.so: $(SO) @@ -49,3 +51,7 @@ rpm: tarball unit: $(MAKE) -C unit-tests +version: + @echo "python-dmidecode: $(VERSION)" + @echo "python version: $(PY_VER) ($(PY))" + -- cgit From 0e76f37815c9a9d218f1b2b1321a138964038e49 Mon Sep 17 00:00:00 2001 From: David Sommerseth Date: Fri, 12 Jun 2009 17:12:39 +0200 Subject: More Makefile cleanup --- Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 669e7f3..30c3b2b 100644 --- a/Makefile +++ b/Makefile @@ -34,12 +34,13 @@ clean: -rm -rf build -rm -rf rpm -rm -rf src/setup_common.py[oc] - cd unit-tests && $(MAKE) clean + -rm -rf $(PACKAGE)-$(VERSION) $(PACKAGE)-$(VERSION).tar.gz + $(MAKE) -C unit-tests clean tarball: rm -rf $(PACKAGE)-$(VERSION) mkdir $(PACKAGE)-$(VERSION) - cp -r contrib doc examples lib Makefile man README src dmidecode.py redhat.spec $(PACKAGE)-$(VERSION) + cp -r contrib doc examples lib Makefile man README src dmidecode.py $(PACKAGE)-$(VERSION) tar -czvf $(PACKAGE)-$(VERSION).tar.gz $(PACKAGE)-$(VERSION) rpm: tarball -- cgit From fc9396d1ab9ac7f2d4e39e3645ab02c130955e00 Mon Sep 17 00:00:00 2001 From: Nima Talebi Date: Wed, 17 Jun 2009 22:16:25 +1000 Subject: Small cleanup --- Makefile | 1 - 1 file changed, 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 30c3b2b..5097afd 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,6 @@ VERSION := $(shell cd src;python -c "from setup_common import *; print get_version();") PACKAGE := python-dmidecode -PY := $(shell python -V 2>&1 |sed -e 's/.\(ython\) \(2\.[0-9]\)\..*/p\1\2/') PY_VER := $(shell python -c 'import sys; print "%d.%d"%sys.version_info[0:2]') PY := python$(PY_VER) SO = build/lib.linux-$(shell uname -m)-$(PY_VER)/dmidecodemod.so -- cgit From a95af5acd4f2591e2c0d42f0284897cd3de90230 Mon Sep 17 00:00:00 2001 From: David Sommerseth Date: Thu, 18 Jun 2009 15:00:57 +0200 Subject: Added dmidump utility This is a simple utility which dumps DMI/SMBIOS data straight to a file, written i C and should not depend on anything extra. Useful to get DMI/SMBIOS data without installing python and/or python-dmidecode. The data dump can be parsed by python-dmidecode later on on a different box. --- Makefile | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 5097afd..3b2e226 100644 --- a/Makefile +++ b/Makefile @@ -13,7 +13,9 @@ PY := python$(PY_VER) SO = build/lib.linux-$(shell uname -m)-$(PY_VER)/dmidecodemod.so ############################################################################### -.PHONY: build install uninstall clean tarball rpm unit version +.PHONY: build dmidump install uninstall clean tarball rpm unit version + +all : build dmidump build: $(PY)-dmidecodemod.so $(PY)-dmidecodemod.so: $(SO) @@ -21,6 +23,9 @@ $(PY)-dmidecodemod.so: $(SO) $(SO): $(PY) src/setup.py build +dmidump : src/util.o src/efi.o + $(CC) -o $@ src/dmidump.c $^ -g -Wall -D_DMIDUMP_MAIN_ + install: $(PY) src/setup.py install @@ -29,7 +34,7 @@ uninstall: clean: -$(PY) src/setup.py clean --all - -rm -f *.so lib/*.o core + -rm -f *.so lib/*.o core dmidump -rm -rf build -rm -rf rpm -rm -rf src/setup_common.py[oc] -- cgit From 5045e99422d6b19d4ba13b00b3b45a96017ae906 Mon Sep 17 00:00:00 2001 From: David Sommerseth Date: Mon, 10 Aug 2009 13:08:42 +0200 Subject: Removed not needed lib/ directory from tarball rule --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 3b2e226..107dbdb 100644 --- a/Makefile +++ b/Makefile @@ -44,7 +44,7 @@ clean: tarball: rm -rf $(PACKAGE)-$(VERSION) mkdir $(PACKAGE)-$(VERSION) - cp -r contrib doc examples lib Makefile man README src dmidecode.py $(PACKAGE)-$(VERSION) + cp -r contrib doc examples Makefile man README src dmidecode.py $(PACKAGE)-$(VERSION) tar -czvf $(PACKAGE)-$(VERSION).tar.gz $(PACKAGE)-$(VERSION) rpm: tarball -- cgit