I do not have use/local/src/ on Mac, what should I do? - linux

I am neophyte on Mac especially on terminal. Though I've read lots of materials, I am still very confused and do not know what I should do.
I need to use aspell on MAC. I followed a tutorial (http://wiki.lyx.org/Mac/MacSpelling) to install it and I've installed Xcode and gcc. In one step, it required me to "type ./configure, followed by ". I did it, but terminal showed:
-bash: ./configure: No such file or directory
This webpage (http://ubuntuforums.org/showthread.php?t=1849525) showed the configure in under "/usr/local/src/configure" but when I cd to this directory I found I do not have the /src/ folder.
/usr/local$ ls
CODEOFCONDUCT.md README.md include/ opt/
CONTRIBUTING.md SUPPORTERS.md info/ share/
Cellar/ bin/ lib/
LICENSE.txt etc/ libexec/
Library/ git/ man/
What show I do? How can I use the ./configure?
Thank you so much.

You likely don't have the command line development tools installed.
Try
xcode-select --install
It also looks like you have homebrew installed. I believe that there is a formula for aspell, so you can try
brew install aspell

The aspell-0.60.6.1 tarball does have a configure script inside its own source tree (so it is located at aspell-0.60.6.1/configure). So you should start with something like (to do outside of /usr/local/, for example in your $HOME/freesoftsource/ directory if you have one, or maybe even simply in your $HOME if you dare).
wget ftp://ftp.gnu.org/gnu/aspell/aspell-0.60.6.1.tar.gz
tar xzvf aspell-0.60.6.1.tar.gz
cd aspell-0.60.6.1
./configure
You may want to add some options to the ./configure above.
You should read aspell installing instructions
N.B. As with most GNU software using configure, the location of the source tree (extracted from the source tar archive as above) does not matter much.

Related

How to run a bash script that installs rpms from a current rpm spec file?

I have this internal software installer that has a size > 4.9GBs,
it installs a bunch of rpms/libraries and set some configs at the end.
I need to create a RPM using rpmbuild(Im new to this rpm creation) in order to install the RPM and also proceed to install/execute this installer(its a bash file).
My rpm spec is currently doing this at (you can check the code below):
%install
Copy 2 zips files into a specific folder.
This are 2 zip files from the actual software folder, I just splitted its
content in 2 parts and zip them to avoid the max size limitations(4gbs if Im
not wrong).
%post
Unzip those files into a specific folder.
run the bash script installer that was inside those zip files (it will run silently because a -s flag that it has).
Complete the bash and rpm installation successfully.
I had alredy built the rpm, so when I try to:
yum install .rpm,
it does the zip part just fine but it stays forever doing nothing at the bash installation part, maybe because this rpm lock thing, but I'm not sure.
By the way, Im not sure at all if this is a good approach for this at the end, I mean combined this rpm and installation stuff
So because the install.sh part is giving me this issues I tried this different changes:
sudo /root/sotfware/install.sh -silent /root/software/silent_configfile.conf
/root/sotfware/install.sh -silent /root/software/silent_configfile.conf
./root/sotfware/install.sh -silent /root/software/silent_configfile.conf
What do you guys thisnk I'm doing wrong?,
Whats the best way to do this? or
Whats you recommendation for this?
This is the spec file:
Name: software-19
Version: 1.0
Release: 1
Summary: software 2019
License: N/A
URL: https://
AutoReqProv: no
AutoReq: no
%description
Some description
%install
mkdir -p %{buildroot}/root/software2019
cp /root/software/software-1.zip %{buildroot}/root/software2019/software-1.zip
cp /root/software/software-2.zip %{buildroot}/root/software2019/software-2.zip
%post
unzip /root/software/software-1.zip -d /root/software2019/
unzip /root/software/software-2.zip -d /root/software2019/rpm/
sudo /root/software/install.sh -s /root/software2019/silent_configfile.conf
rm -rf /root/software/
%clean
rm -rf %{buildroot}
%files
/root/software/*
%changelog
* Tue Jan 20 2019 1.0
- Initial release
Hopefully Im been clear, thanks in advance!
You have multiple issues here
You are building RPMs as root, which is dangerous and can wipe your machine if you don't write things correctly. Since you're just getting started, this is much more likely.
The source files shouldn't have absolute paths.
You shouldn't use sudo because RPM installation is always run as root.
silent_configfile.conf wasn't included in the RPM, so the target machine might not have it.
The %post deletes the files that you told RPM you would install, likely causing errors.
This would also break rpm -V verification.
You are misusing the RPM system by doing a third-party install in your %post.
This breaks things like rpm -q --whatprovides /root/software19/myfile.
This breaks rpm -V because it cannot verify the files you installed.
This breaks any concept of uninstall / upgrade because you don't provide %preun and related files to "do the right thing."
To do things right and not cause your admins headaches for years to come, you need to have those installers run during RPM creation (again, not as root!) with a target of %{buildroot} and then distributing the resulting file structure as an RPM. If this is not something that can be done, then RPM is probably not going to work for you and you need to look at other distribution options, like custom scripts.

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.

Debian / Ubuntu package installed in root as default

Created a simple debian/ubuntu package with some library files (*.so).
Works fine except, it installs them as default in the root path "/".
Since I've recreated my Makefile to output to $DESTDIR/ instead of "the usual" directory that I provide in the Makefile, when compiling from source, how do I now set the path of where the files should be installed now? I know there are several choices when using dh_make to create the package, "s" being the default one. Still, can't seem to find anything on where to tell dpkg to put the installed files.
Secondly, a Deb Library package containing only ".so" files should still be a "Single binary" since I gather that using the Library is for development purposes? Since this is a library, I just wanna make sure that's not the cause of the files being installed in the wrong location. What I mean is .so files and header files installation?
What I've used:
dh_make -e my#email.com -f ../myfile-1.0.tar.gz
dpkg-buildpackage -rfakeroot
and some configurations set i debian/control, $DESTDIR in Makefile.
Seems that it was fairly simple, yet very confusing. This works, not sure if there is a better solution.
In my makefile I have a few variables
InstallTo = /usr/lib
install:
mkdir -p $(DESTDIR)$(InstallTo)
cp $FILE_TO_COPY $(DESTDIR)$(InstallTo)
This way it will create the directory tree inside the *.deb file. I had some trouble using /usr/local/lib instead of /usr/lib/ and rmdir complained when trying to delete it and it had no files (just directories). Not sure why, but changed it to /usr/lib instead.
Since someone voted this up, I'm guessing someone were also looking for the answer and this is my solution. Perhaps someone can provide a better one if there is one.
Just a note, $DESTDIR variable is the variable that dh_make suggest the user to use in our Makefile. It's the path to where dpkg will build the program and where it will install it so it can be included in the .deb file.

How do I "install" a program once I compile it, so I can run it from the command line?

Archlinux.
I downloaded mtools, which includes mcopy, which is what I'm after. The instructions in the INSTALL file say do this:
# ./configure
# make
These worked fine, now I have a bunch of .o files and of course executables.
What do I need to do, so I can just type
# mcopy
and have it run? Since I don't have it "installed" right now, doing that just says
-bash: mcopy: command not found
The usual linux build sequence is
./configure
make
make check
sudo make install
make check attempts to validate if the build took place correctly; not all Makefiles have it but many do. Note you will need sudo make install to do the install in the usual system directories if you are not root.
You can determine which of these options is available for your particular Makefile by
cat Makefile
and reading the labels on the left of the file.
You could create a symbolic link to the application in your /usr/bin folder like
ln -s /fullpath/to/app /usr/bin/aliasnameforapp
Then you can simple call aliasnameforapp from anywhere.

CMake doesn't know where is Qt4 qmake

I am using Debian OS and I'm trying to point to cmake where is my Qt4.
I try to build qjson library and with its CMakeLists.txt:
http://pastebin.com/fKNp0Qgy
I get:
Qt5 not found, searching for Qt4
qmake: could not exec '/usr/lib/x86_64-linux-gnu/qt4/bin/qmake': No such file or directory
CMake Error at /usr/share/cmake-2.8/Modules/FindQt4.cmake:1386 (message):
Found unsuitable Qt version "" from NOTFOUND, this code requires Qt 4.x
Call Stack (most recent call first):
CMakeLists.txt:55 (FIND_PACKAGE)
-- Configuring incomplete, errors occurred!
I'm not familiar with CMake and Qt config, but I'm curious what setting force CMake FIND_PACKAGE to look into '/usr/lib/x86_64-linux-gnu/qt4/bin/qmake' for qmake.
I have installed Qt 4.8.5 from source and I have Qt4 bin folder in completely different directory.
just try "sudo apt-get install qt-sdk" it works for me
I solved my problem.
Looking for QT_SELECT with grep command I found that QT_SELECT is related to /usr/lib/x86_64-linux-gnu/qt-default/qtchooser/default.conf file. From the "default" file name I assumed that it is what is seen as QT_SELECT. Other configs presented with qtchooser -l are in /usr/share/qtchooser/ and /usr/lib/x86_64-linux-gnu/qtchooser directories.
Such a config file has two lines with paths. I just changed these lines, first pointing to my Qt bin directory and second pointing to my Qt lib directory. Then I could see that qtchooser -print-env shows QTTOOLDIR and QTLIBDIR to my Qt.
Then I could easily build qjson library with CMake, Qt4 was found correctly.
In my experience, this problem is most easily solved by putting the folder containing qmake in your PATH environment variable.
Here is the answers
https://askubuntu.com/questions/540746/ubuntu-14-04-qt5-development-libraries/540757#540757
Seems
apt-file search Qt5CoreConfig.cmake was what I was missing. This got me:
qtbase5-dev: /usr/lib/x86_64-linux-gnu/cmake/Qt5Core/Qt5CoreConfig.cmake
Installing that seems to lead to CMake finding Qt5. qmake still reports the same problem when directly called though...some remnant from qt4 still installed it seems...
As for the qmake problem, this is fixed by:
sudo apt-get install qt5-default
In my case it was just that qtchooser was missing the "default" configuration.
I figured cmake is just executing qtchooser and looking for a "default" configuration file name.
You can install any configuration file by doing the following:
qtchooser -install <arbitrary_name> <path_to_qmake>
In my case I simply provided "default" as the arbitrary name... this created the default.conf file in the appropriate locations and all is well. I don't think there is a limit to how many named versions of qt you have.
If you do this as root it should work for all users.
On my old RHEL distro, this did it for me:
sudo yum install qt-devel.x86_64
Just the qt-base one wouldn't work with cmake.
1) Where is your qtchooser configuration file?
$: locate qtchooser | grep conf
2) From the list of conf files, probably there is one call "default.conf"
This one is a link to one of the others (4.conf or qt4.conf or 5.conf or qt5.conf).
Choose the one that makes sense too you, and create a link to it.
Suppose your default file path is
/usr/lib/x86_64-linux-gnu/qt-default/qtchooser/default.conf
Create backup:
$: cd $(dirname /usr/lib/x86_64-linux-gnu/qt-default/qtchooser/default.conf)
$: cp -av default.conf default.conf_backup
Let's say you target is
/usr/lib/x86_64-linux-gnu/qtchooser/qt5.conf
Then:
$: sudo ln -s /usr/lib/x86_64-linux-gnu/qtchooser/qt5.conf default.conf
3) Is the path to your qmake right?
Check qmake location
$: locate qmake | grep bin
Is the same one as indicated in your modified qtchooser/default.conf?
$: cat /usr/lib/x86_64-linux-gnu/qtchooser/qt5.conf
If the answer is YES, then you are done.
If the anser is no, then you need to modify the file:
Create backup:
$: cd $(dirname /usr/lib/x86_64-linux-gnu/qtchooser/qt5.conf)
$: cp -av qt5.conf qt5.conf_backup
Edit file and change path to your qmake location
$ sudo vi qt5.conf
Now it should be done.
Simplest solution was add a link in the directory that the gem expected to find it. On Ubuntu 14.04 it qmake lives in /usr/bin. Simple solution.

Resources