Skip to content

Commit

Permalink
Worked on dpkg files
Browse files Browse the repository at this point in the history
  • Loading branch information
joachimmetz committed Jun 2, 2017
1 parent b77ce68 commit 7fc0668
Show file tree
Hide file tree
Showing 22 changed files with 130 additions and 159 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ stamp-h[1-9]
/common/config.h.in
/common/types.h
/dpkg/changelog
/dpkg/copyright
/include/liblnk.h
/include/liblnk/definitions.h
/include/liblnk/features.h
Expand Down
12 changes: 6 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ compiler:
- clang
- gcc
before_install:
- if test `uname -s` = 'Darwin'; then brew update && brew install gettext gnu-sed && brew link --force gettext; fi
- if test `uname -s` = 'Linux'; then sudo apt-get update && sudo apt-mark hold postgresql-9.2 postgresql-9.3 postgresql-9.4 postgresql-9.5 postgresql-9.6 postgresql-client postgresql-client-common postgresql-common postgresql-contrib-9.2 postgresql-contrib-9.3 postgresql-contrib-9.4 postgresql-contrib-9.5 postgresql-contrib-9.6 postgresql-doc && sudo apt-get --fix-missing -o Dpkg::Options::="--force-confold" upgrade -y && sudo apt-get install -y autopoint; fi
- if test ${TRAVIS_OS_NAME} = "osx"; then brew update && brew install gettext gnu-sed && brew link --force gettext; fi
- if test ${TRAVIS_OS_NAME} = "linux"; then sudo apt-get update && sudo apt-mark hold oracle-java9-installer postgresql-9.2 postgresql-9.3 postgresql-9.4 postgresql-9.5 postgresql-9.6 postgresql-client postgresql-client-common postgresql-common postgresql-contrib-9.2 postgresql-contrib-9.3 postgresql-contrib-9.4 postgresql-contrib-9.5 postgresql-contrib-9.6 postgresql-doc && sudo apt-get --fix-missing -o Dpkg::Options::="--force-confold" upgrade -y && sudo apt-get install -y autopoint; fi
install:
- if test `uname -s` = 'Darwin'; then export SED="/usr/local/bin/gsed"; fi
- if test ${TRAVIS_OS_NAME} = "osx"; then export SED="/usr/local/bin/gsed"; fi
- ./synclibs.sh && ./autogen.sh
- if test -x 'synctestdata.sh'; then ./synctestdata.sh; fi
- if test -x "synctestdata.sh"; then ./synctestdata.sh; fi
script:
- if test `uname -s` = 'Linux'; then export PATH=$(echo $PATH | tr ":" "\n" | sed '/\/opt\/python/d' | tr "\n" ":" | sed "s/::/:/g"); fi
- if test ${TRAVIS_OS_NAME} = "linux"; then export PATH=$(echo $PATH | tr ":" "\n" | sed '/\/opt\/python/d' | tr "\n" ":" | sed "s/::/:/g"); fi
- ./runtests.sh
after_success:
- if test `uname -s` = 'Linux' && test "$CC" = "gcc"; then curl -o codecov.sh -s https://codecov.io/bash && /bin/bash ./codecov.sh; fi
- if test ${TRAVIS_OS_NAME} = "linux" && test ${CC} = "gcc"; then curl -o codecov.sh -s https://codecov.io/bash && /bin/bash ./codecov.sh; fi
11 changes: 5 additions & 6 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,12 @@ DPKG_FILES = \
dpkg/compat \
dpkg/control \
dpkg/copyright \
dpkg/copyright.in \
dpkg/rules \
dpkg/liblnk.docs \
dpkg/liblnk-dev.docs \
dpkg/liblnk-python.docs \
dpkg/liblnk-python3.docs \
dpkg/liblnk-tools.docs \
dpkg/liblnk.install \
dpkg/liblnk-dev.install \
dpkg/liblnk-python.install \
dpkg/liblnk-python3.install \
dpkg/liblnk-tools.install \
dpkg/source/format

GETTEXT_FILES = \
Expand Down
3 changes: 1 addition & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ AC_PREREQ( 2.59 )

AC_INIT(
[liblnk],
[20170305],
[20170602],
[joachim.metz@gmail.com])

AC_CONFIG_SRCDIR(
Expand Down Expand Up @@ -195,7 +195,6 @@ AC_CONFIG_FILES([liblnk/liblnk_definitions.h])
dnl Have configure make distribution specific files
AC_CONFIG_FILES([common/types.h])
AC_CONFIG_FILES([dpkg/changelog])
AC_CONFIG_FILES([dpkg/copyright])
AC_CONFIG_FILES([liblnk/liblnk.rc])
AC_CONFIG_FILES([liblnk.pc])
AC_CONFIG_FILES([liblnk.spec])
Expand Down
2 changes: 1 addition & 1 deletion dpkg/compat
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7
9
13 changes: 10 additions & 3 deletions dpkg/control
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
Source: liblnk
Section: libs
Priority: extra
Maintainer: Joachim Metz <joachim.metz@gmail.com>
Build-Depends: debhelper (>= 7), autotools-dev, python-all-dev, python3-all-dev
Build-Depends: debhelper (>= 9), dh-autoreconf, pkg-config, python-dev, python3-dev
Standards-Version: 3.9.5
Homepage: https://github.com/libyal/liblnk/
Section: libs
Homepage: https://github.com/libyal/liblnk

Package: liblnk
Architecture: any
Expand Down Expand Up @@ -34,6 +34,13 @@ Depends: liblnk (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends}
Description: Several tools for reading Windows Shortcut Files (LNK)
Several tools for reading Windows Shortcut Files (LNK).

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

Package: liblnk-python
Section: python
Architecture: any
Expand Down
25 changes: 25 additions & 0 deletions dpkg/copyright
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: liblnk
Source: https://github.com/libyal/liblnk

Files: *
Copyright: 2009-2017, Joachim Metz <joachim.metz@gmail.com>
License: LGPL-3.0+

License: LGPL-3.0+
This package is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 3 of the License, or (at your option) any later version.
.
This package is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
.
On Debian systems, the complete text of the GNU Lesser General
Public License can be found in "/usr/share/common-licenses/LGPL-3".

40 changes: 0 additions & 40 deletions dpkg/copyright.in

This file was deleted.

4 changes: 0 additions & 4 deletions dpkg/liblnk-dev.docs

This file was deleted.

5 changes: 5 additions & 0 deletions dpkg/liblnk-dev.install
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
usr/include/*
usr/lib/*-*/lib*.a
usr/lib/*-*/lib*.so
usr/lib/*-*/pkgconfig/*
usr/share/man/man3
4 changes: 0 additions & 4 deletions dpkg/liblnk-python.docs

This file was deleted.

1 change: 1 addition & 0 deletions dpkg/liblnk-python.install
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/usr/lib/python2*
4 changes: 0 additions & 4 deletions dpkg/liblnk-python3.docs

This file was deleted.

1 change: 1 addition & 0 deletions dpkg/liblnk-python3.install
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/usr/lib/python3*
4 changes: 0 additions & 4 deletions dpkg/liblnk-tools.docs

This file was deleted.

2 changes: 2 additions & 0 deletions dpkg/liblnk-tools.install
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
usr/bin
usr/share/man/man1
4 changes: 0 additions & 4 deletions dpkg/liblnk.docs

This file was deleted.

1 change: 1 addition & 0 deletions dpkg/liblnk.install
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
usr/lib/*-*/lib*.so.*
86 changes: 7 additions & 79 deletions dpkg/rules
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,100 +1,28 @@
#!/usr/bin/make -f
# debian/rules that uses debhelper >= 7.
# -*- makefile -*-

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
# Uncomment for debhelper verbose output.
# export DH_VERBOSE=1

# This has to be exported to make some magic below work.
export DH_OPTIONS
export SKIP_PYTHON_TESTS=1

%:
dh $@
dh $@ --with autoreconf

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

.PHONY: override_dh_auto_test
override_dh_auto_test:

.PHONY: override_dh_install
override_dh_install:
# Create the liblnk package.
dh_install "debian/tmp/usr/lib/lib*.so.*.*.*" -p liblnk
# Create the liblnk-dev package.
dh_install "debian/tmp/usr/include/*.h" -p liblnk-dev
dh_install "debian/tmp/usr/include/lib*/*.h" -p liblnk-dev
dh_install "debian/tmp/usr/lib/*.a" -p liblnk-dev
dh_install "debian/tmp/usr/lib/*.la" -p liblnk-dev
dh_install "debian/tmp/usr/lib/*.so" -p liblnk-dev
dh_install "debian/tmp/usr/lib/pkgconfig/*" -p liblnk-dev
dh_install "debian/tmp/usr/share/man/man3/*" -p liblnk-dev
# Create the liblnk-tools package.
dh_install "debian/tmp/usr/bin/*" -p liblnk-tools
dh_install "debian/tmp/usr/share/man/man1/*" -p liblnk-tools
# Create the liblnk-python package.
dh_install -X"*_d.so" "debian/tmp/usr/lib/python2*/*" -p liblnk-python
# Create the liblnk-python3 package.
dh_install -X"*_d.so" "debian/tmp/usr/lib/python3*/*" -p liblnk-python3
# The liblnk-dbg, liblnk-python-dbg and liblnk-python3-dbg packages
# are created by dh_strip.
dh_install

.PHONY: override_dh_installmenu
override_dh_installmenu:

.PHONY: override_dh_installmime
override_dh_installmime:

.PHONY: override_dh_installmodules
override_dh_installmodules:

.PHONY: override_dh_installlogcheck
override_dh_installlogcheck:

.PHONY: override_dh_installlogrotate
override_dh_installlogrotate:

.PHONY: override_dh_installpam
override_dh_installpam:

.PHONY: override_dh_installppp
override_dh_installppp:

.PHONY: override_dh_installudev
override_dh_installudev:

.PHONY: override_dh_installwm
override_dh_installwm:

.PHONY: override_dh_installxfonts
override_dh_installxfonts:

.PHONY: override_dh_gconf
override_dh_gconf:

.PHONY: override_dh_icons
override_dh_icons:

.PHONY: override_dh_perl
override_dh_perl:

.PHONY: override_dh_pysupport
override_dh_pysupport:
dh_install --fail-missing -X.la -X/pylnk.a

.PHONY: override_dh_strip
override_dh_strip:
ifeq (,$(filter nostrip,$(DEB_BUILD_OPTIONS)))
dh_strip -pliblnk --dbg-package=liblnk-dbg
dh_strip -pliblnk-tools --dbg-package=liblnk-tools-dbg
dh_strip -pliblnk-python --dbg-package=liblnk-python-dbg
dh_strip -pliblnk-python3 --dbg-package=liblnk-python3-dbg
endif

.PHONY: override_dh_shlibdeps
override_dh_shlibdeps:
dh_shlibdeps -Lliblnk -l${CURDIR}/debian/tmp/usr/lib

.PHONY: override_dh_makeshlibs
override_dh_makeshlibs:
dh_makeshlibs -Xliblnk-dev

2 changes: 1 addition & 1 deletion dpkg/source/format
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0
3.0 (quilt)
1 change: 1 addition & 0 deletions liblnk.ini
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ example_filename1: "calc.lnk"
example_filename2: "wordpad.lnk"

[tools]
description: "Several tools for reading Windows Shortcut Files (LNK)"
directory: "lnktools"
names: ["lnkinfo"]

Expand Down
63 changes: 63 additions & 0 deletions tests/lnk_test_macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,76 @@
goto on_error; \
}

#define LNK_TEST_ASSERT_EQUAL_INT8( name, value, expected_value ) \
if( value != expected_value ) \
{ \
fprintf( stdout, "%s:%d %s (%" PRIi8 ") != %" PRIi8 "\n", __FILE__, __LINE__, name, value, expected_value ); \
goto on_error; \
}

#define LNK_TEST_ASSERT_NOT_EQUAL_INT8( name, value, expected_value ) \
if( value == expected_value ) \
{ \
fprintf( stdout, "%s:%d %s (%" PRIi8 ") == %" PRIi8 "\n", __FILE__, __LINE__, name, value, expected_value ); \
goto on_error; \
}

#define LNK_TEST_ASSERT_EQUAL_UINT8( name, value, expected_value ) \
if( value != expected_value ) \
{ \
fprintf( stdout, "%s:%d %s (%" PRIi8 ") != %" PRIu8 "\n", __FILE__, __LINE__, name, value, expected_value ); \
goto on_error; \
}

#define LNK_TEST_ASSERT_LESS_THAN_UINT8( name, value, expected_value ) \
if( value >= expected_value ) \
{ \
fprintf( stdout, "%s:%d %s (%" PRIi8 ") >= %" PRIu8 "\n", __FILE__, __LINE__, name, value, expected_value ); \
goto on_error; \
}

#define LNK_TEST_ASSERT_EQUAL_INT16( name, value, expected_value ) \
if( value != expected_value ) \
{ \
fprintf( stdout, "%s:%d %s (%" PRIi16 ") != %" PRIi16 "\n", __FILE__, __LINE__, name, value, expected_value ); \
goto on_error; \
}

#define LNK_TEST_ASSERT_NOT_EQUAL_INT16( name, value, expected_value ) \
if( value == expected_value ) \
{ \
fprintf( stdout, "%s:%d %s (%" PRIi16 ") == %" PRIi16 "\n", __FILE__, __LINE__, name, value, expected_value ); \
goto on_error; \
}

#define LNK_TEST_ASSERT_EQUAL_UINT16( name, value, expected_value ) \
if( value != expected_value ) \
{ \
fprintf( stdout, "%s:%d %s (%" PRIi16 ") != %" PRIu16 "\n", __FILE__, __LINE__, name, value, expected_value ); \
goto on_error; \
}

#define LNK_TEST_ASSERT_LESS_THAN_UINT16( name, value, expected_value ) \
if( value >= expected_value ) \
{ \
fprintf( stdout, "%s:%d %s (%" PRIi16 ") >= %" PRIu16 "\n", __FILE__, __LINE__, name, value, expected_value ); \
goto on_error; \
}

#define LNK_TEST_ASSERT_EQUAL_INT32( name, value, expected_value ) \
if( value != expected_value ) \
{ \
fprintf( stdout, "%s:%d %s (%" PRIi32 ") != %" PRIi32 "\n", __FILE__, __LINE__, name, value, expected_value ); \
goto on_error; \
}

#define LNK_TEST_ASSERT_NOT_EQUAL_INT32( name, value, expected_value ) \
if( value == expected_value ) \
{ \
fprintf( stdout, "%s:%d %s (%" PRIi32 ") == %" PRIi32 "\n", __FILE__, __LINE__, name, value, expected_value ); \
goto on_error; \
}

#define LNK_TEST_ASSERT_EQUAL_UINT32( name, value, expected_value ) \
if( value != expected_value ) \
{ \
Expand Down

0 comments on commit 7fc0668

Please sign in to comment.