Skip to content

Commit

Permalink
Worked on combined Python 2 and 3 build support.
Browse files Browse the repository at this point in the history
  • Loading branch information
joachimmetz committed Mar 27, 2016
1 parent 4973eac commit 5ca5962
Show file tree
Hide file tree
Showing 16 changed files with 708 additions and 45 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ stamp-h[1-9]
/include/libevtx/types.h
/libevtx/libevtx.rc
/libevtx/libevtx_definitions.h
/pyevtx[23]/*.[ch]
/LICENSE.pyevtx
/evtxtools/evtxexport
/evtxtools/evtxinfo
/tests/evtx_test_open_close
Expand Down
3 changes: 3 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ Debug:
Recovery:
* scan for records in chunk free space

20160107
* worked on Python 3 support

20160103
* 2016 update
* Worked on format support
Expand Down
2 changes: 2 additions & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ SUBDIRS = \
libcsystem \
evtxtools \
pyevtx \
pyevtx2 \
pyevtx3 \
po \
manuals \
tests \
Expand Down
6 changes: 3 additions & 3 deletions README
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
libevtx is a library to access the Windows XML Event Log (EVTX) format.

Project information:

* Status: alpha
* Licence: LGPLv3+

Work in progress:
* Python 3 support

Planned:

* Multi-threading support

For more information see:

* Project documentation: https://github.com/libyal/libevtx/wiki/Home
* How to build from source: https://github.com/libyal/libevtx/wiki/Building

48 changes: 41 additions & 7 deletions autogen.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh
# Script to generate ./configure using the autotools
#
# Version: 20141007
# Version: 20160106

EXIT_SUCCESS=0;
EXIT_FAILURE=1;
Expand Down Expand Up @@ -47,6 +47,10 @@ LIBTOOLIZE="${BINDIR}/libtoolize";
if test -x "${AUTORECONF}";
then
${AUTORECONF} --force --install
if test $? -ne 0;
then
exit $?;
fi
else
if ! test -x "${ACLOCAL}";
then
Expand Down Expand Up @@ -90,12 +94,42 @@ else
exit ${EXIT_FAILURE};
fi

${AUTOPOINT} --force
${ACLOCAL} --force -I m4
${LIBTOOLIZE} --force
${AUTOHEADER} --force
${AUTOCONF} --force
${AUTOMAKE} --force --add-missing
${AUTOPOINT} --force;
if test $? -ne 0;
then
exit $?;
fi

${ACLOCAL} --force -I m4;
if test $? -ne 0;
then
exit $?;
fi

${LIBTOOLIZE} --force;
if test $? -ne 0;
then
exit $?;
fi

${AUTOHEADER} --force;
if test $? -ne 0;
then
exit $?;
fi

${AUTOCONF} --force;
if test $? -ne 0;
then
exit $?;
fi

${AUTOMAKE} --force --add-missing;
if test $? -ne 0;
then
exit $?;
fi

fi

exit ${EXIT_SUCCESS};
Expand Down
9 changes: 8 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ AC_PREREQ( 2.59 )

AC_INIT(
[libevtx],
[20160103],
[20160107],
[joachim.metz@gmail.com])

AC_CONFIG_SRCDIR(
Expand Down Expand Up @@ -136,7 +136,10 @@ dnl Check if libevtx should be build with debug output
AX_COMMON_CHECK_ENABLE_DEBUG_OUTPUT

dnl Check if libevtx python bindings (pyevtx) should be build
AX_PYTHON_CHECK_PYPREFIX
AX_PYTHON_CHECK_ENABLE
AX_PYTHON2_CHECK_ENABLE
AX_PYTHON3_CHECK_ENABLE

dnl Headers included in various places
AC_CHECK_HEADERS([stdarg.h varargs.h])
Expand Down Expand Up @@ -237,6 +240,8 @@ AC_CONFIG_FILES([libcdirectory/Makefile])
AC_CONFIG_FILES([libcsystem/Makefile])
AC_CONFIG_FILES([evtxtools/Makefile])
AC_CONFIG_FILES([pyevtx/Makefile])
AC_CONFIG_FILES([pyevtx2/Makefile])
AC_CONFIG_FILES([pyevtx3/Makefile])
AC_CONFIG_FILES([po/Makefile.in])
AC_CONFIG_FILES([po/Makevars])
AC_CONFIG_FILES([manuals/Makefile])
Expand Down Expand Up @@ -292,6 +297,8 @@ Features:
Wide character type support: $ac_cv_enable_wide_character_type
evtxtools are build as static executables: $ac_cv_enable_static_executables
Python (pyevtx) support: $ac_cv_enable_python
Python version 2 (pyevtx) support: $ac_cv_enable_python2
Python version 3 (pyevtx) support: $ac_cv_enable_python3
Verbose output: $ac_cv_enable_verbose_output
Debug output: $ac_cv_enable_debug_output
]);
Expand Down
21 changes: 18 additions & 3 deletions dpkg/control
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Source: libevtx
Section: libs
Priority: extra
Maintainer: Joachim Metz <joachim.metz@gmail.com>
Build-Depends: debhelper (>= 7), autotools-dev, python-dev
Build-Depends: debhelper (>= 7), autotools-dev, python-dev, python3-dev
Standards-Version: 3.9.5
Homepage: https://github.com/libyal/libevtx/

Expand Down Expand Up @@ -39,8 +39,8 @@ Section: python
Architecture: any
Depends: libevtx (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends}
Suggests: libevtx-python-dbg
Description: Python bindings for libevtx
Python bindings for libevtx.
Description: Python 2 bindings for libevtx
Python 2 bindings for libevtx.

Package: libevtx-python-dbg
Section: debug
Expand All @@ -49,3 +49,18 @@ Depends: libevtx-python (= ${binary:Version}), ${misc:Depends}
Description: Debugging symbols for libevtx-python
Debugging symbols for libevtx-python.

Package: libevtx-python3
Section: python
Architecture: any
Depends: libevtx (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends}
Suggests: libevtx-python3-dbg
Description: Python 3 bindings for libevtx
Python 3 bindings for libevtx.

Package: libevtx-python3-dbg
Section: debug
Architecture: any
Depends: libevtx-python3 (= ${binary:Version}), ${misc:Depends}
Description: Debugging symbols for libevtx-python3
Debugging symbols for libevtx-python3.

4 changes: 4 additions & 0 deletions dpkg/libevtx-python.docs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
AUTHORS
COPYING
NEWS
README
4 changes: 4 additions & 0 deletions dpkg/libevtx-python3.docs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
AUTHORS
COPYING
NEWS
README
10 changes: 7 additions & 3 deletions dpkg/rules
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export DH_OPTIONS

.PHONY: override_dh_auto_configure
override_dh_auto_configure:
dh_auto_configure -- --enable-python CFLAGS="-g"
dh_auto_configure -- --enable-python2 --enable-python3 CFLAGS="-g"

.PHONY: override_dh_auto_test
override_dh_auto_test:
Expand All @@ -33,8 +33,11 @@ override_dh_install:
dh_install "debian/tmp/usr/bin/*" -p libevtx-tools
dh_install "debian/tmp/usr/share/man/man1/*" -p libevtx-tools
# Create the libevtx-python package.
dh_install -X"*_d.so" "debian/tmp/usr/lib/python*/*" -p libevtx-python
# The libevtx-dbg and libevtx-python-dbg packages are created by dh_strip.
dh_install -X"*_d.so" "debian/tmp/usr/lib/python2*/*" -p libevtx-python
# Create the libevtx-python3 package.
dh_install -X"*_d.so" "debian/tmp/usr/lib/python3*/*" -p libevtx-python3
# The libevtx-dbg, libevtx-python-dbg and libevtx-python3-dbg packages
# are created by dh_strip.
dh_install

.PHONY: override_dh_installmenu
Expand Down Expand Up @@ -84,6 +87,7 @@ override_dh_strip:
ifeq (,$(filter nostrip,$(DEB_BUILD_OPTIONS)))
dh_strip -plibevtx --dbg-package=libevtx-dbg
dh_strip -plibevtx-python --dbg-package=libevtx-python-dbg
dh_strip -plibevtx-python3 --dbg-package=libevtx-python3-dbg
endif

.PHONY: override_dh_shlibdeps
Expand Down
28 changes: 22 additions & 6 deletions libevtx.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,28 @@ Requires: libevtx = %{version}-%{release} @ax_libcdirectory_spec_requires@ @ax_l
Several tools for reading Windows XML Event Log (EVTX) files

%package python
Summary: Python bindings for libevtx
Summary: Python 2 bindings for libevtx
Group: System Environment/Libraries
Requires: libevtx = %{version}-%{release} python
BuildRequires: python-devel

%description python
Python bindings for libevtx
Python 2 bindings for libevtx

%package python3
Summary: Python 3 bindings for libevtx
Group: System Environment/Libraries
Requires: libevtx = %{version}-%{release} python3
BuildRequires: python3-devel

%description python3
Python 3 bindings for libevtx

%prep
%setup -q

%build
%configure --prefix=/usr --libdir=%{_libdir} --mandir=%{_mandir} --enable-python
%configure --prefix=/usr --libdir=%{_libdir} --mandir=%{_mandir} --enable-python2 --enable-python3
make %{?_smp_mflags}

%install
Expand Down Expand Up @@ -82,9 +91,16 @@ rm -rf ${RPM_BUILD_ROOT}
%files python
%defattr(644,root,root,755)
%doc AUTHORS COPYING NEWS README
%{_libdir}/python*/site-packages/*.a
%{_libdir}/python*/site-packages/*.la
%{_libdir}/python*/site-packages/*.so
%{_libdir}/python2*/site-packages/*.a
%{_libdir}/python2*/site-packages/*.la
%{_libdir}/python2*/site-packages/*.so

%files python3
%defattr(644,root,root,755)
%doc AUTHORS COPYING NEWS README
%{_libdir}/python3*/site-packages/*.a
%{_libdir}/python3*/site-packages/*.la
%{_libdir}/python3*/site-packages/*.so

%changelog
* @SPEC_DATE@ Joachim Metz <joachim.metz@gmail.com> @VERSION@-1
Expand Down
Loading

0 comments on commit 5ca5962

Please sign in to comment.