rpmbuild where do dependencies I didn't specify come from? - rpmbuild

If you create an RPM using rpmbuild -ba and PHP scripts are included in the RPM, does it make this RPM automatically dependent on /usr/bin/php and usr/bin/env?
I am using rpmbuild -ba to package a Symfony project. Symfony has many PHP scripts with #!/usr/bin/env php as the first line in the script.
After the build if I execute rpm -qp <rpm-package> --requires it shows me dependencies on /usr/bin/env, /usr/bin/php, /bin/sh (listed twice? weird) and /bin/bash.
I see some scripts using #!/bin/sh where others use #!/bin/bash.
I would like to understand where these dependencies come from as they have not been specified in the .spec file as a "Requires" dependency.

rpmbuild automatically scans your files for dependencies (using ldd etc). You can find the documentation here: http://ftp.rpm.org/max-rpm/s1-rpm-depend-auto-depend.html
(this is not recommended, but) if you want to stop rpmbuild from doing this, you can put:
AutoReqProv: no
in your spec file.

Related

How to set DESTDIR for gmake in rpmbuild SPEC file

I'm trying to build a SPEC file to support a customized RPM for Qt. Because Qt's configure script doesn't recognize some of the options automatically included in the %configure scriptlet I have to call it explicitly in the SPEC file with
./configure --prefix=%{_qtdir} -confirm-license -opensource -system-sqlite -opengl desktop where _qtdir is /opt/custom/SENSOR.
My problem is that the %install step fails by trying to install directly to /opt/custom/SENSOR instead of under the BUILDROOT directory. I've tried setting DESTDIR and prefix with no luck, e.g.
%install
make install prefix=%{_buildrootdir}/%{sensor}.Qt-%{version}-1.el7_9.x86_64%{_qtdir}
How do I get make install to respect an installation directory other than what was given to the configure script?
It is supposed to work like
make install DESTDIR=%{_buildrootdir}
Distributions may have some macros defined to help you there, e.g. on Fedora
%build
%configure
%make_build
%install
%make_install

Have configure.ac But Not autoconf. Can I Generate Configure Without It?

I'm trying to build curl...specifically libcurl...on my Android device; I've built OpenSSL and have cloned the repo. Unfortunately the curl sources use buildconf, which requires autoconf, and I don't have autoconf installed.
Is there an alternate way to generate the configure script and/or the Makefile from the included configure.ac and Makefile.in?
The source tarballs provided by the curl project include generated configure scripts, no need for autoconf then! You can get release versions or daily snapshots from curl.haxx.se.
The configure script is generally generated with the ./buildconf script in the curl source code root directory and it requires autoconf, automake and libtool to be installed.

packaging jruby gems in self contained jar

I'm trying to package compass/sass into a self-contained jar so that I can use compass without installing jruby.
I installed jruby and warbler on a Windows7 machine, running Java 1.6.0_37
I created a folder, named it jrcompass, then installed compass into it, i.e.
jruby -S gem install compass -i .
then I ran in it:
jruby -S warble
which created a file named jrcompass.jar of about ~20MB in size. so far so good.
problem is that when I try to execute the jar I get an error message (below). it seemed from the error that jruby.home was not set, so I passed it as a property in the command line and that worked, but it defeats the purpose of having a self-contained jar.
if I try to pass . as jruby.home then I get an error that it can't find rubygems
any help would be appreciated. TIA.
C:\Apps\test\jrcompass>java -jar jrcompass.jar
Gem::LoadError: Could not find compass (>= 0) amongst [rake-0.9.2.2]
to_specs at jar:file:/C:/Users/Admin/AppData/Local/Temp/jruby9093955264697226808extract/jruby-stdlib-1.7.1.jar!/META-INF/jruby.home/lib/ruby/shared/rubygems/dependency.rb:247
to_spec at jar:file:/C:/Users/Admin/AppData/Local/Temp/jruby9093955264697226808extract/jruby-stdlib-1.7.1.jar!/META-INF/jruby.home/lib/ruby/shared/rubygems/dependency.rb:256
gem at jar:file:/C:/Users/Admin/AppData/Local/Temp/jruby9093955264697226808extract/jruby-stdlib-1.7.1.jar!/META-INF/jruby.home/lib/ruby/shared/rubygems.rb:1231
(root) at file:/C:/Apps/test/jrcompass/jrcompass.jar!/jrcompass/bin/compass:22
load at org/jruby/RubyKernel.java:1046
(root) at file:/C:/Apps/test/jrcompass/jrcompass.jar!/META-INF/main.rb:1
require at org/jruby/RubyKernel.java:1027
(root) at file:/C:/Apps/test/jrcompass/jrcompass.jar!/META-INF/main.rb:1
(root) at jar:file:/C:/Users/Admin/AppData/Local/Temp/jruby9093955264697226808extract/jruby-stdlib-1.7.1.jar!/META-INF/jruby.home/lib/ruby/shared/rubygems/custom_require.rb:1

Symfony 2.0 bundle installation

So I am a new to doctrine, but I am not able to install a bundle at all. I am following the guide, but the "error" which I am getting is very unusual.
Anyhow, I add this lines into deps file:
[FOSRestBundle]
git=http://github.com/FriendsOfSymfony/FOSRestBundle.git
target=bundles/FOS/RestBundle
Then I do:
./bin/vendors install
And I get:
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20090626+lfs/sqlite.so' - /usr/lib/php5/20090626+lfs/sqlite.so: cannot open shared object file: No such file or directory in Unknown on line 0
Your project seems to be based on a Standard Edition that includes vendors.
Try to run ./bin/vendors install --reinstall
So on this standard way I am not able to install it at all. Can somebody explain me what is the problem, because to me it looks like, the symfony vendors script doesnt recognize changes in deps file at all.
This happens when you've downloaded the Symfony2 Standard Edition from the website. The vendor install script checks to see if the vendor directories are git repositories, and if not, will throw this error. You can fix the situation in one of two ways:
you can either run the command that it suggests: php bin/vendors install --reinstall
or, you can remove the vendors directory, then run php bin/vendors install, which amounts to about the same thing
No need to install that. Just follow the steps in the url : http://mmoreramerino.github.com/GearmanBundle/installation.html

How to know the version of RPM during installation

I have created a script for deployment. During the pre script, is it possible to know whats the version of the rpm I am deploying.
I want to create a backup file with the version of the RPM (in its name) so that i can trace back the version of the RPM file.
You could define some variables at the top of your spec file, and then use them in both the tags section and the pre script.
%define version <your-version>
%define relver <your-relver>
Version: %{version}
Release: %{relver}
%pre
/bin/cp your-file your-file.%{version}-%{relver}
You can verify the script will do the expected copy by querying the scripts in the RPM:
rpm -qp --scripts <path-to-your-rpm>/<your-rpm-name>.rpm

Resources