(→Building your package using build) |
(→Troubleshooting (ARM)) |
||
| Line 95: | Line 95: | ||
binary RPM package can be found in /var/tmp/build-root/home/abuild/rpmbuild/RPMS/. | binary RPM package can be found in /var/tmp/build-root/home/abuild/rpmbuild/RPMS/. | ||
| - | == Troubleshooting | + | == Troubleshooting == |
=== Exec format error === | === Exec format error === | ||
| Line 118: | Line 118: | ||
===chroot: cannot run command `rpm'=== | ===chroot: cannot run command `rpm'=== | ||
| - | |||
when build a armv7l rpm,modify /usr/lib/build/build and /usr/lib/build/configs/meego-1.0.conf ,change armv7el to armv7l in these files,maybe /usr/lib/build/Build.pm also need change. | when build a armv7l rpm,modify /usr/lib/build/build and /usr/lib/build/configs/meego-1.0.conf ,change armv7el to armv7l in these files,maybe /usr/lib/build/Build.pm also need change. | ||
If problem persist, see [https://bugs.meego.com/show_bug.cgi?id=18905 bug 18905] | If problem persist, see [https://bugs.meego.com/show_bug.cgi?id=18905 bug 18905] | ||
| + | |||
| + | |||
| + | === rpm verify failed in Ubuntu 10.04 === | ||
| + | If you meet below error, you may have a try to workaround the issue by installing the "rpm" package for 10.10, there seems to be a bug for "rpm" in 10.04 which fails to verify package signature. | ||
| + | "downloading http://linux-ftp.jf.intel.com/pub/mirrors/MeeGo/releases/1.2.0/repos/oss/ia32/packages/noarch/autoconf-2.68-1.3.noarch.rpm ... | ||
| + | rpm verify failed" | ||
| + | |||
| + | 1. add 10.10 repo to /etc/apt/sources.list | ||
| + | deb http://cn.archive.ubuntu.com/ubuntu/ maverick main restricted | ||
| + | deb http://cn.archive.ubuntu.com/ubuntu/ maverick-updates main restricted | ||
| + | |||
| + | 2. remove old rpm and install new one | ||
| + | $ sudo apt-get update | ||
| + | $ sudo apt-get remove rpm | ||
| + | $ sudo apt-get install rpm | ||
== Another language version of this page == | == Another language version of this page == | ||
* [[不需要obs的本地build-_简体中文]] | * [[不需要obs的本地build-_简体中文]] | ||
This page is for people who want to avoid any connection with any OBS backend - ie "as raw as possible".
If you simply want to do a local build then you probably want "osc build" which does almost everything for you. see Build_Infrastructure/Packagers_Developers
Contents |
A more convenient package build way is to use 'build' which is a project from OpenSUSE, MeeGo build infrastructure used it.
You can get build binary package from http://repo.meego.com/MeeGo/tools/repos/ per your Linux distribution, if your Linux distribution isn't there, you can get build source package from http://www.gitorious.org/opensuse/build to build it yourself manually.
After you install it ( I suppose you know how to install a package on your Linux), you can run “build –help” to get help info.
You must run build as root. If your network needs proxy, please export proxy environment variables, for example:
export http_proxy=http://proxy.yourcompany.com:8080/ export no_proxy=localhost,127.0.0.0/8,.yourcompany.com, 172.16.0.0/16
If you used to run “sudo build …” and your network needs proxy, please ensure sudo to inherit proxy environment variables, you can do this by adding the below line to /etc/sudoers
Defaults env_keep += "http_proxy no_proxy HTTP_PROXY NO_PROXY"
You may also need to set correct default distro target, or use the "build --dist=/usr/lib/build/configs/meego-1.1.conf" option:
cd /usr/lib/build/configs sudo ln -sf meego-1.2.conf default.conf
build also will check rpm package signature, so you must import public key of repository you're using, for example:
For http://repo.meego.com/MeeGo/releases/1.2.0/repos/oss/ia32/packages
You can get its public key for http://repo.meego.com/MeeGo/releases/1.2.0/repos/oss/ia32/packages/noarch/meego-release-1.2.0-2.1.noarch.rpm
$ wget http://repo.meego.com/MeeGo/releases/1.2.0/repos/oss/ia32/packages/noarch/meego-release-1.2.0-2.1.noarch.rpm $ rpm2cpio meego-release-1.2.0-2.1.noarch.rpm | cpio -idmv $ rpm --import ./etc/pki/rpm-gpg/RPM-GPG-KEY-meego02
This command will build a cpio binary package for MeeGo.
build --repository http://repo.meego.com/MeeGo/releases/1.2.0/repos/oss/ia32/packages/ --arch i686 cpio-2.11-2.6.src.rpm
Optionally, you also can use spec file to build it, for this case, build will find your source tar ball and patches under current work dir.
build --repository http://repo.meego.com/MeeGo/releases/1.2.0/repos/oss/ia32/packages/ --arch i686 cpio.spec
build will base your repo URL to cache your repo, so please use the same URL string for the same repo every time (URL with / at the end of it and the same URL without / at the end of it will result in different cache dirs), you can use multiple --repository options to specify multiple repos, for example:
build --repository http://repo.meego.com/MeeGo/builds/trunk/preview/core/repos/ia32/packages/ \
--repository http://repo.meego.com/MeeGo/builds/trunk/preview/netbook/repos/ia32/packages/ \
--arch i686 cpio-2.11-2.meego.src.rpm
The default cache dir is /var/cache/build, you can use option –cachedir to set to other dir.
The default BUILDROOT dir is /var/tmp/build-root, you can use --root option to specify one more dir, once build is done, you can get your binary package in BUILDROOT, for example:
... Wrote: /home/abuild/rpmbuild/SRPMS/cpio-2.11-2.meego.src.rpm Wrote: /home/abuild/rpmbuild/RPMS/i586/cpio-2.11-2.meego.i586.rpm Wrote: /home/abuild/rpmbuild/RPMS/i586/cpio-debuginfo-2.11-2.meego.i586.rpm ...
Your cpio binary package is /var/tmp/build-root/home/abuild/rpmbuild/RPMS/i586/2.11-2.meego.i586.rpm
If you want to modify packages, such as add/modify/remove patches, you need unpack src.rpm first. Then development can be based on source code.
This command would unpack src.rpm to current directory, and your work can be in this directory.
rpm2cpio XXX.src.rpm | cpio -idmv
Once you development work is done, you can use ‘build’ command to generate new RPM based on you changes. Command as follows:
build --repository http://YYY/repos/oss/ia32/packages/ --arch i686 XXX.spec
binary RPM package can be found in /var/tmp/build-root/home/abuild/rpmbuild/RPMS/.
Meet this problem :
on fedora13 when using 'build' to create a armv7l rpm package. one of reasons: maybe 'qemu-arm' is not right set. Try command:'file /usr/bin/qemu-arm' ,and if its output show 'dynamically linked',and the problem maye is here,and it should be 'statically linked'.you can use commands 'rpm -i http://download.opensuse.org/repositories/home:/dl9pf:/qemu/Fedora_12/i386/qemu-devel-0.13git2010.06.24.1826-8.1.i386.rpm' (the package maybe changes,so you can go the web address to get it ,then install it )to reinstall this part, and maybe you will meet some problem because of its dependencies ,and you can uninstall all of them first.
on ubuntu10.04,you should install 'qemu-arm-static',use command:apt-get install qemu-arm-static
On Debian, you should install 'qemu-user-static' from Squeeze (Debian 6.0) and later.
This problem on ubuntu 10.04 when using 'build' to create a i686 rpm package. Error:rpm: error while loading shared libraries: liblua-5.1.so: cannot open shared object file: No such file or directory Please modify the /usr/lib/build/configs/default.conf in preinstall section add liblua.--Kismeter 15:02, 2 December 2010 (UTC)
This problem on Ubuntu 10.04 when using 'build' to create a i586 package. Please Use build --repository http://repo.meego.com/MeeGo/builds/xxx/core/repos/ia32/packages/ --arch i686 xxxx.src.rpm The arch must be i686.
when build a armv7l rpm,modify /usr/lib/build/build and /usr/lib/build/configs/meego-1.0.conf ,change armv7el to armv7l in these files,maybe /usr/lib/build/Build.pm also need change. If problem persist, see bug 18905
If you meet below error, you may have a try to workaround the issue by installing the "rpm" package for 10.10, there seems to be a bug for "rpm" in 10.04 which fails to verify package signature. "downloading http://linux-ftp.jf.intel.com/pub/mirrors/MeeGo/releases/1.2.0/repos/oss/ia32/packages/noarch/autoconf-2.68-1.3.noarch.rpm ... rpm verify failed"
1. add 10.10 repo to /etc/apt/sources.list deb http://cn.archive.ubuntu.com/ubuntu/ maverick main restricted deb http://cn.archive.ubuntu.com/ubuntu/ maverick-updates main restricted
2. remove old rpm and install new one $ sudo apt-get update $ sudo apt-get remove rpm $ sudo apt-get install rpm