[leafnode-list] leafnode.spec suggestions
Kevin Bulgrien
kbulgrien at att.net
Tue Jul 27 06:09:23 CEST 2010
I have had some trouble modifying the leafnode.spec file to use a different
prefix. Scripts that worked with an older distribution seem to not work as
well now. The problem appears to be related to rpmbuild environment changes.
When I changed the prefix to /usr/local, all the binaries generated packaging
problems. I think the problem is probably related to auto* tools. It seems
the Makefile.in install*binPROGRAMS scripts do not pick up the prefix change
for some reason, but I did not try to figure out how to fix it at that level.
Example output of rpmbuild:
...
STRIPPROG='strip' /bin/sh /home/admin/operator/pkg/RPM/BUILD/leafnode-2.0.0.alpha20090908a.luascript/install-sh -c -s 'leafnode-version' '/home/admin/operator/pkg/RPM/BUILDROOT/leafnode-2.0.0.alpha20090908a.luascript-0.i386/usr/bin/leafnode-version'
...
Processing files: leafnode-2.0.0.alpha20090908a.luascript-0
error: File not found: /home/admin/operator/pkg/RPM/BUILDROOT/leafnode-2.0.0.alpha20090908a.luascript-0.i386/usr/local/bin/leafnode-version
...
RPM build errors:
File not
found: /home/admin/operator/pkg/RPM/BUILDROOT/leafnode-2.0.0.alpha20090908a.luascript-0.i386/usr/local/bin/leafnode-version
To successfully build an RPM that installs to /usr/local instead of the
default /usr, I had to add the following to the leafnode.spec configure
command, otherwise the binaries did not package properly. I don't know
that this is the "right" way to do it, but it did work.
@@ -48,10 +48,14 @@
--enable-spooldir=%spooldir \
--enable-runas-user=%{runas_user} \
--sysconfdir=%_sysconfdir/leafnode \
+ --sbindir=%_prefix/sbin \
+ --bindir=%_prefix/bin \
--enable-lua
While trying to figure out how to fix the above issue, I ran rpmlint. I am
on Mandriva 2010.1 (Spring), so I do not know if these are universal changes
or distribution specific ones. They were all warnings, so non-critical,
but, probably advisable unless there is an explicit reason to ignore them.
rpmlint did not like the Group. A change like the following removed the
rpmlint warning:
-Group: Productivity/Networking/News/Servers
+Group: Applications/Internet
rpmlint complained about Buildprereq being deprecated, and wanted:
-Buildprereq: lua-devel
+BuildRequires: lua-devel
It did not care for a hardcoded path in the Buildroot, and the warning was
dispensed with by a change like:
-Buildroot: /var/tmp/leafnode-%version-buildroot/
+Buildroot: %{_tmppath}/%{Name}-%{version}-buildroot/
rpmlint did not like the make check in %build. It wanted instead:
+
+%check
make check
I happened to note some end-of-line whitespace that is not critical.
-%doc INSTALL NEWS README README.html README-FQDN.html README-FQDN.pdf
+%doc INSTALL NEWS README README.html README-FQDN.html README-FQDN.pdf
Hope to help.
rpmlint did also complain about a few other things too. I did not note all
the issues above. Here's the output in case it is of interest:
---
$ rpmlint -i leafnode.20090908a.spec
leafnode.20090908a.spec: W: specfile-error error: leafnode.20090908a.spec:21: #%define is forbidden, use #define to comment a %define
leafnode.20090908a.spec: W: specfile-error error: query of specfile leafnode.20090908a.spec failed, can't parse
This error occurred when rpmlint used rpm to query the specfile. The error is
output by rpm and the message should contain more information.
leafnode.20090908a.spec: W: non-utf8-spec-file leafnode.20090908a.spec
The character encoding of the spec file is not UTF-8. Convert it for example
using iconv(1).
leafnode.20090908a.spec:10: W: non-standard-group Productivity/Networking/News/Servers
The value of the Group tag in the package is not valid. Valid groups are:
"Amusements/Games", "Amusements/Graphics", "Applications/Archiving",
"Applications/Communications", "Applications/Databases",
"Applications/Editors", "Applications/Emulators", "Applications/Engineering",
"Applications/File", "Applications/Internet", "Applications/Multimedia",
"Applications/Productivity", "Applications/Publishing", "Applications/System",
"Applications/Text", "Development/Debug", "Development/Debuggers",
"Development/Languages", "Development/Libraries", "Development/System",
"Development/Tools", "Documentation", "System Environment/Base", "System
Environment/Daemons", "System Environment/Kernel", "System
Environment/Libraries", "System Environment/Shells", "User
Interface/Desktops", "User Interface/X", "User Interface/X Hardware Support".
leafnode.20090908a.spec:55: W: make-check-outside-check-section make check
Make check or other automated regression test should be run in %check, as they
can be disabled with a rpm macro for short circuiting purposes.
leafnode.20090908a.spec:28: W: hardcoded-path-in-buildroot-tag /var/tmp/leafnode-%version-buildroot/
A path is hardcoded in your Buildroot tag. It should be replaced by something
like %{_tmppath}/%name-root.
leafnode.20090908a.spec:29: W: hardcoded-packager-tag Matthias
The Packager tag is hardcoded in your spec file. It should be removed, so as
to use rebuilder's own defaults.
leafnode.20090908a.spec:12: W: buildprereq-use lua-devel
The use of BuildPreReq is deprecated, build dependencies are always required
before a package can be built. Use plain BuildRequires instead.
0 packages and 1 specfiles checked; 0 errors, 8 warnings.
---
$ rpm --version
RPM version 4.6.0
$ rpmlint --version
rpmlint version 0.95 Copyright (C) 1999-2007 Frederic Lepied, Mandriva
$ rpmbuild --version
RPM version 4.6.0
Kevin R. Bulgrien
More information about the leafnode-list
mailing list