Automake command from different directory - gnu

I have the folder/files /sources/{configure.ac,Makefile.am,...}
How can I execute Automake command so files/folder configure, Makefile, and autom4te.cache are not generated in /sources but in /mydir ?
Thanks

The directory from which you run configure will be the root directory of where the generated files are put.
cd /mydir
/sources/configure
(Although beware; this is not as common as running ./configure right in the source tree. You're supposed to account for it when writing a GNU-compliant configure script, but nonetheless some packages will not build this way.)

Related

Bundle Expect with shell script to bypass installation of Expect

I want to create a shell script that uses the Expect library however Expect is not installed on any of the systems where I want to run the script. I also cannot install the library on these systems either. Can I build Expect from source and then put in same directory as the script? How would you go about this?
Yes you can, and it's not difficult.
Download Expect sources from https://sourceforge.net/projects/expect/files/latest/download?source=files
Unpack sources
gunzip expect.tar.gz
tar -xvf expect.tar
This will create a directory containing the Expect distribution. Change to that directory and
Configure sources for compilation:
./configure --prefix=~/
With --prefix parameter you specify where Expect should be installed. ~/ in my example is a shortcut for current user home directory, so it will be installed locally for your user only and you don't need root privileges this way to install it. In case you have root privileges and want to install it system-wide, you can omit --prefix parameter.
Compile Expect:
make
And install it:
make install
And that's it :)

Running a script during Debian Packaging

I have some source files and one bash script to run during installation in Ubuntu machines.
What is an easy guide to Debian packaging and create packages for own use?
My practice includes:
I made a sample which copies the files in to /usr/bin/ folder using pbuilder environment, but got struck with running a process.sh file which contains:
set -x
cpath=`pwd`
cd /usr/local/
mkdir libexec
cd
cd $cpath
cp askpin /usr/local/libexec/
cp badpin /usr/local/libexec/
cp msg /usr/local/libexec/
ldconfig
Any help is appreciated.
Traditionally these scripts go into the debian/DEBIAN directory along with the control file and are called preinst, postinst, prerm and postrm.
They are run when it is appropriate by the installation/removal process.
Include a shebang at the top of these files.
See: https://www.debian.org/doc/debian-policy/ch-maintainerscripts.html
Edit:
Just chased down pbuilder and realised that the above answer probably means nothing to you.
I didn't know pbuilder existed, if I had maybe I would have used it, instead of scratching my debian builds into the bare metal, where the above answer makes sense.

How to create a "configure" file?

Recently I downloaded a file using the following link
git clone git://github.com/mapserver/mapcache.git
Inside the downloaded mapcache folder I can not find a configure file to do "./configure". But the installation help file tell:
Unix compilation instructions
If you are using a git clone rather than a tarball distribution, you
must first run autoconf in the root directory, to create the configure
file from configure.in:
$ autoconf
For unix users, the compilation process should resume to:
$ ./configure
$ make
(as root)
make install-module
The installation script takes care of putting the built module in the
apache module directory.
To do ./configure there should be a configure file isn't it? Please show me how to make one to get rid of this problem.
maintainer speaking ...
mapcache and mapserver are switching to cmake for the next release and the docs for the master branch need updating. You can either use the branch-1-0 branch to continue using autoconf builds, or use cmake with master:
$ mkdir build
$ cd build
$ cmake ..
$ make
$ sudo make install
The help file tells you exactly what you need to do
If you are using a git clone rather than a tarball distribution, you must first run autoconf in the root directory, to create the configure file from configure.in
If you don't already have autoconf installed you'll need to install it in the normal way for your distribution.
The repository seems out of sync with the documentation
there is no configure.in as mentioned in the INSTALL file (nowhere not only in the root directory)
there is just a Makefile.vc file for MSVC++
You should contact the maintainer

Trouble when running autogen.sh

I have downloaded R tree from http://libspatialindex.github.com/
Since on running ./autogen.sh I was getting file/folder not found, therefore I downloaded the file autogen.sh from the github repository given below:
https://raw.github.com/libspatialindex/libspatialindex/9a5a2f4d83c3ec7be4dbf2c8a86341703d837185/autogen.sh
Now when I run ./autogen.sh I am getting "Permission denied"
And if I run sh ./autogen.sh I am getting:
glibtoolize or libtoolize not found. Giving up!
Please suggest what should I do now
EDIT:Also I want to use libspatialindex inside my C++ project. I am using netbeans. I mean I want to use the functions inside libspatialindex inside my netbeans project. How should I use the same. Right now I have run the config and make command in a separate directory. I am not getting as to how to use them inside my project.
Install libtool from your package manager.
To fix the 'Permission Denied' error you need to edit the permissions of your autogen.sh file. Run this command:
chmod +x autogen.sh
I got this error after restoring a library from a Backup to a NTFS directory.
I discovered that another reason this can occur is if the mounted partition has noexec flag on it.
Run mount to see if noexec has been set on the partition.
Update /etc/fstab or add -o exec to the mount command.
Hope, it helps others in the same situation as me.

how to use "make mrproper " command? i am working on Linux From Scratch

I am trying to build Linux From Scratch and I have reached till this part : linux headers
Make sure there are no stale files and dependencies lying around from previous activity:
make mrproper
I don't understand: in which directory should I run this command? In one of these?
$LFS/sources/gcc-build
$LFS/sources/gcc-4.4.3
Please Help!
No, you should run that (an the following) in the directory where you unpacked the kernel source tarball.
That comes after gcc use
cd $LFS/sources
tar xvjf linux*
cd linux*
make mproper
make headers_check
make INSTALL_HDR_PATH=dest headers_install
cp -rv dest/include/* /tools/include
cd $LFS/sources tells it to change to the sources directory.
tar xvjf linux* tells it to untar the lunix api headers directory (the j in xvjf might be a capital)
cd linux* tells it to go to the untared directory
make mproper is a special use of the make command to specially make this directory
make headers_check
make INSTALL_HDR_PATH=dest headers_install
cp -rv dest/include/* /tools/include tells it to install and test the package
Running make mrproper or make distclean returns the kernel source tree to its unconfigured state. This means you loose your .config file. You will need to create a new .config file before compiling the kernel.

Resources