pcsclite does not exist on windows

master
Marc Wäckerlin 9 years ago
parent 5efa74fdda
commit 7c36e12d22
  1. 14
      ax_check_qt.m4
  2. 54
      ax_init_standard_project.m4
  3. 84
      bootstrap.sh
  4. 2
      configure.ac
  5. 2
      debian/control.in
  6. 103
      mac-create-app-bundle.sh

@ -42,10 +42,10 @@ AC_DEFUN([AX_CXX_QT_TOOL], [
HAVE_$1=1 HAVE_$1=1
AC_MSG_CHECKING([for $2]) AC_MSG_CHECKING([for $2])
AC_ARG_VAR([$1], [path to Qt tool $2]) AC_ARG_VAR([$1], [path to Qt tool $2])
$1=${$1:-$(pkg-config --variable=$2_location Qt5Core)} $1=${$1:-$(${ac_tool_prefix}pkg-config --variable=$2_location Qt5Core)}
$1=${$1:-$(pkg-config --variable=host_bins Qt5Core)/$2} $1=${$1:-$(${ac_tool_prefix}pkg-config --variable=host_bins Qt5Core)/$2}
$1=${$1:-$(pkg-config --variable=$2_location QtCore)} $1=${$1:-$(${ac_tool_prefix}pkg-config --variable=$2_location QtCore)}
$1=${$1:-$(pkg-config --variable=host_bins QtCore)/$2} $1=${$1:-$(${ac_tool_prefix}pkg-config --variable=host_bins QtCore)/$2}
if ! which "${$1%% *}" > /dev/null; then if ! which "${$1%% *}" > /dev/null; then
if which "$2" > /dev/null; then if which "$2" > /dev/null; then
$1=$2 $1=$2
@ -100,6 +100,8 @@ AC_DEFUN([AX_CHECK_QT], [
PKG_CHECK_MODULES([$1]5, [${qt_modules//Qt/Qt5}], [ PKG_CHECK_MODULES([$1]5, [${qt_modules//Qt/Qt5}], [
HAVE_$1=1 HAVE_$1=1
AC_DEFINE([HAVE_$1]) AC_DEFINE([HAVE_$1])
QTDIR=$(${ac_tool_prefix}pkg-config --variable=prefix Qt5Core)
QT_PLUGIN_PATH=${QTDIR}/share/qt5/plugins
CPPFLAGS+=" ${[$1]5_CFLAGS}" CPPFLAGS+=" ${[$1]5_CFLAGS}"
MOC_FLAGS+=" -DHAVE_$1=1 ${[$1]5_CFLAGS}" MOC_FLAGS+=" -DHAVE_$1=1 ${[$1]5_CFLAGS}"
CXXFLAGS+=" ${[$1]5_CFLAGS}" CXXFLAGS+=" ${[$1]5_CFLAGS}"
@ -120,6 +122,8 @@ AC_DEFUN([AX_CHECK_QT], [
PKG_CHECK_MODULES([$1], [${qt_modules}], [ PKG_CHECK_MODULES([$1], [${qt_modules}], [
HAVE_$1=1 HAVE_$1=1
AC_DEFINE([HAVE_$1]) AC_DEFINE([HAVE_$1])
QTDIR=$(${ac_tool_prefix}pkg-config --variable=prefix QtCore)
QT_PLUGIN_PATH=${QTDIR}/share/qt/plugins
CPPFLAGS+=" ${$1_CFLAGS}" CPPFLAGS+=" ${$1_CFLAGS}"
MOC_FLAGS+=" -DHAVE_$1=1 ${$1_CFLAGS}" MOC_FLAGS+=" -DHAVE_$1=1 ${$1_CFLAGS}"
CXXFLAGS+=" ${$1_CFLAGS}" CXXFLAGS+=" ${$1_CFLAGS}"
@ -140,6 +144,8 @@ AC_DEFUN([AX_CHECK_QT], [
]) ])
AM_CONDITIONAL(HAVE_$1, test $HAVE_$1 -eq 1) AM_CONDITIONAL(HAVE_$1, test $HAVE_$1 -eq 1)
AX_CHECK_VALID_FLAG([-fPIC -fPIE], [position independent code flag]) AX_CHECK_VALID_FLAG([-fPIC -fPIE], [position independent code flag])
AC_SUBST(QTDIR)
AC_SUBST(QT_PLUGIN_PATH)
AC_SUBST(CPPFLAGS) AC_SUBST(CPPFLAGS)
AC_SUBST(MOC_FLAGS) AC_SUBST(MOC_FLAGS)
AC_SUBST(CXXFLAGS) AC_SUBST(CXXFLAGS)

@ -134,6 +134,21 @@ AC_DEFUN([AX_INIT_STANDARD_PROJECT], [
PROJECT_ICON="${PROJECT_NAME}-icon.png" PROJECT_ICON="${PROJECT_NAME}-icon.png"
fi fi
AX_SUBST(PROJECT_ICON) AX_SUBST(PROJECT_ICON)
AC_ARG_ENABLE(pedantic,
[AS_HELP_STRING([--enable-pedantic],
[enable all warnings and checks, abort on warnings])],
[have_pedantic="$enableval"; test "$enableval" = "yes" && \
AM_CXXFLAGS="${AM_CXXFLAGS:-} -pedantic-errors -Wall -W -Wfloat-equal -Wundef -Wendif-labels -Wpointer-arith -Wcast-align -Wwrite-strings -Wconversion -Wsign-compare -Wmissing-format-attribute -Wno-multichar -Wpacked -Wredundant-decls -Werror -Wshadow -Wcast-qual -Wno-ctor-dtor-privacy"])
dnl problem in libs: -Wshadow -Wcast-qual
dnl auto.hpp: -Wno-ctor-dtor-privacy (removed)
AM_CONDITIONAL(PEDANTIC, test "$enableval" = "yes")
if test "$have_pedantic" == "yes"; then
AC_MSG_NOTICE([Pedantic compile mode enabled!
- all warnings for GNU g++ are enabled
- all warnings result in an error
- doxygen warnings are treated as error too]); fi
AC_CONFIG_FILES([makefile]) AC_CONFIG_FILES([makefile])
AX_ADD_MAKEFILE_TARGET_DEP([clean-am], [clean-standard-project-targets], [makefile.in]) AX_ADD_MAKEFILE_TARGET_DEP([clean-am], [clean-standard-project-targets], [makefile.in])
AX_ADD_MAKEFILE_TARGET_DEP([distclean-am], [distclean-standard-project-targets], [makefile.in]) AX_ADD_MAKEFILE_TARGET_DEP([distclean-am], [distclean-standard-project-targets], [makefile.in])
@ -174,27 +189,13 @@ AC_DEFUN([AX_USE_CXX], [
AM_DISTCHECK_CONFIGURE_FLAGS="CXXFLAGS='${CXXFLAGS}' CPPFLAGS='${CPPFLAGS}' CFLAGS='${CFLAGS}' LDFLAGS='${LDFLAGS}'" AM_DISTCHECK_CONFIGURE_FLAGS="CXXFLAGS='${CXXFLAGS}' CPPFLAGS='${CPPFLAGS}' CFLAGS='${CFLAGS}' LDFLAGS='${LDFLAGS}'"
AC_SUBST(AM_DISTCHECK_CONFIGURE_FLAGS) AC_SUBST(AM_DISTCHECK_CONFIGURE_FLAGS)
AC_ARG_ENABLE(pedantic, MINGW=no
[AS_HELP_STRING([--enable-pedantic],
[enable all warnings and checks, abort on warnings])],
[have_pedantic="$enableval"; test "$enableval" = "yes" && \
AM_CXXFLAGS="${AM_CXXFLAGS:-} -pedantic-errors -Wall -W -Wfloat-equal -Wundef -Wendif-labels -Wpointer-arith -Wcast-align -Wwrite-strings -Wconversion -Wsign-compare -Wmissing-format-attribute -Wno-multichar -Wpacked -Wredundant-decls -Werror -Wshadow -Wcast-qual -Wno-ctor-dtor-privacy"])
dnl problem in libs: -Wshadow -Wcast-qual
dnl auto.hpp: -Wno-ctor-dtor-privacy (removed)
AM_CONDITIONAL(PEDANTIC, test "$enableval" = "yes")
if test "$have_pedantic" == "yes"; then
AC_MSG_NOTICE([Pedantic compile mode enabled!
- all warnings for GNU g++ are enabled
- all warnings result in an error
- doxygen warnings are treated as error too]); fi
MINGW32=no
MAC=no MAC=no
case $host_os in case $host_os in
*mingw32*) MINGW32=yes;; *mingw*) MINGW=yes;;
*darwin* | *rhapsody* | *macosx*) MAC=yes;; *darwin* | *rhapsody* | *macosx*) MAC=yes;;
esac esac
AM_CONDITIONAL(MINGW32, test "$MINGW32" = "yes") AM_CONDITIONAL(MINGW, test "$MINGW" = "yes")
AM_CONDITIONAL(MAC, test "$MAC" = "yes") AM_CONDITIONAL(MAC, test "$MAC" = "yes")
AC_SUBST(AM_CXXFLAGS) AC_SUBST(AM_CXXFLAGS)
@ -203,6 +204,15 @@ AC_DEFUN([AX_USE_CXX], [
AX_ADD_MAKEFILE_TARGET_DEP([maintainer-clean-am], [maintainer-clean-cxx-targets], [src/makefile.in]) AX_ADD_MAKEFILE_TARGET_DEP([maintainer-clean-am], [maintainer-clean-cxx-targets], [src/makefile.in])
test -f src/makefile.in && cat >> src/makefile.in <<EOF test -f src/makefile.in && cat >> src/makefile.in <<EOF
#### Begin: Appended by $0 #### Begin: Appended by $0
%.app: %
-rm -r [\$][@]
\$(MAKE) DESTDIR=[\$][\$](pwd)/[\$][@]/tmp install
QTDIR="\${QTDIR}" \
QT_PLUGINS="\${QT_PLUGINS}" \
QT_PLUGIN_PATH="\${QT_PLUGIN_PATH}" \
\${top_builddir}/mac-create-app-bundle.sh \
[\$][@] [\$][<] [\$][\$](pwd)/[\$][@]/tmp\${prefix}
maintainer-clean-cxx-targets: maintainer-clean-cxx-targets:
-rm makefile.in -rm makefile.in
#### End: $0 #### End: $0
@ -406,19 +416,19 @@ AC_DEFUN([AX_PKG_REQUIRE], [
AC_SUBST(CPPFLAGS) AC_SUBST(CPPFLAGS)
AC_SUBST(CXXFLAGS) AC_SUBST(CXXFLAGS)
AC_SUBST(PKG_REQUIREMENTS) AC_SUBST(PKG_REQUIREMENTS)
if test -n "$3"; then if test -n "$3" -a "${$1_found}" != "no"; then
tmp_package=${$1_found} tmp_package=${$1_found}
$1_found=no $1_found=no
old_CPPFLAGS=${CPPFLAGS} old_CPPFLAGS=${CPPFLAGS}
CPPFLAGS=" ${$1_CFLAGS} ${CPPFLAGS}" CPPFLAGS=" ${$1_CFLAGS} ${CPPFLAGS}"
AC_CHECK_HEADER([$3], [ AC_CHECK_HEADER([$3], [
$1_found=yes $1_found=${tmp_package}
], [ ], [
for x in ${$1_CFLAGS}; do for x in ${$1_CFLAGS}; do
AC_MSG_NOTICE([search for $3 in ${x[#]-I}]) AC_MSG_NOTICE([search for $3 in ${x[#]-I}])
for f in $(find ${x[#]-I} -name "$3"); do for f in $(find ${x[#]-I} -name "$3"); do
if test -f "$f"; then if test -f "$f"; then
$1_found=yes $1_found=${tmp_package}
$1_CFLAGS+=" -I${f%/*}" $1_CFLAGS+=" -I${f%/*}"
AC_MSG_NOTICE([added path ${f%/*}]) AC_MSG_NOTICE([added path ${f%/*}])
break; break;
@ -429,12 +439,12 @@ AC_DEFUN([AX_PKG_REQUIRE], [
fi fi
done done
if test "${$1_found}" = "no"; then if test "${$1_found}" = "no"; then
tmp_includedir=$(pkg-config --variable=includedir $tmp_package) tmp_includedir=$(${ac_tool_prefix}pkg-config --variable=includedir $tmp_package)
for x in ${tmp_includedir}; do for x in ${tmp_includedir}; do
AC_MSG_NOTICE([search for $3 in $x]) AC_MSG_NOTICE([search for $3 in $x])
for f in $(find ${x} -name "$3"); do for f in $(find ${x} -name "$3"); do
if test -f "$f"; then if test -f "$f"; then
$1_found=yes $1_found=${tmp_package}
$1_CFLAGS+=" -I${f%/*}" $1_CFLAGS+=" -I${f%/*}"
AC_MSG_NOTICE([added path ${f%/*}]) AC_MSG_NOTICE([added path ${f%/*}])
break; break;

@ -100,6 +100,7 @@ GENERATED FILES
* ax_init_standard_project.m4 - auxiliary macro definition file * ax_init_standard_project.m4 - auxiliary macro definition file
* ax_cxx_compile_stdcxx_11.m4 - auxiliary macro definition file * ax_cxx_compile_stdcxx_11.m4 - auxiliary macro definition file
* ax_check_qt.m4 - auxiliary macro definition file * ax_check_qt.m4 - auxiliary macro definition file
* mac-create-app-bundle.sh - script to create apple mac os-x app-bundle
* AUTHORS - replace your name in AUTHORS before first run * AUTHORS - replace your name in AUTHORS before first run
* configure.ac - global configuration file template * configure.ac - global configuration file template
* makefile.am - global makefile template * makefile.am - global makefile template
@ -373,6 +374,7 @@ copy ${MY_NAME}
copy ax_init_standard_project.m4 copy ax_init_standard_project.m4
copy ax_cxx_compile_stdcxx_11.m4 copy ax_cxx_compile_stdcxx_11.m4
copy ax_check_qt.m4 copy ax_check_qt.m4
copy mac-create-app-bundle.sh
AUTHOR=$(gpg -K | sed -n 's,uid *,,p' | sort | head -1) AUTHOR=$(gpg -K | sed -n 's,uid *,,p' | sort | head -1)
if test -z "${AUTHOR}"; then if test -z "${AUTHOR}"; then
AUTHOR="FIRSTNAME LASTNAME (URL) <EMAIL>" AUTHOR="FIRSTNAME LASTNAME (URL) <EMAIL>"
@ -409,7 +411,81 @@ AX_INIT_STANDARD_PROJECT
AC_OUTPUT AC_OUTPUT
EOF EOF
PACKAGE_NAME=$(sed -n 's/.*m4_define *( *x_package_name *, *\([^ ]*\) *).*/\1/p' configure.ac) PACKAGE_NAME=$(sed -n 's/.*m4_define *( *x_package_name *, *\([^ ]*\) *).*/\1/p' configure.ac)
echo "${HEADER}MAINTAINERCLEANFILES = makefile.in" | to --condition AX_USE_CXX src/makefile.am if ! testtag "AX_CHECK_QT" configure.ac && \
! testtag "AX_REQUIRE_QT" configure.ac; then
echo "${HEADER}MAINTAINERCLEANFILES = makefile.in" | \
to --condition AX_USE_CXX src/makefile.am
else
to --condition AX_USE_CXX src/makefile.am <<EOF
${HEADER}bin_PROGRAMS = ${PACKAGE_NAME}
## required to enable the translation feature
LANGUAGE_FILE_BASE = ${PACKAGE_NAME}
## list here the Qt plugins your project depends on
## required to build Mac OS-X app-bundle
QT_PLUGINS = iconengines imageformats platforms
#### enable if you deliver a KDE/Gnome desktop file
#applicationsdir = ${datarootdir}/applications
#dist_applications_DATA = ${PACKAGE_NAME}.desktop
#### enable (ev. instead of bin_PROGRAMS) if you build a library
#lib_LTLIBRARIES = ${PACKAGE_NAME}.la
#${PACKAGE_NAME}_la_SOURCES = libmain.cxx version.cxx
## noop to prevent:
## «src/makefile.am: error: object 'version.\$(OBJEXT)' created both with
## libtool and without»
#${PACKAGE_NAME}_la_CXXFLAGS = \$(AM_CXXFLAGS)
## list headers that are required for build, but that are not installed
noinst_HEADERS = version.hxx
## list all %.hxx files with Q_OBJECT as moc_%.cxx
${PACKAGE_NAME//-/_}_MOCFILES = moc_${PACKAGE_NAME}.cxx
## list all %.ui files as ui_%.hxx
${PACKAGE_NAME//-/_}_UIFILES = ui_${PACKAGE_NAME}.hxx
## list all %.qrc resource files as qrc_%.cxx
## note: if there exists a directory %, the file %.qrc is generated from that
${PACKAGE_NAME//-/_}_RESOURCES = qrc_languages.cxx qrc_resources.cxx
## list all final translation files, list all supported languages here
${PACKAGE_NAME//-/_}_TRANSLATIONS = \${LANGUAGE_FILE_BASE}_en.qm \\
\${LANGUAGE_FILE_BASE}_de.qm \\
\${LANGUAGE_FILE_BASE}_fr.qm \\
\${LANGUAGE_FILE_BASE}_it.qm
## list all C++ files that need translation
${PACKAGE_NAME//-/_}_TR_FILES = main.cxx version.cxx
## automatic assembly, no need to change
${PACKAGE_NAME//-/_}_SOURCES = ${swisssign_pin_entry_TR_FILES} ${BUILT_SOURCES}
## automatic assembly, no need to change
BUILT_SOURCES = \${${PACKAGE_NAME//-/_}_MOCFILES} \
\${${PACKAGE_NAME//-/_}_UIFILES} \
\${${PACKAGE_NAME//-/_}_TRANSLATIONS} \
\${${PACKAGE_NAME//-/_}_RESOURCES}
## automatic assembly, no need to change
EXTRA_DIST_TR = \${${PACKAGE_NAME//-/_}_MOCFILES:moc_%.cxx=%.hxx} \
\${${PACKAGE_NAME//-/_}_UIFILES:ui_%.hxx=%.ui}
## automatic assembly, no need to change
## except: adapt the pre-delivered qt_%.qm list (language files you copy from qt
EXTRA_DIST = \${EXTRA_DIST_TR} \
\${${PACKAGE_NAME//-/_}_RESOURCES:qrc_%.cxx:%.qrc} \
\${${PACKAGE_NAME//-/_}_TRANSLATIONS:%.qm=%.ts} \
qt_de.qm qt_fr.qm
## automatic assembly, no need to change
LANGUAGE_FILES = \${EXTRA_DIST_TR} \${${PACKAGE_NAME//-/_}_TR_FILES}
MAINTAINERCLEANFILES = makefile.in
EOF
fi
to --condition AX_USE_CXX src/version.hxx <<EOF to --condition AX_USE_CXX src/version.hxx <<EOF
/*! @file /*! @file
@ -552,11 +628,13 @@ if testtag AX_USE_DOXYGEN; then
if testtag AX_USE_SCRIPTS; then if testtag AX_USE_SCRIPTS; then
doxyadd INPUT "@top_srcdir@/scripts" doxyadd INPUT "@top_srcdir@/scripts"
fi fi
if testtag AX_BUILD_HTML; then
doxyadd INPUT "@top_srcdir@/html"
fi
if testtag AX_USE_CPPUNIT; then if testtag AX_USE_CPPUNIT; then
doxyadd INPUT "@top_srcdir@/test" doxyadd INPUT "@top_srcdir@/test"
fi fi
doxyreplace FILE_PATTERNS '*.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.idl *.ddl *.odl *.h *.hh *.hxx *.hpp *.h++ *.cs *.d *.php *.php4 *.php5 *.phtml *.inc *.m *.markdown *.md *.mm *.dox *.py *.f90 *.f *.for *.tcl *.vhd *.vhdl *.ucf *.qsf *.as *.js' doxyreplace FILE_PATTERNS '*.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.idl *.ddl *.odl *.h *.hh *.hxx *.hpp *.h++ *.cs *.d *.php *.php4 *.php5 *.phtml *.inc *.m *.markdown *.md *.mm *.dox *.py *.f90 *.f *.for *.tcl *.vhd *.vhdl *.ucf *.qsf *.as *.js *.wt'
doxyadd FILE_PATTERNS *.wt
doxyreplace RECURSIVE YES doxyreplace RECURSIVE YES
doxyreplace EXCLUDE_PATTERNS "moc_* uic_* qrc_*" doxyreplace EXCLUDE_PATTERNS "moc_* uic_* qrc_*"
if testtag AX_BUILD_EXAMPLES; then if testtag AX_BUILD_EXAMPLES; then

@ -39,7 +39,9 @@ AX_CHECK_QT([QTNETWORK], [Qt5Network >= 5.2])
CPPFLAGS="${CPPFLAGS} -DQT_NO_KEYWORDS" CPPFLAGS="${CPPFLAGS} -DQT_NO_KEYWORDS"
# libraries used # libraries used
if test "$MINGW" = "no"; then
AX_PKG_REQUIRE([pcsc], [libpcsclite], [pcsclite.h]) AX_PKG_REQUIRE([pcsc], [libpcsclite], [pcsclite.h])
fi
AX_PKG_REQUIRE([ssl], [libssl], [openssl/crypto.h], [openssl]) AX_PKG_REQUIRE([ssl], [libssl], [openssl/crypto.h], [openssl])
AX_PKG_REQUIRE([mrwcxx], [mrw-c++], [mrw/checkcxx11.hxx]) AX_PKG_REQUIRE([mrwcxx], [mrw-c++], [mrw/checkcxx11.hxx])
AX_PKG_REQUIRE([pkcs11], [p11-kit-1], [pkcs11.h], [libpkcs11-helper-1]) AX_PKG_REQUIRE([pkcs11], [p11-kit-1], [pkcs11.h], [libpkcs11-helper-1])

2
debian/control.in vendored

@ -1,7 +1,7 @@
Source: @PACKAGE_NAME@ Source: @PACKAGE_NAME@
Priority: extra Priority: extra
Maintainer: @AUTHOR@ Maintainer: @AUTHOR@
Build-Depends: debhelper (>= 7), pkg-config, autotools-dev, doxygen, graphviz, lsb-release, libssl-dev, libpkcs11-helper1-dev | libp11-kit-dev | libgnutls-dev, libpcsclite-dev, mrw-c++-dev, qtbase5-dev | libqt4-dev, qtbase5-dev-tools | qt4-dev-tools Build-Depends: debhelper (>= 7), pkg-config, autotools-dev, doxygen, graphviz, lsb-release, libssl-dev, libpkcs11-helper1-dev | libp11-kit-dev | libgnutls-dev, libpcsclite-dev, mrw-c++-dev, libproxy-dev, qtbase5-dev | libqt4-dev, qtbase5-dev-tools | qt4-dev-tools
Standards-Version: 3.8.1 Standards-Version: 3.8.1
Section: libs Section: libs
Homepage: https://dev.marc.waeckerlin.org/projects/libpcscxx Homepage: https://dev.marc.waeckerlin.org/projects/libpcscxx

@ -0,0 +1,103 @@
#!/bin/bash -ex
## @id $Id$
##
## Create Mac OS-X App Bundle from built file
##
## Parameters:
## $1: name of the app-target
## $2: name of the project
## $3: installation source
##
## 1 2 3 4 5 6 7 8
## 45678901234567890123456789012345678901234567890123456789012345678901234567890
if test "$(uname -s)" != "Darwin"; then
echo "**** ERROR: run on Mac OS-X: $0"
exit 1
fi
test -n "$1"
test -n "$2"
test -d "$3"
target="$(pwd)/${1}/Contents/MacOS"
# Step 1: create and fill app directory structure
mkdir -p ${1}/Contents/{Resources,MacOS}
! test -d ${3}/bin || \
find ${3}/bin -mindepth 1 -maxdepth 1 -exec mv {} ${1}/Contents/MacOS/ \;
executablefile=$(ls -1 ${1}/Contents/MacOS/ | head -1)
! test -d ${3}/lib || \
find ${3}/lib -mindepth 1 -maxdepth 1 -exec mv {} ${1}/Contents/MacOS/ \;
! test -d ${3}/share/${2} || \
find ${3}/share/${2} -mindepth 1 -maxdepth 1 -exec mv {} ${1}/Contents/Resources/ \;
! test -d ${3}/share/${2} || rmdir ${3}/share/${2}
! test -d ${3}/share || \
find ${3}/share -mindepth 1 -maxdepth 1 -exec mv {} ${1}/Contents/Resources/ \;
! test -d ${3}/bin || rmdir ${3}/bin
! test -d ${3}/lib || rmdir ${3}/lib
! test -d ${3}/share || rmdir ${3}/share
! test -d ${3} || \
find ${3} -mindepth 1 -maxdepth 1 -exec mv {} ${1}/Contents/Resources/ \;
! test -d ${3} || rmdir ${3}
! test -d ${1}/tmp || rm -r ${1}/tmp
# Step 2: copy qt plugins, if necessary
for f in ${QT_PLUGINS}; do
test -d ${target}/${f} \
|| cp -r ${QT_PLUGIN_PATH}/${f} ${target}/${f} \
|| exit 1
done
# Step 3: resolve all library dependencies
found=1
oldpath="$(pwd)"
while [ $found -ne 0 ]; do
found=0
cd "${target}"
for file in $(find . -type f); do
for lib in $(otool -L ${file} | tail -n +2 \
| egrep '/opt/local/|'"${HOME}" \
| grep -v $file | awk '{print $1}'); do
found=1
test -f ${lib##*/} \
|| ( \
cp ${lib} . \
&& chmod u+w ${lib##*/} \
) \
|| exit 1
install_name_tool -change ${lib} \
@executable_path/${lib##*/} ${file} \
|| exit 1
done
done
done
cd ${oldpath}
# Step 4: if necessary, install qt_menu.nib
if test -n "${QTDIR}"; then
MENU_NIB=$(find ${QTDIR} -name .svn -prune -o -name qt_menu.nib -print \
| head -1)
if test -e "${MENU_NIB}"; then
rsync -r "${MENU_NIB}" ${1}/Contents/Resources/
test -d ${1}/Contents/Resources/qt_menu.nib
fi
fi
# Step 5: copy or create info.plist
infoplist=$(find ${1}/Contents/Resources -name Info.plist)
if test -f "${infoplist}"; then
mv "${infoplist}" ${1}/Contents/Info.plist
else
cat > ${1}/Contents/Info.plist <<EOF
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleIdentifier</key>
<string>${2}</string>
<key>CFBundleExecutable</key>
<string>${executablefile##/}</string>
</dict>
</plist>
EOF
fi
Loading…
Cancel
Save