[xsd-users] Re: Spec file for XSD..

Boris Kolpackov boris at codesynthesis.com
Wed Oct 1 17:08:54 EDT 2008


Hi Bill,

Fitzpatrick, Bill <BFITZPATRICK at NADA.org> writes:

> If you send me the spec file I can 'fix' it to make it work.

The .rpm spec file is attached. Here are a few note on how it works
right now:

1. The spec is designed to link libstdc++ statically.

2. It installs some things from ../../../work/xsd/dist/unix/xsd. This
   is a hard coded path on out build box that contains example README
   files as well as the build systems. You can find these files in any
   precompiled binary package, e.g., xsd-3.2.0-i686-linux-gnu.tar.bz2

We use the spec file as follows:

1. Build all the prerequisites except XSD. Basically follow the build
   instructions for UNIX until XSD:

   http://www.codesynthesis.com/projects/xsd/extras/build-unix.xhtml

2. Then run:

   $ export CXX=g++
   $ rpmbuild -ba xsd.spec

If you would like to automate the build process, including 
configuration and building of prerequisites then you can take
a look at how Raphael Bossek did this for the Debian package.
He basically created and saved a configuration where all the
prerequisites are installed. His rules script (Debian's 
counterpart of the spec file) would then unpack each 
prerequisite, copy the configuration, build, and install.

Boris

-------------- next part --------------
Summary: XML Schema to C++ data binding compiler
Name: xsd
Version: 3.2.0
Release: 1
License: GPL version 2 + exceptions; http://www.codesynthesis.com/projects/xsd/
Group: Development/Tools
Source: http://www.codesynthesis.com/download/xsd/3.2/%{name}-%{version}.tar.bz2
Prefix: %{_prefix}
Buildroot: %{_tmppath}/%{name}-root
AutoReqProv: no

%description
CodeSynthesis XSD is an XML Schema to C++ data binding compiler.
Provided with an XML instance specification (XML Schema), it
generates C++ classes that represent the given vocabulary as
well as parsing and serialization code.

%prep
%setup -q

%build

%ifarch x86_64
HOST_CPU=x86_64; export HOST_CPU
%endif

%ifarch i686
HOST_CPU=i686; export HOST_CPU
%endif

/bin/sh -c "if test -z "\$HOST_CPU" ; then echo error HOST_CPU not set && exit 1; fi"
/bin/sh -c "if test -z "\$CXX" ; then echo error CXX not set && exit 1; fi"
/bin/sh -c "ln -s `\$CXX --print-file-name=libstdc++.a` ./xsd/libstdc++.a"
echo "host cpu $HOST_CPU"
make -C xsd cxx_ld_options="-L. -static-libgcc" verbose=1
rm -f ./xsd/libstdc++.a


# We don't want the binaries to be stripped.
#
%ifarch x86_64
%define __os_install_post /usr/lib/rpm/brp-compress
%endif

%install

%ifarch x86_64
HOST_CPU=x86_64; export HOST_CPU
%endif

%ifarch i686
HOST_CPU=i686; export HOST_CPU
%endif

rm -rf ${RPM_BUILD_ROOT}
echo "host cpu $HOST_CPU"
make install                                  \
install_bin_dir=$RPM_BUILD_ROOT%{_bindir}     \
install_inc_dir=$RPM_BUILD_ROOT%{_includedir} \
install_lib_dir=$RPM_BUILD_ROOT%{_libdir}     \
install_data_dir=$RPM_BUILD_ROOT%{_datadir}   \
install_doc_dir=$RPM_BUILD_ROOT%{_docdir}     \
install_man_dir=$RPM_BUILD_ROOT%{_mandir}     \
install_info_dir=$RPM_BUILD_ROOT%{_infodir}

install -m 644 ../../../work/xsd/dist/unix/xsd/README $RPM_BUILD_ROOT%{_docdir}/xsd
cp -rL ../../../work/xsd/dist/unix/xsd/examples $RPM_BUILD_ROOT%{_docdir}/xsd


%clean
rm -rf ${RPM_BUILD_ROOT}

%post

%preun

%files
%defattr(-,root,root)
%{_bindir}/xsd
%{_includedir}/xsd
%{_docdir}/xsd
%{_docdir}/libxsd

%ifarch x86_64
%{_mandir}/man1/xsd.1.gz
%else
%{_mandir}/man1/xsd.1
%endif

%changelog
* Tue Sep 30 2008 Boris Kolpackov <boris at codesynthesis.com>
  - new upstream release
  
* Wed Feb 06 2008 Boris Kolpackov <boris at codesynthesis.com>
  - new upstream release
  
* Tue Jul 31 2007 Boris Kolpackov <boris at codesynthesis.com>
  - new upstream release
  
* Tue Jan 23 2007 Boris Kolpackov <boris at codesynthesis.com>
  - new upstream release
  
* Mon Sep 18 2006 Boris Kolpackov <boris at codesynthesis.com>
  - new upstream release

* Mon Jul 10 2006 Boris Kolpackov <boris at codesynthesis.com>
  - new upstream release

* Mon May 01 2006 Boris Kolpackov <boris at codesynthesis.com>
  - new upstream release

* Mon Apr 18 2006 Boris Kolpackov <boris at codesynthesis.com>
  - new upstream release

* Sun Mar 13 2006 Boris Kolpackov <boris at codesynthesis.com>
  - new upstream release

* Sun Feb 05 2006 Boris Kolpackov <boris at codesynthesis.com>
  - new upstream release

* Mon Jan 16 2006 Boris Kolpackov <boris at codesynthesis.com>
  - new upstream release

* Mon Dec 05 2005 Boris Kolpackov <boris at codesynthesis.com>
  - new upstream release

* Tue Nov 08 2005 Boris Kolpackov <boris at codesynthesis.com>
  - new upstream release

* Mon Oct 20 2005 Boris Kolpackov <boris at codesynthesis.com>
  - new upstream release

* Mon Oct 03 2005 Boris Kolpackov <boris at codesynthesis.com>
  - new upstream release

* Fri Sep 16 2005 Boris Kolpackov <boris at codesynthesis.com>
  - new upstream release

* Thu Sep 01 2005 Boris Kolpackov <boris at codesynthesis.com>
  - new upstream release

* Thu Aug 25 2005 Boris Kolpackov <boris at codesynthesis.com>
  - new upstream release

* Sat Aug 06 2005 Boris Kolpackov <boris at codesynthesis.com>
  - new upstream release

* Wed Jul 20 2005 Boris Kolpackov <boris at codesynthesis.com>
  - spec file written for xsd


More information about the xsd-users mailing list