[opensuse-buildservice] questions re: creating & building minimal project/spec file
I'm working on a local osc build, exploring minimal spec file & build process for an eventual, intended, local obs install. On local machine, atm, my test-project dir contains only tree "home:pgnd:usrlocal-stack"/ home:pgnd:usrlocal-stack/ └── openssl ├── openssl-1.0.2a.tar.gz └── openssl.spec 1 directory, 2 files The rudimentary spec is cat openssl.spec %define basepkgname openssl Name: %{basepkgname}-local Version: 1.0.2a Release: 1 Summary: openssl test License: https://www.openssl.org/source/license.html Group: Productivity/Networking/Security Url: https://www.openssl.org/ Source: https://www.%{basepkgname}.org/source/%{basepkgname}-%{version}.tar.gz Provides: ssl-local BuildRequires: bc BuildRequires: ed BuildRequires: patchelf BuildRequires: pkg-config BuildRequires: zlib-devel BuildRoot: /tmp/%{basepkgname}-%{version}-build %description openssl test %prep %setup -q %build find -type f -name "*.c" -exec sed -i -e 's|getenv|secure_getenv|g' {} + ./config -DHAVE_CRYPTODEV -DUSE_CRYPTODEV_DIGESTS --openssldir=/opt/ssl --libdir=lib64 threads shared enable-ec_nistp_64_gcc_128 enable-rfc3779 make depend make %install make install DESTDIR="%buildroot" %clean %post %postun %files %changelog On exec of build, with rpm deps already cached, osc build --noinit openSUSE_13.2 x86_64 openssl.spec Building openssl.spec for openSUSE_13.2/x86_64 Use local '/home/pgnd/obs/home:pgnd:usrlocal-stack/openssl/.osc/_buildinfo-openSUSE_13.2-x86_64.xml' file as buildinfo Use local '/home/pgnd/obs/home:pgnd:usrlocal-stack/openssl/.osc/_buildconfig-openSUSE_13.2-x86_64' file as buildconfig Updating cache of required packages 0.0% cache miss. 103/103 dependencies cached. Verifying integrity of cached packages using keys from openSUSE:13.2 Writing build configuration Running build logging output to /var/tmp/build-root/openSUSE_13.2-x86_64/.build.log... [ 0s] Memory limit set to 33093592KB [ 0s] Using BUILD_ROOT=/var/tmp/build-root/openSUSE_13.2-x86_64 [ 0s] Using BUILD_ARCH=x86_64:i686:i586:i486:i386 [ 0s] [ 0s] [ 0s] desk.loc started "build openssl.spec" at Fri Apr 24 17:05:39 UTC 2015. [ 0s] [ 0s] [ 0s] processing recipe /home/pgnd/obs/home:pgnd:usrlocal-stack/openssl/openssl.spec ... [ 0s] running changelog2spec --target rpm --file /home/pgnd/obs/home:pgnd:usrlocal-stack/openssl/openssl.spec [ 1s] ----------------------------------------------------------------- [ 1s] ----- building openssl.spec (user abuild) [ 1s] ----------------------------------------------------------------- [ 1s] ----------------------------------------------------------------- [ 1s] + exec rpmbuild -ba --define '_srcdefattr (-,root,root)' --nosignature /usr/src/packages/SOURCES/openssl.spec [ 1s] Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.ZLrbSJ [ 1s] + umask 022 [ 1s] + cd /usr/src/packages/BUILD [ 1s] + cd /usr/src/packages/BUILD [ 1s] + rm -rf openssl-local-1.0.2a [ 1s] + /usr/bin/gzip -dc /usr/src/packages/SOURCES/openssl-1.0.2a.tar.gz [ 1s] + /bin/tar -xf - [ 2s] + STATUS=0 [ 2s] + '[' 0 -ne 0 ']' [ 2s] + cd openssl-local-1.0.2a [ 2s] /var/tmp/rpm-tmp.ZLrbSJ: line 34: cd: openssl-local-1.0.2a: No such file or directory [ 2s] error: Bad exit status from /var/tmp/rpm-tmp.ZLrbSJ (%prep) [ 2s] [ 2s] [ 2s] RPM build errors: [ 2s] Bad exit status from /var/tmp/rpm-tmp.ZLrbSJ (%prep) The buildroot was: /var/tmp/build-root/openSUSE_13.2-x86_64 Couple of questions, (1) The osc build cmd line specifies build target & arch, osc build --noinit openSUSE_13.2 x86_64 openssl.spec The build, however appears to use multiple arches [ 0s] Using BUILD_ARCH=x86_64:i686:i586:i486:i386 Why? (2) The spec file defines build root, BuildRoot: /tmp/%{basepkgname}-%{version}-build but, the build uses, instead, [ 0s] Using BUILD_ROOT=/var/tmp/build-root/openSUSE_13.2-x86_64 Why? (3) The build fails @ %prep [ 2s] /var/tmp/rpm-tmp.ZLrbSJ: line 34: cd: openssl-local-1.0.2a: No such file or directory [ 2s] error: Bad exit status from /var/tmp/rpm-tmp.ZLrbSJ (%prep) Is %setup -q not appropriate? Or is the .tar.gz not properly handled? -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-buildservice+owner@opensuse.org
PGNd
(3) The build fails @ %prep
[ 2s] /var/tmp/rpm-tmp.ZLrbSJ: line 34: cd: openssl-local-1.0.2a: No such file or directory [ 2s] error: Bad exit status from /var/tmp/rpm-tmp.ZLrbSJ (%prep)
Is
%setup -q
not appropriate? Or is the .tar.gz not properly handled?
%setup (without -n) assumes that the tarfile extracts to a directory that is %{name}-%{version}. Since you have used %{basepkgname}-local for the Name tag, this won't match what openssl-1.0.2a.tar.gz uses as its toplevel directory. Andreas. -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different." -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-buildservice+owner@opensuse.org
not appropriate? Or is the .tar.gz not properly handled?
On Fri, Apr 24, 2015, at 10:43 AM, Dmitriy Perlow wrote:
The final command of `%setup -q` is `cd %name-%version`, please add a top level directory or modify %setup: http://www.rpm.org/max-rpm/s1-rpm-inside-macros.html
On Fri, Apr 24, 2015, at 10:38 AM, Andreas Schwab wrote:
%setup (without -n) assumes that the tarfile extracts to a directory that is %{name}-%{version}. Since you have used %{basepkgname}-local for the Name tag, this won't match what openssl-1.0.2a.tar.gz uses as its toplevel directory.
Exactly what's needed; my source & build locations are sorted. Thanks. I need to add specific repo dependencies for use in my build. For this test case, I'm building for target openSUSE_13.2/x86_64, but want to use specific pkgs for dependencies, from specific repos, not the 13.2 base. Questions re: two instances, (1) I need to build a cryptodev package as a prereq. It'll source both some include files for this openssl, and a kernel module. I'll publish both my cryptodev and openssl pkgs in the same OBS subproject. In the openssl.spec is it sufficient to 'require cryptdev', so that the LOCAL-to-the-subproject pkg is always used/referenced? (2) For the kernel-module, I want it built against sources from the KernelStable repos. I added BuildRequires: kernel-desktop-devel to the spec, and added Kernel_stable_standard to my porject's "Repositories of home:pgnd:usrlocal-stack" but at build, it sources from 13.2 repos, not from KernelStable (openSUSE:13.2) kernel-default-devel- 100% |==================| 2.5 MB 00:11 (openSUSE:13.2) kernel-devel-3.16.6-2 100% |==================| 10 MB 00:17 (openSUSE:13.2) kernel-macros-3.16.6- 100% |==================| 515 kB 00:00 What's the syntax in an osc build project to force preference of a pkg dep from a different/specific repo? -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-buildservice+owner@opensuse.org
PGNd
Questions re: two instances,
(1) I need to build a cryptodev package as a prereq. It'll source both some include files for this openssl, and a kernel module.
I'll publish both my cryptodev and openssl pkgs in the same OBS subproject.
In the openssl.spec is it sufficient to 'require cryptdev', so that the LOCAL-to-the-subproject pkg is always used/referenced?
It should be sufficient. But may be cryptodev-devel?..
(2) For the kernel-module, I want it built against sources from the KernelStable repos.
I added
BuildRequires: kernel-desktop-devel
to the spec, and added
Kernel_stable_standard to my porject's "Repositories of home:pgnd:usrlocal-stack"
but at build, it sources from 13.2 repos, not from KernelStable
(openSUSE:13.2) kernel-default-devel- 100% |==================| 2.5 MB 00:11 (openSUSE:13.2) kernel-devel-3.16.6-2 100% |==================| 10 MB 00:17 (openSUSE:13.2) kernel-macros-3.16.6- 100% |==================| 515 kB 00:00
What's the syntax in an osc build project to force preference of a pkg dep from a different/specific repo?
The different build target was added to your home subproject not a 13.2 target extension. So you should build against Kernel_stable_standard not openSUSE_13.2 or merge them at https://build.opensuse.org/project/meta/home:pgnd:usrlocal-stack f.e.: <repository name="openSUSE_13.2"> <path project="Kernel:stable" repository="standard"/> <path project="openSUSE:13.2" repository="standard"/> <arch>x86_64</arch> </repository> I don't really remember if "openSUSE:13.2" has to be strictly at the bottom of list. -- Best regards, Dmitriy DA(P).DarkneSS Perlow @ Linux x64 -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-buildservice+owner@opensuse.org
On Fri, Apr 24, 2015, at 01:21 PM, Dmitriy Perlow wrote:
In the openssl.spec is it sufficient to 'require cryptdev', so that the LOCAL-to-the-subproject pkg is always used/referenced?
It should be sufficient. But may be cryptodev-devel?..
Good point. Thanks. I'm also considering separately namespacing my pkgs. They'll sometimes be parallel-installed with similar pkgs from distibution. In my case, e.g., then pkg name == pngd-openssl rather than pkg name == openssl On a local obs-instance I can of course do what I choose. I don't yet know what policy, if any, exists on online-OBS. Are there any guidelines or restrictions on namespacing at @obs? Iiuc, publishing within a home:<user> project serves as sufficient isolation -- with appropriate warnings -- from mistaken public use, but does not necessarily cleanly avoid collisions when used. In particular, are lsb namespaces guidelines and registration, per LANANA (http://www.lanana.org/lsbreg/instructions.html) mandated?
What's the syntax in an osc build project to force preference of a pkg dep from a different/specific repo?
The different build target was added to your home subproject not a 13.2 target extension. So you should build against Kernel_stable_standard not openSUSE_13.2 or merge them at https://build.opensuse.org/project/meta/home:pgnd:usrlocal-stack f.e.: <repository name="openSUSE_13.2"> <path project="Kernel:stable" repository="standard"/> <path project="openSUSE:13.2" repository="standard"/> <arch>x86_64</arch> </repository>
Understood. Thanks.
I don't really remember if "openSUSE:13.2" has to be strictly at the bottom of list.
Sounds like that implies a possible mechanism of prioritization by list-ordering? Is there perhaps an equivalent to zypper's priority, allowing for discrete, per repo, priority setting in a merged set of repositories to be used in a given OBS project? -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-buildservice+owner@opensuse.org
PGNd
On Fri, Apr 24, 2015, at 01:21 PM, Dmitriy Perlow wrote:
In the openssl.spec is it sufficient to 'require cryptdev', so that the LOCAL-to-the-subproject pkg is always used/referenced?
It should be sufficient. But may be cryptodev-devel?..
Good point. Thanks.
I'm also considering separately namespacing my pkgs. They'll sometimes be parallel-installed with similar pkgs from distibution.
In my case, e.g., then
pkg name == pngd-openssl
rather than
pkg name == openssl
On a local obs-instance I can of course do what I choose. I don't yet know what policy, if any, exists on online-OBS.
Are there any guidelines or restrictions on namespacing at @obs? Iiuc, publishing within a home:<user> project serves as sufficient isolation -- with appropriate warnings -- from mistaken public use, but does not necessarily cleanly avoid collisions when used.
In particular, are lsb namespaces guidelines and registration, per LANANA (http://www.lanana.org/lsbreg/instructions.html) mandated?
https://en.opensuse.org/Portal:Build_Service https://en.opensuse.org/Portal:Packaging https://en.opensuse.org/Portal:Development I see it like home:username:sub-| |-packagename-| |-packagename.spec-| |-libsonamesoversion |-packagename |-packagename-devel Where packagename is upstream name or executable name if there is only one. Lots of errors and warnings are got usually by new packager, so you could just read and resolve them. NB! Python and other languages require different name scheme. -- Best regards, Dmitriy DA(P).DarkneSS Perlow @ Linux x64 -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-buildservice+owner@opensuse.org
On Fri, Apr 24, 2015, at 01:54 PM, Dmitriy Perlow wrote:
In particular, are lsb namespaces guidelines and registration, per LANANA (http://www.lanana.org/lsbreg/instructions.html) mandated?
https://en.opensuse.org/Portal:Build_Service https://en.opensuse.org/Portal:Packaging https://en.opensuse.org/Portal:Development
I see it like
home:username:sub-| |-packagename-| |-packagename.spec-| |-libsonamesoversion |-packagename |-packagename-devel
Where packagename is upstream name or executable name if there is only one. Lots of errors and warnings are got usually by new packager, so you could just read and resolve them.
Yes, I've seen those already. My understanding was that they speak only to naming withing the home:<user>:etc. hierarchy, but do NOT address namespacing of parallel pkg installs. Perhaps I need to re-read @ those links ... Eg, sticking with my current test case, distribution installs pkg == openssl that gets installed into system-specified, standard locations. I can certainly build & install an unpackaged openssl instance into any non-system location, external to the rpm build system, with no ill effects. I do this regularly. However, If I intend to build/pkg my own instance of openssl.rpm -- with NON SYSTEM install location (e.g., /opt/ssl) I don't think it's wise to name the pkg openssl. Many repos -- including maintenance and update -- of course provide alternate installs for pkgs -- but the majority provide pkg.rpms that override/overwrite the current pkg's system-install. You don't end up with a 2-instance, parallel install. My consideration of the separate pkg namespace is for the specific case of multiple instances. Probably also need to think about the "Provides:" names as well.
NB! Python and other languages require different name scheme.
Understood. -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-buildservice+owner@opensuse.org
PGNd
Couple of questions,
(1) The osc build cmd line specifies build target & arch,
osc build --noinit openSUSE_13.2 x86_64 openssl.spec
The build, however appears to use multiple arches
[ 0s] Using BUILD_ARCH=x86_64:i686:i586:i486:i386
Why?
Please just don't mention it, you'll get x86_64 packages only via this command line.
(2) The spec file defines build root,
BuildRoot: /tmp/%{basepkgname}-%{version}-build
but, the build uses, instead,
[ 0s] Using BUILD_ROOT=/var/tmp/build-root/openSUSE_13.2-x86_64
Why?
OBS overwrites this variable, please don't use it and setup osc to another local directory or make links, loops mounts etc.
(3) The build fails @ %prep
[ 2s] /var/tmp/rpm-tmp.ZLrbSJ: line 34: cd: openssl-local-1.0.2a: No such file or directory [ 2s] error: Bad exit status from /var/tmp/rpm-tmp.ZLrbSJ (%prep)
Is
%setup -q
not appropriate? Or is the .tar.gz not properly handled?
The final command of `%setup -q` is `cd %name-%version`, please add a top level directory or modify %setup: http://www.rpm.org/max-rpm/s1-rpm-inside-macros.html -- Best regards, Dmitriy DA(P).DarkneSS Perlow @ Linux x64 -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-buildservice+owner@opensuse.org
participants (3)
-
Andreas Schwab
-
Dmitriy Perlow
-
PGNd