Busybox rpm scriplets - embed

I am packaging with rpm for embedded device with busybox instead normal GNU system.
When I install with busybox, it install module, but do not even try to run scriplets.
On regular system, It runs them and fails(ofc, another version of kernel).
Question: Where am I wrong, and how to work around it?
Here is my spec-file:
# The kernel version you are building for
%define kernel 3.4.0-rc6-01292-g9b8149d
# The name of the module you are supplying
%define modname ktgrabber
# The path to the module, after it is installed
%define modpath /lib/modules/%{kernel}/kernel/net/ipv4
# Which revision are we on
%define pkgrelease 1.SL
# Is this a new module, or are we replacing an existing module
# 1 - new module
# 0 - replacing an existing module
%define newmodule 1
# Optional - what Architecture we are building for
#%define thisarch ia32e
Name: kernel-module-%{modname}-%{kernel}
Summary: Kernel Module %{modname} for the %{kernel} kernel
Version: 0.99
Release: 1
Epoch: 0
License: GPLv2+
Packager: Troy Dawson <dawson#fnal.gov>
Group: System Environment/Kernel
BuildRoot: %{_tmppath}/%{name}-%{version}-root
#Requires: /boot/vmlinux-%{kernel}, modutils
Provides: kernel-module-%{modname} = %{epoch}:%{version}
Source0: %{modname}.ko.%{kernel}
%description
This package provides a %{modname} kernel module for
kernel %{kernel}.
%install
mkdir -p $RPM_BUILD_ROOT/%{modpath}
%if %{newmodule}
install -m 644 %{SOURCE0} $RPM_BUILD_ROOT/%{modpath}/%{modname}.ko
%else
install -m 644 %{SOURCE0} $RPM_BUILD_ROOT/%{modpath}/%{modname}.%{version}.%{pkgrelease}.o
%endif
%pre
touch /root/bar
mkdir /alice
%post
touch /bar
/bin/echo %{modname} >> /etc/modules
depmod
mkdir /foo
depmod -ae %{kernel} >/dev/null 2>&1
modprobe %{modname}
%postun
sed -i 's/^%{modname}$//g' /etc/modules
%if %{newmodule}
depmod -ae %{kernel} >/dev/null 2>&1 || :
%else
if [ "" = "0" ] ; then
if ! [ -f %{modpath}/%{modname}.original.o ] ; then
mv %{modpath}/%{modname}.o %{modpath}/%{modname}.original.o
fi
cp -f %{modpath}/%{modname}.%{version}.%{pkgrelease}.o %{modpath}/%{modname}.o
depmod -ae %{kernel} >/dev/null 2>&1 || :
fi
%endif
%files
%if %{newmodule}
%{modpath}/%{modname}.ko
%else
%{modpath}/%{modname}.%{version}.%{pkgrelease}.ko
%endif

Check out this link : http://lists.busybox.net/pipermail/busybox/2006-November/059507.html scriptlets aren't run by busybox's rpm command.
Looking at the source at http://git.busybox.net/busybox/tree/archival/rpm.c#n149 that appears to be true.

Related

Github Action - Can't build gtest using ccache, mingw, cmake and ninja

I am using this workflow: cmake_build.yaml
Here is my toplevel CMakeLists.txt:
cmake_minimum_required(VERSION 3.15)
project(
container
VERSION 0.1.0
DESCRIPTION "An extension to the standard container library in c++"
HOMEPAGE_URL ""
LANGUAGES CXX
)
add_executable(${PROJECT_NAME} src/main.cpp)
set_target_properties(
${PROJECT_NAME}
PROPERTIES
LINKER_LANGUAGE CXX
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib/${CMAKE_BUILD_TYPE}"
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib/${CMAKE_BUILD_TYPE}"
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin/${CMAKE_BUILD_TYPE}"
)
target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_17)
target_include_directories(
${PROJECT_NAME}
PUBLIC
$<INSTALL_INTERFACE:include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/src
)
install(
DIRECTORY
include/${PROJECT_NAME_LOWERCASE}
DESTINATION
include
)
enable_testing()
add_subdirectory(test)
and test/CMakeLists.txt
cmake_minimum_required(VERSION 3.14)
project(my_project)
# GoogleTest requires at least C++14
set(CMAKE_CXX_STANDARD 17)
include(FetchContent)
FetchContent_Declare(
googletest
URL https://github.com/google/googletest/archive/03597a01ee50ed33e9dfd640b249b4be3799d395.zip
)
# For Windows: Prevent overriding the parent project's compiler/linker settings
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
FetchContent_MakeAvailable(googletest)
add_executable(
hello_test
hello_test.cc
)
target_link_libraries(
hello_test
GTest::gtest_main
)
include(GoogleTest)
gtest_discover_tests(hello_test)
I am using the example from gtest docs:
test/hello_test.cc:
#include <gtest/gtest.h>
TEST(HelloTest, BasicAssertions) {
// Expect two strings not to be equal.
EXPECT_STRNE("hello", "world");
// Expect equality.
EXPECT_EQ(7 * 6, 42);
}
int main(int argc, char **argv)
{
testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
It builds fine on Windows MSVC, Macos Clang, Linux GCC, but fails using Mingw GCC, here is error shown:
FAILED: test/hello_test.exe test/hello_test[1]_tests.cmake D:/a/tsst/tsst/build/test/hello_test[1]_tests.cmake
cmd.exe /C "cd . && C:\ProgramData\chocolatey\bin\g++.exe -O3 -DNDEBUG test/CMakeFiles/hello_test.dir/hello_test.cc.obj -o test\hello_test.exe -Wl,--out-implib,test\libhello_test.dll.a -Wl,--major-image-version,0,--minor-image-version,0 lib/libgtest_main.a lib/libgtest.a -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 && cmd.exe /C "cd /D D:\a\tsst\tsst\build\test && D:\a\tsst\tsst\cmake-3.24.3-windows-x86_64\bin\cmake.exe -D TEST_TARGET=hello_test -D TEST_EXECUTABLE=D:/a/tsst/tsst/build/test/hello_test.exe -D TEST_EXECUTOR= -D TEST_WORKING_DIR=D:/a/tsst/tsst/build/test -D TEST_EXTRA_ARGS= -D TEST_PROPERTIES= -D TEST_PREFIX= -D TEST_SUFFIX= -D TEST_FILTER= -D NO_PRETTY_TYPES=FALSE -D NO_PRETTY_VALUES=FALSE -D TEST_LIST=hello_test_TESTS -D CTEST_FILE=D:/a/tsst/tsst/build/test/hello_test[1]_tests.cmake -D TEST_DISCOVERY_TIMEOUT=5 -D TEST_XML_OUTPUT_DIR= -P D:/a/tsst/tsst/cmake-3.24.3-windows-x86_64/share/cmake-3.24/Modules/GoogleTestAddTests.cmake""
CMake Error at D:/a/tsst/tsst/cmake-3.24.3-windows-x86_64/share/cmake-3.24/Modules/GoogleTestAddTests.cmake:112 (message):
Error running test executable.
Path: 'D:/a/tsst/tsst/build/test/hello_test.exe'
Result: Exit code 0xc0000139
Output:
Call Stack (most recent call first):
D:/a/tsst/tsst/cmake-3.24.3-windows-x86_64/share/cmake-3.24/Modules/GoogleTestAddTests.cmake:225 (gtest_discover_tests_impl)
ninja: build stopped: subcommand failed.
Build works fine without building gtest, and it fails when building test executable with gtest

Install problem MiKTeX under GitHub Actions

Since around October 16 2022 we have problems with installing MiKTeX under GitHub Actions.
The error we get is:
Run ./miktexsetup_standalone --local-package-repository=C:/miktex-repository \
./miktexsetup_standalone --local-package-repository=C:/miktex-repository \
--package-set=essential \
--shared \
install
shell: C:\Program Files\Git\bin\bash.EXE --noprofile --norc -e -o pipefail {0}
initexmf.exe: The executed process did not succeed.
initexmf.exe: Data: fileName="C:\Program Files\MiKTeX\miktex\bin\x64\initexmf.exe", exitCode="1"
Error: Process completed with exit code 1.
The procedure followed in GitHub Actions consists of a few steps:
Step 1:
- name: Download MikTex (Windows)
run: |
$wc = New-Object System.Net.WebClient;
$maxAttempts=5;
$attemptCount=0;
Do {
$attemptCount++;
Try {
$wc.DownloadFile("https://ctan.math.illinois.edu/systems/win32/miktex/setup/windows-x64/miktexsetup-5.1-x64.zip","miktexsetup-5.1-x64.zip")
} Catch [Exception] {
Write-Host $_.Exception | format-list -force
}
} while (((Test-Path "miktexsetup-5.1-x64.zip") -eq $false) -and ($attemptCount -le $maxAttempts))
shell: pwsh
if: matrix.config.os == 'windows-latest'
Step 2:
- name: Extract MikTex zip (Windows)
shell: bash
run: |
unzip miktexsetup-5.1-x64.zip
if: matrix.config.os == 'windows-latest'
Step 3:
- name: Download MikTex packages (Windows)
shell: bash
run: |
./miktexsetup_standalone --verbose \
--local-package-repository=C:/miktex-repository \
--remote-package-repository="https://ctan.math.illinois.edu/systems/win32/miktex/tm/packages/" \
--package-set=essential \
download
if: matrix.config.os == 'windows-latest'
Step 4 (the failing step):
- name: Install MikTex packages (Windows)
shell: bash
run: |
./miktexsetup_standalone --local-package-repository=C:/miktex-repository \
--package-set=essential \
--shared \
install
if: matrix.config.os == 'windows-latest'
Step 5:
- name: Setting MikTex paths (Windows)
shell: bash
run: |
echo "C:/Program Files/MiKTeX/miktex/bin/x64/" >> $GITHUB_PATH
export PATH="/c/Program Files/MiKTeX/miktex/bin/x64/:$PATH"
echo "Configuring MiKTeX to install missing packages on the fly"
initexmf --admin --verbose --set-config-value='[MPM]AutoInstall=1'
if: matrix.config.os == 'windows-latest'
Any ideas how to solve this problem / what can be the problem?
Based on discussions in https://github.com/MiKTeX/miktex/discussions/1204 and https://github.com/MiKTeX/miktex/issues/1213 the solution is to replace the MiKTeX version's zip file
from:
miktexsetup-5.1-x64.zip
to:
miktexsetup-5.2.0+b8f430f-x64.zip

How to add `--registry-mirror` when starting docker from "Docker quickstart terminal"?

From the docker distribution document: https://github.com/docker/distribution
It says to configure the docker to use the mirror, we should:
Configuring the Docker daemon
You will need to pass the --registry-mirror option to your Docker daemon on startup:
docker --registry-mirror=https://<my-docker-mirror-host> daemon
I'm newbie to docker, and I start docker from mac normal by the provided "Docker Quickstart Termial" app, which actaully invokes a start.sh shell:
#!/bin/bash
VM=default
DOCKER_MACHINE=/usr/local/bin/docker-machine
VBOXMANAGE=/Applications/VirtualBox.app/Contents/MacOS/VBoxManage
BLUE='\033[0;34m'
GREEN='\033[0;32m'
NC='\033[0m'
unset DYLD_LIBRARY_PATH
unset LD_LIBRARY_PATH
clear
if [ ! -f $DOCKER_MACHINE ] || [ ! -f $VBOXMANAGE ]; then
echo "Either VirtualBox or Docker Machine are not installed. Please re-run the Toolbox Installer and try again."
exit 1
fi
$VBOXMANAGE showvminfo $VM &> /dev/null
VM_EXISTS_CODE=$?
if [ $VM_EXISTS_CODE -eq 1 ]; then
echo "Creating Machine $VM..."
$DOCKER_MACHINE rm -f $VM &> /dev/null
rm -rf ~/.docker/machine/machines/$VM
$DOCKER_MACHINE create -d virtualbox --virtualbox-memory 2048 --virtualbox-disk-size 204800 $VM
else
echo "Machine $VM already exists in VirtualBox."
fi
VM_STATUS=$($DOCKER_MACHINE status $VM)
if [ "$VM_STATUS" != "Running" ]; then
echo "Starting machine $VM..."
$DOCKER_MACHINE start $VM
yes | $DOCKER_MACHINE regenerate-certs $VM
fi
echo "Setting environment variables for machine $VM..."
clear
cat << EOF
## .
## ## ## ==
## ## ## ## ## ===
/"""""""""""""""""\___/ ===
~~~ {~~ ~~~~ ~~~ ~~~~ ~~~ ~ / ===- ~~~
\______ o __/
\ \ __/
\____\_______/
EOF
echo -e "${BLUE}docker${NC} is configured to use the ${GREEN}$VM${NC} machine with IP ${GREEN}$($DOCKER_MACHINE ip $VM)${NC}"
echo "For help getting started, check out the docs at https://docs.docker.com"
echo
eval $($DOCKER_MACHINE env $VM --shell=bash)
USER_SHELL=$(dscl /Search -read /Users/$USER UserShell | awk '{print $2}' | head -n 1)
if [[ $USER_SHELL == *"/bash"* ]] || [[ $USER_SHELL == *"/zsh"* ]] || [[ $USER_SHELL == *"/sh"* ]]; then
$USER_SHELL --login
else
$USER_SHELL
fi
Is it the correct file that I can put my '--registry-mirror' config to it? What should I do?
If you do a docker-machine create --help:
docker-machine create --help
Usage: docker-machine create [OPTIONS] [arg...]
Create a machine.
Run 'docker-machine create --driver name' to include the create flags for that driver in the help text.
Options:
...
--engine-insecure-registry [--engine-insecure-registry option --engine-insecure-registry option] Specify insecure registries to allow with the created en
gine
--engine-registry-mirror [--engine-registry-mirror option --engine-registry-mirror option] Specify registry mirrors to use
So you can modify your script to add one more parameter:
--engine-registry-mirror=...
However, since your 'default' docker-machine probably already exists (do a docker-machine ls), you might need to remove it first (docker-machine rm default: make sure you can easily recreate your images from your local Dockerfiles, and/or that you don't have data container that would need to be saved first)
Open C:\Users\<YourName>\.docker\daemon.json, edit the "registry-mirrors" entry in that file.
{"registry-mirrors":["https://registry.docker-cn.com"],"insecure-registries":[], "debug":true, "experimental": true}

Issues installing IDAS on CentOS 7 VM through provided RPMs

I've been trying to install IDAS GE in a CentOS 7 VM on my machine through the UL2.0 RPMs(download link!) available in its catalogue page.
I followed the instructions on github, but I get stuck in starting the IoT as per section 3 of the Deployment section of the instructions. If I execute the init_iotagent.sh, where I inserted the local IP of the VM, I get the error:
log4cplus:ERROR No appenders could be found for logger (main).
log4cplus:ERROR Please initialize the log4cplus system properly.
HTTPFilter DESTRUCTOR 0
HTTPFilter DESTRUCTOR 0
Also, in the instructions for Starting IoTAgent as a Service, it's said that:
After installing iot-agent-base RPM an init.d script can be found in
this folder /usr/local/iot/init.d .
But this file is not there, leading me to believe that the IoTAgent wasn't installed properly from the RPMs provided.
Also, I can't find log files regarding IoTAgent, only the MongoDB has its log file at /usr/local/iot/mongodb-linux-x86_64-2.6.9/log/mongoc.log.
If anyone could help, it would be apreciated. Also, if more info is needed, please let me know.
Thank you
I recommend you to get the GitHub repository and build the RPMs from the source and then install it in your CentOS. Like is explained in the documentation:
NOTE: I changed the BUILD_TYPE to Release, so I created the Release dir.
GIT_VERSION and GIT_COMMIT are not the latest ones.
git clone https://github.com/telefonicaid/fiware-IoTAgent-Cplusplus.git
cd fiware....
mkdir -p build/Release
cd build/Release
cmake -DGIT_VERSION=20527 -DGIT_COMMIT=217023407f25ed258043cfc00a46b6c05fb0b52c -DMQTT=ON -DCMAKE_BUILD_TYPE=Release ../../
make install
make package
The packages will be in pack/Linux/RPM/
rpm -i iot-agent-base-xxxxxxx (xxxxxxx will be the numbers of the build)
rpm -i iot-agent-ul-xxxxxx (xxxxxxx will be the numbers of the build)
Once installed with RPMs the init.d file is in: /usr/local/iot/init.d/iotagent
This is the content of the file:
#!/bin/bash
# Copyright 2015 Telefonica Investigación y Desarrollo, S.A.U
#
# This file is part of fiware-IoTagent-Cplusplus (FI-WARE project).
#
# iotagent Start/Stop iotagent
#
# chkconfig: 2345 99 60
# description: iotagent
. /etc/rc.d/init.d/functions
PARAM=$1
INSTANCE=$2
USERNAME=iotagent
EXECUTABLE=/usr/local/iot/bin/iotagent
CONFIG_PATH=/usr/local/iot/config
iotagent_start()
{
local result=0
local instance=${1}
if [[ ! -x ${EXECUTABLE} ]]; then
printf "%s\n" "Fail - missing ${EXECUTABLE} executable"
exit 1
fi
if [[ -z ${instance} ]]; then
list_instances="${CONFIG_PATH}/iotagent_*.conf"
else
list_instances="${CONFIG_PATH}/iotagent_${instance}.conf"
fi
for instance_config in ${list_instances}
do
local NAME
NAME=${instance_config%.conf}
NAME=${NAME#*iotagent_}
source ${instance_config}
local IOTAGENT_PID_FILE="/var/run/iot/iotagent_${NAME}.pid"
printf "Starting iotagent ${NAME}..."
status -p ${IOTAGENT_PID_FILE} ${EXECUTABLE} &> /dev/null
if [[ ${?} -eq 0 ]]; then
printf "%s\n" " Already running, skipping $(success)"
continue
fi
# Load the environment
set -a
source ${instance_config}
# Mandatory parameters
IOTAGENT_OPTS=" ${IS_MANAGER} \
-n ${IOTAGENT_SERVER_NAME} \
-v ${IOTAGENT_LOG_LEVEL} \
-i ${IOTAGENT_SERVER_ADDRESS} \
-p ${IOTAGENT_SERVER_PORT} \
-d ${IOTAGENT_LIBRARY_DIR} \
-c ${IOTAGENT_CONFIG_FILE}"
su ${USERNAME} -c "LD_LIBRARY_PATH=\"${IOTAGENT_LIBRARY_DIR}\" \
${EXECUTABLE} ${IOTAGENT_OPTS} & echo \$! > ${IOTAGENT_PID_FILE}" &> /dev/null
sleep 2 # wait some time to leave iotagent start
local PID=$(cat ${IOTAGENT_PID_FILE})
local var_pid=$(ps -ef | grep ${PID} | grep -v grep)
if [[ -z "${var_pid}" ]]; then
printf "%s" "pidfile not found"
printf "%s\n" "$(failure)"
exit 1
else
printf "%s\n" "$(success)"
fi
done
return ${result}
}
iotagent_stop()
{
local result=0
local iotagent_instance=${1}
if [[ -z ${iotagent_instance} ]]; then
list_run_instances="/var/run/iot/iotagent_*.pid"
else
list_run_instances="/var/run/iot/iotagent_${iotagent_instance}.pid"
fi
if [[ $(ls -l ${list_run_instances} 2> /dev/null | wc -l) -eq 0 ]]; then
printf "%s\n" "There aren't any instance of IoTAgent ${iotagent_instance} running $(success)"
return 0
fi
for run_instance in ${list_run_instances}
do
local NAME
NAME=${run_instance%.pid}
NAME=${NAME#*iotagent_}
printf "%s" "Stopping IoTAgent ${NAME}..."
local RUN_PID=$(cat ${run_instance})
kill ${RUN_PID} &> /dev/null
local KILLED_PID=$(ps -ef | grep ${RUN_PID} | grep -v grep | awk '{print $2}')
if [[ -z ${KILLED_PID} ]]; then
printf "%s\n" "$(success)"
else
printf "%s\n" "$(failure)"
result=$((${result}+1))
fi
rm -f ${run_instance} &> /dev/null
done
return ${result}
}
iotagent_status()
{
local result=0
local iotagent_instance=${1}
if [[ -z ${iotagent_instance} ]]; then
list_run_instances="/var/run/iot/iotagent_*.pid"
else
list_run_instances="/var/run/iot/iotagent_${iotagent_instance}.pid"
fi
if [[ $(ls -l ${list_run_instances} 2> /dev/null | wc -l) -eq 0 ]]; then
printf "%s\n" "There aren't any instance of IoTAgent ${iotagent_instance} running."
return 1
fi
for run_instance in ${list_run_instances}
do
local NAME
NAME=${run_instance%.pid}
NAME=${NAME#*iotagent_}
printf "%s\n" "IoTAgent ${NAME} status..."
status -p ${run_instance} ${NODE_EXEC}
result=$((${result}+${?}))
done
return ${result}
}
case ${PARAM} in
'start')
iotagent_start ${INSTANCE}
;;
'stop')
iotagent_stop ${INSTANCE}
;;
'restart')
iotagent_stop ${INSTANCE}
iotagent_start ${INSTANCE}
;;
'status')
iotagent_status ${INSTANCE}
;;
esac
And the logs file are in /tmp/ :
IoTAgent-IoTPlatform.log
IoTAgent.log
IoTAgent-Manager.log
Hope this helps you.

creating ipa file using command line with code signing

I am trying to create an ipa file using xcode command line including signing.
i tried searching for it, i got the commands to create ipa with out code signing.
i need the commands mainly to integrate with hudson CI.
Please suggest.
-Prahasa
This is the script which I use to integrate with Hudson and my iPhone Apps.
#!/bin/sh
CONFIGURATION="AdHoc" # or Release or Debug
# location of files included in dist (.mobileprovision, iTunesArtwork, README)
DISTDIR="_distfiles"
. build.config
MARKETING_VERSION=`agvtool what-marketing-version -terse1`
build_xcode ()
{
xcodebuild -configuration "$CONFIGURATION" -sdk $SDK
}
# CONFIGURATION for xcode build can be overridden from commandline
NEWCONFIG="$1"
if ! test "$NEWCONFIG"x = x; then
echo "=== using configuration from command line $NEWCONFIG"
CONFIGURATION="$NEWCONFIG"
fi
# XCODE check build available for specified configuration
CHECKCONFIGURATION=`xcodebuild -list | egrep "$CONFIGURATION($|\ )"`
if test "$CHECKCONFIGURATION"x = x; then
echo "ERROR: xcodebuild could not find valid build configuration $CONFIGURATION"
echo
xcodebuild -list
echo
exit
fi
VERSION="$MARKETING_VERSION ($BUILD_NUMBER)"
#######
echo "=== Building distribution package for $RELEASE - $VERSION"
echo "=== setting build number to $BUILD_NUMBER"
agvtool new-version -all "${BUILD_NUMBER}"
# XCODE make sure buildpath exists for configuration, build if missing
BUILDPATH="build/$CONFIGURATION-iphoneos"
build_xcode
if [ $? != 0 ]; then
echo "ERROR: xcodebuild not successful"
exit 1
fi
if test ! -d "$BUILDPATH"; then
echo "ERROR: xcodebuild could not build configuration $CONGIRUATION ($BUILDPATH)"
exit
fi
echo "=== Successfully built configuration $CONFIGURATION ($BUILDPATH)"
# HACK : accomodate configurations with spaces, chdir to determine app name
cd "$BUILDPATH"
# derive name of .app dir (application)
APPDIR=`ls -d *.app`
cd ../..
APPPATH="$BUILDPATH/$APPDIR"
DSYMPATH="$BUILDPATH/$APPDIR.dSYM"
if test "$APPDIR"x = x; then
APPPATH="$BUILDPATH/.app"
fi
# XCODE make sure app dir exists in buildpath, build if missing
if test ! -d "$APPPATH"; then
echo "missing $APPPATH build in $BUILDPATH, trying to build"
build_xcode
# HACK : accomodate configurations with spaces, chdir to determine app name
cd "$BUILDPATH"
# derive name of .app dir (application)
APPDIR=`ls -d *.app`
cd ../..
# check again for APPDIR/APPPATH
APPPATH="$BUILDPATH/$APPDIR"
if test "$APPDIR"x = x; then
APPPATH="$BUILDPATH/.app"
fi
if test ! -d "$APPPATH"; then
echo "ERROR: xcodebuild could not build $APPPATH configuration $CONGIRUATION ($BUILDPATH)"
exit
fi
echo "=== Successfully built $APPDIR configuration $CONFIGURATION ($BUILDPATH)"
fi
# Create directory for release package
echo " - Creating release dir"
RELEASEDIR="$RELEASEBASE/$RELEASE-$CONFIGURATION-$MARKETING_VERSION-$BUILD_NUMBER"
mkdir -p "$RELEASEDIR"
echo "RELEASEDIR = $RELEASEDIR"
echo "BUILDPATH = $BUILDPATH"
echo "APPPATH = $APPPATH"
echo "DSYMPATH = $APPPATH"
# Copy other files
cp $DISTDIR/* "$RELEASEDIR"
# .IPA file: iphone app archive file, installable by itunes
IPA=`echo $APPDIR | sed "s/\.app/\.ipa/"`
echo " - Creating $IPA payload"
mkdir -p "$RELEASEDIR/Payload/"
echo " - Copying $APPPATH to $RELEASEDIR/Payload/"
# Copy built .app to payload/ itunes-specific install dir
cp -Rp "$APPPATH" "$RELEASEDIR/Payload/"
# Build .IPA file
# this is just a zipfile with a payload/ dir with the .app, and artwork
cd "$RELEASEDIR"
# include 512x512 png of artwork, if foudn
if test -f "iTunesArtwork"; then
zip -y -r "$IPA" iTunesArtwork Payload/
rm -rf Payload iTunesArtwork
else
zip -y -r "$IPA" Payload/
rm -rf Payload
fi
cd ..
pwd
# Create .zip packaged Distribution
ZIPFILE="$RELEASE-$CONFIGURATION-$MARKETING_VERSION-$BUILD_NUMBER.zip"
DSYMZIPFILE="$RELEASE-$CONFIGURATION-$MARKETING_VERSION-$BUILD_NUMBER-dSYM.zip"
echo " - zipfile is $ZIPFILE"
echo " - Compressing release $ZIPFILE"
zip -y -r "$ZIPFILE" "$RELEASE-$CONFIGURATION-$MARKETING_VERSION-$BUILD_NUMBER"
cp -pR "../$DSYMPATH" "$RELEASE-$CONFIGURATION-$MARKETING_VERSION-$BUILD_NUMBER"
echo " - creating zip of dSYM file"
zip -y -r "$DSYMZIPFILE" "$RELEASE-$CONFIGURATION-$MARKETING_VERSION-$BUILD_NUMBER/$APPDIR.dSYM"
cd ..
echo "=== Build complete for $RELEASEBASE/$ZIPFILE"
Then, my hudson configuration looks like this:
./build.sh AdHoc
./build.sh Release
Finally, my files to archive looks like this:
_release/MobilePracticePro-*-${BUILD_NUMBER}*.zip
Hope this is helpful to you! Using Hudson is really great. Also, realize your signing key needs to be installed on the same box as hudson runs and running as same user. At least that is how it is for me.
I have been facing the same issue and resolved by using the steps give in the details of the link Xcode "Build and Archive" from command line