From 46632c536288d4159d7c78cab921dc2ab2d08dc4 Mon Sep 17 00:00:00 2001 From: nima Date: Wed, 17 Dec 2008 12:59:32 +0000 Subject: Debianizing dmidecode. git-svn-id: svn://svn.autonomy.net.au/python-dmidecode@110 abc39116-655e-4be6-ad55-d661dc543056 --- BUILD.Linux/dmidecode.spec | 3 +- Makefile | 76 --------------------------------------------- dmidecode.makefile | 73 +++++++++++++++++++++++++++++++++++++++++++ doc/README.types | 55 ++++++++++++++++++++++++++++++++ doc/changelog | 5 +++ private/mem-001 | Bin 0 -> 2226 bytes 6 files changed, 135 insertions(+), 77 deletions(-) delete mode 100644 Makefile create mode 100644 dmidecode.makefile create mode 100644 doc/README.types create mode 100644 doc/changelog create mode 100644 private/mem-001 diff --git a/BUILD.Linux/dmidecode.spec b/BUILD.Linux/dmidecode.spec index 43c98a5..2474e61 100644 --- a/BUILD.Linux/dmidecode.spec +++ b/BUILD.Linux/dmidecode.spec @@ -8,12 +8,13 @@ Summary: Python wrapper around dmidecode Name: %{name} Version: %{version} Release: %{release}.%{dist} +Requires: redhat-lsb Source: %{shortname}-%{unmangled_version}.tar.gz License: GNU GPL v3 Group: Development/Libraries BuildRoot: %{_tmppath}/%{shortname}-buildroot Prefix: %{_prefix} -Vendor: Nima Talebi, Joel Heenan, Vaughan Whitteron +Vendor: Autonomy BuildRequires: python-devel Url: http://projects.autonomy.net.au/dmidecode/ diff --git a/Makefile b/Makefile deleted file mode 100644 index 6da92fc..0000000 --- a/Makefile +++ /dev/null @@ -1,76 +0,0 @@ -#. -#. DMI Decode Python Module -#. -#. (C) 2008 Nima Talebi -#. -#. Licensed under the GNU Public License v3 -#. - -PY := $(shell python -V 2>&1 |sed -e 's/.\(ython\) \(2\.[0-9]\)\..*/p\1\2/') -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 = /usr/lib/$(PY)/site-packages/dmidecode.so - -#. Search -vpath %.o $(OBJ_D) -vpath %.c $(SRC_D) -vpath %.h $(SRC_D) -vpath % $(OBJ_D) - -############################################################################### -install: build - $(PY) src/setup.py install - -build: - $(PY) src/setup.py build - - -############################################################################### -SO: libdmidecode.so - cp $< $@ - nm -u $@ - -libdmidecode.so: dmihelper.o util.o dmioem.o dmidecode.o dmidecodemodule.o - $(CC) $(LDFLAGS) $(SOFLAGS) $^ -o $@ - -dmidecodemodule.o: dmidecodemodule.c - $(CC) $(CFLAGS) -c -o $@ $< - -dmidecode.o: dmidecode.c version.h types.h util.h config.h dmidecode.h dmioem.h - $(CC) $(CFLAGS) -c -o $@ $< - -dmihelper.o: dmihelper.c dmihelper.h - $(CC) $(CFLAGS) -c -o $@ $< - -util.o: util.c types.h util.h config.h - $(CC) $(CFLAGS) -c -o $@ $< - -dmioem.o: dmioem.c types.h dmidecode.h dmioem.h - $(CC) $(CFLAGS) -c -o $@ $< - - - -############################################################################### -uninstall: - rm -f $(SO) - -clean : - $(PY) src/setup.py clean - -$(RM) lib/*.so lib/*.o core - -rm -rf build - -.PHONY: install clean uninstall module diff --git a/dmidecode.makefile b/dmidecode.makefile new file mode 100644 index 0000000..f4c9645 --- /dev/null +++ b/dmidecode.makefile @@ -0,0 +1,73 @@ +#. +#. DMI Decode Python Module +#. +#. (C) 2008 Nima Talebi +#. +#. Licensed under the GNU Public License v3 +#. + +PY := $(shell python -V 2>&1 |sed -e 's/.\(ython\) \(2\.[0-9]\)\..*/p\1\2/') +PY_VER = $(shell python -c 'import sys;print(sys.version[0:3])') +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)/dmidecode.so + +#. Search +vpath %.o $(OBJ_D) +vpath %.c $(SRC_D) +vpath %.h $(SRC_D) +vpath % $(OBJ_D) + +############################################################################### +build: dmidecode.so +dmidecode.so: $(SO) + cp $< . + +$(SO): + $(PY) src/setup.py build + +############################################################################### +libdmidecode.so: dmihelper.o util.o dmioem.o dmidecode.o dmidecodemodule.o + $(CC) $(LDFLAGS) $(SOFLAGS) $^ -o $@ + +$(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 $@ $< + + + +############################################################################### +uninstall: + rm -f $(SO) + +clean : + $(PY) src/setup.py clean + -$(RM) *.so lib/*.o core + -rm -rf build + +.PHONY: install clean uninstall module build diff --git a/doc/README.types b/doc/README.types new file mode 100644 index 0000000..5d65a3a --- /dev/null +++ b/doc/README.types @@ -0,0 +1,55 @@ + Type Information + ---------------------------------------- + 0 BIOS + 1 System + 2 Base Board + 3 Chassis + 4 Processor + 5 Memory Controller + 6 Memory Module + 7 Cache + 8 Port Connector + 9 System Slots + 10 On Board Devices + 11 OEM Strings + 12 System Configuration Options + 13 BIOS Language + 14 Group Associations + 15 System Event Log + 16 Physical Memory Array + 17 Memory Device + 18 32-bit Memory Error + 19 Memory Array Mapped Address + 20 Memory Device Mapped Address + 21 Built-in Pointing Device + 22 Portable Battery + 23 System Reset + 24 Hardware Security + 25 System Power Controls + 26 Voltage Probe + 27 Cooling Device + 28 Temperature Probe + 29 Electrical Current Probe + 30 Out-of-band Remote Access + 31 Boot Integrity Services + 32 System Boot + 33 64-bit Memory Error + 34 Management Device + 35 Management Device Component + 36 Management Device Threshold Data + 37 Memory Channel + 38 IPMI Device + 39 Power Supply + + + Keyword Types + ------------------------------ + bios 0, 13 + system 1, 12, 15, 23, 32 + baseboard 2, 10 + chassis 3 + processor 4 + memory 5, 6, 16, 17 + cache 7 + connector 8 + slot 9 diff --git a/doc/changelog b/doc/changelog new file mode 100644 index 0000000..664841a --- /dev/null +++ b/doc/changelog @@ -0,0 +1,5 @@ +dmidecode (0.1) unstable; urgency=low + + * Initial release. + + -- Nima Talebi Wed, 17 Dec 2008 19:11:34 +0900 diff --git a/private/mem-001 b/private/mem-001 new file mode 100644 index 0000000..76e659d Binary files /dev/null and b/private/mem-001 differ -- cgit