mirror of
https://github.com/fwbuilder/fwbuilder
synced 2026-03-23 19:57:21 +01:00
fixed Mac OS X package
This commit is contained in:
parent
1ceece091e
commit
0530ee62fd
@ -282,10 +282,11 @@
|
||||
chains".
|
||||
|
||||
* main.cpp: implemented printing of the firewall object contents
|
||||
from CLI per bug #1996739: "Feature: CLI printing or policy export"
|
||||
|
||||
from CLI per bug #1996739: "Feature: CLI printing or policy export".
|
||||
Use command line flag "-P <firewall_name>" to print and exit.
|
||||
|
||||
2008-06-16 <alek@codeminders.com>
|
||||
|
||||
|
||||
* newHostDiaog.cpp: fixed bug #1899488: "Unable to set MAC address
|
||||
while adding a host"
|
||||
|
||||
|
||||
@ -12,7 +12,7 @@ fwbuilder \- Multiplatform firewall configuration tool
|
||||
.RB [-d]
|
||||
.RB [-h]
|
||||
.RB [-o file]
|
||||
.RB [-p object_name]
|
||||
.RB [-P object_name]
|
||||
.RB [-v]
|
||||
|
||||
|
||||
@ -53,9 +53,9 @@ lots of output on standard error. This is used for debugging.
|
||||
Prints brief help message
|
||||
|
||||
.IP "-o file"
|
||||
Specify the name of the file for the print output, see option "-p".
|
||||
Specify the name of the file for the print output, see option "-P".
|
||||
|
||||
.IP "-p object_name"
|
||||
.IP "-P object_name"
|
||||
Print rules and objects for the firewall object "object_name" and
|
||||
immediately exit. The program does not go into interactive mode and
|
||||
does not need X11. Print output will be placed in the file specified
|
||||
|
||||
26
qmake.inc
26
qmake.inc
@ -11,15 +11,15 @@ SO_VERSION = @LIBFWBUILDER_SOLIB_VERSION@
|
||||
DEFINES += $$(DEFINES)
|
||||
LANGUAGE = C++
|
||||
UI_DIR = ui
|
||||
MANDIR = /home/vadim/src/fwb3-branch-v3/install_root/share/man/
|
||||
DOCDIR = /home/vadim/src/fwb3-branch-v3/install_root/share/doc/fwbuilder-3.0.0
|
||||
MANDIR = /Users/vadim/src/fwb3-branch-v3/install_root/share/man/
|
||||
DOCDIR = /Users/vadim/src/fwb3-branch-v3/install_root/share/doc/fwbuilder-3.0.0
|
||||
|
||||
HAVE_ANTLR_RUNTIME = 1
|
||||
HAVE_EXTERNAL_ANTLR = 0
|
||||
|
||||
unix {
|
||||
ANTLR_INCLUDEPATH = /home/vadim/src/fwb3-branch-v3/source/fwbuilder/src/
|
||||
ANTLR_LIBS = /home/vadim/src/fwb3-branch-v3/source/fwbuilder/src/antlr/libantlr.a
|
||||
ANTLR_INCLUDEPATH = /Users/vadim/src/fwb3-branch-v3/source/fwbuilder/src/
|
||||
ANTLR_LIBS = /Users/vadim/src/fwb3-branch-v3/source/fwbuilder/src/antlr/libantlr.a
|
||||
FWBPARSER_LIB = ../parsers/libfwbparser.a
|
||||
}
|
||||
|
||||
@ -30,36 +30,36 @@ unix {
|
||||
MOC_DIR = .moc
|
||||
OBJECTS_DIR = .obj
|
||||
|
||||
PREFIX = /home/vadim/src/fwb3-branch-v3/install_root
|
||||
PREFIX = /Users/vadim/src/fwb3-branch-v3/install_root
|
||||
exec_prefix = @EXEC_PREFIX@
|
||||
DESTDIR =
|
||||
|
||||
INCLUDEPATH += .. ../.. $$(INCLUDEPATH) /home/vadim/src/fwb3-branch-v3/install_root/include/ /home/vadim/src/fwb3-branch-v3/install_root/include/fwb-3 /usr/include/libxml2
|
||||
INCLUDEPATH += .. ../.. $$(INCLUDEPATH) /Users/vadim/src/fwb3-branch-v3/install_root/include/ /Users/vadim/src/fwb3-branch-v3/install_root/include/fwb-3 /usr/include/libxml2
|
||||
|
||||
LIBS_FWCOMPILER = -L/home/vadim/src/fwb3-branch-v3/install_root/lib -pthread -lfwcompiler -lfwbuilder -lxslt -lxml2 -lnetsnmp -lm -lwrap
|
||||
LIBS_FWBUILDER = -L/home/vadim/src/fwb3-branch-v3/install_root/lib -pthread -lfwbuilder -lxslt -lxml2 -lnetsnmp -lm -lwrap
|
||||
LIBS_FWCOMPILER = -L/Users/vadim/src/fwb3-branch-v3/install_root/lib -lfwcompiler -lfwbuilder -lxslt -lxml2 -lz -lpthread -licucore -lm -lnetsnmp
|
||||
LIBS_FWBUILDER = -L/Users/vadim/src/fwb3-branch-v3/install_root/lib -lfwbuilder -lxslt -lxml2 -lz -lpthread -licucore -lm -lnetsnmp
|
||||
|
||||
target.path = $$PREFIX/bin
|
||||
dtd.path = @TEMPLATE_DIR@/
|
||||
migration.path = @TEMPLATE_DIR@/migration
|
||||
doc.path = /home/vadim/src/fwb3-branch-v3/install_root/share/doc/fwbuilder-3.0.0
|
||||
doc.path = /Users/vadim/src/fwb3-branch-v3/install_root/share/doc/fwbuilder-3.0.0
|
||||
|
||||
# win32:target.path = $$PREFIX/
|
||||
# unix:target.path = $$PREFIX/share/fwbuilder/
|
||||
# macx:target.path = $$PREFIX/
|
||||
|
||||
res.files = src/res/objects_init.xml src/res/templates.xml src/res/resources.xml
|
||||
res.path = /home/vadim/src/fwb3-branch-v3/install_root/share/fwbuilder-3.0.0
|
||||
res.path = ../Resources
|
||||
res_os.files = src/res/os/*.xml
|
||||
res_os.path = /home/vadim/src/fwb3-branch-v3/install_root/share/fwbuilder-3.0.0/os/
|
||||
res_os.path = ../Resources/os/
|
||||
res_platform.files = src/res/platform/*.xml
|
||||
res_platform.path = /home/vadim/src/fwb3-branch-v3/install_root/share/fwbuilder-3.0.0/platform/
|
||||
res_platform.path = ../Resources/platform/
|
||||
|
||||
INSTALLS += res
|
||||
INSTALLS += res_os
|
||||
INSTALLS += res_platform
|
||||
# INSTALLS += icns
|
||||
LIBS += $$LIBS_FWBUILDER -lutil
|
||||
LIBS += $$LIBS_FWBUILDER -L/sw/lib -lpoll
|
||||
|
||||
PKGLOCALEDIR = $$res.path/locale
|
||||
|
||||
|
||||
@ -11,8 +11,10 @@
|
||||
#endif
|
||||
|
||||
#ifdef Q_OS_MACX
|
||||
# include <CoreFoundation/CFURL.h>
|
||||
# include <CoreFoundation/CFBundle.h>
|
||||
# include <QDir>
|
||||
# include <QApplication>
|
||||
//# include <CoreFoundation/CFURL.h>
|
||||
//# include <CoreFoundation/CFBundle.h>
|
||||
#endif
|
||||
|
||||
#include <string>
|
||||
@ -42,20 +44,9 @@ string guessExecPath(const char *argv0)
|
||||
{
|
||||
|
||||
#ifdef Q_OS_MACX
|
||||
// see http://doc.trolltech.com/3.3/mac-differences.html#7-1
|
||||
// except that article explains how to get path to bundle, while
|
||||
// we need path to executable here. Using CFBundleCopyExecutableURL
|
||||
// instead of CFBundleCopyBundleURL
|
||||
//
|
||||
CFURLRef bundleURL = CFBundleCopyExecutableURL(CFBundleGetMainBundle());
|
||||
CFStringRef macPath = CFURLCopyFileSystemPath(bundleURL,
|
||||
kCFURLPOSIXPathStyle);
|
||||
const char *pathPtr = CFStringGetCStringPtr(macPath,
|
||||
CFStringGetSystemEncoding());
|
||||
CFRelease(bundleURL);
|
||||
CFRelease(macPath);
|
||||
|
||||
return pathPtr;
|
||||
QDir dir(QApplication::applicationDirPath());
|
||||
return string(dir.absolutePath().toAscii().constData());
|
||||
|
||||
#else
|
||||
|
||||
@ -71,7 +62,8 @@ string guessExecPath(const char *argv0)
|
||||
while ( !(s=path.section(':',i1,i1)).isEmpty() )
|
||||
{
|
||||
s=s+"/"+argv0;
|
||||
if (access(s.toLatin1().constData(),F_OK|X_OK)==0) return s.toLatin1().constData();
|
||||
if (access(s.toLatin1().constData(),F_OK|X_OK)==0)
|
||||
return s.toLatin1().constData();
|
||||
i1++;
|
||||
}
|
||||
return argv0;
|
||||
@ -111,11 +103,11 @@ http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/ge
|
||||
|
||||
void init(char * const *argv)
|
||||
{
|
||||
argv0=findExecutable(argv[0]);
|
||||
argv0 = findExecutable(argv[0]);
|
||||
|
||||
string::size_type n0=argv0.find_last_of("/\\");
|
||||
if (n0!=string::npos) appRootDir=argv0.substr(0,n0) + FS_SEPARATOR;
|
||||
else appRootDir="";
|
||||
string::size_type n0 = argv0.find_last_of("/\\");
|
||||
if (n0!=string::npos) appRootDir = argv0.substr(0,n0) + FS_SEPARATOR;
|
||||
else appRootDir = "";
|
||||
|
||||
libfwbuilder::init();
|
||||
|
||||
@ -124,12 +116,12 @@ void init(char * const *argv)
|
||||
/* On windows and mac we install API resources (DTD etc) in the
|
||||
* dir right above the one where we install resources for the GUI and compilers
|
||||
*/
|
||||
if (respath=="") respath = appRootDir+RES_DIR;
|
||||
n0=respath.find_last_of("/\\");
|
||||
if (respath=="") respath = appRootDir + RES_DIR;
|
||||
n0 = respath.find_last_of("/\\");
|
||||
librespath = respath.substr(0,n0);
|
||||
|
||||
sysfname = respath+FS_SEPARATOR+"objects_init.xml";
|
||||
tempfname = respath+FS_SEPARATOR+"templates.xml";
|
||||
sysfname = respath + FS_SEPARATOR+"objects_init.xml";
|
||||
tempfname = respath + FS_SEPARATOR+"templates.xml";
|
||||
|
||||
#else
|
||||
|
||||
|
||||
@ -97,7 +97,7 @@ debugDialog::debugDialog(QWidget *parent) : QDialog(parent)
|
||||
m_dialog->debugText->append( QString("Versions:") );
|
||||
m_dialog->debugText->append( QString(" Firewall Builder %1")
|
||||
.arg(VERSION) );
|
||||
m_dialog->debugText->append( QString(" Release %1 Build %2")
|
||||
m_dialog->debugText->append( QString(" Revision %1 Build %2")
|
||||
.arg(RELEASE_NUM).arg(BUILD_NUM) );
|
||||
m_dialog->debugText->append( QString(" Using libfwbuilder %1")
|
||||
.arg( libfwbuilder::Constants::getLibraryVersion().c_str() ) );
|
||||
|
||||
@ -134,6 +134,8 @@ int fwbdebug = 0;
|
||||
bool safemode = false;
|
||||
bool registered = false;
|
||||
bool gui_experiment1 = false;
|
||||
bool cli_print = false;
|
||||
QString cli_print_fwname = "";
|
||||
|
||||
#ifndef _WIN32
|
||||
|
||||
@ -331,7 +333,7 @@ void usage()
|
||||
}
|
||||
|
||||
|
||||
int main( int argc, char ** argv )
|
||||
int main( int argc, char *argv[] )
|
||||
{
|
||||
|
||||
|
||||
@ -343,8 +345,6 @@ int main( int argc, char ** argv )
|
||||
print_output_file_name="";
|
||||
fwbdebug=0;
|
||||
safemode=false;
|
||||
bool pparam=false;
|
||||
QString pparamValue="";
|
||||
|
||||
if(fwbdebug)
|
||||
qDebug("main()");
|
||||
@ -544,10 +544,19 @@ int main( int argc, char ** argv )
|
||||
}
|
||||
#endif
|
||||
|
||||
if (fwbdebug)
|
||||
{
|
||||
qDebug("Command line: argc=%d", argc);
|
||||
for (int i=0; i<argc; ++i)
|
||||
qDebug(argv[i]);
|
||||
}
|
||||
|
||||
// can not use "-p" for command line printing because
|
||||
// Mac OS X supplies switch "-psnXXXXX" when program is
|
||||
// started via Finder.
|
||||
|
||||
int c;
|
||||
while ((c = getopt (argc , argv , "hvf:o:p:dxsg")) != EOF )
|
||||
while ((c = getopt (argc , argv , "hvf:o:P:dxsg")) != EOF )
|
||||
switch (c) {
|
||||
case 'h':
|
||||
usage();
|
||||
@ -576,9 +585,9 @@ int main( int argc, char ** argv )
|
||||
case 'g':
|
||||
gui_experiment1 = true;
|
||||
break;
|
||||
case 'p':
|
||||
pparam=true ;
|
||||
pparamValue=optarg;
|
||||
case 'P':
|
||||
cli_print = true ;
|
||||
cli_print_fwname = optarg;
|
||||
}
|
||||
|
||||
if ( (argc-1)==optind)
|
||||
@ -586,19 +595,26 @@ int main( int argc, char ** argv )
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
if (fwbdebug) qDebug("Initializing ...");
|
||||
|
||||
if (fwbdebug) qDebug("Creating app ...");
|
||||
//QApplication::setDesktopSettingsAware(desktopaware);
|
||||
app = new QApplication( argc, argv );
|
||||
app->setOrganizationName(QLatin1String("NetCitadel LLC"));
|
||||
app->setApplicationName(QLatin1String("Firewall Builder"));
|
||||
|
||||
|
||||
/* need to initialize in order to be able to use FWBSettings */
|
||||
init(argv);
|
||||
init_platforms();
|
||||
|
||||
#if 0
|
||||
if (fwbdebug) qDebug("Creating app ...");
|
||||
|
||||
//QApplication::setDesktopSettingsAware(desktopaware);
|
||||
app = new QApplication( argc, argv );
|
||||
app->setOrganizationName(QLatin1String("NetCitadel LLC"));
|
||||
app->setApplicationName(QLatin1String("Firewall Builder"));
|
||||
#endif
|
||||
|
||||
Q_INIT_RESOURCE(MainRes);
|
||||
|
||||
@ -617,10 +633,11 @@ int main( int argc, char ** argv )
|
||||
true, true, fwbdebug);
|
||||
#endif
|
||||
|
||||
if (pparam)
|
||||
if (cli_print)
|
||||
{
|
||||
if (fwbdebug) qDebug("Print from command line");
|
||||
FWWindow::printFirewallFromFile(filename,
|
||||
pparamValue,
|
||||
cli_print_fwname,
|
||||
print_output_file_name);
|
||||
return 0;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user