[Oval-commits] r123 - branches/debian/debian/patches

Pavel Vinogradov blaze-guest at alioth.debian.org
Thu Aug 9 10:39:51 UTC 2007


Author: blaze-guest
Date: 2007-08-09 10:39:51 +0000 (Thu, 09 Aug 2007)
New Revision: 123

Added:
   branches/debian/debian/patches/debian.makefile.patch
   branches/debian/debian/patches/debian.manpage.patch
   branches/debian/debian/patches/oval.probefactory.patch
Removed:
   branches/debian/debian/patches/debian.ovaldi.1.patch
Modified:
   branches/debian/debian/patches/series
Log:
Add patches to split rpm and dpkg dependencies

Added: branches/debian/debian/patches/debian.makefile.patch
===================================================================
--- branches/debian/debian/patches/debian.makefile.patch	                        (rev 0)
+++ branches/debian/debian/patches/debian.makefile.patch	2007-08-09 10:39:51 UTC (rev 123)
@@ -0,0 +1,97 @@
+diff -urN oval-ref/project/linux/Makefile oval-debian/project/linux/Makefile
+--- oval-ref/project/linux/Makefile	2007-08-07 23:08:09.000000000 +0200
++++ oval-deb/project/linux/Makefile	2007-08-07 23:15:47.000000000 +0200
+@@ -54,10 +54,26 @@
+ LIBDIR = -L/usr/lib
+ 
+ # What libraries do we need?
+-LIBS = -lxerces-c -lxalan-c -lpcre -lrpm -lrpmdb -lrpmio -lpopt -lapt-pkg
++LIBS = -lxerces-c -lxalan-c -lpcre -lpopt
+ 
+ # Determine what platform the source is being build on
+ PLATFORM = $(shell uname)
++# Determine which distribution we are in
++# NOTE: could be abstracted to dpkg vs. rpm binaries being
++# available, as the DPKG or RPM probes could be used for
++# other distributions (RPM for SuSE or Mandrake, DPKG for
++# Ubuntu)
++DISTRIBUTION = $(shell if test  -e /etc/debian_version ; then echo DEBIAN; elif test -e /etc/redhat_release ; then echo REDHAT; else echo NO_DISTRIBUTION; fi)
++# Alternative (binary-based), note that both DPKG and RPM are 
++# mutually exclusive here:
++#PACKAGE_FORMAT = $(shell if test  -e /usr/bin/dpkg ; then echo DPKG; elif test -e /usr/bin/rpm ; then echo RPM; else echo NO_LINUX_PACKAGE; fi)
++
++ifeq ($(DISTRIBUTION), REDHAT)
++	LIBS += -lrpm -lrpmdb -lrpmio 
++endif
++ifeq ($(DISTRIBUTION), DEBIAN)
++	LIBS += -lapt-pkg
++endif
+ 
+ # What object code are we expecting?
+ OBJS = \
+@@ -131,8 +148,6 @@
+ 	FileProbe.obj \
+ 	InetListeningServersProbe.obj \
+ 	ProcessProbe.obj \
+-	RPMInfoProbe.obj \
+-	DPKGInfoProbe.obj \
+ 	UnameProbe.obj \
+ 	TextFileContentProbe.obj \
+ 	XmlFileContentProbe.obj \
+@@ -142,6 +157,13 @@
+ 	FileHashProbe.obj \
+ 	VariableProbe.obj \
+ 
++ifeq ($(DISTRIBUTION), REDHAT)
++	OBJS += RPMInfoProbe.obj
++endif
++ifeq ($(DISTRIBUTION), DEBIAN)
++	OBJS += DPKGInfoProbe.obj
++endif
++
+ REL_OBJS = \
+ 	$(BUILDDIR)/Main.obj \
+ 	$(BUILDDIR)/AbsComponent.obj \
+@@ -213,8 +235,6 @@
+ 	$(BUILDDIR)/FileProbe.obj \
+ 	$(BUILDDIR)/InetListeningServersProbe.obj \
+ 	$(BUILDDIR)/ProcessProbe.obj \
+-	$(BUILDDIR)/RPMInfoProbe.obj \
+-	$(BUILDDIR)/DPKGInfoProbe.obj \
+ 	$(BUILDDIR)/UnameProbe.obj \
+ 	$(BUILDDIR)/TextFileContentProbe.obj \
+ 	$(BUILDDIR)/XmlFileContentProbe.obj \
+@@ -224,6 +244,13 @@
+ 	$(BUILDDIR)/FileHashProbe.obj \
+ 	$(BUILDDIR)/VariableProbe.obj \
+ 
++ifeq ($(DISTRIBUTION), REDHAT)
++	REL_OBJS += $(BUILDDIR)/RPMInfoProbe.obj
++endif
++ifeq ($(DISTRIBUTION), DEBIAN)
++	REL_OBJS += $(BUILDDIR)/DPKGInfoProbe.obj
++endif
++
+ # Search the output directory for object files
+ vpath %.obj $(BUILDDIR)
+ vpath %.cpp $(SRCDIR)
+@@ -241,7 +268,7 @@
+ .SUFFIXES: .cpp .obj
+ 
+ .cpp.obj:
+-	$(CXX) -c $(CPPFLAGS) -D$(PLATFORM) $(INCDIRS) -o $(BUILDDIR)/$@ $^
++	$(CXX) -c $(CPPFLAGS) -D$(PLATFORM) -D$(DISTRIBUTION) $(INCDIRS) -o $(BUILDDIR)/$@ $^
+ 
+ # *******************************************************************
+ #                            Rules
+@@ -251,6 +278,10 @@
+ 
+ set-platform:
+ 	@if [ $(PLATFORM) = Linux ]; then \
++		if [ $(DISTRIBUTION) = NO_DISTRIBUTION ]; then \
++			echo "Unknown distribution. Exiting"; \
++			exit 1; \
++		fi; \
+ 		make linux; \
+ 	fi;
+ 
\ No newline at end of file

Copied: branches/debian/debian/patches/debian.manpage.patch (from rev 122, branches/debian/debian/patches/debian.ovaldi.1.patch)
===================================================================
--- branches/debian/debian/patches/debian.manpage.patch	                        (rev 0)
+++ branches/debian/debian/patches/debian.manpage.patch	2007-08-09 10:39:51 UTC (rev 123)
@@ -0,0 +1,70 @@
+--- oval-ref/docs/ovaldi.1	2007-06-28 19:35:00.000000000 +0500
++++ oval-debian/docs/ovaldi.1	2007-08-09 14:33:55.000000000 +0500
+@@ -21,7 +21,7 @@
+ .B \-o filename
+ Specifies the pathname of the OVAL Definition file to use.  If none is
+ specified than the Interpreter will default to "definitions.xml" in the
+-Interpreter directory.
++current directory.
+ .TP
+ .B \-d filename
+ Specifies the pathname of the file to which collected configuration data is
+@@ -32,12 +32,12 @@
+ Specifies the pathname of the file to which analysis results are to be
+ saved.  This data is stored according to the format defined by the OVAL
+ Results Schema.  If none is specified than the Interpreter will default to
+-"results.xml" in the Interpreter directory.
++"results.xml" in the current directory.
+ .TP
+ .B \-v filename
+ Specifies the pathname of the external variable file to use.  If none is
+ specified than the Interpreter will default to "external-variables.xml" in
+-the Interpreter directory.
++the current directory.
+ .TP
+ .B \-e definition id list
+ Specifies a list of definition ids to evaluate in the input oval-definitions
+@@ -51,7 +51,7 @@
+ Specifies the pathname of the oval-definitions-schematron.xsl
+ to be used for Schematron validation. If none is specified 
+ then the Interpreter will default to "oval-definitions-schematron.xsl"
+-in the Interpreter directory.
++in the /usr/share/ovaldi/xml directory.
+ .TP
+ .B \-i filename
+ Specifies the pathname of a System Characteristics file that is to be used
+@@ -78,12 +78,12 @@
+ .B \-t filename
+ Specifies the pathname of the xsl file which should be used to
+ transform the oval results. If none is specified then the Interpreter
+-will default to "results_to_html.xsl" in the Interpreter directory.
++will default to "results_to_html.xsl" in the /usr/share/ovaldi/xml/ directory.
+ .TP
+ .B \-x filename
+ Specifies the pathname of the file which xsl transform results
+ are to be saved.  If none is specified then the Interpreter
+-will default to "results.html" in the Interpreter directory.
++will default to "results.html" in the current directory.
+ .TP
+ .B \-z
+ Calculates and prints to the screen the MD5 checksum of the current data
+@@ -92,13 +92,15 @@
+ available from the OVAL Web site.
+ .SH EXAMPLES
+ .TP
+-Run the interpreter against the Linux definitions file, without verifying MD5 checksum:
++Run the interpreter against the Debian example definition file, without verifying MD5 checksum:
+ .B ovaldi
+-\-o linux.definitions.xml
++\-o /usr/share/doc/ovaldi/examples/package_example.xml
+ \-m
+ .SH FILES
+ .TP
+-/usr/share/ovaldi/*.xsd
++/usr/share/ovaldi/xml/*.xsd
+ The schema files for the OVAL language.
+-.SH AUTHOR
++.SH AUTHORS
+ Man page written by Brendan Jonathan Baker (bakerj at mitre.org)
++.br
++Man page adapted to Debian by Pavel Vinogradov (Pavel.Vinogradov at nixdev.net)

Deleted: branches/debian/debian/patches/debian.ovaldi.1.patch
===================================================================
--- branches/debian/debian/patches/debian.ovaldi.1.patch	2007-08-09 09:39:38 UTC (rev 122)
+++ branches/debian/debian/patches/debian.ovaldi.1.patch	2007-08-09 10:39:51 UTC (rev 123)
@@ -1,70 +0,0 @@
---- oval-ref/docs/ovaldi.1	2007-06-28 19:35:00.000000000 +0500
-+++ oval-debian/docs/ovaldi.1	2007-08-09 14:33:55.000000000 +0500
-@@ -21,7 +21,7 @@
- .B \-o filename
- Specifies the pathname of the OVAL Definition file to use.  If none is
- specified than the Interpreter will default to "definitions.xml" in the
--Interpreter directory.
-+current directory.
- .TP
- .B \-d filename
- Specifies the pathname of the file to which collected configuration data is
-@@ -32,12 +32,12 @@
- Specifies the pathname of the file to which analysis results are to be
- saved.  This data is stored according to the format defined by the OVAL
- Results Schema.  If none is specified than the Interpreter will default to
--"results.xml" in the Interpreter directory.
-+"results.xml" in the current directory.
- .TP
- .B \-v filename
- Specifies the pathname of the external variable file to use.  If none is
- specified than the Interpreter will default to "external-variables.xml" in
--the Interpreter directory.
-+the current directory.
- .TP
- .B \-e definition id list
- Specifies a list of definition ids to evaluate in the input oval-definitions
-@@ -51,7 +51,7 @@
- Specifies the pathname of the oval-definitions-schematron.xsl
- to be used for Schematron validation. If none is specified 
- then the Interpreter will default to "oval-definitions-schematron.xsl"
--in the Interpreter directory.
-+in the /usr/share/ovaldi/xml directory.
- .TP
- .B \-i filename
- Specifies the pathname of a System Characteristics file that is to be used
-@@ -78,12 +78,12 @@
- .B \-t filename
- Specifies the pathname of the xsl file which should be used to
- transform the oval results. If none is specified then the Interpreter
--will default to "results_to_html.xsl" in the Interpreter directory.
-+will default to "results_to_html.xsl" in the /usr/share/ovaldi/xml/ directory.
- .TP
- .B \-x filename
- Specifies the pathname of the file which xsl transform results
- are to be saved.  If none is specified then the Interpreter
--will default to "results.html" in the Interpreter directory.
-+will default to "results.html" in the current directory.
- .TP
- .B \-z
- Calculates and prints to the screen the MD5 checksum of the current data
-@@ -92,13 +92,15 @@
- available from the OVAL Web site.
- .SH EXAMPLES
- .TP
--Run the interpreter against the Linux definitions file, without verifying MD5 checksum:
-+Run the interpreter against the Debian example definition file, without verifying MD5 checksum:
- .B ovaldi
--\-o linux.definitions.xml
-+\-o /usr/share/doc/ovaldi/examples/package_example.xml
- \-m
- .SH FILES
- .TP
--/usr/share/ovaldi/*.xsd
-+/usr/share/ovaldi/xml/*.xsd
- The schema files for the OVAL language.
--.SH AUTHOR
-+.SH AUTHORS
- Man page written by Brendan Jonathan Baker (bakerj at mitre.org)
-+.br
-+Man page adapted to Debian by Pavel Vinogradov (Pavel.Vinogradov at nixdev.net)

Added: branches/debian/debian/patches/oval.probefactory.patch
===================================================================
--- branches/debian/debian/patches/oval.probefactory.patch	                        (rev 0)
+++ branches/debian/debian/patches/oval.probefactory.patch	2007-08-09 10:39:51 UTC (rev 123)
@@ -0,0 +1,52 @@
+diff -ur oval-def/src/linux/ProbeFactory.cpp oval-debian/src/linux/ProbeFactory.cpp
+--- oval-def/src/linux/ProbeFactory.cpp	2007-08-07 22:52:56.000000000 +0200
++++ oval-debian/src/linux/ProbeFactory.cpp	2007-07-25 10:14:21.000000000 +0200
+@@ -81,12 +81,16 @@
+ 		probe = UnameProbe::Instance();
+ 
+ // here are the objects defined in the linux schema
++#ifdef DEBIAN
+ 	} else if(objectName.compare("dpkginfo_object") == 0) {
+ 		probe = DPKGInfoProbe::Instance();
++#endif
+ 	} else if(objectName.compare("inetlisteningservers_object") == 0) {
+ 		probe = InetListeningServersProbe::Instance();
++#ifdef REDHAT
+ 	} else if(objectName.compare("rpminfo_object") == 0) {
+ 		probe = RPMInfoProbe::Instance();
++#endif
+ 	}
+ 
+ 	return probe;
+@@ -107,11 +111,15 @@
+ 	probe = UnameProbe::Instance();
+ 	delete probe;
+ 
++#ifdef REDHAT
+ 	probe = RPMInfoProbe::Instance();
+ 	delete probe;
++#endif
+ 	
++#ifdef DEBIAN
+ 	probe = DPKGInfoProbe::Instance();
+ 	delete probe;
++#endif
+ 	
+ 	probe = ProcessProbe::Instance();
+ 	delete probe;
+diff -ur oval-def/src/linux/ProbeFactory.h oval-debian/src/linux/ProbeFactory.h
+--- oval-def/src/linux/ProbeFactory.h	2007-08-07 22:52:56.000000000 +0200
++++ oval-debian/src/linux/ProbeFactory.h	2007-07-16 20:23:10.000000000 +0200
+@@ -46,8 +46,12 @@
+ #include "FileHashProbe.h"
+ #include "FamilyProbe.h"
+ #include "UnameProbe.h"
++#ifdef REDHAT
+ #include "RPMInfoProbe.h"
++#endif
++#ifdef DEBIAN
+ #include "DPKGInfoProbe.h"
++#endif
+ #include "InetListeningServersProbe.h"
+ #include "ProcessProbe.h"
+ //#include "ShadowProbe.h"

Modified: branches/debian/debian/patches/series
===================================================================
--- branches/debian/debian/patches/series	2007-08-09 09:39:38 UTC (rev 122)
+++ branches/debian/debian/patches/series	2007-08-09 10:39:51 UTC (rev 123)
@@ -1,5 +1,7 @@
 oval.misc.patch
 oval.textfilecontent.patch
 oval.dpkg.patch
-debian.ovaldi.1.patch
+oval.probefactory.patch
+debian.manpage.patch
 debian.xsddir.patch
+debian.makefile.patch




More information about the Oval-commits mailing list