How to tell PEAR where to extract the downloaded files? - deployment

I set up a local pear repository/client, however you call it. I discovered a channel and already downloaded a package, which worked fine. As far as I know pear separates the php and data files in two folders, after it extracted the files. But I want ALL files being together in one directory which I can specify. How can I do this?
I already tried:
pear config-set data_dir my-specified-directory
pear config-set php_dir my-specified-directory
But that does not work because it expects directories called data and php. Is there any way to do this? Background: I use pear to deploy packages on a test server and I need everything in one directory to run the application.

So finally I found it:
pear config-set www_dir my-specified-directory

Related

How do you install Eigen?

I'm a complete beginner at Eigen, including headers and coding in general. I tried installing Eigen's libraries to do some stuff in Visual Studio Code but I can't find the solution, or rather I don't understand what the answers mean.
I have downloaded the zip from the site but don't know what to do with it. My main question is, should you not be able to see the definition to #include <eigen3/Eigen/Dense> in vscode? Because I can't and I don't understand if I'm supposed to.
I hear many of the answers say "Eigen c++ is a header only library: you don't have to install it, you just download it, unzip it and link your code against it." so does that mean i need to place the Eigen/Dense files in the default include? Because when I do I can't find them when I right click on /Dense> in the include code. Do I include them in my environment variables?
1. Download Eigen
$ wget -O Eigen.zip https://gitlab.com/libeigen/eigen/-/archive/3.4.0/eigen-3.4.0.zip
2. Extract and copy to /usr/local/include
$ unzip Eigen.zip # it has unzipped into the library called eigen-3.4.0
$ sudo cp -r eigen-3.4.0/Eigen /usr/local/include
Now you can compile your source files
You need to add the directory to which you copied Eigen to the include path of your project. After this #include<Eigen/Dense> should work.
Please google "visual C++ add directory to include path" to see how this is done.

Install components into /opt directly with install4j

I am currently installing into /opt/mycompany/. I have 2 components in my installation and they are installed as /opt/mycompany/foo and /opt/mycompany/bar.
Is it possible to directly install my components into /opt like /opt/foo and /opt/bar.
As the media configurations require us to specify a directory(mycompany) inside /opt where our components gets installed, I am not able to achieve what I want.
Currently I am using symbolic links to achieve this. Is there a better solution available for this ?
In the distribution tree, add an installation root /opt and add files under that root. See
https://www.ej-technologies.com/resources/install4j/help/doc/concepts/files.html
for more information.
However, you always need an installation directory that is not directly /opt, because it contains the .install4j runtime directory.

how to generate a copy of this binary perl distribution

I'm working with an application that downloads its own copy of Perl from a 3rd party website as a sort of bootstrap. I'd like to get a different copy from a more trusted source like CPAN, but I can't find any precompiled copies of Perl (only full source distributions) and I don't know how to build from source. Is there anywhere I can get a precompiled copy?
Another problem is that I don't know for sure that this download is just "a compiled copy of Perl". I'm assuming that, but I don't know what it's supposed to look like.
It comes in a .tar.gz which really only has two directories populated:
/bin (contains perl, cpan, perldoc, enc2xs, etc)
/lib/5.16.3 (contains subdirectories for various CPAN modules)
So to summarize: 1) Is this what Perl looks like when it is compiled? 2) Where can I get a pre-compiled version of Perl for my OS (RHEL 7), or if this isn't possible, how can I best generate a compiled version?
PS: For those who are curious, this is the copy of Perl that is downloaded by Miyagawa's Heroku Perl buildpack (https://github.com/miyagawa/heroku-buildpack-perl), which I am using for a project. He downloads copies of Perl stored on a website cache.bulknews.net, which might just be his own hosting, not sure.
I don't know how to build from source
This is documented in INSTALL in the distribution.
It's quite simple on a unix system:
cd /tmp
wget https://cpan.metacpan.org/authors/id/S/SH/SHAY/perl-5.26.1.tar.bz2
tar xvjf perl-5.26.1.tar.bz2
cd perl-5.26.1
sh Configure -des -Dusethreads -Dprefix='/some/dir'
make
make test
make install
You might also want to pass -Duserelocatableinc to make the install relocatable.
You can also use perlbrew or plenv to assist you with installing perl and managing multiple installs of perl.

How to Build an RPM from Source in One Line without Spec Files etc?

I've been reading about building RPMs, and the process is quite complex. Is there any program/software that works like this:
Download tar.gz file. Extract to directory
cd into directory
Run
RPM file is output into the directory
Does any such program exist? It seems as if it should. After all, when I run make, make install etc, I don't need to specify spec files, provide locations for where the software has to be installed. So why should I have to do all that for creating RPMs?
I've tried using checkinstall, but I keep getting errors like "Directory not found: /root/rpmbuild/BUILDROOT/hello-2.10-1.x86_64/usr"
So is there an easier way?
No. There is no easier way.
Sometimes upstream provide 'make rpm' target. Sometime checkinstall works. But often you have to create the spec file manually.
BTW that error from checkinstall reveals two things:
you are running that command as root. That is very very unwise.
you should create few build directories. Run command rpmdev-setuptree it will create them for you.

Zend Server 6 with OSX 10.8.2 ... issues with PHPUnit

I really like ZS6, but I'm having issues with PEAR and PHPUnit on OSX 10.8.x.
After ZS6 installation to default paths, PEAR seems to working fine from the command line, however, for some strange reason it installs the phpunit package in a pear folder with a bin, docs, and share folder at /Users/myusername/pear location. That in itself doesn't make sense to me at all. Further, PHPUnit isn't setup to be run from the terminal (command not found).
If you run 'pear list' pear says there are no extensions installed from channel pear.php.net.
my .bash_profile has the following:
export PATH=/usr/local/bin:$PATH
PATH=$PATH:/usr/local/zend/bin:/usr/local/zend/mysql/bin
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/zend/lib
the php.ini file is still setup as the default locations:
.:/usr/local/zend/share/ZendFramework/library:/usr/local/zend/share/pear
So far I've tried changing the php.ini path, I've tried changing the .bash_profile export path, I'm tried uninstalling and removing all traces I could find of pear and reinstalling ZS6, and even installing pear manually again... I have the same issue each time.
Is it possible there's a conflict with previous settings on this box?
You can adjust those config values with pear config-set, for example
$ pear config-set php_dir /usr/share/pear/php
$ pear config-set data_dir /usr/share/pear/data
Do that for all config values with "broken" paths.
After that, either manually move the files from the old to the new directories, or reinstall all packages.