#!/bin/sh## Name: build.linux## The build.linux script is likely to work in other Unices although# it was not tested.#############################################################################echo"***"echo"*** Prepare environment from scratch"echo"***"#### You probably want to edit these variables if you think they do not# match your system installationexportSOURCE=`pwd`exportPATH=$PATH:`pwd`/../../../BUILD/dist/usr/bin
exportLD_LIBRARY_PATH=`pwd`/../../../BUILD/dist/usr/lib
exportVERSION=1.2.8
exportARCH=amd64
exportREPOSITORY_PATH=$(pwd)/repo
#### The script always starts from the beginning, just comment out# parts if you do not want to lose all and rebuild all, although# compile the z library is generally fast
rm -rf BUILD
#### This rm is commented out by default because it should not be in# effect; we use it when we use the --debug 0100 to keep the temporary# files and thus to avoid seeing entries from older runs
rm -rf /tmp/wpkg-*
#### Create a BUILD directory with:# install -- installation directory to install the source to compile# and its dependencies
mkdir -p BUILD/install/var/lib/wpkg
#### Create an empty repository
mkdir "$REPOSITORY_PATH"#### Create an installation environment, used to do the build and test the# installation.#
wpkg --root $SOURCE/BUILD/install --create-admindir admindir.control
############################################################################echo"***"echo"*** Build source package (a .deb with the source tarball)"echo"***"#### Create a source package with wpkg; change the PATH at the top# to include the location where you have wpkg compiled unless# you installed it and it already is in your path.## Use "--build" without a directory or .deb filename to build source.## Add "--debug 0100" to keep the temporary files when wpkg exists.#cd zlib
wpkg --field-variables VERSION=$VERSION --build --output-repository-dir "$REPOSITORY_PATH"cd ..
############################################################################echo"***"echo"*** Build binary package"echo"***"#### Create a binary package with wpkg
wpkg --build ./toto --output-repository-dir "$REPOSITORY_PATH"############################################################################echo"***"echo"*** Install binary package (using the .deb file)"echo"***"
wpkg --root $SOURCE/BUILD/install --install "$REPOSITORY_PATH/wpkg/toto_0.1.0_linux-amd64.deb"############################################################################echo"***"echo"*** Build binary package (a .deb using the source .deb file)"echo"***"#### Now build the package by compiling all the sources in the repository.## We could also build just that one package by specify the source .deb# file as in:## wpkg --build "$$REPOSITORY_PATH/sources/zlib-src_1.2.8.deb"## You would also need to specify the --output-repository-dir option in# this case.## Add "--debug 0100" to keep the temporary files when wpkg exists.#
wpkg --build "$REPOSITORY_PATH" --root $SOURCE/BUILD/install
And the result (last lines of log):
-- Install configuration: ""
-- Installing: /tmp/wpkg-31061/install/runtime/lib/libz.so.1.2
-- Installing: /tmp/wpkg-31061/install/runtime/lib/libz.so.1
-- Installing: /tmp/wpkg-31061/install/runtime/lib/libz.so
-- Install configuration: ""
-- Installing: /tmp/wpkg-31061/install/documentation/share/man/zlib.3
-- Installing: /tmp/wpkg-31061/install/documentation/share/doc/zlib/zlib.3.pdf
-- Installing: /tmp/wpkg-31061/install/documentation/share/doc/zlib/README
-- Installing: /tmp/wpkg-31061/install/documentation/share/doc/zlib/FAQ
-- Install configuration: ""
-- Installing: /tmp/wpkg-31061/install/development/include/zconf.h
-- Installing: /tmp/wpkg-31061/install/development/include/zlib.h
-- Installing: /tmp/wpkg-31061/install/development/share/pkgconfig/zlib.pc
wpkg:info: 2016/05/01 16:18:09: [package:zlib] building package "zlib" (build-package)
wpkg:info: 2016/05/01 16:18:09: [package:zlib-doc] building package "zlib-doc" (build-package)
wpkg:info: 2016/05/01 16:18:09: [package:zlib-dev] building package "zlib-dev" (build-package)
wpkg:error: 2016/05/01 16:18:09: [package:zlib-src] package "zlib-src" is not installed and thus it cannot be removed, purged, or deconfigured. (2) (validate-removal)
wpkg:error: 2016/05/01 16:18:09: [package:zlib-src] package "zlib-src" is not installed and thus it cannot be removed, purged, or deconfigured. (2) (validate-removal)
wpkg --create-index /home/schroeterm/devel/unigw-master/wpkg/samples/sample7/repo/index.tar.gz --recursive --repository /home/schroeterm/devel/unigw-master/wpkg/samples/sample7/repo
wpkg:info: 2016/05/01 16:18:09: add package "sources/zlib-src_1.2.8.ctrl" to this repository index file. (repository)
wpkg:info: 2016/05/01 16:18:09: add package "wpkg/zlib_1.2.8_amd64.ctrl" to this repository index file. (repository)
wpkg:info: 2016/05/01 16:18:09: add package "wpkg/zlib-doc_1.2.8_amd64.ctrl" to this repository index file. (repository)
wpkg:info: 2016/05/01 16:18:09: add package "wpkg/toto_0.1.0_linux-amd64.ctrl" to this repository index file. (repository)
wpkg:info: 2016/05/01 16:18:09: add package "wpkg/zlib-dev_1.2.8_amd64.ctrl" to this repository index file. (repository)
wpkg:info: 2016/05/01 16:18:09: finalizing output file. (repository)
wpkg:error: 2016/05/01 16:18:09: [package:zlib-src] system("wpkg --root /home/schroeterm/devel/unigw-master/wpkg/samples/sample7/BUILD/install --instdir /home/schroeterm/devel/unigw-master/wpkg/samples/sample7/BUILD/install --admindir /home/schroeterm/devel/unigw-master/wpkg/samples/sample7/BUILD/install/var/lib/wpkg --build /home/schroeterm/devel/unigw-master/wpkg/samples/sample7/repo/sources/zlib-src_1.2.8.deb --output-repository-dir /home/schroeterm/devel/unigw-master/wpkg/samples/sample7/repo --repository /home/schroeterm/devel/unigw-master/wpkg/samples/sample7/repo --create-index index.tar.gz --force-file-info --run-unit-tests --make-tool make --debug 0") called returned 256 (run-script)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have something else I'm trying to finish and will come back to this later. Many things went on at some point last year and many things may not work exactly as before. Also quite a few things were fixed too.
Thank you for your reports.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
With the current HEAD, there is a major regression with the build of a source repository.
The -src packages are no longer removed if at least one package was already installed in the --root.
I've hacked the sample7 in order to reproduce the problem. It's easy.. see the attached archive.
The main script:
And the result (last lines of log):
Juste decompress this archive in
unigw-master/wpkg/samples/
then run./build.linux
,IMHO it's broken since cbaf9ef36252d99d96e53836a60ca930d643026a but I'm not 100% sure.
Hi Matthieu,
I have something else I'm trying to finish and will come back to this later. Many things went on at some point last year and many things may not work exactly as before. Also quite a few things were fixed too.
Thank you for your reports.
Note that I use every days (on win, linux and darwin) the version 1.0.2. It's the best one. I've problems only since the version 1.0.3.