"Requires" entry in .spec file does not work - packaging

I was writing an .spec file for a rpm package and I'm having an issue.
I need to install that package with a specific version of another package.
Let's take a python package example. So, I write it:
Requires : bash, grep, python >= 2.6.7-4b
But, the package is installed even if the python package is in the 2.6.6 version.
If I remove python package, the system shows me that my package needs python 2.6.7.
Is there something wrong?
Output from rpm -q --provides python:
Distutils
python(abi) = 2.6
python-abi = 2.6
python-ctypes = 1.0.1
python-hashlib = 20081120
python-sqlite = 2.3.2
python-uuid = 1.31
python-x86_64 = 2.6.6-52.el6
python2 = 2.6.6
python = 2.6.6-52.el6
python(x86-64) = 2.6.6-52.el6
Output from rpm -qpR $yourpackage.rpm:
/bin/sh
python >= 2.6.7-4b
bash
grep
rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(FileDigests) <= 4.6.0-1
rpmlib(PartialHardlinkSets) <= 4.0.4-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
rpmlib(PayloadIsXz) <= 5.2-1

The ''Requires:'' tag is ignored unless you add ''Autoreq: no'' as well.
Newer versions of rpmbuild calculate the requirements automatically and ignore ''Requires:'' unless the feature is turned off.
I have run into this issue multiple times and it is worth noting that you should at first run rpmbuild without ''Autoreq: no'', note the autodetected dependencies, and add them to the ''Required:'' tag before the final run with ''Autoreq: no''.
Is also worth noting that the automatic detection of dependencies is a little buggy and has some issues with comments.
I packaged a perl script with a comment containing " ... then use a module ... " a while ago.
Autoreq detected that as being perl module "perl a" and added it to the dependencies making my rpm useless.

Related

screen fails on NetBSD, reporting "poll: Invalid argument"

I have installed and used screen many times on several different operating systems. Recently I installed it on a NetBSD-8.0 virtual machine.
$ sudo pkgin install screen
calculating dependencies...done.
1 package to install:
screen-4.8.0nb1
0 to refresh, 0 to upgrade, 1 to install
0B to download, 1098K to install
proceed ? [Y/n] Y
installing screen-4.8.0nb1...
screen-4.8.0nb1: setting permissions on /usr/pkg/bin/screen-4.8.0 (o=root, g=wheel, m=4511)
screen-4.8.0nb1: adding /usr/pkg/bin/screen to /etc/shells
screen-4.8.0nb1: registering info file /usr/pkg/info/screen.info
===========================================================================
$NetBSD: MESSAGE,v 1.5 2005/12/28 17:53:24 reed Exp $
[snip]
===========================================================================
pkg_install warnings: 0, errors: 0
reading local summary...
processing local summary...
marking screen-4.8.0nb1 as non auto-removable
However, when I went to use it, I got an immediate failure.
$ uname -mrs
NetBSD 8.0 amd64
$ ls -l /usr/pkg/bin/screen
lrwxr-xr-x 1 root wheel 12 Apr 6 02:50 /usr/pkg/bin/screen -> screen-4.8.0
$ groups
users wheel
$ screen
poll: Invalid argument
This problem persists even when I first remove, then reinstall the screen package. Any suggestions as to what's wrong?
My guess is that the system used to build binary packages for 8.0 (as of the 8.0_2020Q1 pkgsrc release) is no longer quite compatible with the NetBSD-8.0 release. It is likely running on a newer release, inside a chroot(8) sandbox.
I would recommend using NetBSD-9.0 instead, as that is the latest NetBSD release, or NetBSD-8.2, as that is the latest release in the netbsd-8 branch. Using the latest NetBSD and pkgsrc releases provides better coverage against unpatched vulnerabilities.
However, if you want to keep using NetBSD-8.0, you can get a working screen(1) from the 8.0_2019Q4 pkgsrc release. To have pkgin(1) pull from that release, edit the /usr/pkg/etc/pkgin/repositories.conf file to use this repository URL:
http://ftp.NetBSD.org/pub/pkgsrc/packages/NetBSD/amd64/8.0_2019Q4/All
There is currently likely just one line in the file that is not commented out, and it points to a URL with just 8.0 in it (which on the server is a symbolic link to the latest pkgsrc release). Just replace that line, or comment it out and add the above line.
Then remove and re-install screen:
sudo pkgin remove screen && sudo pkgin install screen

Can't run "cro stub" etc

Installed Cro via Zef, but can't run "cro stub", "cro run", etc.
(Edit: Fedora 28, rakudo from Fedora)
[zv#localhost ~]$ cro stub hello
bash: cro: command not found...
[zv#localhost ~]$
So, where is "cro" installed ? Coudn't find it anywhere.
[zv#localhost ~]$ which cro
/usr/bin/which: no cro in (/usr/share/Modules/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/home/zv/.local/bin:/home/zv/bin)
[zv#localhost ~]$ zef info cro
- Info for: cro
- Identity: Cro::Core:ver<0.7.6>
- Recommended By: /home/zv/.perl6
- Installed: Yes
Description: Implements the asynchronous pipeline at the heart of all Cro libraries.
License: Artistic-2.0
Source-url: https://github.com/croservices/cro-core.git
Provides: 19 modules
Depends: 0 items
Update: I had installed "Cro", no "cro" (all lowercase).
Following on the answer by Takao, I tried installing "cro" (all lowercase), but Zef said there was nothing more to install.
Using "--force-install" with Zef did the trick, "cro" (all lowercase) was installed in .perl6/bin.
Also, when first installing Cro there was an issue with IO::Socket::Async::SSL, which couldn't find the symbol "sk_num" in libssl.so...I told Zef to skip the test on IO::Socket::Async:SSL, and the installation suceeded. Anyway, I imagine I won't be able to use Cro with encrypted connections.
Firstly, are you sure you installed cro, not just Cro::Core module? Your zef info cro prints info for Cro::Core package it seems.
I tried to reproduce it, installing by zef install cro(note lowercase for module name).
In the end of zef's installation log I see:
1 bin/ script [cro] installed to:
/home/foo/.perl6/bin
The path above may be different(it depends on how you installed Rakudo and zef), but in general it is a path where zef stores scripts, so you need to add it to your PATH to use. You can find info about adding paths into your PATH variable, as it depends on what shell you are using.
Personally, I am using fish, so it is a matter of set PATH ~/.perl6/bin $PATH in ~/.config/fish/config.fish, but for bash or different shell it would be different.
It seems like a case of:
By accident you installed Cro(which zef thinks of Cro::Core), instead of cro(which gives you managing script you want to run). Try out zef install cro in lowercase.
You do not have path where zef installs stuff in your PATH variable. Can be fixed by adding it. Judging by your which output, it seems to be the solution you want.

stack install elm-export fails

I would like to install elm-export package using stack. It needs to be imported in a servant-elm example.
It's like:
shell> stack install elm-export
shell>
No error message. So I thought it's installed.
But when I stack build,
Error message shows:
test-0.1.0.0: build (exe)
Preprocessing executable 'test' for test-0.1.0.0..
Building executable 'test' for test-0.1.0.0..
[1 of 1] Compiling Main ( src\Main.hs, .stack-
work\dist\5c8418a7\build\test\test-tmp\Main.o )
C:\Code\Haskell\11_Stack-Projects-That-Need-Dependency\test\src\Main.hs:6:1:
error:
Could not find module â–’â–’Elmâ–’â–’
Use -v to see a list of the files searched for.
|
6 | import Elm (Spec (Spec), specsToDir, toElmDecoderSource,
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^...
My question is, Where can I check if the package is installed? And how do I fix this?
ps. Cabal successfully installed elm-export and servant-export and runghc successfully run example code. Now I am trying to use stack to install package to prevent from ruining some dependency.
If you want to use this library in a haskell stack package you don't need to run stack install. Instead you need to add it to your project dependencies.
See the HaskellStack User Guide (adding dependencies)
Depending on the version of stack you have this might be in one of two places I think:
if you have a packages.yaml, add it in the section 'dependencies'
dependencies:
- base >= 4.7 && < 5
- elm-export >= 0.6 && < 1.0
if you don't have packages.yaml, add it to you cabal file directly
library
hs-source-dirs:
src
build-depends:
base >=4.7 && <5
, elm-export >= 0.6 && < 1.0
FYI: stack install is used to install executables which you can then use on the command line. It can be used inside or outside of haskell stack projects.
I don't think elm-export declares any executables, which is why it didn't output anything. Some examples are pandoc, hindent, etc. These are haskell libraries which also provides executables that you can install using stack.
$ stack install pandoc
...
Copied executables to /Users/<me>/.local/bin:
- pandoc
$ pandoc --help
pandoc [OPTIONS] [FILES]
-f FORMAT, -r FORMAT --from=FORMAT, --read=FORMAT

g++ error on import of Theano on Windows 7

I'm attempting to get setup with a proper g++ installation according to the theano installation guide. I've previously had theano working with the python only implementation. I'm using the bleeding edge version of theano from their git repo on python 3.4. I've tried using the theano suggested TDM-GCC-64 method as well as MinGW, and both result in the exact same error. (copied as readable as possible)
Problem occurred during compilation with the command line below:
C:\MinGW\bin\g++.exe -shared -g -march=skylake -mmmx -mno-3dnow -msse -msse2 -msse3
-mssse3 -mno-sse4a -mcx16 -msahf -mmovbe -maes -mno-sha -mpclmul -mpopcnt
-mabm -mno-lwp -mfma -mno-fma4 -mno-xop -mbmi -mbmi2 -mno-tbm -mavx
-mavx2 -msse4.2 -msse4.1 -mlzcnt -mrtm -mhle -mrdrnd -mf16c -mfsgsbase
-mrdseed -mprfchw -madx -mfxsr -mxsave -mxsaveopt -mno-avx512f
-mno-avx512er -mno-avx512cd -mno-avx512pf -mno-prefetchwt1 -mclflushopt
-mxsavec -mxsaves -mno-avx512dq -mno-avx512bw -mno-avx512vl
-mno-avx512ifma -mno-avx512vbmi -mno-clwb -mno-pcommit -mno-mwaitx
-mno-clzero -mno-pku --param l1-cache-size=32 --param
l1-cache-line-size=64 --param l2-cache-size=8192 -mtune=skylake
-DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION -m64 -DMS_WIN64
-IC:\Python34_64bit\lib\site-packages\numpy\core\include
IC:\Python34_64bit\include -IC:\Python34_64bit\lib\site-packages\theano\gof
-o C:\Users\Jwely\AppData\Local\Theano\compiledir_Windows-7-6.1.7601-SP1-Intel64_Family_6_Model_94_Stepping_3_GenuineIntel-3.4.4-64\lazylinker_ext\lazylinker_ext.pyd
C:\Users\Jwely\AppData\Local\Theano\compiledir_Windows-7-6.1.7601-SP1-Intel64_Family_6_Model_94_Stepping_3_GenuineIntel-3.4.4-64\lazylinker_ext\mod.cpp
-LC:\Python34_64bit\libs -LC:\Python34_64bit -lpython34
In file included from c:\mingw\include\c++\6.1.0\math.h:36:0,
from C:\Python34_64bit\include/pyport.h:328,
from C:\Python34_64bit\include/Python.h:50,
from C:\Users\Jwely\AppData\Local\Theano\compiledir_Windows-7-6.1.7601-SP1-Intel64_Family_6_Model_94_Stepping_3_GenuineIntel-3.4.4-64\lazylinker_ext\mod.cpp:1:
c:\mingw\include\c++\6.1.0\cmath:1133:11: error: '::hypot' has not been declared
using ::hypot;
^~~~~
It may be worth noting that before it prints this error, it prints an entire file worth of code, you can find the entire error output here
I'm not sure what to try next, I've followed the directions twice, used a couple different installation methods for some dependencies, and made sure to clean up my system path between each attempt and reboot.
This worked for me:
Go to your user folder: C:/Users/[username]
Create .theanorc file if it doesn't already exist
makes sure it includes the lines:
[gcc]
cxxflags = -D_hypot=hypot
"Error: '::hypot' has not been declared" in cmath while trying to embed Python
Error building Boost 1.49.0 with GCC 4.7.0
my solution is comment out all the
#define hypot _hypot
macro in the pyconfig.h file
This worked for me
Go to System properties/Advance system setting
Add your MinGW installation path, if already added and looks something like C:\{your MingW installation}\bin
change it to C:\{your MingW installation}
The answers above are probably a better, more permanent solution. For a quick fix, the following worked for me:
import theano
theano.config.gcc.cxxflags = "-D_hypot=hypot"
...with Windows 10, Anaconda 4.4, Python 2.7, Theano v0.10.0.dev1, m2w64-toolchain v5.3.0
if you can't create a file with name .theanorc.
You can use this code in console but before open cmd in C:/Users/[username] and then write python and then paste below code there:
import os
with open(os.path.join(os.environ["USERPROFILE"], ".theanorc"), "w") as f:
f.write("[gcc]\ncxxflags = -D_hypot=hypot")
First, uninstall all Theano versions.
Then:
pip install pydot-ng
conda install mingw libpython
pip install git+https://github.com/Theano/Theano.git#egg=Theano

new version of automake failing

I'm trying to build iptables which requires automake as part of the build step. While I have this working on my machine, a colleague is having trouble. the configure is failing due to an automake bug as follows:
./configure: line 12080: syntax error near unexpected token `libnfnetlink,'
./configure: line 12080: `PKG_CHECK_MODULES(libnfnetlink, libnfnetlink >= 1.0,'
(automake fails to resolve the PKG_CHECK_MODULES macro...) The PKG_CHECK_MODULES is in pkg.m4. We inserted a line in the top level makefile aclocal --print-ac-dir. This tells us that it points to a directory where pkg.m4 exists, and where the macro seems to be properly defined. The big difference between our systems seems to be that I have automake 1.11.1, and he has automake (GNU automake) 1.11.6 (RN 10.10.2 (sic), assuming 1.10.2) (I'm not sure what the RN refers to...). He also has a newer version of autoconf (I have 2.66, he has 2.69). I noticed that in my colleague's version of the pkg.m4 file, there is a dnl in the middle of the PKG_CHECK_MODULES file, which I do not appear to have, however, it is right before a closing bracket [] dnl ], so I am assuming it is not doing anything. Does anyone know what might be causing this error, or what I might try next?
(note: I do not want to have to downgrade automake, as this has to work on third party build machines as well).
Thanks,
John
EDIT:
In configure.ac, you have the lines:
AM_CONDITIONAL([ENABLE_LIBIPQ], [test "$enable_libipq" = "yes"])
PKG_CHECK_MODULES([libnfnetlink], [libnfnetlink >= 1.0],
[nfnetlink=1], [nfnetlink=0])
AM_CONDITIONAL([HAVE_LIBNFNETLINK], [test "$nfnetlink" = 1])
The problem is that the PKG_CHECK_MODULES macro is not being resolved, so that PKG_CHECK_MODULES ends up in the configure script itself (I suppose that's autoconf then, and not automake - my bad -- still new to all of this). So in configure, you end up with a line:
PKG_CHECK_MODULES([libnfnetlink], [libnfnetlink >= 1.0],
which bash does not understand, and treats as a syntax error.
I had similar problems with my compilation env.
In my case, it helped to downgrade pkg-config to version 0.24, and libtool to version 2.4.2