| (2 intermediate revisions not shown) | |||
| Line 14: | Line 14: | ||
* If your host is MeeGo, you need to install one more package 'perl-XML-Parser' | * If your host is MeeGo, you need to install one more package 'perl-XML-Parser' | ||
| + | |||
| + | zypper install build perl-XML-Parser | ||
| + | |||
=== Setup === | === Setup === | ||
| Line 35: | Line 38: | ||
<pre> | <pre> | ||
cd /usr/lib/build/configs | cd /usr/lib/build/configs | ||
| + | # To get the meego-1.2 conf | ||
| + | sudo wget http://stskeeps.subnetmask.net/meego-1.2.conf | ||
sudo ln -sf meego-1.2.conf default.conf | sudo ln -sf meego-1.2.conf default.conf | ||
</pre> | </pre> | ||
| Line 44: | Line 49: | ||
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 | 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 | ||
| + | |||
| + | If you are building MeeGo packages on same MeeGo version you may already have the key, in which case importing will fail. | ||
<pre> | <pre> | ||
| Line 50: | Line 57: | ||
$ rpm --import ./etc/pki/rpm-gpg/RPM-GPG-KEY-meego02 | $ rpm --import ./etc/pki/rpm-gpg/RPM-GPG-KEY-meego02 | ||
</pre> | </pre> | ||
| - | |||
=== Build a package === | === Build a package === | ||
| Line 176: | Line 182: | ||
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 key import failed=== | ||
| + | |||
| + | If you are running the instructions on same version of MeeGo as the repository you are trying to build from, you probably already have the GPG key. In this case trying to import it again will fail but won't say why. | ||
== 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.
zypper install build perl-XML-Parser
After you install it, you can run “build –help” to get help info. You need to 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 # To get the meego-1.2 conf sudo wget http://stskeeps.subnetmask.net/meego-1.2.conf 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
If you are building MeeGo packages on same MeeGo version you may already have the key, in which case importing will fail.
$ 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/.
If you meet below error, please import GPG key first, if the issue still exist and you are using Ubuntu10.04, 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
Steps to fix: 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
3. comment out 10.10 repo to avoid upgrade other packages
You may have such issue when using 'build' to create a armv7l rpm package, please see detailed solution for the distro
Try command:'file /usr/bin/qemu-arm', and its output should show "statically linked", if not, you can re-install the qemu package(the package maybe changes, you can go the web address to get it, then install it).
$file /usr/bin/qemu-arm $sudo rpm -i http://download.opensuse.org/repositories/home:/dl9pf:/qemu/Fedora_12/i386/qemu-devel-0.13git2010.06.24.1826-8.1.i386.rpm
Please install 'qemu-arm-static'
$sudo apt-get install qemu-arm-static
Please 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 are running the instructions on same version of MeeGo as the repository you are trying to build from, you probably already have the GPG key. In this case trying to import it again will fail but won't say why.