A new user interface for you! Read more...

File qxmledit.spec of Package qxmledit

%def_enable lto

%define Name QXmlEdit
Name: qxmledit
Version: 0.9.4
Release: 1
Summary: Simple XML editor and XSD viewer
Group: Productivity/Publishing/XML
License: LGPL-2.0+
URL: http://%name.org/
Source: %name-%version.tar.xz
Provides: %Name = %version-%release

%if 0%{?suse_version} > 1320 || 0%{?suse_version} == 1315
%def_with qt5
%else
%def_without qt5
%endif

BuildRequires: gcc-c++
BuildRequires: hicolor-icon-theme
BuildRequires: pkg-config
BuildRequires: pkgconfig(glu)
BuildRequires: freeglut-devel
%if_with qt5
BuildRequires: pkgconfig(Qt5Core)
BuildRequires: pkgconfig(Qt5Svg)
BuildRequires: pkgconfig(Qt5Xml)
BuildRequires: pkgconfig(Qt5XmlPatterns)
BuildRequires: pkgconfig(Qt5Network)
BuildRequires: pkgconfig(Qt5Sql)
BuildRequires: pkgconfig(Qt5Concurrent)
BuildRequires: pkgconfig(Qt5PrintSupport)
BuildRequires: pkgconfig(Qt5OpenGL)
%else
BuildRequires: pkgconfig(QtCore)
BuildRequires: pkgconfig(QtSvg)
BuildRequires: pkgconfig(QtXml)
BuildRequires: pkgconfig(QtXmlPatterns)
BuildRequires: pkgconfig(QtNetwork)
BuildRequires: pkgconfig(QtSql)
BuildRequires: pkgconfig(QtOpenGL)
%endif

%description
%Name is a simple XML editor written in qt4. Its main features are unusual data
visualization modes, nice XML manipulation and presentation. It can split very
big XML files into fragments, and compare XML files. It is one of the few
graphical Open Source XSD viewers.
Main features:
  - Hierarchical customizable view of XML elements.
  - Fast XML hierarchy navigation.
  - Split of big XML files.
  - Search supporting XPath expressions.
  - Base 64 data handling.
  - Custom visualization styles.
  - XML Schema (XSD) viewer.
  - Columnar view.
  - Sessions handling.
  - Graphical XML file view.
  - Map view of a XML document.
  - Split and fragment extraction of big XML files.
  - Visual compare of XML Schema files.
  - Visual compare of XML files.
  - XML Snippets.
  - XSL specialized mode.


%prep
%setup -q


%build
%if_with qt5
QMAKE=qmake-qt5
%else
qmake --version >/dev/null 2>&1 && QMAKE=qmake || QMAKE=qmake-qt4
%endif
$QMAKE \
	"CONFIG+=release staticlib" \
	QMAKE_CFLAGS+="%optflags%{?_enable_lto: -flto}" \
	QMAKE_CXXFLAGS+="%optflags -flto" \
	QMAKE_LFLAGS_RELEASE="%{?_enable_lto:$(echo '%optflags' | grep -o -- '-O[0-3s]\?') -flto=jobserver -fwhole-program}" \
	QMAKE_STRIP="" \
	%Name.pro
make %{?_smp_mflags} \
	QXMLEDIT_INST_DATA_DIR=%_datadir/%name \
	QXMLEDIT_INST_DIR=%_bindir \
	QXMLEDIT_INST_DOC_DIR=%_docdir/%name \
	QXMLEDIT_INST_LIB_DIR=%_libdir \
	QXMLEDIT_INST_INCLUDE_DIR=%_includedir/%name


%install
make INSTALL_ROOT=%buildroot install
rm -f %buildroot%_datadir/*.desktop
ln -sf %Name %buildroot%_bindir/%name
install -p -m 0644 AUTHORS NEWS README ROADMAP TODO %buildroot%_docdir/%name/

install -pD -m 0644 src/images/icon.png %buildroot%_datadir/icons/hicolor/32x32/apps/%name.png
install -pD -m 0644 src/images/icon.svg %buildroot%_datadir/icons/hicolor/scalable/apps/%name.svg

install -d -m 0755 %buildroot%_desktopdir
cat > %buildroot%_desktopdir/%name.desktop <<__EOF__
[Desktop Entry]
Name=%Name
GenericName=%Name
Comment=%summary
Type=Application
Exec=QXmlEdit %%u
Icon=%name
Categories=Qt;Utility;TextEditor;
MimeType=text/xml;application/xml;
StartupNotify=true
Terminal=false
__EOF__


%files
%defattr(-, root, root)
%doc %_docdir/%name
%_bindir/*
%_datadir/%name
%_desktopdir/*
%_datadir/icons/hicolor/32x32/apps/*
%_datadir/icons/hicolor/scalable/apps/*
%exclude %_includedir
%exclude %_libdir


%changelog