Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion application/application.pro
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,5 @@ HEADERS = ../csvimpcommon/csvimpdata.h \
SOURCES = main.cpp \
../csvimpcommon/csvimpdata.cpp

QT += sql
QT += sql widgets
RESOURCES += ../csvimpcommon/csvimp.qrc
41 changes: 22 additions & 19 deletions application/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,14 @@
#include <QSplashScreen>
#include <QSqlDatabase>
#include <QStyleFactory>
#include <QWindowsStyle>
#include <QProxyStyle>
#include <QtGlobal>

#ifdef Q_WS_MACX
#if QT_VERSION < 0x050000
#ifdef Q_OS_MACX
#include <qmacstyle_mac.h>
#endif
#endif

#include <xsqlquery.h>
#include <dbtools.h>
Expand Down Expand Up @@ -64,28 +67,28 @@ bool loadPlugin()
int main(int argc, char *argv[])
{
QString username = "";
bool haveUsername = FALSE;
bool haveDatabaseURL = FALSE;
bool loggedIn = FALSE;
bool haveUsername = false;
bool haveDatabaseURL = false;
bool loggedIn = false;

QString databaseURL = "";

QApplication app(argc, argv);
app.addLibraryPath(".");

#ifndef Q_WS_MACX
#ifndef Q_OS_MACX
QApplication::setWindowIcon(QIcon(":/images/CSVimpIcon-32x32.png"));
#endif

#ifdef Q_WS_WIN
#ifdef Q_OS_WIN
if (QSysInfo::WindowsVersion == QSysInfo::WV_XP)
app.setStyle(QStyleFactory::create("windowsxpstyle"));
else
app.setStyle(new QWindowsStyle);
#elif defined Q_WS_MACX
app.setStyle(new QProxyStyle);
#elif defined Q_OS_MACX && QT_VERSION < 0x050000
app.setStyle(new QMacStyle);
#else
app.setStyle(new QWindowsStyle);
app.setStyle(new QProxyStyle);
#endif

if (!loadPlugin())
Expand All @@ -97,32 +100,32 @@ int main(int argc, char *argv[])

if (argc > 1)
{
haveUsername = FALSE;
bool havePasswd = FALSE;
haveUsername = false;
bool havePasswd = false;
QString passwd = "";

for (int intCounter = 1; intCounter < argc; intCounter++)
{
QString argument(argv[intCounter]);

if (argument.contains("-databaseURL=")) {
haveDatabaseURL = TRUE;
haveDatabaseURL = true;
databaseURL = argument.right(argument.length() - 13);
}
else if (argument.contains("-username="))
{
haveUsername = TRUE;
haveUsername = true;
username = argument.right(argument.length() - 10);
}
else if (argument.contains("-passwd="))
{
havePasswd = TRUE;
havePasswd = true;
passwd = argument.right(argument.length() - 8);
}
else if (argument.contains("-noAuth"))
{
haveUsername = TRUE;
havePasswd = TRUE;
haveUsername = true;
havePasswd = true;
}

}
Expand Down Expand Up @@ -163,7 +166,7 @@ int main(int argc, char *argv[])
QApplication::exit(-1);
}
else
loggedIn = TRUE;
loggedIn = true;
}
}

Expand All @@ -181,7 +184,7 @@ int main(int argc, char *argv[])
if (haveDatabaseURL)
params.append("databaseURL", databaseURL);

login newdlg(0, "", TRUE);
login newdlg(0, "", true);
QPixmap tmpPixmap(":/images/splashCSVimp.png");
newdlg._logo->setPixmap(tmpPixmap);
QSplashScreen splash(tmpPixmap);
Expand Down
71 changes: 71 additions & 0 deletions csvimp.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
Name: csvimp
Version: 0.5.0
Release: 1%{?dist}
Summary: xTuple reporting utility and libraries
License: CPAL
Url: http://www.xtuple.org/DataImportTool
Source: https://github.com/xtuple/csvimp/archive/v%version.tar.gz
BuildRequires: qt-devel
BuildRequires: openrpt-devel

%description
A tool designed to import Comma Separated Value (CSV) files into the
database for the xTuple Applications (PostBooks and OpenMFG).

%package devel
Summary: CSVImp development files
Requires: qt-devel, libdmtx-devel, openrpt-devel

%description devel
A tool designed to import Comma Separated Value (CSV) files into the
database for the xTuple Applications (PostBooks and OpenMFG).
This package provides the header files used by developers.

%prep
%setup -q

%build
export HARDCODE_APPLICATION_DIR='\"/usr/lib/csvimp\"'
export USE_SHARED_OPENRPT=1
export OPENRPT_HEADERS=/usr/include/openrpt
export OPENRPT_LIBDIR=%{_libdir}
#lrelease-qt4 */*/*.ts */*.ts
qmake-qt4 .
make %{?_smp_mflags}

%install
# make install doesn't do anything for this qmake project so we do
# the installs manually
#make INSTALL_ROOT=%{buildroot} install
rm -f %{buildroot}%{_libdir}/lib*.a
rm -f %{buildroot}%{_libdir}/lib*.la
mkdir -p %{buildroot}%{_bindir}
install csvimp %{buildroot}%{_bindir}
mkdir -p %{buildroot}/usr/lib/csvimp/plugins
install plugins/libcsvimpplugin.so %{buildroot}/usr/lib/csvimp/plugins
mkdir -p %{buildroot}%{_includedir}/csvimp
find . -name '*.h' -exec install -D {} %{buildroot}%{_includedir}/csvimp/{} \;

%post
/sbin/ldconfig

%postun
/sbin/ldconfig

%clean
rm -rf $RPM_BUILD_ROOT

%files
%{_bindir}/*
%dir /usr/lib/csvimp
%dir /usr/lib/csvimp/plugins
/usr/lib/csvimp/plugins/libcsvimpplugin.so

%files devel
%dir %{_includedir}/csvimp/
%{_includedir}/csvimp/*

%changelog
* Wed Feb 25 2015 Daniel Pocock <<daniel@pocock.pro> - 0.5.0-1
- Initial RPM packaging.

6 changes: 3 additions & 3 deletions csvimpcommon/csvimpdata.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* This file is part of the xTuple ERP: PostBooks Edition, a free and
* open source Enterprise Resource Planning software suite,
* Copyright (c) 1999-2014 by OpenMFG LLC, d/b/a xTuple.
* Copyright (c) 1999-2015 by OpenMFG LLC, d/b/a xTuple.
* It is licensed to you under the Common Public Attribution License
* version 1.0, the full text of which (including xTuple-specific Exhibits)
* is available at www.xtuple.com/CPAL. By using this software, you agree
Expand All @@ -13,6 +13,6 @@
#include <QObject>

QString CSVImp::build = QObject::tr("%1 %2").arg(__DATE__, __TIME__);
QString CSVImp::copyright = QObject::tr("Copyright (c) 1999-2014, OpenMFG, LLC");
QString CSVImp::copyright = QObject::tr("Copyright (c) 1999-2015, OpenMFG, LLC");
QString CSVImp::name = QObject::tr("CSV Import");
QString CSVImp::version = QString("0.5.0");
QString CSVImp::version = QString("0.5.1");
14 changes: 14 additions & 0 deletions debian/README.source
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
The following was used to repack the tarball from upstream:

rm plugins/libcsvimpplugin.dylib \
csvimp.app/Contents/MacOS/csvimp

find . -name '*.o' -exec rm {} \;

The following was used to reformat the upstream license text
(published on their web site at http://www.xtuple.com/CPAL):

cat cpal-raw.txt | \
sed -e 's/^ $/./g' | \
sed -e 's/^$/./g' | \
while read ; do echo " $REPLY" ; done >> copyright
23 changes: 23 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
csvimp (0.5.0-2) unstable; urgency=medium

* Minor fixes.

-- Daniel Pocock <daniel@pocock.pro> Sat, 18 Oct 2014 20:14:24 +0200

csvimp (0.5.0-1) unstable; urgency=medium

* Update for latest upstream code.

-- Daniel Pocock <daniel@pocock.pro> Sat, 18 Oct 2014 16:49:46 +0200

csvimp (0.4.7-2) unstable; urgency=low

* Make clean less fragile

-- Daniel Pocock <daniel@pocock.com.au> Sun, 22 Sep 2013 09:23:46 +0200

csvimp (0.4.7-1) unstable; urgency=low

* Initial release. (Closes: #723654)

-- Daniel Pocock <daniel@pocock.com.au> Wed, 18 Sep 2013 17:10:54 +0200
4 changes: 4 additions & 0 deletions debian/clean
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
lib/*
Makefile .DS_Store
*/Makefile */.DS_Store */tmp/* */*.qm
*/*/Makefile */*/.DS_Store */*/tmp/* */*/*.qm
1 change: 1 addition & 0 deletions debian/compat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
9
30 changes: 30 additions & 0 deletions debian/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
Source: csvimp
Section: misc
Priority: optional
Maintainer: Debian xTuple Maintainers <pkg-xtuple-maintainers@lists.alioth.debian.org>
Uploaders:
Andrew Shadura <andrewsh@debian.org>,
Daniel Pocock <daniel@pocock.pro>
Build-Depends: debhelper (>= 9), dpkg-dev (>= 1.16.1~), libqt4-dev (>= 4.1.0), libopenrpt-dev (>= 3.3.7)
Standards-Version: 3.9.6
Homepage: http://www.xtuple.org/DataImportTool
Vcs-Git: https://github.com/xtuple/csvimp
Vcs-Browser: https://github.com/xtuple/csvimp

Package: csvimp
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, libqt4-sql-psql
Description: CSV data import tool for xTuple applications
A tool designed to import Comma Separated Value (CSV) files into the
database for the xTuple Applications (PostBooks and OpenMFG).

Package: libcsvimp-dev
Section: libdevel
Architecture: any
Depends: libqt4-dev (>= 4.1.0), ${misc:Depends}
Description: CSV data import tool for xTuple applications (development files)
A tool designed to import Comma Separated Value (CSV) files into the
database for the xTuple Applications (PostBooks and OpenMFG).
.
This package contains the static development library and its headers.

Loading